diff --git a/.backportrc.json b/.backportrc.json index a62729789a26c..58dfbf669671f 100644 --- a/.backportrc.json +++ b/.backportrc.json @@ -3,6 +3,7 @@ "repoName": "kibana", "targetBranchChoices": [ "main", + "8.15", "8.14", "8.13", "8.12", @@ -51,7 +52,7 @@ "backport" ], "branchLabelMapping": { - "^v8.15.0$": "main", + "^v8.16.0$": "main", "^v(\\d+).(\\d+).\\d+$": "$1.$2" }, "autoMerge": true, diff --git a/.buildkite/ftr_configs.yml b/.buildkite/ftr_configs.yml index 730b3aa460f4b..0a0d9d44d80ea 100644 --- a/.buildkite/ftr_configs.yml +++ b/.buildkite/ftr_configs.yml @@ -13,10 +13,8 @@ disabled: - x-pack/test/security_solution_api_integration/config/ess/config.base.basic.ts - x-pack/test/security_solution_api_integration/config/serverless/config.base.ts - x-pack/test/security_solution_api_integration/config/serverless/config.base.essentials.ts - - x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint/configs/config.base.ts - x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint_api_int/configs/config.base.ts - - x-pack/test/security_solution_endpoint/config.base.ts - - x-pack/test/security_solution_endpoint_api_int/config.base.ts + - x-pack/test/security_solution_endpoint/configs/config.base.ts # QA suites that are run out-of-band - x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js @@ -91,6 +89,10 @@ disabled: - x-pack/test_serverless/api_integration/test_suites/security/config.feature_flags.ts - x-pack/test_serverless/functional/test_suites/security/config.feature_flags.ts + # http/2 security muted tests + - x-pack/test/security_functional/saml.http2.config.ts + - x-pack/test/security_functional/oidc.http2.config.ts + defaultQueue: 'n2-4-spot' enabled: - test/accessibility/config.ts @@ -401,11 +403,13 @@ enabled: - x-pack/test/security_functional/login_selector.config.ts - x-pack/test/security_functional/oidc.config.ts - x-pack/test/security_functional/saml.config.ts - - x-pack/test/security_functional/saml.http2.config.ts - - x-pack/test/security_functional/oidc.http2.config.ts - x-pack/test/security_functional/insecure_cluster_warning.config.ts - x-pack/test/security_functional/user_profiles.config.ts - x-pack/test/security_functional/expired_session.config.ts + - x-pack/test/security_solution_endpoint/configs/endpoint.config.ts + - x-pack/test/security_solution_endpoint/configs/serverless.endpoint.config.ts + - x-pack/test/security_solution_endpoint/configs/integrations.config.ts + - x-pack/test/security_solution_endpoint/configs/serverless.integrations.config.ts - x-pack/test/session_view/basic/config.ts - x-pack/test/spaces_api_integration/security_and_spaces/config_basic.ts - x-pack/test/spaces_api_integration/security_and_spaces/copy_to_space_config_basic.ts @@ -578,7 +582,3 @@ enabled: - x-pack/test/security_solution_api_integration/test_suites/sources/indices/trial_license_complete_tier/configs/serverless.config.ts - x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint_api_int/configs/config.ts - x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint_api_int/configs/serverless.config.ts - - x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint/configs/endpoint.config.ts - - x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint/configs/serverless.endpoint.config.ts - - x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint/configs/integrations.config.ts - - x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint/configs/serverless.integrations.config.ts diff --git a/.buildkite/pipeline-resource-definitions/README.md b/.buildkite/pipeline-resource-definitions/README.md new file mode 100644 index 0000000000000..07a3e54fd93bd --- /dev/null +++ b/.buildkite/pipeline-resource-definitions/README.md @@ -0,0 +1,28 @@ +# Buildkite pipeline resource definitions + +## Overview +The pipeline resources are "RRE" (real resource entities) that are used to create/maintain buildkite pipelines. + +The resources described in these files are parsed and loaded to Backstage (https://backstage.elastic.dev). +From there, [Terrazzo](https://buildkite.com/elastic/terrazzo/) is generating and updating the buildkite pipelines. + +These pipelines are referenced indirectly through the root's [`catalog-info.yaml`](../../catalog-info.yaml) file in order to reduce bloat in the main resources file. +There's a location file that collects files defined in this folder ([locations.yml](locations.yml)), this file needs to be updated in order to keep track of local files. + +Available parameters and further help can be found here: https://docs.elastic.dev/ci/getting-started-with-buildkite-at-elastic + +## Creating a new pipeline resource definition +The easiest way to create a new pipeline is either by copying and editing a similar pipeline, +or by copying a blank template (see [_new_pipeline.yml](_templates/_new_pipeline.yml)) and editing that. + +You can validate your pipeline's structural integrity, and it's conformity to baseline rules by running the following command: +```bash +.buildkite/pipeline-resource-definitions/scripts/validate-pipeline-definition.sh +``` + +Once you've added the file, you should update the [locations.yml](locations.yml) file to include the new pipeline, or run the following command to update it: +```bash +.buildkite/pipeline-resource-definitions/scripts/fix-location-collection.ts +``` + +Add your pipeline implementation, commit & push & merge. The pipeline resource will appear in Backstage within minutes, then the pipeline will be added to Buildkite within ~10 minutes. \ No newline at end of file diff --git a/.buildkite/pipeline-resource-definitions/_template/template.yml b/.buildkite/pipeline-resource-definitions/_templates/_new_pipeline.yml similarity index 100% rename from .buildkite/pipeline-resource-definitions/_template/template.yml rename to .buildkite/pipeline-resource-definitions/_templates/_new_pipeline.yml diff --git a/.buildkite/pipeline-resource-definitions/kibana-artifacts-snapshot.yml b/.buildkite/pipeline-resource-definitions/kibana-artifacts-snapshot.yml index 3c28f5de81662..e1c40f690f4ec 100644 --- a/.buildkite/pipeline-resource-definitions/kibana-artifacts-snapshot.yml +++ b/.buildkite/pipeline-resource-definitions/kibana-artifacts-snapshot.yml @@ -22,7 +22,6 @@ spec: ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' SLACK_NOTIFICATIONS_CHANNEL: '#kibana-operations-alerts' allow_rebuilds: true - branch_configuration: main 8.14 7.17 default_branch: main repository: elastic/kibana pipeline_file: .buildkite/pipelines/artifacts.yml @@ -44,16 +43,3 @@ spec: access_level: MANAGE_BUILD_AND_READ kibana-tech-leads: access_level: MANAGE_BUILD_AND_READ - schedules: - Daily build (main): - cronline: 0 7 * * * America/New_York - message: Daily build - branch: main - Daily build (8.14): - cronline: 0 7 * * * America/New_York - message: Daily build - branch: '8.14' - Daily build (7.17): - cronline: 0 7 * * * America/New_York - message: Daily build - branch: '7.17' diff --git a/.buildkite/pipeline-resource-definitions/kibana-artifacts-staging.yml b/.buildkite/pipeline-resource-definitions/kibana-artifacts-staging.yml index def68475815a7..71bcc4079c50d 100644 --- a/.buildkite/pipeline-resource-definitions/kibana-artifacts-staging.yml +++ b/.buildkite/pipeline-resource-definitions/kibana-artifacts-staging.yml @@ -23,7 +23,6 @@ spec: ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' SLACK_NOTIFICATIONS_CHANNEL: '#kibana-operations-alerts' allow_rebuilds: true - branch_configuration: 7.17 8.14 repository: elastic/kibana pipeline_file: .buildkite/pipelines/artifacts.yml skip_intermediate_builds: false @@ -44,12 +43,3 @@ spec: access_level: MANAGE_BUILD_AND_READ kibana-tech-leads: access_level: MANAGE_BUILD_AND_READ - schedules: - Daily build (8.14): - cronline: 0 7 * * * America/New_York - message: Daily build - branch: '8.14' - Daily build (7.17): - cronline: 0 7 * * * America/New_York - message: Daily build - branch: '7.17' diff --git a/.buildkite/pipeline-resource-definitions/kibana-artifacts-trigger.yml b/.buildkite/pipeline-resource-definitions/kibana-artifacts-trigger.yml index c51728226f9b4..8a9585762de83 100644 --- a/.buildkite/pipeline-resource-definitions/kibana-artifacts-trigger.yml +++ b/.buildkite/pipeline-resource-definitions/kibana-artifacts-trigger.yml @@ -23,7 +23,6 @@ spec: ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' SLACK_NOTIFICATIONS_CHANNEL: '#kibana-operations-alerts' allow_rebuilds: true - branch_configuration: '8.14' default_branch: main repository: elastic/kibana pipeline_file: .buildkite/pipelines/artifacts_trigger.yml @@ -45,8 +44,3 @@ spec: access_level: MANAGE_BUILD_AND_READ kibana-tech-leads: access_level: MANAGE_BUILD_AND_READ - schedules: - Daily build (8.14): - cronline: 0 */2 * * * America/New_York - message: Daily build - branch: '8.14' diff --git a/.buildkite/pipeline-resource-definitions/kibana-es-forward-testing.yml b/.buildkite/pipeline-resource-definitions/kibana-es-forward-testing.yml new file mode 100644 index 0000000000000..dea4426e60e1b --- /dev/null +++ b/.buildkite/pipeline-resource-definitions/kibana-es-forward-testing.yml @@ -0,0 +1,41 @@ +# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json +apiVersion: backstage.io/v1alpha1 +kind: Resource +metadata: + name: bk-kibana-es-forward-compatibility-testing + description: Forward compatibility testing between Kibana 7.17 and ES 8+ + links: + - url: 'https://buildkite.com/elastic/kibana-es-forward-compatibility-testing' + title: Pipeline link +spec: + type: buildkite-pipeline + system: buildkite + owner: 'group:kibana-operations' + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + name: kibana / ES Forward Compatibility Testing + description: Forward compatibility testing between Kibana 7.17 and ES 8+ + spec: + env: + SLACK_NOTIFICATIONS_CHANNEL: '#kibana-operations-alerts' + ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' + allow_rebuilds: false + branch_configuration: main + default_branch: main + repository: elastic/kibana + pipeline_file: .buildkite/pipelines/es_forward.yml # Note: this file exists in 7.17 only + skip_intermediate_builds: false + provider_settings: + prefix_pull_request_fork_branch_names: false + trigger_mode: none + teams: + kibana-operations: + access_level: MANAGE_BUILD_AND_READ + appex-qa: + access_level: MANAGE_BUILD_AND_READ + kibana-tech-leads: + access_level: MANAGE_BUILD_AND_READ + everyone: + access_level: BUILD_AND_READ diff --git a/.buildkite/pipeline-resource-definitions/kibana-es-snapshots.yml b/.buildkite/pipeline-resource-definitions/kibana-es-snapshots.yml index a012322971248..357f983339fd7 100644 --- a/.buildkite/pipeline-resource-definitions/kibana-es-snapshots.yml +++ b/.buildkite/pipeline-resource-definitions/kibana-es-snapshots.yml @@ -22,7 +22,7 @@ spec: SLACK_NOTIFICATIONS_CHANNEL: '#kibana-operations-alerts' ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' allow_rebuilds: true - branch_configuration: main 8.14 7.17 + branch_configuration: main 8.15 8.14 7.17 default_branch: main repository: elastic/kibana pipeline_file: .buildkite/pipelines/es_snapshots/build.yml @@ -49,6 +49,10 @@ spec: cronline: 0 9 * * * America/New_York message: Daily build branch: main + Daily build (8.15): + cronline: 0 9 * * * America/New_York + message: Daily build + branch: '8.15' Daily build (8.14): cronline: 0 9 * * * America/New_York message: Daily build @@ -82,7 +86,7 @@ spec: SLACK_NOTIFICATIONS_CHANNEL: '#kibana-operations-alerts' ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' allow_rebuilds: true - branch_configuration: main 8.14 7.17 + branch_configuration: main 8.15 8.14 7.17 default_branch: main repository: elastic/kibana pipeline_file: .buildkite/pipelines/es_snapshots/promote.yml @@ -130,7 +134,7 @@ spec: ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' REPORT_FAILED_TESTS_TO_GITHUB: 'true' allow_rebuilds: true - branch_configuration: main 8.14 7.17 + branch_configuration: main 8.15 8.14 7.17 default_branch: main repository: elastic/kibana pipeline_file: .buildkite/pipelines/es_snapshots/verify.yml diff --git a/.buildkite/pipeline-resource-definitions/kibana-on-merge-unsupported-ftrs.yml b/.buildkite/pipeline-resource-definitions/kibana-on-merge-unsupported-ftrs.yml index 9171e5ba2008d..d75ceba304d22 100644 --- a/.buildkite/pipeline-resource-definitions/kibana-on-merge-unsupported-ftrs.yml +++ b/.buildkite/pipeline-resource-definitions/kibana-on-merge-unsupported-ftrs.yml @@ -22,7 +22,7 @@ spec: SLACK_NOTIFICATIONS_CHANNEL: '#kibana-unsupported-ftrs-alerts' ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' allow_rebuilds: true - branch_configuration: main 8.14 7.17 + branch_configuration: main 8.15 8.14 7.17 default_branch: main repository: elastic/kibana pipeline_file: .buildkite/pipelines/on_merge_unsupported_ftrs.yml diff --git a/.buildkite/pipeline-resource-definitions/kibana-on-merge.yml b/.buildkite/pipeline-resource-definitions/kibana-on-merge.yml index 3240cf5e01777..98d9f1d143e43 100644 --- a/.buildkite/pipeline-resource-definitions/kibana-on-merge.yml +++ b/.buildkite/pipeline-resource-definitions/kibana-on-merge.yml @@ -25,7 +25,7 @@ spec: REPORT_FAILED_TESTS_TO_GITHUB: 'true' ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' allow_rebuilds: true - branch_configuration: main 7.17 8.14 + branch_configuration: main 7.17 8.14 8.15 default_branch: main repository: elastic/kibana pipeline_file: .buildkite/pipelines/on_merge.yml diff --git a/.buildkite/pipeline-resource-definitions/kibana-serverless-emergency-release.yml b/.buildkite/pipeline-resource-definitions/kibana-serverless-emergency-release.yml new file mode 100644 index 0000000000000..5911095262ac1 --- /dev/null +++ b/.buildkite/pipeline-resource-definitions/kibana-serverless-emergency-release.yml @@ -0,0 +1,30 @@ +# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json +apiVersion: backstage.io/v1alpha1 +kind: Resource +metadata: + name: buildkite-pipeline-kibana-emergency-release + description: Emergency release + links: + - title: Pipeline + url: https://buildkite.com/elastic/kibana-emergency-release +spec: + type: buildkite-pipeline + owner: group:kibana-operations + system: buildkite + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + name: kibana / emergency release + spec: + repository: elastic/kibana + provider_settings: + trigger_mode: none + pipeline_file: ".buildkite/pipelines/emergency_release.yml" + teams: + kibana-operations: + access_level: MANAGE_BUILD_AND_READ + kibana-release-operators: + access_level: BUILD_AND_READ + everyone: + access_level: READ_ONLY diff --git a/.buildkite/pipeline-resource-definitions/kibana-serverless-quality-gates.yml b/.buildkite/pipeline-resource-definitions/kibana-serverless-quality-gates.yml new file mode 100644 index 0000000000000..1f57f2ca83250 --- /dev/null +++ b/.buildkite/pipeline-resource-definitions/kibana-serverless-quality-gates.yml @@ -0,0 +1,33 @@ +# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json +apiVersion: backstage.io/v1alpha1 +kind: Resource +metadata: + name: kibana-tests-pipeline + description: Definition of the kibana pipeline + links: + - title: Pipeline + url: https://buildkite.com/elastic/kibana-tests +spec: + type: buildkite-pipeline + owner: group:kibana-tech-leads + system: buildkite + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + name: kibana-tests + description: Pipeline that tests the service integration in various environments + spec: + repository: elastic/kibana + pipeline_file: ./.buildkite/pipelines/quality-gates/pipeline.kibana-tests.yaml + provider_settings: + trigger_mode: none + teams: + kibana-operations: + access_level: MANAGE_BUILD_AND_READ + kibana-release-operators: + access_level: BUILD_AND_READ + cloud-tooling: + access_level: BUILD_AND_READ + everyone: + access_level: READ_ONLY diff --git a/.buildkite/pipeline-resource-definitions/locations.yml b/.buildkite/pipeline-resource-definitions/locations.yml index ccbc41c60ece1..35115b00e273b 100644 --- a/.buildkite/pipeline-resource-definitions/locations.yml +++ b/.buildkite/pipeline-resource-definitions/locations.yml @@ -14,6 +14,7 @@ spec: - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-artifacts-staging.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-artifacts-trigger.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-coverage-daily.yml + - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-es-forward-testing.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-es-serverless-snapshots.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-es-snapshots.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-esql-grammar-sync.yml @@ -27,6 +28,8 @@ spec: - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-performance-data-set-extraction-daily.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-pr.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-purge-cloud-deployments.yml + - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-serverless-emergency-release.yml + - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-serverless-quality-gates.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-serverless-quality-gates-emergency.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-serverless-release-testing.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-serverless-release.yml @@ -39,3 +42,4 @@ spec: - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-gen-ai.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-investigations.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-rule-management.yml + - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/trigger-version-dependent-jobs.yml diff --git a/.buildkite/pipeline-resource-definitions/fix-location-collection.ts b/.buildkite/pipeline-resource-definitions/scripts/fix-location-collection.ts similarity index 83% rename from .buildkite/pipeline-resource-definitions/fix-location-collection.ts rename to .buildkite/pipeline-resource-definitions/scripts/fix-location-collection.ts index d4e36f2559a89..1173cddeb15aa 100755 --- a/.buildkite/pipeline-resource-definitions/fix-location-collection.ts +++ b/.buildkite/pipeline-resource-definitions/scripts/fix-location-collection.ts @@ -11,7 +11,7 @@ import jsYaml from 'js-yaml'; import path from 'path'; import { execSync } from 'child_process'; -const EXCLUDE_LIST = ['locations.yml', '_template/template.yml']; +const EXCLUDE_LIST = ['locations.yml', '_templates']; const REPO_FILES_BASE = 'https://github.com/elastic/kibana/blob/main'; type BackstageLocationResource = object & { @@ -20,19 +20,19 @@ type BackstageLocationResource = object & { async function main() { const repoRoot = execSync('git rev-parse --show-toplevel').toString().trim(); - const resourceDefinitionsFolder = path.resolve( + const resourceDefinitionsRoot = path.resolve( repoRoot, '.buildkite', 'pipeline-resource-definitions' ); const resourceDefinitionsBaseUrl = `${REPO_FILES_BASE}/.buildkite/pipeline-resource-definitions`; - const locationFile = path.resolve(resourceDefinitionsFolder, 'locations.yml'); + const locationFile = path.resolve(resourceDefinitionsRoot, 'locations.yml'); const locationFileLines = fs.readFileSync(locationFile, 'utf8').split('\n'); - const pipelines = readDirRecursively(resourceDefinitionsFolder) + const pipelines = readDirRecursively(resourceDefinitionsRoot) .filter((file) => file.endsWith('.yml')) - .map((file) => file.replace(`${resourceDefinitionsFolder}/`, '')) - .filter((f) => !EXCLUDE_LIST.includes(f)); + .map((file) => file.replace(`${resourceDefinitionsRoot}/`, '')) + .filter((f) => EXCLUDE_LIST.every((excludeExpr) => !f.match(excludeExpr))); const preamble = locationFileLines.slice(0, 1); diff --git a/.buildkite/pipeline-resource-definitions/scripts/validate-pipeline-definition.sh b/.buildkite/pipeline-resource-definitions/scripts/validate-pipeline-definition.sh new file mode 100755 index 0000000000000..cd153b23f10ab --- /dev/null +++ b/.buildkite/pipeline-resource-definitions/scripts/validate-pipeline-definition.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# This script is used to validate a single RRE for a pipeline definition. + +TARGET_FILE=$1 + +if [ -z "$TARGET_FILE" ]; then + echo "Usage: $0 " + exit 1 +fi + +echo "Validating $TARGET_FILE..." +ABSOLUTE_PATH=$(realpath "$TARGET_FILE") +FILE_NAME=$(basename "$ABSOLUTE_PATH") +FOLDER_NAME=$(dirname "$ABSOLUTE_PATH") + +docker run -it \ + --mount type=bind,source="$FOLDER_NAME",target=/home/app/ \ + docker.elastic.co/ci-agent-images/pipelib \ + rre validate --backstage-entity-aware "/home/app/$FILE_NAME" + +if [ $? -ne 0 ]; then + echo "$FILE_NAME invalid ❌" + exit 1 +else + echo "$FILE_NAME valid ✅" + exit 0 +fi diff --git a/.buildkite/pipeline-resource-definitions/trigger-version-dependent-jobs.yml b/.buildkite/pipeline-resource-definitions/trigger-version-dependent-jobs.yml new file mode 100644 index 0000000000000..ea474356b137d --- /dev/null +++ b/.buildkite/pipeline-resource-definitions/trigger-version-dependent-jobs.yml @@ -0,0 +1,71 @@ +### +# For more information on authoring pipeline definitions, +# follow the guides at https://docs.elastic.dev/ci/getting-started-with-buildkite-at-elastic +### +# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json +apiVersion: backstage.io/v1alpha1 +kind: Resource +metadata: + name: bk-kibana-trigger-version-dependent-jobs + description: 'Trigger version-dependent jobs' + links: + - url: 'https://buildkite.com/elastic/kibana-trigger-version-dependent-jobs' + title: Pipeline link +spec: + type: buildkite-pipeline + system: buildkite + owner: 'group:kibana-operations' + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + name: kibana / trigger version-dependent jobs + description: 'Trigger version-dependent jobs' + spec: + env: + SLACK_NOTIFICATIONS_CHANNEL: '#kibana-operations-alerts' + ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' + + allow_rebuilds: false + branch_configuration: main + default_branch: main + repository: elastic/kibana + pipeline_file: .buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.sh + skip_intermediate_builds: false + provider_settings: + prefix_pull_request_fork_branch_names: false + skip_pull_request_builds_for_existing_commits: true + trigger_mode: none + teams: + kibana-operations: + access_level: MANAGE_BUILD_AND_READ + appex-qa: + access_level: MANAGE_BUILD_AND_READ + kibana-tech-leads: + access_level: MANAGE_BUILD_AND_READ + everyone: + access_level: BUILD_AND_READ + schedules: + Trigger ES forward compatibility tests: + cronline: 0 5 * * * + message: Trigger ES forward compatibility tests + env: + TRIGGER_PIPELINE_SET: es-forward + Trigger artifact staging builds: + cronline: 0 7 * * * America/New_York + message: Trigger artifact staging builds + env: + TRIGGER_PIPELINE_SET: artifacts-staging + MESSAGE: Daily staging build + Trigger artifact snapshot builds: + cronline: 0 7 * * * America/New_York + message: Trigger artifact snapshot builds + env: + TRIGGER_PIPELINE_SET: artifacts-snapshot + MESSAGE: Daily snapshot build + Run kibana-artifacts-trigger: + cronline: 0 */2 * * * America/New_York + message: Trigger 'kibana-artifacts-trigger' + env: + TRIGGER_PIPELINE_SET: artifacts-trigger + MESSAGE: Daily build diff --git a/.buildkite/pipeline-utils/agent_images.ts b/.buildkite/pipeline-utils/agent_images.ts index 0606f036b1c64..d139f7953e00f 100644 --- a/.buildkite/pipeline-utils/agent_images.ts +++ b/.buildkite/pipeline-utils/agent_images.ts @@ -52,4 +52,19 @@ function getAgentImageConfig({ returnYaml = false } = {}): string | AgentImageCo return config; } -export { getAgentImageConfig }; +const expandAgentQueue = (queueName: string = 'n2-4-spot') => { + const [kind, cores, addition] = queueName.split('-'); + const additionalProps = + { + spot: { preemptible: true }, + virt: { localSsdInterface: 'nvme', enableNestedVirtualization: true, localSsds: 1 }, + }[addition] || {}; + + return { + ...getAgentImageConfig(), + machineType: `${kind}-standard-${cores}`, + ...additionalProps, + }; +}; + +export { getAgentImageConfig, expandAgentQueue }; diff --git a/.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts b/.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts index 20b2d366e6067..a24214b1e62b0 100644 --- a/.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts +++ b/.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts @@ -16,27 +16,10 @@ import { BuildkiteClient, BuildkiteStep } from '../buildkite'; import { CiStatsClient, TestGroupRunOrderResponse } from './client'; import DISABLED_JEST_CONFIGS from '../../disabled_jest_configs.json'; -import { getAgentImageConfig } from '#pipeline-utils'; +import { expandAgentQueue } from '#pipeline-utils'; type RunGroup = TestGroupRunOrderResponse['types'][0]; -// TODO: remove this after https://github.com/elastic/kibana-operations/issues/15 is finalized -/** This function bridges the agent targeting between gobld and kibana-buildkite agent targeting */ -const getAgentRule = (queueName: string = 'n2-4-spot') => { - if (process.env?.BUILDKITE_AGENT_META_DATA_QUEUE === 'gobld') { - const [kind, cores, spot] = queueName.split('-'); - return { - ...getAgentImageConfig(), - machineType: `${kind}-standard-${cores}`, - preemptible: spot === 'spot', - }; - } else { - return { - queue: queueName, - }; - } -}; - const getRequiredEnv = (name: string) => { const value = process.env[name]; if (typeof value !== 'string' || !value) { @@ -436,7 +419,7 @@ export async function pickTestGroupRunOrder() { parallelism: unit.count, timeout_in_minutes: 120, key: 'jest', - agents: getAgentRule('n2-4-spot'), + agents: expandAgentQueue('n2-4-spot'), retry: { automatic: [ { exit_status: '-1', limit: 3 }, @@ -454,7 +437,7 @@ export async function pickTestGroupRunOrder() { parallelism: integration.count, timeout_in_minutes: 120, key: 'jest-integration', - agents: getAgentRule('n2-4-spot'), + agents: expandAgentQueue('n2-4-spot'), retry: { automatic: [ { exit_status: '-1', limit: 3 }, @@ -488,7 +471,7 @@ export async function pickTestGroupRunOrder() { label: title, command: getRequiredEnv('FTR_CONFIGS_SCRIPT'), timeout_in_minutes: 90, - agents: getAgentRule(queue), + agents: expandAgentQueue(queue), env: { FTR_CONFIG_GROUP_KEY: key, ...FTR_EXTRA_ARGS, diff --git a/.buildkite/pipeline-utils/utils.test.ts b/.buildkite/pipeline-utils/utils.test.ts new file mode 100644 index 0000000000000..2fece6082bc5c --- /dev/null +++ b/.buildkite/pipeline-utils/utils.test.ts @@ -0,0 +1,45 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/* eslint-disable @typescript-eslint/no-unused-expressions */ + +import { expect } from 'chai'; +import { getKibanaDir, getVersionsFile } from './utils'; +import fs from 'fs'; + +// TODO: replace mocha with jest, and write tests that mock FS + +describe('getKibanaDir', () => { + it('should return the kibana directory', () => { + const kibanaDir = getKibanaDir(); + + expect(kibanaDir).to.be.ok; + expect(fs.existsSync(kibanaDir)).to.be.true; + }); +}); + +describe('getVersionsFile', () => { + it('should return the versions file', () => { + const versionsFile = getVersionsFile(); + + expect(versionsFile).to.be.ok; + expect(versionsFile.versions).to.be.an('array'); + }); + + it('should correctly find prevMajor and prevMinor versions', () => { + const versionsFile = getVersionsFile(); + + expect(versionsFile.prevMajors).to.be.an('array'); + expect(versionsFile.prevMajors.length).to.eql(1); + expect(versionsFile.prevMajors[0].branch).to.eql('7.17'); + + expect(versionsFile.prevMinors).to.be.an('array'); + }); + + // TODO: write more tests with mocking... +}); diff --git a/.buildkite/pipeline-utils/utils.ts b/.buildkite/pipeline-utils/utils.ts index e9a5cf9193334..9f7a27d6e1518 100644 --- a/.buildkite/pipeline-utils/utils.ts +++ b/.buildkite/pipeline-utils/utils.ts @@ -7,6 +7,8 @@ */ import { execSync } from 'child_process'; +import fs from 'fs'; +import path from 'path'; const getKibanaDir = (() => { let kibanaDir: string | undefined; @@ -21,4 +23,42 @@ const getKibanaDir = (() => { }; })(); -export { getKibanaDir }; +export interface Version { + branch: string; + version: string; +} +export interface VersionsFile { + versions: Array< + { + previousMajor?: boolean; + previousMinor?: boolean; + currentMajor?: boolean; + currentMinor?: boolean; + } & Version + >; +} +const getVersionsFile = (() => { + let versions: VersionsFile & { + prevMinors: Version[]; + prevMajors: Version[]; + current: Version; + }; + const versionsFileName = 'versions.json'; + try { + const versionsJSON = JSON.parse( + fs.readFileSync(path.join(getKibanaDir(), versionsFileName)).toString() + ); + versions = { + versions: versionsJSON.versions, + prevMinors: versionsJSON.versions.filter((v: any) => v.previousMinor), + prevMajors: versionsJSON.versions.filter((v: any) => v.previousMajor), + current: versionsJSON.versions.find((v: any) => v.currentMajor && v.currentMinor), + }; + } catch (error) { + throw new Error(`Failed to read ${versionsFileName}: ${error}`); + } + + return () => versions; +})(); + +export { getKibanaDir, getVersionsFile }; diff --git a/.buildkite/pipelines/flaky_tests/pipeline.ts b/.buildkite/pipelines/flaky_tests/pipeline.ts index 6a5b7da38a143..d77504deacb45 100644 --- a/.buildkite/pipelines/flaky_tests/pipeline.ts +++ b/.buildkite/pipelines/flaky_tests/pipeline.ts @@ -7,7 +7,7 @@ */ import { groups } from './groups.json'; -import { BuildkiteStep } from '#pipeline-utils'; +import { BuildkiteStep, expandAgentQueue } from '#pipeline-utils'; const configJson = process.env.KIBANA_FLAKY_TEST_RUNNER_CONFIG; if (!configJson) { @@ -32,34 +32,6 @@ if (Number.isNaN(concurrency)) { const BASE_JOBS = 1; const MAX_JOBS = 500; -// TODO: remove this after https://github.com/elastic/kibana-operations/issues/15 is finalized -/** This function bridges the agent targeting between gobld and kibana-buildkite agent targeting */ -const getAgentRule = (queueName: string = 'n2-4-spot') => { - if ( - process.env.BUILDKITE_AGENT_META_DATA_QUEUE === 'gobld' || - process.env.BUILDKITE_AGENT_META_DATA_PROVIDER === 'k8s' - ) { - const [kind, cores, addition] = queueName.split('-'); - const additionalProps = - { - spot: { preemptible: true }, - virt: { localSsdInterface: 'nvme', enableNestedVirtualization: true, localSsds: 1 }, - }[addition] || {}; - - return { - provider: 'gcp', - image: 'family/kibana-ubuntu-2004', - imageProject: 'elastic-images-prod', - machineType: `${kind}-standard-${cores}`, - ...additionalProps, - }; - } else { - return { - queue: queueName, - }; - } -}; - function getTestSuitesFromJson(json: string) { const fail = (errorMsg: string) => { console.error('+++ Invalid test config provided'); @@ -150,7 +122,7 @@ const pipeline = { steps.push({ command: '.buildkite/scripts/steps/build_kibana.sh', label: 'Build Kibana Distribution and Plugins', - agents: getAgentRule('c2-8'), + agents: expandAgentQueue('c2-8'), key: 'build', if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''", }); @@ -173,7 +145,7 @@ for (const testSuite of testSuites) { concurrency, concurrency_group: process.env.UUID, concurrency_method: 'eager', - agents: getAgentRule('n2-4-spot'), + agents: expandAgentQueue('n2-4-spot'), depends_on: 'build', timeout_in_minutes: 150, cancel_on_build_failing: true, @@ -197,7 +169,7 @@ for (const testSuite of testSuites) { steps.push({ command: `.buildkite/scripts/steps/functional/${suiteName}.sh`, label: group.name, - agents: getAgentRule(agentQueue), + agents: expandAgentQueue(agentQueue), key: `cypress-suite-${suiteIndex++}`, depends_on: 'build', timeout_in_minutes: 150, @@ -233,7 +205,7 @@ pipeline.steps.push({ pipeline.steps.push({ command: 'ts-node .buildkite/pipelines/flaky_tests/post_stats_on_pr.ts', label: 'Post results on Github pull request', - agents: getAgentRule('n2-4-spot'), + agents: expandAgentQueue('n2-4-spot'), timeout_in_minutes: 15, retry: { automatic: [{ exit_status: '-1', limit: 3 }], diff --git a/.buildkite/pipelines/on_merge.yml b/.buildkite/pipelines/on_merge.yml index ae6c05721ae84..4eb15c16970ef 100644 --- a/.buildkite/pipelines/on_merge.yml +++ b/.buildkite/pipelines/on_merge.yml @@ -16,28 +16,6 @@ steps: limit: 1 - wait - - label: 'Triggering changes-based pipelines' - branches: main - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-prod - provider: gcp - machineType: n2-standard-2 - # TODO: this can probably be deleted after the migration https://github.com/elastic/kibana-operations/issues/15 - plugins: - - chronotc/monorepo-diff#v2.0.4: - watch: - - path: - - 'versions.json' - config: - command: 'ts-node .buildkite/scripts/steps/trigger_pipeline.ts kibana-buildkite-pipelines-deploy main' - label: 'Trigger pipeline deploy' - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-prod - provider: gcp - machineType: n2-standard-2 - - command: .buildkite/scripts/steps/on_merge_build_and_metrics.sh label: Build Kibana Distribution and Plugins agents: diff --git a/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_explore.yml b/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_explore.yml index 7aff13525a2fc..7697da4b3edaf 100644 --- a/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_explore.yml +++ b/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_explore.yml @@ -17,3 +17,66 @@ steps: automatic: - exit_status: '-1' limit: 1 + + - group: "API MKI - Explore" + key: api_test_explore + steps: + - label: Running explore:hosts:runner:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:hosts:runner:qa:serverless + key: explore:hosts:runner:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-prod + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running explore:network:runner:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:network:runner:qa:serverless + key: explore:network:runner:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-prod + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running explore:overview:runner:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:overview:runner:qa:serverless + key: explore:overview:runner:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-prod + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running explore:users:runner:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:users:runner:qa:serverless + key: explore:users:runner:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-prod + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 diff --git a/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_gen_ai.yml b/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_gen_ai.yml index 2d84e7d4e0315..3fe69ca56c38b 100644 --- a/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_gen_ai.yml +++ b/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_gen_ai.yml @@ -1,6 +1,6 @@ steps: - command: .buildkite/scripts/pipelines/security_solution_quality_gate/security_solution_cypress/mki_security_solution_cypress.sh cypress:run:qa:serverless:ai_assistant - label: "Cypress MKI - GenAI + label: "Cypress MKI - GenAI" key: test_ai_assistant env: BK_TEST_SUITE_KEY: "serverless-cypress-gen-ai" diff --git a/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_investigations.yml b/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_investigations.yml index d19d709231e31..0988bf6ecf6b8 100644 --- a/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_investigations.yml +++ b/.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_investigations.yml @@ -17,3 +17,36 @@ steps: automatic: - exit_status: '-1' limit: 1 + + - group: "API MKI - Investigations" + key: api_test_investigations + steps: + - label: Running investigations:timeline:runner:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh investigations:timeline:runner:qa:serverless + key: investigations:timeline:runner:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-prod + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running investigations:saved-objects:runner:qa:serverless + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh investigations:saved-objects:runner:qa:serverless + key: investigations:saved-objects:runner:qa:serverless + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-prod + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 diff --git a/.buildkite/pipelines/security_solution_quality_gate/mki_quality_gate/mki_quality_gate_explore.yml b/.buildkite/pipelines/security_solution_quality_gate/mki_quality_gate/mki_quality_gate_explore.yml index e60f4509fcb3e..2c518fa24efab 100644 --- a/.buildkite/pipelines/security_solution_quality_gate/mki_quality_gate/mki_quality_gate_explore.yml +++ b/.buildkite/pipelines/security_solution_quality_gate/mki_quality_gate/mki_quality_gate_explore.yml @@ -17,3 +17,66 @@ steps: automatic: - exit_status: '-1' limit: 1 + + - group: "API MKI - Explore" + key: api_test_explore + steps: + - label: Running explore:hosts:runner:qa:serverless:release + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:hosts:runner:qa:serverless:release + key: explore:hosts:runner:qa:serverless:release + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-prod + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running explore:network:runner:qa:serverless:release + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:network:runner:qa:serverless:release + key: explore:network:runner:qa:serverless:release + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-prod + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running explore:overview:runner:qa:serverless:release + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:overview:runner:qa:serverless:release + key: explore:overview:runner:qa:serverless:release + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-prod + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running explore:users:runner:qa:serverless:release + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh explore:users:runner:qa:serverless:release + key: explore:users:runner:qa:serverless:release + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-prod + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 diff --git a/.buildkite/pipelines/security_solution_quality_gate/mki_quality_gate/mki_quality_gate_investigations.yml b/.buildkite/pipelines/security_solution_quality_gate/mki_quality_gate/mki_quality_gate_investigations.yml index ed46611989b87..d3f57e40ec2cb 100644 --- a/.buildkite/pipelines/security_solution_quality_gate/mki_quality_gate/mki_quality_gate_investigations.yml +++ b/.buildkite/pipelines/security_solution_quality_gate/mki_quality_gate/mki_quality_gate_investigations.yml @@ -17,3 +17,36 @@ steps: automatic: - exit_status: '-1' limit: 1 + + - group: "API MKI - Investigations" + key: api_test_investigations + steps: + - label: Running investigations:timeline:runner:qa:serverless:release + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh investigations:timeline:runner:qa:serverless:release + key: investigations:timeline:runner:qa:serverless:release + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-prod + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 + + - label: Running investigations:saved-objects:runner:qa:serverless:release + command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh investigations:saved-objects:runner:qa:serverless:release + key: investigations:saved-objects:runner:qa:serverless:release + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-prod + provider: gcp + machineType: n2-standard-4 + preemptible: true + timeout_in_minutes: 120 + retry: + automatic: + - exit_status: "1" + limit: 2 diff --git a/.buildkite/pull_requests.json b/.buildkite/pull_requests.json index 0c6714d1c75b7..0758e0255247f 100644 --- a/.buildkite/pull_requests.json +++ b/.buildkite/pull_requests.json @@ -45,52 +45,6 @@ "/__snapshots__/", "\\.test\\.(ts|tsx|js|jsx)" ] - }, - { - "repoOwner": "elastic", - "repoName": "kibana", - "pipelineSlug": "kibana-kme-test", - - "enabled": true, - "allow_org_users": true, - "allowed_repo_permissions": ["admin", "write"], - "set_commit_status": true, - "commit_status_context": "kibana-ci-test", - "build_on_commit": true, - "build_on_comment": false, - "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))", - "skip_ci_labels": [], - "labels": ["kme-test"], - "skip_target_branches": ["6.8", "7.11", "7.12"], - "enable_skippable_commits": true, - "skip_ci_on_only_changed": [ - "^dev_docs/", - "^docs/", - "^rfcs/", - "^\\.github/", - "\\.md$", - "\\.mdx$", - "^api_docs/.+\\.devdocs\\.json$", - "^\\.backportrc\\.json$", - "^nav-kibana-dev\\.docnav\\.json$", - "^src/dev/prs/kibana_qa_pr_list\\.json$", - "^\\.buildkite/pull_requests\\.json$", - "^\\.catalog-info\\.yaml$" - ], - "always_require_ci_on_changed": [ - "^docs/developer/plugin-list.asciidoc$", - "^\\.github/CODEOWNERS$", - "/plugins/[^/]+/readme\\.(md|asciidoc)$" - ], - "kibana_versions_check": true, - "kibana_build_reuse": true, - "kibana_build_reuse_pipeline_slugs": ["kibana-kme-test", "kibana-on-merge"], - "kibana_build_reuse_regexes": [ - "^test/", - "^x-pack/test/", - "/__snapshots__/", - "\\.test\\.(ts|tsx|js|jsx)" - ] } ] } diff --git a/.buildkite/scripts/common/util.sh b/.buildkite/scripts/common/util.sh index 5630fed40bf93..bc5983e249669 100755 --- a/.buildkite/scripts/common/util.sh +++ b/.buildkite/scripts/common/util.sh @@ -172,3 +172,9 @@ npm_install_global() { download_artifact() { retry 3 1 timeout 3m buildkite-agent artifact download "$@" } + +print_if_dry_run() { + if [[ "${DRY_RUN:-}" =~ ^(1|true)$ ]]; then + echo "DRY_RUN is enabled." + fi +} diff --git a/.buildkite/scripts/lifecycle/post_command.sh b/.buildkite/scripts/lifecycle/post_command.sh index b22293dbcb8b6..47e118a402408 100755 --- a/.buildkite/scripts/lifecycle/post_command.sh +++ b/.buildkite/scripts/lifecycle/post_command.sh @@ -6,13 +6,6 @@ echo '--- Log out of gcloud' ./.buildkite/scripts/common/activate_service_account.sh --unset-impersonation || echo "Failed to unset impersonation" ./.buildkite/scripts/common/activate_service_account.sh --logout-gcloud || echo "Failed to log out of gcloud" -if [[ "${SKIP_NODE_SETUP:-}" =~ ^(1|true)$ ]]; then - echo '--- Skipping Agent Debug Info' -else - echo '--- Agent Debug Info' - ts-node .buildkite/scripts/lifecycle/print_agent_links.ts || true -fi - IS_TEST_EXECUTION_STEP="$(buildkite-agent meta-data get "${BUILDKITE_JOB_ID}_is_test_execution_step" --default '')" if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then diff --git a/.buildkite/scripts/lifecycle/pre_command.sh b/.buildkite/scripts/lifecycle/pre_command.sh index c0b08f474bbd2..3b2a3dcdcdad1 100755 --- a/.buildkite/scripts/lifecycle/pre_command.sh +++ b/.buildkite/scripts/lifecycle/pre_command.sh @@ -11,16 +11,6 @@ if [[ "${SKIP_NODE_SETUP:-}" =~ ^(1|true)$ ]]; then else source .buildkite/scripts/common/setup_node.sh source .buildkite/scripts/common/setup_buildkite_deps.sh - - echo '--- Agent Debug/SSH Info' - ts-node .buildkite/scripts/lifecycle/print_agent_links.ts || true -fi - -if [[ "$(curl -is metadata.google.internal || true)" ]]; then - echo "" - echo "To SSH into this agent, run:" - echo "gcloud compute ssh --tunnel-through-iap --project elastic-kibana-ci --zone \"$(curl -sH Metadata-Flavor:Google http://metadata.google.internal/computeMetadata/v1/instance/zone)\" \"$(curl -sH Metadata-Flavor:Google http://metadata.google.internal/computeMetadata/v1/instance/name)\"" - echo "" fi if [[ "${BUILDKITE_LABEL:-}" == *"Run Dynamic Pipeline"* || "${BUILDKITE_LABEL:-}" == *"Upload Pipeline"* ]]; then diff --git a/.buildkite/scripts/lifecycle/print_agent_links.ts b/.buildkite/scripts/lifecycle/print_agent_links.ts deleted file mode 100644 index 428ec3dc0aaff..0000000000000 --- a/.buildkite/scripts/lifecycle/print_agent_links.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { BuildkiteClient } from '#pipeline-utils'; - -(async () => { - try { - const client = new BuildkiteClient(); - const build = await client.getCurrentBuild(); - - const job = build.jobs.find((j) => j.id === process.env.BUILDKITE_JOB_ID); - const startTime = job - ? new Date(job.started_at) - : new Date(new Date().getTime() - 60 * 60 * 1000); - const twoHours = new Date(startTime.getTime() + 2 * 60 * 60 * 1000); - - const METRICS_URL = [ - `https://kibana-ops-buildkite-monitoring.kb.us-central1.gcp.cloud.es.io:9243`, - `/app/metrics/link-to/host-detail/${process.env.BUILDKITE_AGENT_NAME}`, - `?to=${twoHours.getTime()}`, - `&from=${startTime.getTime()}`, - ].join(''); - - const LOGS_URL = [ - `https://kibana-ops-buildkite-monitoring.kb.us-central1.gcp.cloud.es.io:9243`, - `/app/logs/link-to/host-logs/${process.env.BUILDKITE_AGENT_NAME}`, - `?time=${startTime.getTime()}`, - ].join(''); - - console.log('Agent Metrics:'); - console.log('\u001b]1339;' + `url='${METRICS_URL}'\u0007`); - console.log('Agent Logs:'); - console.log('\u001b]1339;' + `url='${LOGS_URL}'\u0007`); - } catch (ex) { - // Probably don't need to fail the build for this failure, just log it - console.error('Buildkite API Error', ex.message); - if (ex.response) { - console.error('HTTP Error Response Status', ex.response.status); - console.error('HTTP Error Response Body', ex.response.data); - } - } -})(); diff --git a/.buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.sh b/.buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.sh new file mode 100755 index 0000000000000..500372eb91596 --- /dev/null +++ b/.buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -euo pipefail + +ts-node .buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.ts diff --git a/.buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.test.ts b/.buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.test.ts new file mode 100644 index 0000000000000..45475301f1c49 --- /dev/null +++ b/.buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.test.ts @@ -0,0 +1,77 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +/* eslint-disable @typescript-eslint/no-unused-expressions */ + +import { getVersionsFile } from '#pipeline-utils'; +import { expect } from 'chai'; + +import { + getArtifactBuildTriggers, + getArtifactSnapshotPipelineTriggers, + getESForwardPipelineTriggers, + getArtifactStagingPipelineTriggers, +} from './pipeline'; + +const versionsFile = getVersionsFile(); + +describe('pipeline trigger combinations', () => { + it('should trigger the correct pipelines for "es-forward"', () => { + const esForwardTriggers = getESForwardPipelineTriggers(); + // tests 7.17 against 8.x versions + const targets = versionsFile.versions.filter((v) => v.currentMajor === true); + + expect(esForwardTriggers.length).to.eql(targets.length); + + expect(esForwardTriggers.every((trigger) => trigger.build?.branch === '7.17')).to.be.true; + + const targetedManifests = esForwardTriggers.map((t) => t.build?.env?.ES_SNAPSHOT_MANIFEST); + targets.forEach((t) => + expect(targetedManifests).to.include( + `https://storage.googleapis.com/kibana-ci-es-snapshots-daily/${t.version}/manifest-latest-verified.json` + ) + ); + }); + + it('should trigger the correct pipelines for "artifacts-snapshot"', () => { + const snapshotTriggers = getArtifactSnapshotPipelineTriggers(); + // triggers for all open branches + const branches = versionsFile.versions.map((v) => v.branch); + + expect(snapshotTriggers.length).to.eql(branches.length); + + branches.forEach((b) => { + expect(snapshotTriggers.some((trigger) => trigger.build?.branch === b)).to.be.true; + }); + }); + + it('should trigger the correct pipelines for "artifacts-trigger"', () => { + const triggerTriggers = getArtifactBuildTriggers(); + // all currentMajor+prevMinor branches + const branches = versionsFile.versions + .filter((v) => v.currentMajor === true && v.previousMinor === true) + .map((v) => v.branch); + + expect(triggerTriggers.length).to.eql(branches.length); + branches.forEach((b) => { + expect(triggerTriggers.some((trigger) => trigger.build?.branch === b)).to.be.true; + }); + }); + + it('should trigger the correct pipelines for "artifacts-staging"', () => { + const stagingTriggers = getArtifactStagingPipelineTriggers(); + // all branches that are not currentMajor+currentMinor + const branches = versionsFile.versions + .filter((v) => !v.currentMajor || !v.currentMinor) + .map((v) => v.branch); + + expect(stagingTriggers.length).to.eql(branches.length); + branches.forEach((b) => { + expect(stagingTriggers.some((trigger) => trigger.build?.branch === b)).to.be.true; + }); + }); +}); diff --git a/.buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.ts b/.buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.ts new file mode 100755 index 0000000000000..314e3d2164688 --- /dev/null +++ b/.buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.ts @@ -0,0 +1,179 @@ +#!/usr/bin/env ts-node +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { getVersionsFile, BuildkiteTriggerStep } from '#pipeline-utils'; + +const pipelineSets = { + 'es-forward': 'kibana-es-forward-compatibility-testing', + 'artifacts-snapshot': 'kibana-artifacts-snapshot', + 'artifacts-staging': 'kibana-artifacts-staging', + 'artifacts-trigger': 'kibana-artifacts-trigger', +}; + +/** + * This pipeline is used to emit trigger steps onto different pipelines, based on dynamic parameters retrieved from the repository. + */ +async function main() { + const pipelineSetNames = Object.keys(pipelineSets); + const pipelineSetName: string | undefined = process.env.TRIGGER_PIPELINE_SET; + const pipelineSteps: BuildkiteTriggerStep[] = []; + + if (!pipelineSetName) { + throw new Error( + `Env var TRIGGER_PIPELINE_SET is required, and can be one of: ${pipelineSetNames}` + ); + } else if (!pipelineSetNames.includes(pipelineSetName)) { + throw new Error( + `Invalid value for TRIGGER_PIPELINE_SET (${pipelineSetName}), can be one of: ${pipelineSetNames}` + ); + } + + switch (pipelineSetName) { + case 'es-forward': { + pipelineSteps.push(...getESForwardPipelineTriggers()); + break; + } + case 'artifacts-snapshot': { + pipelineSteps.push(...getArtifactSnapshotPipelineTriggers()); + break; + } + case 'artifacts-staging': { + pipelineSteps.push(...getArtifactStagingPipelineTriggers()); + break; + } + case 'artifacts-trigger': { + pipelineSteps.push(...getArtifactBuildTriggers()); + break; + } + default: { + throw new Error(`Unknown pipeline set: ${pipelineSetName}`); + } + } + + emitPipeline(pipelineSteps); +} + +/** + * This pipeline is testing the forward compatibility of Kibana with different versions of Elasticsearch. + * Should be triggered for combinations of (Kibana@7.17 + ES@8.x {current open branches on the same major}) + */ +export function getESForwardPipelineTriggers(): BuildkiteTriggerStep[] { + const versions = getVersionsFile(); + const kibanaPrevMajor = versions.prevMajors[0]; + const targetESVersions = [versions.prevMinors, versions.current].flat(); + + return targetESVersions.map(({ version }) => { + return { + trigger: pipelineSets['es-forward'], + async: true, + label: `Triggering Kibana ${kibanaPrevMajor.version} + ES ${version} forward compatibility`, + build: { + message: process.env.MESSAGE || `ES forward-compatibility test for ES ${version}`, + branch: kibanaPrevMajor.branch, + commit: 'HEAD', + env: { + ES_SNAPSHOT_MANIFEST: `https://storage.googleapis.com/kibana-ci-es-snapshots-daily/${version}/manifest-latest-verified.json`, + DRY_RUN: process.env.DRY_RUN, + }, + }, + } as BuildkiteTriggerStep; + }); +} + +/** + * This pipeline creates Kibana artifact snapshots for all open branches. + * Should be triggered for all open branches in the versions.json: 7.x, 8.x + */ +export function getArtifactSnapshotPipelineTriggers() { + // Trigger for all named branches + const versions = getVersionsFile(); + const targetVersions = [versions.prevMajors, versions.prevMinors, versions.current].flat(); + + return targetVersions.map(({ branch }) => { + return { + trigger: pipelineSets['artifacts-snapshot'], + async: true, + label: `Triggering snapshot artifact builds for ${branch}`, + build: { + message: process.env.MESSAGE || `Snapshot artifact build for ${branch}`, + branch, + commit: 'HEAD', + env: { + DRY_RUN: process.env.DRY_RUN, + }, + }, + } as BuildkiteTriggerStep; + }); +} + +/** + * This pipeline creates Kibana artifacts for branches that are not the current main. + * Should be triggered for all open branches in the versions.json: 7.x, 8.x, but not main. + */ +export function getArtifactStagingPipelineTriggers() { + // Trigger for all branches, that are not current minor+major + const versions = getVersionsFile(); + const targetVersions = [versions.prevMajors, versions.prevMinors].flat(); + + return targetVersions.map(({ branch }) => { + return { + trigger: pipelineSets['artifacts-staging'], + async: true, + label: `Triggering staging artifact builds for ${branch}`, + build: { + message: process.env.MESSAGE || `Staging artifact build for ${branch}`, + branch, + commit: 'HEAD', + env: { + DRY_RUN: process.env.DRY_RUN, + }, + }, + } as BuildkiteTriggerStep; + }); +} + +/** + * This pipeline checks if there are any changes in the incorporated $BEATS_MANIFEST_LATEST_URL (beats version) + * and triggers a staging artifact build. + * Should be triggered only for the active minor versions that are not `main` and not `7.17`. + * + * TODO: we could basically do the check logic of .buildkite/scripts/steps/artifacts/trigger.sh in here, and remove kibana-artifacts-trigger + */ +export function getArtifactBuildTriggers() { + const versions = getVersionsFile(); + const targetVersions = versions.prevMinors; + + return targetVersions.map( + ({ branch }) => + ({ + trigger: pipelineSets['artifacts-trigger'], + async: true, + label: `Triggering artifact build for ${branch}`, + build: { + message: process.env.MESSAGE || `Artifact build for ${branch}`, + branch, + commit: 'HEAD', + env: { + DRY_RUN: process.env.DRY_RUN, + }, + }, + } as BuildkiteTriggerStep) + ); +} + +function emitPipeline(pipelineSteps: BuildkiteTriggerStep[]) { + console.log(JSON.stringify(pipelineSteps, null, 2)); +} + +if (require.main === module) { + main().catch((error) => { + console.error(error); + process.exit(1); + }); +} diff --git a/.buildkite/scripts/steps/artifacts/cloud.sh b/.buildkite/scripts/steps/artifacts/cloud.sh index e12cf7958c86e..86fa86f37bd3c 100644 --- a/.buildkite/scripts/steps/artifacts/cloud.sh +++ b/.buildkite/scripts/steps/artifacts/cloud.sh @@ -7,6 +7,11 @@ set -euo pipefail source "$(dirname "$0")/../../common/util.sh" source .buildkite/scripts/steps/artifacts/env.sh +if [[ "${DRY_RUN:-}" =~ ^(true|1)$ ]]; then + echo "--- Nothing to do in DRY_RUN mode" + exit 0 +fi + echo "--- Push docker image" mkdir -p target diff --git a/.buildkite/scripts/steps/artifacts/docker_image.sh b/.buildkite/scripts/steps/artifacts/docker_image.sh index 551910432c413..77790bf3d5a8a 100755 --- a/.buildkite/scripts/steps/artifacts/docker_image.sh +++ b/.buildkite/scripts/steps/artifacts/docker_image.sh @@ -18,46 +18,82 @@ export KIBANA_IMAGE="$KIBANA_BASE_IMAGE:$KIBANA_IMAGE_TAG" echo "--- Verify manifest does not already exist" echo "Checking manifest for $KIBANA_IMAGE" -if docker manifest inspect $KIBANA_IMAGE &> /dev/null; then - echo "Manifest already exists, exiting" - exit 1 +SKIP_BUILD=false +if docker manifest inspect "$KIBANA_IMAGE" &> /dev/null; then + # If a staging build manifest already exists, there's a workflow error and the root cause should be investigated. + if [[ "${BUILDKITE_PULL_REQUEST:-false}" == "false" ]]; then + echo "Manifest already exists, exiting" + exit 1 + else + echo "Manifest already exists, skipping build. Look up previous build for artifacts." + SKIP_BUILD=true + fi fi -echo "--- Build Kibana" -node scripts/build \ - --debug \ - --release \ - --serverless \ - --docker-cross-compile \ - --docker-namespace="kibana-ci" \ - --docker-tag="$KIBANA_IMAGE_TAG" - -echo "--- Tag images" -docker rmi "$KIBANA_IMAGE" -docker load < "target/kibana-serverless-$BASE_VERSION-docker-image.tar.gz" -docker tag "$KIBANA_IMAGE" "$KIBANA_IMAGE-amd64" - -docker rmi "$KIBANA_IMAGE" -docker load < "target/kibana-serverless-$BASE_VERSION-docker-image-aarch64.tar.gz" -docker tag "$KIBANA_IMAGE" "$KIBANA_IMAGE-arm64" - -echo "--- Push images" -docker image push "$KIBANA_IMAGE-arm64" -docker image push "$KIBANA_IMAGE-amd64" - -echo "--- Create and push manifests" -docker manifest create \ - "$KIBANA_IMAGE" \ - --amend "$KIBANA_IMAGE-arm64" \ - --amend "$KIBANA_IMAGE-amd64" -docker manifest push "$KIBANA_IMAGE" - -if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]] && [[ "${BUILDKITE_PULL_REQUEST:-false}" == "false" ]]; then +if [[ "$SKIP_BUILD" == "false" ]]; then + echo "--- Build Kibana" + node scripts/build \ + --debug \ + --release \ + --serverless \ + --docker-cross-compile \ + --docker-namespace="kibana-ci" \ + --docker-tag="$KIBANA_IMAGE_TAG" + + echo "--- Tag images" + docker rmi "$KIBANA_IMAGE" + docker load < "target/kibana-serverless-$BASE_VERSION-docker-image.tar.gz" + docker tag "$KIBANA_IMAGE" "$KIBANA_IMAGE-amd64" + + docker rmi "$KIBANA_IMAGE" + docker load < "target/kibana-serverless-$BASE_VERSION-docker-image-aarch64.tar.gz" + docker tag "$KIBANA_IMAGE" "$KIBANA_IMAGE-arm64" + + echo "--- Push images" + docker image push "$KIBANA_IMAGE-arm64" + docker image push "$KIBANA_IMAGE-amd64" + + echo "--- Create and push manifests" docker manifest create \ - "$KIBANA_BASE_IMAGE:latest" \ + "$KIBANA_IMAGE" \ --amend "$KIBANA_IMAGE-arm64" \ --amend "$KIBANA_IMAGE-amd64" - docker manifest push "$KIBANA_BASE_IMAGE:latest" + docker manifest push "$KIBANA_IMAGE" + + if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]] && [[ "${BUILDKITE_PULL_REQUEST:-false}" == "false" ]]; then + docker manifest create \ + "$KIBANA_BASE_IMAGE:latest" \ + --amend "$KIBANA_IMAGE-arm64" \ + --amend "$KIBANA_IMAGE-amd64" + docker manifest push "$KIBANA_BASE_IMAGE:latest" + fi + + echo "--- Build dependencies report" + node scripts/licenses_csv_report "--csv=target/dependencies-$GIT_ABBREV_COMMIT.csv" + + echo "--- Upload archives" + buildkite-agent artifact upload "kibana-serverless-$BASE_VERSION-linux-x86_64.tar.gz" + buildkite-agent artifact upload "kibana-serverless-$BASE_VERSION-linux-aarch64.tar.gz" + buildkite-agent artifact upload "kibana-serverless-$BASE_VERSION-docker-image.tar.gz" + buildkite-agent artifact upload "kibana-serverless-$BASE_VERSION-docker-image-aarch64.tar.gz" + buildkite-agent artifact upload "kibana-serverless-$BASE_VERSION-docker-build-context.tar.gz" + buildkite-agent artifact upload "kibana-$BASE_VERSION-cdn-assets.tar.gz" + buildkite-agent artifact upload "dependencies-$GIT_ABBREV_COMMIT.csv" + + echo "--- Upload CDN assets" + cd target + gcloud auth activate-service-account --key-file <(echo "$GCS_SA_CDN_KEY") + + CDN_ASSETS_FOLDER=$(mktemp -d) + tar -xf "kibana-$BASE_VERSION-cdn-assets.tar.gz" -C "$CDN_ASSETS_FOLDER" --strip=1 + + gsutil -m cp -r "$CDN_ASSETS_FOLDER/*" "gs://$GCS_SA_CDN_BUCKET/$GIT_ABBREV_COMMIT" + gcloud auth revoke "$GCS_SA_CDN_EMAIL" + + echo "--- Validate CDN assets" + ts-node "$(git rev-parse --show-toplevel)/.buildkite/scripts/steps/artifacts/validate_cdn_assets.ts" \ + "$GCS_SA_CDN_URL" \ + "$CDN_ASSETS_FOLDER" fi cat << EOF | buildkite-agent annotate --style "info" --context image @@ -75,33 +111,6 @@ if [[ "${BUILDKITE_PULL_REQUEST:-false}" != "false" ]]; then buildkite-agent meta-data set pr_comment:early_comment_job_id "$BUILDKITE_JOB_ID" fi -echo "--- Build dependencies report" -node scripts/licenses_csv_report "--csv=target/dependencies-$GIT_ABBREV_COMMIT.csv" - -echo "--- Upload CDN assets" -cd target -gcloud auth activate-service-account --key-file <(echo "$GCS_SA_CDN_KEY") - -CDN_ASSETS_FOLDER=$(mktemp -d) -tar -xf "kibana-$BASE_VERSION-cdn-assets.tar.gz" -C "$CDN_ASSETS_FOLDER" --strip=1 - -gsutil -m cp -r "$CDN_ASSETS_FOLDER/*" "gs://$GCS_SA_CDN_BUCKET/$GIT_ABBREV_COMMIT" -gcloud auth revoke "$GCS_SA_CDN_EMAIL" - -echo "--- Validate CDN assets" -ts-node "$(git rev-parse --show-toplevel)/.buildkite/scripts/steps/artifacts/validate_cdn_assets.ts" \ - "$GCS_SA_CDN_URL" \ - "$CDN_ASSETS_FOLDER" - -echo "--- Upload archives" -buildkite-agent artifact upload "kibana-serverless-$BASE_VERSION-linux-x86_64.tar.gz" -buildkite-agent artifact upload "kibana-serverless-$BASE_VERSION-linux-aarch64.tar.gz" -buildkite-agent artifact upload "kibana-serverless-$BASE_VERSION-docker-image.tar.gz" -buildkite-agent artifact upload "kibana-serverless-$BASE_VERSION-docker-image-aarch64.tar.gz" -buildkite-agent artifact upload "kibana-serverless-$BASE_VERSION-docker-build-context.tar.gz" -buildkite-agent artifact upload "kibana-$BASE_VERSION-cdn-assets.tar.gz" -buildkite-agent artifact upload "dependencies-$GIT_ABBREV_COMMIT.csv" - # This part is related with updating the configuration of kibana-controller, # so that new stack instances contain the latest and greatest image of kibana, # and the respective stack components of course. diff --git a/.buildkite/scripts/steps/artifacts/publish.sh b/.buildkite/scripts/steps/artifacts/publish.sh index 40ea04fc33fea..08c6ecc1e25ad 100644 --- a/.buildkite/scripts/steps/artifacts/publish.sh +++ b/.buildkite/scripts/steps/artifacts/publish.sh @@ -5,6 +5,8 @@ set -euo pipefail source .buildkite/scripts/common/util.sh source .buildkite/scripts/steps/artifacts/env.sh +print_if_dry_run + echo "--- Download and verify artifacts" function download { download_artifact "$1" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" @@ -60,6 +62,7 @@ if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]]; then download_artifact beats_manifest.json /tmp --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" export BEATS_MANIFEST_URL=$(jq -r .manifest_url /tmp/beats_manifest.json) + PUBLISH_CMD=$(cat << EOF docker run --rm \ --name release-manager \ -e VAULT_ADDR \ @@ -76,6 +79,13 @@ if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]]; then --qualifier "$VERSION_QUALIFIER" \ --dependency "beats:$BEATS_MANIFEST_URL" \ --artifact-set main +EOF +) + if [[ "${DRY_RUN:-}" =~ ^(1|true)$ ]]; then + PUBLISH_CMD+=(" --dry-run") + fi + + "${PUBLISH_CMD[@]}" KIBANA_SUMMARY=$(curl -s "$KIBANA_MANIFEST_LATEST" | jq -re '.summary_url') diff --git a/.buildkite/scripts/steps/serverless/deploy.sh b/.buildkite/scripts/steps/serverless/deploy.sh index 0c6f52b6f1982..325aadf187b5b 100644 --- a/.buildkite/scripts/steps/serverless/deploy.sh +++ b/.buildkite/scripts/steps/serverless/deploy.sh @@ -160,9 +160,12 @@ EOF is_pr_with_label "ci:project-deploy-elasticsearch" && deploy "elasticsearch" if is_pr_with_label "ci:project-deploy-observability" ; then - create_github_issue_oblt_test_environments - echo "--- Deploy observability with Kibana CI" - deploy "observability" + # Only deploy observability if the PR is targeting main + if [[ "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" == "main" ]]; then + create_github_issue_oblt_test_environments + echo "--- Deploy observability with Kibana CI" + deploy "observability" + fi fi is_pr_with_label "ci:project-deploy-security" && deploy "security" diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2dd7f2a8c6aee..d22a59072a86d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -28,6 +28,7 @@ x-pack/plugins/alerting @elastic/response-ops x-pack/packages/kbn-alerting-state-types @elastic/response-ops packages/kbn-alerting-types @elastic/response-ops packages/kbn-alerts-as-data-utils @elastic/response-ops +packages/kbn-alerts-grouping @elastic/response-ops x-pack/test/alerting_api_integration/common/plugins/alerts_restricted @elastic/response-ops packages/kbn-alerts-ui-shared @elastic/response-ops packages/kbn-ambient-common-types @elastic/kibana-operations @@ -406,6 +407,7 @@ packages/kbn-eslint-plugin-imports @elastic/kibana-operations packages/kbn-eslint-plugin-telemetry @elastic/obs-knowledge-team examples/eso_model_version_example @elastic/kibana-security x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin @elastic/kibana-security +src/plugins/esql @elastic/kibana-esql packages/kbn-esql-ast @elastic/kibana-esql examples/esql_ast_inspector @elastic/kibana-esql src/plugins/esql_datagrid @elastic/kibana-esql @@ -421,7 +423,7 @@ x-pack/plugins/event_log @elastic/response-ops packages/kbn-expandable-flyout @elastic/security-threat-hunting-investigations packages/kbn-expect @elastic/kibana-operations @elastic/appex-qa x-pack/examples/exploratory_view_example @elastic/obs-ux-infra_services-team -x-pack/plugins/observability_solution/exploratory_view @elastic/obs-ux-infra_services-team +x-pack/plugins/observability_solution/exploratory_view @elastic/obs-ux-management-team src/plugins/expression_error @elastic/kibana-presentation src/plugins/chart_expressions/expression_gauge @elastic/kibana-visualizations src/plugins/chart_expressions/expression_heatmap @elastic/kibana-visualizations @@ -504,7 +506,7 @@ x-pack/plugins/integration_assistant @elastic/security-solution src/plugins/interactive_setup @elastic/kibana-security test/interactive_setup_api_integration/plugins/test_endpoints @elastic/kibana-security packages/kbn-interpreter @elastic/kibana-visualizations -x-pack/plugins/observability_solution/investigate @elastic/obs-ai-assistant +x-pack/plugins/observability_solution/investigate @elastic/obs-ux-management-team packages/kbn-io-ts-utils @elastic/obs-knowledge-team packages/kbn-ipynb @elastic/search-kibana packages/kbn-jest-serializers @elastic/kibana-operations @@ -657,6 +659,7 @@ packages/react/kibana_context/root @elastic/appex-sharedux packages/react/kibana_context/styled @elastic/appex-sharedux packages/react/kibana_context/theme @elastic/appex-sharedux packages/react/kibana_mount @elastic/appex-sharedux +packages/kbn-recently-accessed @elastic/appex-sharedux x-pack/plugins/remote_clusters @elastic/kibana-management test/plugin_functional/plugins/rendering_plugin @elastic/kibana-core packages/kbn-repo-file-maps @elastic/kibana-operations @@ -847,7 +850,7 @@ test/server_integration/plugins/status_plugin_b @elastic/kibana-core packages/kbn-std @elastic/kibana-core packages/kbn-stdio-dev-helpers @elastic/kibana-operations packages/kbn-storybook @elastic/kibana-operations -x-pack/plugins/observability_solution/synthetics @elastic/obs-ux-infra_services-team +x-pack/plugins/observability_solution/synthetics @elastic/obs-ux-management-team x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture @elastic/response-ops x-pack/test/plugin_api_perf/plugins/task_manager_performance @elastic/response-ops x-pack/plugins/task_manager @elastic/response-ops @@ -864,7 +867,6 @@ packages/kbn-test-jest-helpers @elastic/kibana-operations @elastic/appex-qa packages/kbn-test-subj-selector @elastic/kibana-operations @elastic/appex-qa x-pack/examples/testing_embedded_lens @elastic/kibana-visualizations packages/kbn-text-based-editor @elastic/kibana-esql -src/plugins/text_based_languages @elastic/kibana-esql x-pack/examples/third_party_lens_navigation_prompt @elastic/kibana-visualizations x-pack/examples/third_party_vis_lens_example @elastic/kibana-visualizations x-pack/plugins/threat_intelligence @elastic/security-threat-hunting-investigations @@ -903,7 +905,7 @@ src/plugins/unified_search @elastic/kibana-visualizations packages/kbn-unsaved-changes-badge @elastic/kibana-data-discovery packages/kbn-unsaved-changes-prompt @elastic/kibana-management x-pack/plugins/upgrade_assistant @elastic/kibana-management -x-pack/plugins/observability_solution/uptime @elastic/obs-ux-infra_services-team +x-pack/plugins/observability_solution/uptime @elastic/obs-ux-management-team x-pack/plugins/drilldowns/url_drilldown @elastic/appex-sharedux src/plugins/url_forwarding @elastic/kibana-visualizations src/plugins/usage_collection @elastic/kibana-core @@ -1141,15 +1143,15 @@ x-pack/test/observability_ai_assistant_functional @elastic/obs-ai-assistant #CC# /x-pack/plugins/observability_solution/observability/ @elastic/apm-ui # Uptime -/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/uptime/ @elastic/obs-ux-infra_services-team -/x-pack/test/functional/apps/uptime @elastic/obs-ux-infra_services-team -/x-pack/test/functional/es_archives/uptime @elastic/obs-ux-infra_services-team -/x-pack/test/functional/services/uptime @elastic/obs-ux-infra_services-team -/x-pack/test/api_integration/apis/uptime @elastic/obs-ux-infra_services-team -/x-pack/test/api_integration/apis/synthetics @elastic/obs-ux-infra_services-team -/x-pack/test/alerting_api_integration/observability/synthetics_rule.ts @elastic/obs-ux-infra_services-team +/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/uptime/ @elastic/obs-ux-management-team +/x-pack/test/functional/apps/uptime @elastic/obs-ux-management-team +/x-pack/test/functional/es_archives/uptime @elastic/obs-ux-management-team +/x-pack/test/functional/services/uptime @elastic/obs-ux-management-team +/x-pack/test/api_integration/apis/uptime @elastic/obs-ux-management-team +/x-pack/test/api_integration/apis/synthetics @elastic/obs-ux-management-team +/x-pack/test/alerting_api_integration/observability/synthetics_rule.ts @elastic/obs-ux-management-team /x-pack/test/alerting_api_integration/observability/index.ts @elastic/obs-ux-management-team -/x-pack/test_serverless/api_integration/test_suites/observability/synthetics @elastic/obs-ux-infra_services-team +/x-pack/test_serverless/api_integration/test_suites/observability/synthetics @elastic/obs-ux-management-team # Logs /x-pack/test/api_integration/apis/logs_ui @elastic/obs-ux-logs-team @@ -1424,7 +1426,7 @@ x-pack/test/security_solution_api_integration/test_suites/sources @elastic/secur /x-pack/test/security_solution_cypress/cypress/* @elastic/security-engineering-productivity /x-pack/test/security_solution_cypress/cypress/tasks/login.ts @elastic/security-engineering-productivity /x-pack/test/security_solution_cypress/es_archives @elastic/security-engineering-productivity -/x-pack/plugins/security_solution/scripts/run_cypress @MadameSheema @patrykkopycinski @oatkiller @maximpn @banderror +/x-pack/plugins/security_solution/scripts/run_cypress @MadameSheema @patrykkopycinski @maximpn @banderror ## Security Solution sub teams - Threat Hunting Investigations @@ -1615,7 +1617,7 @@ x-pack/test/security_solution_cypress/cypress/tasks/expandable_flyout @elastic/ /x-pack/plugins/security_solution/server/lib/license/ @elastic/security-defend-workflows /x-pack/plugins/security_solution/server/fleet_integration/ @elastic/security-defend-workflows /x-pack/plugins/security_solution/scripts/endpoint/ @elastic/security-defend-workflows -/x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint/ @elastic/security-defend-workflows +/x-pack/test/security_solution_endpoint/ @elastic/security-defend-workflows /x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint_api_int/ @elastic/security-defend-workflows /x-pack/test_serverless/shared/lib/security/kibana_roles/ @elastic/security-defend-workflows /x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management @elastic/security-defend-workflows @@ -1733,9 +1735,9 @@ packages/react @elastic/appex-sharedux x-pack/plugins/actions/server/saved_objects/index.ts @elastic/response-ops @elastic/kibana-security x-pack/plugins/alerting/server/saved_objects/index.ts @elastic/response-ops @elastic/kibana-security x-pack/plugins/fleet/server/saved_objects/index.ts @elastic/fleet @elastic/kibana-security -x-pack/plugins/observability_solution/synthetics/server/saved_objects/saved_objects.ts @elastic/obs-ux-infra_services-team @elastic/kibana-security -x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_monitor.ts @elastic/obs-ux-infra_services-team @elastic/kibana-security -x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_param.ts @elastic/obs-ux-infra_services-team @elastic/kibana-security +x-pack/plugins/observability_solution/synthetics/server/saved_objects/saved_objects.ts @elastic/obs-ux-management-team @elastic/kibana-security +x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_monitor.ts @elastic/obs-ux-management-team @elastic/kibana-security +x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_param.ts @elastic/obs-ux-management-team @elastic/kibana-security # Specialised GitHub workflows for the Observability robots /.github/workflows/deploy-my-kibana.yml @elastic/observablt-robots @elastic/kibana-operations diff --git a/.github/paths-labeller.yml b/.github/paths-labeller.yml index 49c2f6dba53b0..dbbefda24c9ac 100644 --- a/.github/paths-labeller.yml +++ b/.github/paths-labeller.yml @@ -14,14 +14,15 @@ - 'packages/kbn-apm-synthtrace/**/*.*' - 'packages/kbn-apm-synthtrace-client/**/*.*' - 'packages/kbn-apm-utils/**/*.*' - - 'x-pack/plugins/observability_solution/synthetics/**/*.*' - 'x-pack/plugins/observability_solution/ux/**/*.*' - - 'x-pack/plugins/observability_solution/exploratory_view/**/*.*' - 'Team:Fleet': - 'x-pack/plugins/fleet/**/*.*' - 'x-pack/test/fleet_api_integration/**/*.*' - 'Team:obs-ux-management': - 'x-pack/plugins/observability_solution/observability/**/*.*' + - 'x-pack/plugins/observability_solution/slo/**/*.*' + - 'x-pack/plugins/observability_solution/synthetics/**/*.*' + - 'x-pack/plugins/observability_solution/exploratory_view/**/*.*' - 'Team:Obs AI Assistant': - 'x-pack/plugins/observability_solution/observability_ai_assistant/**/*.*' - 'x-pack/plugins/observability_solution/observability_ai_assistant_*/**/*.*' diff --git a/.github/workflows/auto-approve-api-docs.yml b/.github/workflows/auto-approve-api-docs.yml index 503ea9634d00e..11e28d46d9cc2 100644 --- a/.github/workflows/auto-approve-api-docs.yml +++ b/.github/workflows/auto-approve-api-docs.yml @@ -1,5 +1,5 @@ on: - pull_request: + pull_request_target: branches: - main types: diff --git a/.github/workflows/auto-approve-backports.yml b/.github/workflows/auto-approve-backports.yml index 2f73696406d92..4c08e2bbb718c 100644 --- a/.github/workflows/auto-approve-backports.yml +++ b/.github/workflows/auto-approve-backports.yml @@ -1,5 +1,5 @@ on: - pull_request: + pull_request_target: branches-ignore: - main types: diff --git a/.i18nrc.json b/.i18nrc.json index 0053dc5d2ad51..bab7cdc68d81d 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -59,6 +59,7 @@ "flot": "packages/kbn-flot-charts/lib", "generateCsv": "packages/kbn-generate-csv", "grouping": "packages/kbn-grouping/src", + "alertsGrouping": "packages/kbn-alerts-grouping", "guidedOnboarding": "src/plugins/guided_onboarding", "guidedOnboardingPackage": "packages/kbn-guided-onboarding", "home": "src/plugins/home", @@ -115,7 +116,7 @@ "serverlessPackages": "packages/serverless", "coloring": "packages/kbn-coloring/src", "languageDocumentationPopover": "packages/kbn-language-documentation-popover/src", - "textBasedLanguages": "src/plugins/text_based_languages", + "esql": "src/plugins/esql", "esqlDataGrid": "src/plugins/esql_datagrid", "statusPage": "src/legacy/core_plugins/status_page", "telemetry": ["src/plugins/telemetry", "src/plugins/telemetry_management_section"], diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index 4747cbb25d843..b6fffb4194b6b 100644 --- a/api_docs/actions.mdx +++ b/api_docs/actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/actions title: "actions" image: https://source.unsplash.com/400x175/?github description: API docs for the actions plugin -date: 2024-07-04 +date: 2024-07-11 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 dc62e81a5ffc5..6492dd6984167 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/advancedSettings title: "advancedSettings" image: https://source.unsplash.com/400x175/?github description: API docs for the advancedSettings plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] --- import advancedSettingsObj from './advanced_settings.devdocs.json'; diff --git a/api_docs/ai_assistant_management_selection.mdx b/api_docs/ai_assistant_management_selection.mdx index 23028b42ea8ab..8d2b1f6fef27c 100644 --- a/api_docs/ai_assistant_management_selection.mdx +++ b/api_docs/ai_assistant_management_selection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiAssistantManagementSelection title: "aiAssistantManagementSelection" image: https://source.unsplash.com/400x175/?github description: API docs for the aiAssistantManagementSelection plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiAssistantManagementSelection'] --- import aiAssistantManagementSelectionObj from './ai_assistant_management_selection.devdocs.json'; diff --git a/api_docs/aiops.mdx b/api_docs/aiops.mdx index a848dde158657..729b2feaf6311 100644 --- a/api_docs/aiops.mdx +++ b/api_docs/aiops.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiops title: "aiops" image: https://source.unsplash.com/400x175/?github description: API docs for the aiops plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops'] --- import aiopsObj from './aiops.devdocs.json'; diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index 9a88ab625db7e..830bc1ebcdbe3 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/alerting title: "alerting" image: https://source.unsplash.com/400x175/?github description: API docs for the alerting plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] --- import alertingObj from './alerting.devdocs.json'; diff --git a/api_docs/apm.devdocs.json b/api_docs/apm.devdocs.json index 9890cb6043243..d88ea5a9e24d1 100644 --- a/api_docs/apm.devdocs.json +++ b/api_docs/apm.devdocs.json @@ -418,7 +418,7 @@ "label": "APIEndpoint", "description": [], "signature": [ - "\"POST /internal/apm/data_view/static\" | \"GET /internal/apm/data_view/index_pattern\" | \"GET /internal/apm/environments\" | \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics_by_transaction_name\" | \"POST /internal/apm/services/{serviceName}/errors/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}/samples\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}/error/{errorId}\" | \"GET /internal/apm/services/{serviceName}/errors/distribution\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}/top_erroneous_transactions\" | \"POST /internal/apm/latency/overall_distribution/transactions\" | \"GET /internal/apm/services/{serviceName}/metrics/charts\" | \"GET /internal/apm/services/{serviceName}/metrics/nodes\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/charts\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/summary\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/functions_overview\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/active_instances\" | \"GET /internal/apm/observability_overview\" | \"GET /internal/apm/observability_overview/has_data\" | \"GET /internal/apm/service-map\" | \"GET /internal/apm/service-map/service/{serviceName}\" | \"GET /internal/apm/service-map/dependency\" | \"GET /internal/apm/services\" | \"POST /internal/apm/services/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/metadata/details\" | \"GET /internal/apm/services/{serviceName}/metadata/icons\" | \"GET /internal/apm/services/{serviceName}/agent\" | \"GET /internal/apm/services/{serviceName}/transaction_types\" | \"GET /internal/apm/services/{serviceName}/node/{serviceNodeName}/metadata\" | \"GET /api/apm/services/{serviceName}/annotation/search 2023-10-31\" | \"POST /api/apm/services/{serviceName}/annotation 2023-10-31\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}\" | \"GET /internal/apm/services/{serviceName}/throughput\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/dependencies\" | \"GET /internal/apm/services/{serviceName}/dependencies/breakdown\" | \"GET /internal/apm/services/{serviceName}/anomaly_charts\" | \"GET /internal/apm/services/{serviceName}/alerts_count\" | \"GET /internal/apm/entities/services\" | \"GET /internal/apm/service-groups\" | \"GET /internal/apm/service-group\" | \"POST /internal/apm/service-group\" | \"DELETE /internal/apm/service-group\" | \"GET /internal/apm/service-group/services\" | \"GET /internal/apm/service-group/counts\" | \"GET /internal/apm/suggestions\" | \"GET /internal/apm/traces/{traceId}\" | \"GET /internal/apm/traces\" | \"GET /internal/apm/traces/{traceId}/root_transaction\" | \"GET /internal/apm/transactions/{transactionId}\" | \"GET /internal/apm/traces/find\" | \"POST /internal/apm/traces/aggregated_critical_path\" | \"GET /internal/apm/traces/{traceId}/transactions/{transactionId}\" | \"GET /internal/apm/traces/{traceId}/spans/{spanId}\" | \"GET /internal/apm/transactions\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/latency\" | \"GET /internal/apm/services/{serviceName}/transactions/traces/samples\" | \"GET /internal/apm/services/{serviceName}/transaction/charts/breakdown\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/error_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate_by_transaction_name\" | \"GET /internal/apm/rule_types/transaction_error_rate/chart_preview\" | \"GET /internal/apm/rule_types/error_count/chart_preview\" | \"GET /internal/apm/rule_types/transaction_duration/chart_preview\" | \"GET /api/apm/settings/agent-configuration 2023-10-31\" | \"GET /api/apm/settings/agent-configuration/view 2023-10-31\" | \"DELETE /api/apm/settings/agent-configuration 2023-10-31\" | \"PUT /api/apm/settings/agent-configuration 2023-10-31\" | \"POST /api/apm/settings/agent-configuration/search 2023-10-31\" | \"GET /api/apm/settings/agent-configuration/environments 2023-10-31\" | \"GET /api/apm/settings/agent-configuration/agent_name 2023-10-31\" | \"GET /internal/apm/settings/anomaly-detection/jobs\" | \"POST /internal/apm/settings/anomaly-detection/jobs\" | \"GET /internal/apm/settings/anomaly-detection/environments\" | \"POST /internal/apm/settings/anomaly-detection/update_to_v3\" | \"GET /internal/apm/settings/apm-index-settings\" | \"GET /internal/apm/settings/apm-indices\" | \"POST /internal/apm/settings/apm-indices/save\" | \"GET /internal/apm/settings/custom_links/transaction\" | \"GET /internal/apm/settings/custom_links\" | \"POST /internal/apm/settings/custom_links\" | \"PUT /internal/apm/settings/custom_links/{id}\" | \"DELETE /internal/apm/settings/custom_links/{id}\" | \"GET /api/apm/sourcemaps 2023-10-31\" | \"POST /api/apm/sourcemaps 2023-10-31\" | \"DELETE /api/apm/sourcemaps/{id} 2023-10-31\" | \"POST /internal/apm/sourcemaps/migrate_fleet_artifacts\" | \"GET /internal/apm/fleet/has_apm_policies\" | \"GET /internal/apm/fleet/agents\" | \"POST /api/apm/fleet/apm_server_schema 2023-10-31\" | \"GET /internal/apm/fleet/apm_server_schema/unsupported\" | \"GET /internal/apm/fleet/migration_check\" | \"POST /internal/apm/fleet/cloud_apm_package_policy\" | \"GET /internal/apm/fleet/java_agent_versions\" | \"GET /internal/apm/dependencies/top_dependencies\" | \"GET /internal/apm/dependencies/upstream_services\" | \"GET /internal/apm/dependencies/metadata\" | \"GET /internal/apm/dependencies/charts/latency\" | \"GET /internal/apm/dependencies/charts/throughput\" | \"GET /internal/apm/dependencies/charts/error_rate\" | \"GET /internal/apm/dependencies/operations\" | \"GET /internal/apm/dependencies/charts/distribution\" | \"GET /internal/apm/dependencies/operations/spans\" | \"GET /internal/apm/correlations/field_candidates/transactions\" | \"GET /internal/apm/correlations/field_value_stats/transactions\" | \"POST /internal/apm/correlations/field_value_pairs/transactions\" | \"POST /internal/apm/correlations/significant_correlations/transactions\" | \"POST /internal/apm/correlations/p_values/transactions\" | \"GET /internal/apm/fallback_to_transactions\" | \"GET /internal/apm/has_data\" | \"GET /internal/apm/event_metadata/{processorEvent}/{id}\" | \"GET /internal/apm/agent_keys\" | \"GET /internal/apm/agent_keys/privileges\" | \"POST /internal/apm/api_key/invalidate\" | \"POST /api/apm/agent_keys 2023-10-31\" | \"GET /internal/apm/storage_explorer\" | \"GET /internal/apm/services/{serviceName}/storage_details\" | \"GET /internal/apm/storage_chart\" | \"GET /internal/apm/storage_explorer/privileges\" | \"GET /internal/apm/storage_explorer_summary_stats\" | \"GET /internal/apm/storage_explorer/is_cross_cluster_search\" | \"GET /internal/apm/storage_explorer/get_services\" | \"GET /internal/apm/traces/{traceId}/span_links/{spanId}/parents\" | \"GET /internal/apm/traces/{traceId}/span_links/{spanId}/children\" | \"GET /internal/apm/services/{serviceName}/infrastructure_attributes\" | \"GET /internal/apm/debug-telemetry\" | \"GET /internal/apm/time_range_metadata\" | \"GET /internal/apm/settings/labs\" | \"GET /internal/apm/get_agents_per_service\" | \"GET /internal/apm/get_latest_agent_versions\" | \"GET /internal/apm/services/{serviceName}/agent_instances\" | \"GET /internal/apm/mobile-services/{serviceName}/error/http_error_rate\" | \"GET /internal/apm/mobile-services/{serviceName}/errors/groups/main_statistics\" | \"POST /internal/apm/mobile-services/{serviceName}/errors/groups/detailed_statistics\" | \"GET /internal/apm/mobile-services/{serviceName}/error_terms\" | \"POST /internal/apm/mobile-services/{serviceName}/crashes/groups/detailed_statistics\" | \"GET /internal/apm/mobile-services/{serviceName}/crashes/groups/main_statistics\" | \"GET /internal/apm/mobile-services/{serviceName}/crashes/distribution\" | \"GET /internal/apm/services/{serviceName}/mobile/filters\" | \"GET /internal/apm/mobile-services/{serviceName}/most_used_charts\" | \"GET /internal/apm/mobile-services/{serviceName}/transactions/charts/sessions\" | \"GET /internal/apm/mobile-services/{serviceName}/transactions/charts/http_requests\" | \"GET /internal/apm/mobile-services/{serviceName}/stats\" | \"GET /internal/apm/mobile-services/{serviceName}/location/stats\" | \"GET /internal/apm/mobile-services/{serviceName}/terms\" | \"GET /internal/apm/mobile-services/{serviceName}/main_statistics\" | \"GET /internal/apm/mobile-services/{serviceName}/detailed_statistics\" | \"GET /internal/apm/diagnostics\" | \"POST /internal/apm/assistant/get_apm_timeseries\" | \"GET /internal/apm/assistant/get_downstream_dependencies\" | \"GET /internal/apm/services/{serviceName}/profiling/flamegraph\" | \"GET /internal/apm/profiling/status\" | \"GET /internal/apm/services/{serviceName}/profiling/functions\" | \"GET /internal/apm/services/{serviceName}/profiling/hosts/flamegraph\" | \"GET /internal/apm/services/{serviceName}/profiling/hosts/functions\" | \"POST /internal/apm/custom-dashboard\" | \"DELETE /internal/apm/custom-dashboard\" | \"GET /internal/apm/services/{serviceName}/dashboards\"" + "\"POST /internal/apm/data_view/static\" | \"GET /internal/apm/data_view/index_pattern\" | \"GET /internal/apm/environments\" | \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/groups/main_statistics_by_transaction_name\" | \"POST /internal/apm/services/{serviceName}/errors/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}/samples\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}/error/{errorId}\" | \"GET /internal/apm/services/{serviceName}/errors/distribution\" | \"GET /internal/apm/services/{serviceName}/errors/{groupId}/top_erroneous_transactions\" | \"POST /internal/apm/latency/overall_distribution/transactions\" | \"GET /internal/apm/services/{serviceName}/metrics/charts\" | \"GET /internal/apm/services/{serviceName}/metrics/nodes\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/charts\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/summary\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/functions_overview\" | \"GET /internal/apm/services/{serviceName}/metrics/serverless/active_instances\" | \"GET /internal/apm/observability_overview\" | \"GET /internal/apm/observability_overview/has_data\" | \"GET /internal/apm/service-map\" | \"GET /internal/apm/service-map/service/{serviceName}\" | \"GET /internal/apm/service-map/dependency\" | \"GET /internal/apm/services\" | \"POST /internal/apm/services/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/metadata/details\" | \"GET /internal/apm/services/{serviceName}/metadata/icons\" | \"GET /internal/apm/services/{serviceName}/agent\" | \"GET /internal/apm/services/{serviceName}/transaction_types\" | \"GET /internal/apm/services/{serviceName}/node/{serviceNodeName}/metadata\" | \"GET /api/apm/services/{serviceName}/annotation/search 2023-10-31\" | \"POST /api/apm/services/{serviceName}/annotation 2023-10-31\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/details/{serviceNodeName}\" | \"GET /internal/apm/services/{serviceName}/throughput\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics\" | \"GET /internal/apm/services/{serviceName}/service_overview_instances/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/dependencies\" | \"GET /internal/apm/services/{serviceName}/dependencies/breakdown\" | \"GET /internal/apm/services/{serviceName}/anomaly_charts\" | \"GET /internal/apm/services/{serviceName}/alerts_count\" | \"GET /internal/apm/entities/services\" | \"GET /internal/apm/entities/services/{serviceName}/logs_rate_timeseries\" | \"GET /internal/apm/entities/services/{serviceName}/logs_error_rate_timeseries\" | \"GET /internal/apm/service-groups\" | \"GET /internal/apm/service-group\" | \"POST /internal/apm/service-group\" | \"DELETE /internal/apm/service-group\" | \"GET /internal/apm/service-group/services\" | \"GET /internal/apm/service-group/counts\" | \"GET /internal/apm/suggestions\" | \"GET /internal/apm/traces/{traceId}\" | \"GET /internal/apm/traces\" | \"GET /internal/apm/traces/{traceId}/root_transaction\" | \"GET /internal/apm/transactions/{transactionId}\" | \"GET /internal/apm/traces/find\" | \"POST /internal/apm/traces/aggregated_critical_path\" | \"GET /internal/apm/traces/{traceId}/transactions/{transactionId}\" | \"GET /internal/apm/traces/{traceId}/spans/{spanId}\" | \"GET /internal/apm/transactions\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/groups/detailed_statistics\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/latency\" | \"GET /internal/apm/services/{serviceName}/transactions/traces/samples\" | \"GET /internal/apm/services/{serviceName}/transaction/charts/breakdown\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/error_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate\" | \"GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate_by_transaction_name\" | \"GET /internal/apm/rule_types/transaction_error_rate/chart_preview\" | \"GET /internal/apm/rule_types/error_count/chart_preview\" | \"GET /internal/apm/rule_types/transaction_duration/chart_preview\" | \"GET /api/apm/settings/agent-configuration 2023-10-31\" | \"GET /api/apm/settings/agent-configuration/view 2023-10-31\" | \"DELETE /api/apm/settings/agent-configuration 2023-10-31\" | \"PUT /api/apm/settings/agent-configuration 2023-10-31\" | \"POST /api/apm/settings/agent-configuration/search 2023-10-31\" | \"GET /api/apm/settings/agent-configuration/environments 2023-10-31\" | \"GET /api/apm/settings/agent-configuration/agent_name 2023-10-31\" | \"GET /internal/apm/settings/anomaly-detection/jobs\" | \"POST /internal/apm/settings/anomaly-detection/jobs\" | \"GET /internal/apm/settings/anomaly-detection/environments\" | \"POST /internal/apm/settings/anomaly-detection/update_to_v3\" | \"GET /internal/apm/settings/apm-index-settings\" | \"GET /internal/apm/settings/apm-indices\" | \"POST /internal/apm/settings/apm-indices/save\" | \"GET /internal/apm/settings/custom_links/transaction\" | \"GET /internal/apm/settings/custom_links\" | \"POST /internal/apm/settings/custom_links\" | \"PUT /internal/apm/settings/custom_links/{id}\" | \"DELETE /internal/apm/settings/custom_links/{id}\" | \"GET /api/apm/sourcemaps 2023-10-31\" | \"POST /api/apm/sourcemaps 2023-10-31\" | \"DELETE /api/apm/sourcemaps/{id} 2023-10-31\" | \"POST /internal/apm/sourcemaps/migrate_fleet_artifacts\" | \"GET /internal/apm/fleet/has_apm_policies\" | \"GET /internal/apm/fleet/agents\" | \"POST /api/apm/fleet/apm_server_schema 2023-10-31\" | \"GET /internal/apm/fleet/apm_server_schema/unsupported\" | \"GET /internal/apm/fleet/migration_check\" | \"POST /internal/apm/fleet/cloud_apm_package_policy\" | \"GET /internal/apm/fleet/java_agent_versions\" | \"GET /internal/apm/dependencies/top_dependencies\" | \"GET /internal/apm/dependencies/upstream_services\" | \"GET /internal/apm/dependencies/metadata\" | \"GET /internal/apm/dependencies/charts/latency\" | \"GET /internal/apm/dependencies/charts/throughput\" | \"GET /internal/apm/dependencies/charts/error_rate\" | \"GET /internal/apm/dependencies/operations\" | \"GET /internal/apm/dependencies/charts/distribution\" | \"GET /internal/apm/dependencies/operations/spans\" | \"GET /internal/apm/correlations/field_candidates/transactions\" | \"GET /internal/apm/correlations/field_value_stats/transactions\" | \"POST /internal/apm/correlations/field_value_pairs/transactions\" | \"POST /internal/apm/correlations/significant_correlations/transactions\" | \"POST /internal/apm/correlations/p_values/transactions\" | \"GET /internal/apm/fallback_to_transactions\" | \"GET /internal/apm/has_data\" | \"GET /internal/apm/event_metadata/{processorEvent}/{id}\" | \"GET /internal/apm/agent_keys\" | \"GET /internal/apm/agent_keys/privileges\" | \"POST /internal/apm/api_key/invalidate\" | \"POST /api/apm/agent_keys 2023-10-31\" | \"GET /internal/apm/storage_explorer\" | \"GET /internal/apm/services/{serviceName}/storage_details\" | \"GET /internal/apm/storage_chart\" | \"GET /internal/apm/storage_explorer/privileges\" | \"GET /internal/apm/storage_explorer_summary_stats\" | \"GET /internal/apm/storage_explorer/is_cross_cluster_search\" | \"GET /internal/apm/storage_explorer/get_services\" | \"GET /internal/apm/traces/{traceId}/span_links/{spanId}/parents\" | \"GET /internal/apm/traces/{traceId}/span_links/{spanId}/children\" | \"GET /internal/apm/services/{serviceName}/infrastructure_attributes\" | \"GET /internal/apm/debug-telemetry\" | \"GET /internal/apm/time_range_metadata\" | \"GET /internal/apm/settings/labs\" | \"GET /internal/apm/get_agents_per_service\" | \"GET /internal/apm/get_latest_agent_versions\" | \"GET /internal/apm/services/{serviceName}/agent_instances\" | \"GET /internal/apm/mobile-services/{serviceName}/error/http_error_rate\" | \"GET /internal/apm/mobile-services/{serviceName}/errors/groups/main_statistics\" | \"POST /internal/apm/mobile-services/{serviceName}/errors/groups/detailed_statistics\" | \"GET /internal/apm/mobile-services/{serviceName}/error_terms\" | \"POST /internal/apm/mobile-services/{serviceName}/crashes/groups/detailed_statistics\" | \"GET /internal/apm/mobile-services/{serviceName}/crashes/groups/main_statistics\" | \"GET /internal/apm/mobile-services/{serviceName}/crashes/distribution\" | \"GET /internal/apm/services/{serviceName}/mobile/filters\" | \"GET /internal/apm/mobile-services/{serviceName}/most_used_charts\" | \"GET /internal/apm/mobile-services/{serviceName}/transactions/charts/sessions\" | \"GET /internal/apm/mobile-services/{serviceName}/transactions/charts/http_requests\" | \"GET /internal/apm/mobile-services/{serviceName}/stats\" | \"GET /internal/apm/mobile-services/{serviceName}/location/stats\" | \"GET /internal/apm/mobile-services/{serviceName}/terms\" | \"GET /internal/apm/mobile-services/{serviceName}/main_statistics\" | \"GET /internal/apm/mobile-services/{serviceName}/detailed_statistics\" | \"GET /internal/apm/diagnostics\" | \"POST /internal/apm/assistant/get_apm_timeseries\" | \"GET /internal/apm/assistant/get_downstream_dependencies\" | \"GET /internal/apm/services/{serviceName}/profiling/flamegraph\" | \"GET /internal/apm/profiling/status\" | \"GET /internal/apm/services/{serviceName}/profiling/functions\" | \"GET /internal/apm/services/{serviceName}/profiling/hosts/flamegraph\" | \"GET /internal/apm/services/{serviceName}/profiling/hosts/functions\" | \"POST /internal/apm/custom-dashboard\" | \"DELETE /internal/apm/custom-dashboard\" | \"GET /internal/apm/services/{serviceName}/dashboards\"" ], "path": "x-pack/plugins/observability_solution/apm/server/routes/apm_routes/get_global_apm_server_route_repository.ts", "deprecated": false, @@ -472,14 +472,24 @@ "<{ serviceName: ", "StringC", "; }>; query: ", + "IntersectionC", + "<[", "TypeC", "<{ start: ", "Type", "; end: ", "Type", - "; }>; }> | undefined; handler: ({}: ", + "; }>, ", + "PartialC", + "<{ checkFor: ", + "UnionC", + "<[", + "LiteralC", + "<\"entities\">, ", + "LiteralC", + "<\"services\">]>; }>]>; }> | undefined; handler: ({}: ", "APMRouteHandlerResources", - " & { params: { path: { serviceName: string; }; query: { start: number; end: number; }; }; }) => Promise<{ serviceDashboards: ", + " & { params: { path: { serviceName: string; }; query: { start: number; end: number; } & { checkFor?: \"entities\" | \"services\" | undefined; }; }; }) => Promise<{ serviceDashboards: ", "SavedApmCustomDashboard", "[]; }>; } & ", "APMRouteCreateOptions", @@ -5661,6 +5671,114 @@ "SavedServiceGroup", "[]; }>; } & ", "APMRouteCreateOptions", + "; \"GET /internal/apm/entities/services/{serviceName}/logs_error_rate_timeseries\": { endpoint: \"GET /internal/apm/entities/services/{serviceName}/logs_error_rate_timeseries\"; params?: ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ serviceName: ", + "StringC", + "; }>; query: ", + "IntersectionC", + "<[", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">]>; }>, ", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>]>; }> | undefined; handler: ({}: ", + "APMRouteHandlerResources", + " & { params: { path: { serviceName: string; }; query: { environment: \"ENVIRONMENT_NOT_DEFINED\" | \"ENVIRONMENT_ALL\" | ", + "Branded", + "; } & { kuery: string; } & { start: number; end: number; }; }; }) => Promise<{ currentPeriod: ", + "LogsErrorRateTimeseriesReturnType", + "; }>; } & ", + "APMRouteCreateOptions", + "; \"GET /internal/apm/entities/services/{serviceName}/logs_rate_timeseries\": { endpoint: \"GET /internal/apm/entities/services/{serviceName}/logs_rate_timeseries\"; params?: ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ serviceName: ", + "StringC", + "; }>; query: ", + "IntersectionC", + "<[", + "TypeC", + "<{ environment: ", + "UnionC", + "<[", + "LiteralC", + "<\"ENVIRONMENT_NOT_DEFINED\">, ", + "LiteralC", + "<\"ENVIRONMENT_ALL\">, ", + "BrandC", + "<", + "StringC", + ", ", + { + "pluginId": "@kbn/io-ts-utils", + "scope": "common", + "docId": "kibKbnIoTsUtilsPluginApi", + "section": "def-common.NonEmptyStringBrand", + "text": "NonEmptyStringBrand" + }, + ">]>; }>, ", + "TypeC", + "<{ kuery: ", + "StringC", + "; }>, ", + "TypeC", + "<{ start: ", + "Type", + "; end: ", + "Type", + "; }>]>; }> | undefined; handler: ({}: ", + "APMRouteHandlerResources", + " & { params: { path: { serviceName: string; }; query: { environment: \"ENVIRONMENT_NOT_DEFINED\" | \"ENVIRONMENT_ALL\" | ", + "Branded", + "; } & { kuery: string; } & { start: number; end: number; }; }; }) => Promise<{ currentPeriod: ", + "LogsRateTimeseriesReturnType", + "; }>; } & ", + "APMRouteCreateOptions", "; \"GET /internal/apm/entities/services\": { endpoint: \"GET /internal/apm/entities/services\"; params?: ", "TypeC", "<{ query: ", diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index a458a7510759d..3e3688dce2c04 100644 --- a/api_docs/apm.mdx +++ b/api_docs/apm.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apm title: "apm" image: https://source.unsplash.com/400x175/?github description: API docs for the apm plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] --- import apmObj from './apm.devdocs.json'; diff --git a/api_docs/apm_data_access.mdx b/api_docs/apm_data_access.mdx index 3cdbbc06563a1..21b67dd6160cc 100644 --- a/api_docs/apm_data_access.mdx +++ b/api_docs/apm_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apmDataAccess title: "apmDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the apmDataAccess plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apmDataAccess'] --- import apmDataAccessObj from './apm_data_access.devdocs.json'; diff --git a/api_docs/assets_data_access.mdx b/api_docs/assets_data_access.mdx index 5a3e457132829..3ea04a6401275 100644 --- a/api_docs/assets_data_access.mdx +++ b/api_docs/assets_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/assetsDataAccess title: "assetsDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the assetsDataAccess plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'assetsDataAccess'] --- import assetsDataAccessObj from './assets_data_access.devdocs.json'; diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index a5cf4003f841e..ecf938f654271 100644 --- a/api_docs/banners.mdx +++ b/api_docs/banners.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/banners title: "banners" image: https://source.unsplash.com/400x175/?github description: API docs for the banners plugin -date: 2024-07-04 +date: 2024-07-11 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 e7a24b638dd17..a9ea60f5a4f42 100644 --- a/api_docs/bfetch.mdx +++ b/api_docs/bfetch.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/bfetch title: "bfetch" image: https://source.unsplash.com/400x175/?github description: API docs for the bfetch plugin -date: 2024-07-04 +date: 2024-07-11 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 0ae826313a983..24d534fd65a08 100644 --- a/api_docs/canvas.mdx +++ b/api_docs/canvas.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/canvas title: "canvas" image: https://source.unsplash.com/400x175/?github description: API docs for the canvas plugin -date: 2024-07-04 +date: 2024-07-11 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 16e773f455e28..e322a93eaebd9 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cases title: "cases" image: https://source.unsplash.com/400x175/?github description: API docs for the cases plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] --- import casesObj from './cases.devdocs.json'; diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index 0d73eba87c794..de9a785c6f3ed 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/charts title: "charts" image: https://source.unsplash.com/400x175/?github description: API docs for the charts plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts'] --- import chartsObj from './charts.devdocs.json'; diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index a3c6b7dc61be1..f502cdf61f118 100644 --- a/api_docs/cloud.mdx +++ b/api_docs/cloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloud title: "cloud" image: https://source.unsplash.com/400x175/?github description: API docs for the cloud plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud'] --- import cloudObj from './cloud.devdocs.json'; diff --git a/api_docs/cloud_data_migration.mdx b/api_docs/cloud_data_migration.mdx index 3d1741ee97cc3..1e031cba557ed 100644 --- a/api_docs/cloud_data_migration.mdx +++ b/api_docs/cloud_data_migration.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudDataMigration title: "cloudDataMigration" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudDataMigration plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudDataMigration'] --- import cloudDataMigrationObj from './cloud_data_migration.devdocs.json'; diff --git a/api_docs/cloud_defend.devdocs.json b/api_docs/cloud_defend.devdocs.json index a147bd238d697..fc5809fff4cc6 100644 --- a/api_docs/cloud_defend.devdocs.json +++ b/api_docs/cloud_defend.devdocs.json @@ -739,7 +739,7 @@ "label": "CloudDefendStatusCode", "description": [], "signature": [ - "\"unprivileged\" | \"indexed\" | \"indexing\" | \"index-timeout\" | \"not-deployed\" | \"not-installed\"" + "\"indexed\" | \"unprivileged\" | \"indexing\" | \"index-timeout\" | \"not-deployed\" | \"not-installed\"" ], "path": "x-pack/plugins/cloud_defend/common/v1.ts", "deprecated": false, diff --git a/api_docs/cloud_defend.mdx b/api_docs/cloud_defend.mdx index 98baf5078cb43..20c6b22cbb41b 100644 --- a/api_docs/cloud_defend.mdx +++ b/api_docs/cloud_defend.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudDefend title: "cloudDefend" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudDefend plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudDefend'] --- import cloudDefendObj from './cloud_defend.devdocs.json'; diff --git a/api_docs/cloud_experiments.mdx b/api_docs/cloud_experiments.mdx index 2e146c9771c96..ae517fc661661 100644 --- a/api_docs/cloud_experiments.mdx +++ b/api_docs/cloud_experiments.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudExperiments title: "cloudExperiments" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudExperiments plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudExperiments'] --- import cloudExperimentsObj from './cloud_experiments.devdocs.json'; diff --git a/api_docs/cloud_security_posture.mdx b/api_docs/cloud_security_posture.mdx index 03402c8c53987..847acbfa0de75 100644 --- a/api_docs/cloud_security_posture.mdx +++ b/api_docs/cloud_security_posture.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudSecurityPosture title: "cloudSecurityPosture" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudSecurityPosture plugin -date: 2024-07-04 +date: 2024-07-11 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 3ba10527aeae4..0825074a8d879 100644 --- a/api_docs/console.mdx +++ b/api_docs/console.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/console title: "console" image: https://source.unsplash.com/400x175/?github description: API docs for the console plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console'] --- import consoleObj from './console.devdocs.json'; diff --git a/api_docs/content_management.mdx b/api_docs/content_management.mdx index 449310eac3fa5..eb4b9b449e09b 100644 --- a/api_docs/content_management.mdx +++ b/api_docs/content_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/contentManagement title: "contentManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the contentManagement plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'contentManagement'] --- import contentManagementObj from './content_management.devdocs.json'; diff --git a/api_docs/controls.devdocs.json b/api_docs/controls.devdocs.json index 06a783deb4ac9..0596e5df7d55e 100644 --- a/api_docs/controls.devdocs.json +++ b/api_docs/controls.devdocs.json @@ -4897,7 +4897,7 @@ "label": "chainingSystem", "description": [], "signature": [ - "\"HIERARCHICAL\" | \"NONE\"" + "\"NONE\" | \"HIERARCHICAL\"" ], "path": "src/plugins/controls/common/control_group/types.ts", "deprecated": false, @@ -7174,7 +7174,7 @@ "label": "chainingSystem", "description": [], "signature": [ - "\"HIERARCHICAL\" | \"NONE\"" + "\"NONE\" | \"HIERARCHICAL\"" ], "path": "src/plugins/controls/common/control_group/types.ts", "deprecated": false, @@ -7728,7 +7728,7 @@ "label": "ControlGroupChainingSystem", "description": [], "signature": [ - "\"HIERARCHICAL\" | \"NONE\"" + "\"NONE\" | \"HIERARCHICAL\"" ], "path": "src/plugins/controls/common/control_group/types.ts", "deprecated": false, diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index 1992af56c5a13..ed3402a2c87db 100644 --- a/api_docs/controls.mdx +++ b/api_docs/controls.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/controls title: "controls" image: https://source.unsplash.com/400x175/?github description: API docs for the controls plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] --- import controlsObj from './controls.devdocs.json'; diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index dc1ad335a03ba..f93ee1c9104b1 100644 --- a/api_docs/custom_integrations.mdx +++ b/api_docs/custom_integrations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/customIntegrations title: "customIntegrations" image: https://source.unsplash.com/400x175/?github description: API docs for the customIntegrations plugin -date: 2024-07-04 +date: 2024-07-11 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 de3639ca81e09..96fa2e226b69f 100644 --- a/api_docs/dashboard.devdocs.json +++ b/api_docs/dashboard.devdocs.json @@ -1105,9 +1105,9 @@ "label": "registerDashboardPanelPlacementSetting", "description": [], "signature": [ - "(embeddableType: string, getPanelPlacementSettings: ", + "(embeddableType: string, getPanelPlacementSettings: ", "GetPanelPlacementSettings", - ") => void" + ") => void" ], "path": "src/plugins/dashboard/public/plugin.tsx", "deprecated": false, @@ -1137,7 +1137,7 @@ "description": [], "signature": [ "GetPanelPlacementSettings", - "" + "" ], "path": "src/plugins/dashboard/public/plugin.tsx", "deprecated": false, diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index 1907d6d2bffa5..bf7dabe1a8958 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboard title: "dashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboard plugin -date: 2024-07-04 +date: 2024-07-11 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 992fa5ef3a7e7..8621e73a61b7a 100644 --- a/api_docs/dashboard_enhanced.mdx +++ b/api_docs/dashboard_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboardEnhanced title: "dashboardEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboardEnhanced plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboardEnhanced'] --- import dashboardEnhancedObj from './dashboard_enhanced.devdocs.json'; diff --git a/api_docs/data.mdx b/api_docs/data.mdx index e5a7220a0c4a1..1b14f907dc075 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data title: "data" image: https://source.unsplash.com/400x175/?github description: API docs for the data plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] --- import dataObj from './data.devdocs.json'; diff --git a/api_docs/data_quality.devdocs.json b/api_docs/data_quality.devdocs.json index 9ed104a5f220d..1abc27872df38 100644 --- a/api_docs/data_quality.devdocs.json +++ b/api_docs/data_quality.devdocs.json @@ -47,70 +47,9 @@ "common": { "classes": [], "functions": [], - "interfaces": [ - { - "parentPluginId": "dataQuality", - "id": "def-common.DataQualityLocatorParams", - "type": "Interface", - "tags": [], - "label": "DataQualityLocatorParams", - "description": [], - "signature": [ - { - "pluginId": "dataQuality", - "scope": "common", - "docId": "kibDataQualityPluginApi", - "section": "def-common.DataQualityLocatorParams", - "text": "DataQualityLocatorParams" - }, - " extends ", - { - "pluginId": "@kbn/utility-types", - "scope": "common", - "docId": "kibKbnUtilityTypesPluginApi", - "section": "def-common.SerializableRecord", - "text": "SerializableRecord" - } - ], - "path": "x-pack/plugins/data_quality/common/locators/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "dataQuality", - "id": "def-common.DataQualityLocatorParams.filters", - "type": "Object", - "tags": [], - "label": "filters", - "description": [], - "signature": [ - "Filters | undefined" - ], - "path": "x-pack/plugins/data_quality/common/locators/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - } - ], + "interfaces": [], "enums": [], "misc": [ - { - "parentPluginId": "dataQuality", - "id": "def-common.DATA_QUALITY_LOCATOR_ID", - "type": "string", - "tags": [], - "label": "DATA_QUALITY_LOCATOR_ID", - "description": [], - "signature": [ - "\"DATA_QUALITY_LOCATOR\"" - ], - "path": "x-pack/plugins/data_quality/common/locators/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "dataQuality", "id": "def-common.DATA_QUALITY_URL_STATE_KEY", diff --git a/api_docs/data_quality.mdx b/api_docs/data_quality.mdx index 9811b3652fa6c..e3303471571cd 100644 --- a/api_docs/data_quality.mdx +++ b/api_docs/data_quality.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataQuality title: "dataQuality" image: https://source.unsplash.com/400x175/?github description: API docs for the dataQuality plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataQuality'] --- import dataQualityObj from './data_quality.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 8 | 0 | 8 | 0 | +| 5 | 0 | 5 | 0 | ## Client @@ -33,9 +33,6 @@ Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux ## Common -### Interfaces - - ### Consts, variables and types diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index d1accbc8147be..234d0de08b169 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-query title: "data.query" image: https://source.unsplash.com/400x175/?github description: API docs for the data.query plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] --- import dataQueryObj from './data_query.devdocs.json'; diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index 26185cb25bab9..174dfd5a5f487 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-search title: "data.search" image: https://source.unsplash.com/400x175/?github description: API docs for the data.search plugin -date: 2024-07-04 +date: 2024-07-11 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 3b1afc2f13ff6..2d73601ae56a8 100644 --- a/api_docs/data_view_editor.mdx +++ b/api_docs/data_view_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewEditor title: "dataViewEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewEditor plugin -date: 2024-07-04 +date: 2024-07-11 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 8f874598ff42e..ea063ed0ddeeb 100644 --- a/api_docs/data_view_field_editor.mdx +++ b/api_docs/data_view_field_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewFieldEditor title: "dataViewFieldEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewFieldEditor plugin -date: 2024-07-04 +date: 2024-07-11 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 a99ef71bca1e3..477ea83571529 100644 --- a/api_docs/data_view_management.mdx +++ b/api_docs/data_view_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewManagement title: "dataViewManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewManagement plugin -date: 2024-07-04 +date: 2024-07-11 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 0b0e2fb4147bb..611d75c419502 100644 --- a/api_docs/data_views.devdocs.json +++ b/api_docs/data_views.devdocs.json @@ -12992,6 +12992,10 @@ "plugin": "controls", "path": "src/plugins/controls/public/services/options_list/options_list_service.ts" }, + { + "plugin": "@kbn/lens-embeddable-utils", + "path": "packages/kbn-lens-embeddable-utils/config_builder/columns/breakdown.ts" + }, { "plugin": "triggersActionsUi", "path": "x-pack/plugins/triggers_actions_ui/public/common/lib/data_apis.ts" @@ -13116,10 +13120,6 @@ "plugin": "ml", "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx" }, - { - "plugin": "@kbn/lens-embeddable-utils", - "path": "packages/kbn-lens-embeddable-utils/config_builder/columns/breakdown.ts" - }, { "plugin": "@kbn/ml-data-view-utils", "path": "x-pack/packages/ml/data_view_utils/actions/data_view_handler.ts" diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index 0c3df626e6016..10a355586b1b7 100644 --- a/api_docs/data_views.mdx +++ b/api_docs/data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViews title: "dataViews" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViews plugin -date: 2024-07-04 +date: 2024-07-11 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 c980289746483..fb4dbd51a2442 100644 --- a/api_docs/data_visualizer.mdx +++ b/api_docs/data_visualizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataVisualizer title: "dataVisualizer" image: https://source.unsplash.com/400x175/?github description: API docs for the dataVisualizer plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] --- import dataVisualizerObj from './data_visualizer.devdocs.json'; diff --git a/api_docs/dataset_quality.devdocs.json b/api_docs/dataset_quality.devdocs.json index 48297e463fbda..e585856f949a4 100644 --- a/api_docs/dataset_quality.devdocs.json +++ b/api_docs/dataset_quality.devdocs.json @@ -159,7 +159,7 @@ "KeyofC", "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>; }> | undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { query: { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; }; }; }) => Promise<{ integrations: ({ name: string; } & { title?: string | undefined; version?: string | undefined; icons?: ({ path: string; src: string; } & { title?: string | undefined; size?: string | undefined; type?: string | undefined; })[] | undefined; datasets?: { [x: string]: string; } | undefined; dashboards?: { id: string; title: string; }[] | undefined; })[]; }>; } & ", + " & { params: { query: { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; }; }; }) => Promise<{ integrations: ({ name: string; } & { title?: string | undefined; version?: string | undefined; icons?: ({ path: string; src: string; } & { title?: string | undefined; size?: string | undefined; type?: string | undefined; })[] | undefined; datasets?: { [x: string]: string; } | undefined; })[]; }>; } & ", "DatasetQualityRouteCreateOptions", "; \"GET /internal/dataset_quality/data_streams/{dataStream}/settings\": { endpoint: \"GET /internal/dataset_quality/data_streams/{dataStream}/settings\"; params?: ", "TypeC", @@ -169,7 +169,7 @@ "StringC", "; }>; }> | undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { path: { dataStream: string; }; }; }) => Promise<{ createdOn?: number | null | undefined; }>; } & ", + " & { params: { path: { dataStream: string; }; }; }) => Promise<{ createdOn?: number | null | undefined; integration?: string | undefined; }>; } & ", "DatasetQualityRouteCreateOptions", "; \"GET /internal/dataset_quality/data_streams/{dataStream}/details\": { endpoint: \"GET /internal/dataset_quality/data_streams/{dataStream}/details\"; params?: ", "TypeC", @@ -314,7 +314,7 @@ "KeyofC", "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>; }> | undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { query: { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; }; }; }) => Promise<{ integrations: ({ name: string; } & { title?: string | undefined; version?: string | undefined; icons?: ({ path: string; src: string; } & { title?: string | undefined; size?: string | undefined; type?: string | undefined; })[] | undefined; datasets?: { [x: string]: string; } | undefined; dashboards?: { id: string; title: string; }[] | undefined; })[]; }>; } & ", + " & { params: { query: { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; }; }; }) => Promise<{ integrations: ({ name: string; } & { title?: string | undefined; version?: string | undefined; icons?: ({ path: string; src: string; } & { title?: string | undefined; size?: string | undefined; type?: string | undefined; })[] | undefined; datasets?: { [x: string]: string; } | undefined; })[]; }>; } & ", "DatasetQualityRouteCreateOptions", "; \"GET /internal/dataset_quality/data_streams/{dataStream}/settings\": { endpoint: \"GET /internal/dataset_quality/data_streams/{dataStream}/settings\"; params?: ", "TypeC", @@ -324,7 +324,7 @@ "StringC", "; }>; }> | undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { path: { dataStream: string; }; }; }) => Promise<{ createdOn?: number | null | undefined; }>; } & ", + " & { params: { path: { dataStream: string; }; }; }) => Promise<{ createdOn?: number | null | undefined; integration?: string | undefined; }>; } & ", "DatasetQualityRouteCreateOptions", "; \"GET /internal/dataset_quality/data_streams/{dataStream}/details\": { endpoint: \"GET /internal/dataset_quality/data_streams/{dataStream}/details\"; params?: ", "TypeC", diff --git a/api_docs/dataset_quality.mdx b/api_docs/dataset_quality.mdx index 153062b25a0f6..4dabd7b5e9c45 100644 --- a/api_docs/dataset_quality.mdx +++ b/api_docs/dataset_quality.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/datasetQuality title: "datasetQuality" image: https://source.unsplash.com/400x175/?github description: API docs for the datasetQuality plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'datasetQuality'] --- import datasetQualityObj from './dataset_quality.devdocs.json'; diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index b4f9423a76875..a07ed2211d123 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByApi slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-api title: Deprecated API usage by API description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -17,8 +17,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Referencing plugin(s) | Remove By | | ---------------|-----------|-----------| | | ml, stackAlerts | - | -| | data, @kbn/search-errors, savedObjectsManagement, unifiedSearch, @kbn/unified-field-list, lens, controls, triggersActionsUi, dataVisualizer, canvas, presentationUtil, logsShared, fleet, ml, @kbn/lens-embeddable-utils, @kbn/ml-data-view-utils, enterpriseSearch, graph, visTypeTimeseries, exploratoryView, stackAlerts, infra, securitySolution, timelines, transform, upgradeAssistant, uptime, ux, maps, dataViewManagement, eventAnnotationListing, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega | - | -| | encryptedSavedObjects, ml, securitySolution | - | +| | data, @kbn/search-errors, savedObjectsManagement, unifiedSearch, @kbn/unified-field-list, lens, controls, @kbn/lens-embeddable-utils, triggersActionsUi, dataVisualizer, canvas, presentationUtil, logsShared, fleet, ml, @kbn/ml-data-view-utils, enterpriseSearch, graph, visTypeTimeseries, exploratoryView, stackAlerts, infra, securitySolution, timelines, transform, upgradeAssistant, uptime, ux, maps, dataViewManagement, eventAnnotationListing, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega | - | +| | ml, securitySolution | - | | | actions, savedObjectsTagging, ml, enterpriseSearch | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core, savedObjects, visualizations, aiops, dataVisualizer, ml, dashboardEnhanced, graph, lens, securitySolution, eventAnnotation, @kbn/core-saved-objects-browser-mocks | - | | | @kbn/core, savedObjects, embeddable, visualizations, canvas, graph, ml, @kbn/core-saved-objects-common, @kbn/core-saved-objects-server, actions, @kbn/alerting-types, alerting, savedSearch, enterpriseSearch, securitySolution, taskManager, @kbn/core-saved-objects-server-internal, @kbn/core-saved-objects-api-server | - | @@ -39,7 +39,6 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | securitySolution | - | | | cloudDefend, osquery, securitySolution, synthetics | - | | | cloudDefend, osquery, securitySolution, synthetics | - | -| | alerting, observabilityAIAssistant, fleet, cloudSecurityPosture, enterpriseSearch, securitySolution, serverlessSearch, transform, upgradeAssistant, apm, entityManager, observabilityOnboarding, synthetics, security | - | | | cases, securitySolution, security | - | | | @kbn/securitysolution-data-table, securitySolution | - | | | @kbn/securitysolution-data-table, securitySolution | - | @@ -66,8 +65,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | securitySolution | - | | | @kbn/monaco, securitySolution | - | | | fleet, cloudSecurityPosture, exploratoryView, osquery, synthetics | - | +| | alerting, observabilityAIAssistant, fleet, cloudSecurityPosture, enterpriseSearch, serverlessSearch, transform, upgradeAssistant, apm, entityManager, observabilityOnboarding, synthetics, security | - | | | actions, alerting | - | -| | visualizations, lens, controls, dashboard, discover, links | - | +| | visualizations, lens, controls, dashboard, discover | - | | | discover, @kbn/reporting-public | - | | | data, discover, imageEmbeddable, embeddable | - | | | @kbn/core-plugins-browser-internal, @kbn/core-root-browser-internal, home, savedObjects, unifiedSearch, visualizations, fileUpload, dashboardEnhanced, transform, discover, dataVisualizer | - | @@ -153,13 +153,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | security | - | | | observabilityShared | - | | | @kbn/react-kibana-context-styled, kibanaReact | - | -| | encryptedSavedObjects | - | | | @kbn/content-management-table-list-view, filesManagement | - | | | @kbn/core | - | | | @kbn/core | - | | | @kbn/core-lifecycle-browser-mocks, @kbn/core, @kbn/core-plugins-browser-internal | - | | | @kbn/core | - | | | @kbn/core-plugins-server-internal | - | +| | encryptedSavedObjects | - | | | reporting | - | | | @kbn/reporting-export-types-csv, reporting | - | | | @kbn/reporting-export-types-csv, reporting | - | diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 651a7cedc8166..f1fb99dcd5ae9 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByPlugin slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-plugin title: Deprecated API usage by plugin description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -736,7 +736,6 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [encryption_key_rotation_service.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.ts#:~:text=authc), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.ts#:~:text=authc) | - | | | [create_migration.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/encrypted_saved_objects/server/create_migration.ts#:~:text=convertToMultiNamespaceTypeVersion), [create_migration.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/encrypted_saved_objects/server/create_migration.ts#:~:text=convertToMultiNamespaceTypeVersion) | - | @@ -990,7 +989,6 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [plugin.ts](https://github.com/elastic/kibana/tree/main/src/plugins/links/public/plugin.ts#:~:text=registerEmbeddableFactory) | - | | | [save_to_library.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/links/public/content_management/save_to_library.tsx#:~:text=SavedObjectSaveModal), [save_to_library.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/links/public/content_management/save_to_library.tsx#:~:text=SavedObjectSaveModal) | 8.8.0 | | | [links.ts](https://github.com/elastic/kibana/tree/main/src/plugins/links/server/saved_objects/links.ts#:~:text=migrations) | - | @@ -1330,8 +1328,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode)+ 7 more | 8.8.0 | | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode)+ 7 more | 8.8.0 | | | [get_is_alert_suppression_active.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.ts#:~:text=license%24), [create_threat_signals.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signals.ts#:~:text=license%24), [query.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/query.ts#:~:text=license%24), [threshold.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24) | 8.8.0 | -| | [request_context_factory.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/request_context_factory.ts#:~:text=authc), [route.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts#:~:text=authc), [create_signals_migration_route.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts#:~:text=authc), [delete_signals_migration_route.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts#:~:text=authc), [finalize_signals_migration_route.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts#:~:text=authc), [common.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts#:~:text=authc) | - | -| | [endpoint_app_context_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts#:~:text=authc), [open_close_signals_route.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts#:~:text=authc), [open_close_signals_route.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts#:~:text=authc), [file_info_handler.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts#:~:text=authc), [file_download_handler.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.ts#:~:text=authc), [response_actions.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts#:~:text=authc), [list.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/actions/list.test.ts#:~:text=authc), [response_actions.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts#:~:text=authc), [state.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/actions/state.test.ts#:~:text=authc), [index.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/suggestions/index.test.ts#:~:text=authc)+ 14 more | - | +| | [route.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts#:~:text=authc) | - | | | [suggest_user_profiles_route.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts#:~:text=userProfiles), [suggest_user_profiles_route.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts#:~:text=userProfiles) | - | | | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedCellValueElementProps), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedCellValueElementProps) | - | | | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedRowRenderer), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedRowRenderer) | - | diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index a7d49eac71da0..2cc94d7fa75f6 100644 --- a/api_docs/deprecations_by_team.mdx +++ b/api_docs/deprecations_by_team.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsDueByTeam slug: /kibana-dev-docs/api-meta/deprecations-due-by-team title: Deprecated APIs due to be removed, by team description: Lists the teams that are referencing deprecated APIs with a remove by date. -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -71,7 +71,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| -| dashboard | | [save_modal.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/api/overlays/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/api/overlays/save_modal.tsx#:~:text=SavedObjectSaveModal), [add_to_library_action.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_actions/add_to_library_action.tsx#:~:text=SavedObjectSaveModal), [add_to_library_action.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_actions/add_to_library_action.tsx#:~:text=SavedObjectSaveModal), [saved_object_save_modal_dashboard.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard.tsx#:~:text=SavedObjectSaveModal), [saved_object_save_modal_dashboard.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard.tsx#:~:text=SavedObjectSaveModal), [save_to_library.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/links/public/content_management/save_to_library.tsx#:~:text=SavedObjectSaveModal), [save_to_library.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/links/public/content_management/save_to_library.tsx#:~:text=SavedObjectSaveModal), [attribute_service.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#:~:text=SavedObjectSaveModal), [attribute_service.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#:~:text=SavedObjectSaveModal) | 8.8.0 | +| dashboard | | [save_modal.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/api/overlays/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/api/overlays/save_modal.tsx#:~:text=SavedObjectSaveModal), [add_to_library_action.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_actions/add_to_library_action.tsx#:~:text=SavedObjectSaveModal), [add_to_library_action.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_actions/add_to_library_action.tsx#:~:text=SavedObjectSaveModal), [saved_object_save_modal_dashboard.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard.tsx#:~:text=SavedObjectSaveModal), [saved_object_save_modal_dashboard.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard.tsx#:~:text=SavedObjectSaveModal), [attribute_service.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#:~:text=SavedObjectSaveModal), [attribute_service.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#:~:text=SavedObjectSaveModal), [save_to_library.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/links/public/content_management/save_to_library.tsx#:~:text=SavedObjectSaveModal), [save_to_library.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/links/public/content_management/save_to_library.tsx#:~:text=SavedObjectSaveModal) | 8.8.0 | diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index 9514703a5dbbf..562287dd1cb42 100644 --- a/api_docs/dev_tools.mdx +++ b/api_docs/dev_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/devTools title: "devTools" image: https://source.unsplash.com/400x175/?github description: API docs for the devTools plugin -date: 2024-07-04 +date: 2024-07-11 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 951a0fdc8c848..90f85106e8612 100644 --- a/api_docs/discover.mdx +++ b/api_docs/discover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discover title: "discover" image: https://source.unsplash.com/400x175/?github description: API docs for the discover plugin -date: 2024-07-04 +date: 2024-07-11 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 4bbd636677ffe..053a1991eb618 100644 --- a/api_docs/discover_enhanced.mdx +++ b/api_docs/discover_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discoverEnhanced title: "discoverEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the discoverEnhanced plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverEnhanced'] --- import discoverEnhancedObj from './discover_enhanced.devdocs.json'; diff --git a/api_docs/discover_shared.mdx b/api_docs/discover_shared.mdx index 24820743acd45..231fe7f410a82 100644 --- a/api_docs/discover_shared.mdx +++ b/api_docs/discover_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discoverShared title: "discoverShared" image: https://source.unsplash.com/400x175/?github description: API docs for the discoverShared plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverShared'] --- import discoverSharedObj from './discover_shared.devdocs.json'; diff --git a/api_docs/ecs_data_quality_dashboard.mdx b/api_docs/ecs_data_quality_dashboard.mdx index d46c4eff5be3f..a8a4ee382dab3 100644 --- a/api_docs/ecs_data_quality_dashboard.mdx +++ b/api_docs/ecs_data_quality_dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ecsDataQualityDashboard title: "ecsDataQualityDashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the ecsDataQualityDashboard plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ecsDataQualityDashboard'] --- import ecsDataQualityDashboardObj from './ecs_data_quality_dashboard.devdocs.json'; diff --git a/api_docs/elastic_assistant.mdx b/api_docs/elastic_assistant.mdx index d193fdc596172..fccf3d6b64831 100644 --- a/api_docs/elastic_assistant.mdx +++ b/api_docs/elastic_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/elasticAssistant title: "elasticAssistant" image: https://source.unsplash.com/400x175/?github description: API docs for the elasticAssistant plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'elasticAssistant'] --- import elasticAssistantObj from './elastic_assistant.devdocs.json'; diff --git a/api_docs/embeddable.devdocs.json b/api_docs/embeddable.devdocs.json index 8219bbabc6b24..24ed6961df2c9 100644 --- a/api_docs/embeddable.devdocs.json +++ b/api_docs/embeddable.devdocs.json @@ -14495,10 +14495,6 @@ { "plugin": "discover", "path": "src/plugins/discover/public/plugin.tsx" - }, - { - "plugin": "links", - "path": "src/plugins/links/public/plugin.ts" } ], "children": [ diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 143df9035fa41..ba0258d8589df 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddable title: "embeddable" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddable plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddable'] --- import embeddableObj from './embeddable.devdocs.json'; diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index 85de11513ad38..6ea23c886a0f7 100644 --- a/api_docs/embeddable_enhanced.mdx +++ b/api_docs/embeddable_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddableEnhanced title: "embeddableEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddableEnhanced plugin -date: 2024-07-04 +date: 2024-07-11 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 73af7fd2425ee..5b3f5a9f72c75 100644 --- a/api_docs/encrypted_saved_objects.mdx +++ b/api_docs/encrypted_saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/encryptedSavedObjects title: "encryptedSavedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the encryptedSavedObjects plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'encryptedSavedObjects'] --- import encryptedSavedObjectsObj from './encrypted_saved_objects.devdocs.json'; diff --git a/api_docs/enterprise_search.mdx b/api_docs/enterprise_search.mdx index 9bdb57a786cf2..0b4ee2c5256d1 100644 --- a/api_docs/enterprise_search.mdx +++ b/api_docs/enterprise_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/enterpriseSearch title: "enterpriseSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the enterpriseSearch plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] --- import enterpriseSearchObj from './enterprise_search.devdocs.json'; diff --git a/api_docs/entity_manager.devdocs.json b/api_docs/entity_manager.devdocs.json index f8f2a8dde90aa..145b8f97ff63a 100644 --- a/api_docs/entity_manager.devdocs.json +++ b/api_docs/entity_manager.devdocs.json @@ -77,6 +77,96 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "entityManager", + "id": "def-public.ERROR_API_KEY_NOT_FOUND", + "type": "string", + "tags": [], + "label": "ERROR_API_KEY_NOT_FOUND", + "description": [], + "signature": [ + "\"api_key_not_found\"" + ], + "path": "x-pack/plugins/observability_solution/entity_manager/common/errors.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "entityManager", + "id": "def-public.ERROR_API_KEY_NOT_VALID", + "type": "string", + "tags": [], + "label": "ERROR_API_KEY_NOT_VALID", + "description": [], + "signature": [ + "\"api_key_not_valid\"" + ], + "path": "x-pack/plugins/observability_solution/entity_manager/common/errors.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "entityManager", + "id": "def-public.ERROR_API_KEY_SERVICE_DISABLED", + "type": "string", + "tags": [], + "label": "ERROR_API_KEY_SERVICE_DISABLED", + "description": [], + "signature": [ + "\"api_key_service_disabled\"" + ], + "path": "x-pack/plugins/observability_solution/entity_manager/common/errors.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "entityManager", + "id": "def-public.ERROR_DEFINITION_STOPPED", + "type": "string", + "tags": [], + "label": "ERROR_DEFINITION_STOPPED", + "description": [], + "signature": [ + "\"error_definition_stopped\"" + ], + "path": "x-pack/plugins/observability_solution/entity_manager/common/errors.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "entityManager", + "id": "def-public.ERROR_PARTIAL_BUILTIN_INSTALLATION", + "type": "string", + "tags": [], + "label": "ERROR_PARTIAL_BUILTIN_INSTALLATION", + "description": [], + "signature": [ + "\"partial_builtin_installation\"" + ], + "path": "x-pack/plugins/observability_solution/entity_manager/common/errors.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "entityManager", + "id": "def-public.ERROR_USER_NOT_AUTHORIZED", + "type": "string", + "tags": [], + "label": "ERROR_USER_NOT_AUTHORIZED", + "description": [], + "signature": [ + "\"user_not_authorized\"" + ], + "path": "x-pack/plugins/observability_solution/entity_manager/common/errors.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ], "objects": [] diff --git a/api_docs/entity_manager.mdx b/api_docs/entity_manager.mdx index c454acf8cb01c..359efb8f409c7 100644 --- a/api_docs/entity_manager.mdx +++ b/api_docs/entity_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/entityManager title: "entityManager" image: https://source.unsplash.com/400x175/?github description: API docs for the entityManager plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'entityManager'] --- import entityManagerObj from './entity_manager.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 8 | 0 | 8 | 1 | +| 14 | 0 | 14 | 1 | ## Client diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index 861fe5c3af635..7e4c7ae8ed8e7 100644 --- a/api_docs/es_ui_shared.mdx +++ b/api_docs/es_ui_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esUiShared title: "esUiShared" image: https://source.unsplash.com/400x175/?github description: API docs for the esUiShared plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] --- import esUiSharedObj from './es_ui_shared.devdocs.json'; diff --git a/api_docs/esql.devdocs.json b/api_docs/esql.devdocs.json new file mode 100644 index 0000000000000..f3d9e7db3931c --- /dev/null +++ b/api_docs/esql.devdocs.json @@ -0,0 +1,547 @@ +{ + "id": "esql", + "client": { + "classes": [], + "functions": [ + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLangEditor", + "type": "Function", + "tags": [], + "label": "TextBasedLangEditor", + "description": [], + "signature": [ + "(props: ", + { + "pluginId": "@kbn/text-based-editor", + "scope": "public", + "docId": "kibKbnTextBasedEditorPluginApi", + "section": "def-public.TextBasedLanguagesEditorProps", + "text": "TextBasedLanguagesEditorProps" + }, + ") => JSX.Element" + ], + "path": "src/plugins/esql/public/create_editor.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLangEditor.$1", + "type": "Object", + "tags": [], + "label": "props", + "description": [], + "signature": [ + { + "pluginId": "@kbn/text-based-editor", + "scope": "public", + "docId": "kibKbnTextBasedEditorPluginApi", + "section": "def-public.TextBasedLanguagesEditorProps", + "text": "TextBasedLanguagesEditorProps" + } + ], + "path": "src/plugins/esql/public/create_editor.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "esql", + "id": "def-public.EsqlPluginStart", + "type": "Interface", + "tags": [], + "label": "EsqlPluginStart", + "description": [], + "path": "src/plugins/esql/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "esql", + "id": "def-public.EsqlPluginStart.Editor", + "type": "CompoundType", + "tags": [], + "label": "Editor", + "description": [], + "signature": [ + "React.ComponentClass<", + { + "pluginId": "@kbn/text-based-editor", + "scope": "public", + "docId": "kibKbnTextBasedEditorPluginApi", + "section": "def-public.TextBasedLanguagesEditorProps", + "text": "TextBasedLanguagesEditorProps" + }, + ", any> | React.FunctionComponent<", + { + "pluginId": "@kbn/text-based-editor", + "scope": "public", + "docId": "kibKbnTextBasedEditorPluginApi", + "section": "def-public.TextBasedLanguagesEditorProps", + "text": "TextBasedLanguagesEditorProps" + }, + ">" + ], + "path": "src/plugins/esql/public/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps", + "type": "Interface", + "tags": [], + "label": "TextBasedLanguagesEditorProps", + "description": [], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.query", + "type": "Object", + "tags": [], + "label": "query", + "description": [ + "The aggregate type query" + ], + "signature": [ + "{ esql: string; }" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.onTextLangQueryChange", + "type": "Function", + "tags": [], + "label": "onTextLangQueryChange", + "description": [ + "Callback running everytime the query changes" + ], + "signature": [ + "(query: ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, + ") => void" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.onTextLangQueryChange.$1", + "type": "Object", + "tags": [], + "label": "query", + "description": [], + "signature": [ + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + } + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.onTextLangQuerySubmit", + "type": "Function", + "tags": [], + "label": "onTextLangQuerySubmit", + "description": [ + "Callback running when the user submits the query" + ], + "signature": [ + "(query?: ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, + " | undefined, abortController?: AbortController | undefined) => Promise" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.onTextLangQuerySubmit.$1", + "type": "Object", + "tags": [], + "label": "query", + "description": [], + "signature": [ + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" + }, + " | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.onTextLangQuerySubmit.$2", + "type": "Object", + "tags": [], + "label": "abortController", + "description": [], + "signature": [ + "AbortController | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.expandCodeEditor", + "type": "Function", + "tags": [], + "label": "expandCodeEditor", + "description": [ + "Can be used to expand/minimize the editor" + ], + "signature": [ + "(status: boolean) => void" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.expandCodeEditor.$1", + "type": "boolean", + "tags": [], + "label": "status", + "description": [], + "signature": [ + "boolean" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.isCodeEditorExpanded", + "type": "boolean", + "tags": [], + "label": "isCodeEditorExpanded", + "description": [ + "If it is true, the editor initializes with height EDITOR_INITIAL_HEIGHT_EXPANDED" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.detectTimestamp", + "type": "CompoundType", + "tags": [], + "label": "detectTimestamp", + "description": [ + "If it is true, the editor displays the message @timestamp found\nThe text based queries are relying on adhoc dataviews which\ncan have an @timestamp timefield or nothing" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.errors", + "type": "Array", + "tags": [], + "label": "errors", + "description": [ + "Array of errors" + ], + "signature": [ + "Error[] | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.warning", + "type": "string", + "tags": [], + "label": "warning", + "description": [ + "Warning string as it comes from ES" + ], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.isLoading", + "type": "CompoundType", + "tags": [], + "label": "isLoading", + "description": [ + "Disables the editor and displays loading icon in run button\nIt is also used for hiding the history component if it is not defined" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.isDisabled", + "type": "CompoundType", + "tags": [], + "label": "isDisabled", + "description": [ + "Disables the editor" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.isDarkMode", + "type": "CompoundType", + "tags": [], + "label": "isDarkMode", + "description": [ + "Indicator if the editor is on dark mode" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.dataTestSubj", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.hideMinimizeButton", + "type": "CompoundType", + "tags": [], + "label": "hideMinimizeButton", + "description": [ + "If true it hides the minimize button and the user can't return to the minimized version\nUseful when the application doesn't want to give this capability" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.hideRunQueryText", + "type": "CompoundType", + "tags": [], + "label": "hideRunQueryText", + "description": [ + "Hide the Run query information which appears on the footer" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.editorIsInline", + "type": "CompoundType", + "tags": [], + "label": "editorIsInline", + "description": [ + "This is used for applications (such as the inline editing flyout in dashboards)\nwhich want to add the editor without being part of the Unified search component\nIt renders a submit query button inside the editor" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.disableSubmitAction", + "type": "CompoundType", + "tags": [], + "label": "disableSubmitAction", + "description": [ + "Disables the submit query action" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.allowQueryCancellation", + "type": "CompoundType", + "tags": [], + "label": "allowQueryCancellation", + "description": [ + "when set to true enables query cancellation" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.hideTimeFilterInfo", + "type": "CompoundType", + "tags": [], + "label": "hideTimeFilterInfo", + "description": [ + "hide @timestamp info" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.hideQueryHistory", + "type": "CompoundType", + "tags": [], + "label": "hideQueryHistory", + "description": [ + "hide query history" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "esql", + "id": "def-public.TextBasedLanguagesEditorProps.hideHeaderWhenExpanded", + "type": "CompoundType", + "tags": [], + "label": "hideHeaderWhenExpanded", + "description": [ + "hide header buttons when editor is expanded" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-text-based-editor/src/text_based_languages_editor.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/esql.mdx b/api_docs/esql.mdx new file mode 100644 index 0000000000000..8d8b7f0c0b679 --- /dev/null +++ b/api_docs/esql.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: kibEsqlPluginApi +slug: /kibana-dev-docs/api/esql +title: "esql" +image: https://source.unsplash.com/400x175/?github +description: API docs for the esql plugin +date: 2024-07-11 +tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esql'] +--- +import esqlObj from './esql.devdocs.json'; + + + +Contact [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 29 | 0 | 10 | 0 | + +## Client + +### Functions + + +### Interfaces + + diff --git a/api_docs/esql_data_grid.mdx b/api_docs/esql_data_grid.mdx index 594a6b3e1a844..ca621bfee4b02 100644 --- a/api_docs/esql_data_grid.mdx +++ b/api_docs/esql_data_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esqlDataGrid title: "esqlDataGrid" image: https://source.unsplash.com/400x175/?github description: API docs for the esqlDataGrid plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esqlDataGrid'] --- import esqlDataGridObj from './esql_data_grid.devdocs.json'; diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index 83727da213201..7427bc363bf0e 100644 --- a/api_docs/event_annotation.mdx +++ b/api_docs/event_annotation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventAnnotation title: "eventAnnotation" image: https://source.unsplash.com/400x175/?github description: API docs for the eventAnnotation plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotation'] --- import eventAnnotationObj from './event_annotation.devdocs.json'; diff --git a/api_docs/event_annotation_listing.mdx b/api_docs/event_annotation_listing.mdx index 1b30aa5156b08..a65650e5685ce 100644 --- a/api_docs/event_annotation_listing.mdx +++ b/api_docs/event_annotation_listing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventAnnotationListing title: "eventAnnotationListing" image: https://source.unsplash.com/400x175/?github description: API docs for the eventAnnotationListing plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotationListing'] --- import eventAnnotationListingObj from './event_annotation_listing.devdocs.json'; diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index 862f911ab0688..0154024c4e5f2 100644 --- a/api_docs/event_log.mdx +++ b/api_docs/event_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventLog title: "eventLog" image: https://source.unsplash.com/400x175/?github description: API docs for the eventLog plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventLog'] --- import eventLogObj from './event_log.devdocs.json'; diff --git a/api_docs/exploratory_view.mdx b/api_docs/exploratory_view.mdx index 384e24252a637..2cd5df3e65687 100644 --- a/api_docs/exploratory_view.mdx +++ b/api_docs/exploratory_view.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/exploratoryView title: "exploratoryView" image: https://source.unsplash.com/400x175/?github description: API docs for the exploratoryView plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'exploratoryView'] --- import exploratoryViewObj from './exploratory_view.devdocs.json'; -Contact [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) for questions regarding this plugin. +Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index 1a60d5744254b..61400637bd16c 100644 --- a/api_docs/expression_error.mdx +++ b/api_docs/expression_error.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionError title: "expressionError" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionError plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionError'] --- import expressionErrorObj from './expression_error.devdocs.json'; diff --git a/api_docs/expression_gauge.mdx b/api_docs/expression_gauge.mdx index 1f82bda684ad4..1add6ebb11b99 100644 --- a/api_docs/expression_gauge.mdx +++ b/api_docs/expression_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionGauge title: "expressionGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionGauge plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionGauge'] --- import expressionGaugeObj from './expression_gauge.devdocs.json'; diff --git a/api_docs/expression_heatmap.mdx b/api_docs/expression_heatmap.mdx index f49917248cc10..a46147400ad60 100644 --- a/api_docs/expression_heatmap.mdx +++ b/api_docs/expression_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionHeatmap title: "expressionHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionHeatmap plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionHeatmap'] --- import expressionHeatmapObj from './expression_heatmap.devdocs.json'; diff --git a/api_docs/expression_image.mdx b/api_docs/expression_image.mdx index 8d84415dac8b3..5de5767ec431d 100644 --- a/api_docs/expression_image.mdx +++ b/api_docs/expression_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionImage title: "expressionImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionImage plugin -date: 2024-07-04 +date: 2024-07-11 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 290ef8afabcd6..5478834bbe46c 100644 --- a/api_docs/expression_legacy_metric_vis.mdx +++ b/api_docs/expression_legacy_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionLegacyMetricVis title: "expressionLegacyMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionLegacyMetricVis plugin -date: 2024-07-04 +date: 2024-07-11 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 4562b54274c19..c513aec5c05f0 100644 --- a/api_docs/expression_metric.mdx +++ b/api_docs/expression_metric.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetric title: "expressionMetric" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetric plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetric'] --- import expressionMetricObj from './expression_metric.devdocs.json'; diff --git a/api_docs/expression_metric_vis.devdocs.json b/api_docs/expression_metric_vis.devdocs.json index 3212eb93a18fe..920c0a7b141d0 100644 --- a/api_docs/expression_metric_vis.devdocs.json +++ b/api_docs/expression_metric_vis.devdocs.json @@ -449,6 +449,62 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "expressionMetricVis", + "id": "def-common.MetricArguments.titlesTextAlign", + "type": "CompoundType", + "tags": [], + "label": "titlesTextAlign", + "description": [], + "signature": [ + "\"right\" | \"left\" | \"center\"" + ], + "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "expressionMetricVis", + "id": "def-common.MetricArguments.valuesTextAlign", + "type": "CompoundType", + "tags": [], + "label": "valuesTextAlign", + "description": [], + "signature": [ + "\"right\" | \"left\" | \"center\"" + ], + "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "expressionMetricVis", + "id": "def-common.MetricArguments.iconAlign", + "type": "CompoundType", + "tags": [], + "label": "iconAlign", + "description": [], + "signature": [ + "\"right\" | \"left\"" + ], + "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "expressionMetricVis", + "id": "def-common.MetricArguments.valueFontSize", + "type": "CompoundType", + "tags": [], + "label": "valueFontSize", + "description": [], + "signature": [ + "number | \"default\" | \"fit\"" + ], + "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "expressionMetricVis", "id": "def-common.MetricArguments.color", @@ -745,6 +801,62 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "expressionMetricVis", + "id": "def-common.MetricVisParam.titlesTextAlign", + "type": "CompoundType", + "tags": [], + "label": "titlesTextAlign", + "description": [], + "signature": [ + "\"right\" | \"left\" | \"center\"" + ], + "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "expressionMetricVis", + "id": "def-common.MetricVisParam.valuesTextAlign", + "type": "CompoundType", + "tags": [], + "label": "valuesTextAlign", + "description": [], + "signature": [ + "\"right\" | \"left\" | \"center\"" + ], + "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "expressionMetricVis", + "id": "def-common.MetricVisParam.iconAlign", + "type": "CompoundType", + "tags": [], + "label": "iconAlign", + "description": [], + "signature": [ + "\"right\" | \"left\"" + ], + "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "expressionMetricVis", + "id": "def-common.MetricVisParam.valueFontSize", + "type": "CompoundType", + "tags": [], + "label": "valueFontSize", + "description": [], + "signature": [ + "number | \"default\" | \"fit\"" + ], + "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "expressionMetricVis", "id": "def-common.MetricVisParam.maxCols", diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index 5c0fce0eb1f22..9b335fd928ddc 100644 --- a/api_docs/expression_metric_vis.mdx +++ b/api_docs/expression_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetricVis title: "expressionMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetricVis plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetricVis'] --- import expressionMetricVisObj from './expression_metric_vis.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 67 | 0 | 67 | 2 | +| 75 | 0 | 75 | 2 | ## Client diff --git a/api_docs/expression_partition_vis.mdx b/api_docs/expression_partition_vis.mdx index a83c184c36f4d..1bf57bb07c913 100644 --- a/api_docs/expression_partition_vis.mdx +++ b/api_docs/expression_partition_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionPartitionVis title: "expressionPartitionVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionPartitionVis plugin -date: 2024-07-04 +date: 2024-07-11 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 a2cad0f2f6b12..663c37f0336cd 100644 --- a/api_docs/expression_repeat_image.mdx +++ b/api_docs/expression_repeat_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRepeatImage title: "expressionRepeatImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRepeatImage plugin -date: 2024-07-04 +date: 2024-07-11 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 26c579cd24293..883291f327bca 100644 --- a/api_docs/expression_reveal_image.mdx +++ b/api_docs/expression_reveal_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRevealImage title: "expressionRevealImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRevealImage plugin -date: 2024-07-04 +date: 2024-07-11 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 63d5a0c2ce2f2..5b9ce734491bf 100644 --- a/api_docs/expression_shape.devdocs.json +++ b/api_docs/expression_shape.devdocs.json @@ -635,7 +635,7 @@ "label": "strokeLinecap", "description": [], "signature": [ - "\"inherit\" | \"butt\" | \"round\" | \"square\" | undefined" + "\"square\" | \"inherit\" | \"butt\" | \"round\" | 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 b955c09fe2461..7030d0e522164 100644 --- a/api_docs/expression_shape.mdx +++ b/api_docs/expression_shape.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionShape title: "expressionShape" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionShape plugin -date: 2024-07-04 +date: 2024-07-11 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 1adc253b59bf3..b95138d54ab47 100644 --- a/api_docs/expression_tagcloud.mdx +++ b/api_docs/expression_tagcloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionTagcloud title: "expressionTagcloud" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionTagcloud plugin -date: 2024-07-04 +date: 2024-07-11 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 1d66fc5d9a257..ea7e85c389e76 100644 --- a/api_docs/expression_x_y.devdocs.json +++ b/api_docs/expression_x_y.devdocs.json @@ -417,7 +417,7 @@ "label": "mode", "description": [], "signature": [ - "\"full\" | \"custom\" | \"dataBounds\"" + "\"custom\" | \"full\" | \"dataBounds\"" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false, @@ -2363,7 +2363,7 @@ "label": "AxisExtentMode", "description": [], "signature": [ - "\"full\" | \"custom\" | \"dataBounds\"" + "\"custom\" | \"full\" | \"dataBounds\"" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false, @@ -2378,7 +2378,7 @@ "label": "AxisMode", "description": [], "signature": [ - "\"percentage\" | \"normal\" | \"wiggle\" | \"silhouette\"" + "\"normal\" | \"percentage\" | \"wiggle\" | \"silhouette\"" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false, @@ -3626,7 +3626,7 @@ "label": "YScaleType", "description": [], "signature": [ - "\"log\" | \"time\" | \"linear\" | \"sqrt\"" + "\"log\" | \"sqrt\" | \"time\" | \"linear\"" ], "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 7b00acb9611cf..908c8f388039c 100644 --- a/api_docs/expression_x_y.mdx +++ b/api_docs/expression_x_y.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionXY title: "expressionXY" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionXY plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionXY'] --- import expressionXYObj from './expression_x_y.devdocs.json'; diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index f76eeee947d8d..2c7741a342025 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressions title: "expressions" image: https://source.unsplash.com/400x175/?github description: API docs for the expressions plugin -date: 2024-07-04 +date: 2024-07-11 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 0b0f391e4ac86..b3e14b5434c3b 100644 --- a/api_docs/features.mdx +++ b/api_docs/features.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/features title: "features" image: https://source.unsplash.com/400x175/?github description: API docs for the features plugin -date: 2024-07-04 +date: 2024-07-11 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 ae8bdd69376fe..0f2a1c1d4bd9c 100644 --- a/api_docs/field_formats.mdx +++ b/api_docs/field_formats.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fieldFormats title: "fieldFormats" image: https://source.unsplash.com/400x175/?github description: API docs for the fieldFormats plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] --- import fieldFormatsObj from './field_formats.devdocs.json'; diff --git a/api_docs/fields_metadata.mdx b/api_docs/fields_metadata.mdx index da48a9856d91c..98e8397418109 100644 --- a/api_docs/fields_metadata.mdx +++ b/api_docs/fields_metadata.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fieldsMetadata title: "fieldsMetadata" image: https://source.unsplash.com/400x175/?github description: API docs for the fieldsMetadata plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldsMetadata'] --- import fieldsMetadataObj from './fields_metadata.devdocs.json'; diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index 9e2f5abf99d37..3e073cfc2b353 100644 --- a/api_docs/file_upload.mdx +++ b/api_docs/file_upload.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fileUpload title: "fileUpload" image: https://source.unsplash.com/400x175/?github description: API docs for the fileUpload plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] --- import fileUploadObj from './file_upload.devdocs.json'; diff --git a/api_docs/files.mdx b/api_docs/files.mdx index 163d7562ea18b..176485460c7db 100644 --- a/api_docs/files.mdx +++ b/api_docs/files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/files title: "files" image: https://source.unsplash.com/400x175/?github description: API docs for the files plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'files'] --- import filesObj from './files.devdocs.json'; diff --git a/api_docs/files_management.mdx b/api_docs/files_management.mdx index c693e7ec71ed6..0348766c93248 100644 --- a/api_docs/files_management.mdx +++ b/api_docs/files_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/filesManagement title: "filesManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the filesManagement plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'filesManagement'] --- import filesManagementObj from './files_management.devdocs.json'; diff --git a/api_docs/fleet.devdocs.json b/api_docs/fleet.devdocs.json index fec8ffac9edc5..b0da7aab43721 100644 --- a/api_docs/fleet.devdocs.json +++ b/api_docs/fleet.devdocs.json @@ -25871,6 +25871,20 @@ "path": "x-pack/plugins/fleet/common/types/models/epm.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "fleet", + "id": "def-common.RegistryVarsEntry.RegistryVarsEntryKeys.full_width", + "type": "CompoundType", + "tags": [], + "label": "[RegistryVarsEntryKeys.full_width]", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/fleet/common/types/models/epm.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 35261f949a14c..e99b668273f28 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fleet title: "fleet" image: https://source.unsplash.com/400x175/?github description: API docs for the fleet plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] --- import fleetObj from './fleet.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/fleet](https://github.com/orgs/elastic/teams/fleet) for questi | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 1348 | 5 | 1226 | 72 | +| 1349 | 5 | 1227 | 72 | ## Client diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index e210aa1ada864..d8a4778b5dfb4 100644 --- a/api_docs/global_search.mdx +++ b/api_docs/global_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/globalSearch title: "globalSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the globalSearch plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'globalSearch'] --- import globalSearchObj from './global_search.devdocs.json'; diff --git a/api_docs/guided_onboarding.mdx b/api_docs/guided_onboarding.mdx index f22d604d4ecf1..cd0a584abd942 100644 --- a/api_docs/guided_onboarding.mdx +++ b/api_docs/guided_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/guidedOnboarding title: "guidedOnboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the guidedOnboarding plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'guidedOnboarding'] --- import guidedOnboardingObj from './guided_onboarding.devdocs.json'; diff --git a/api_docs/home.mdx b/api_docs/home.mdx index d708d283ae03e..12cd9e9a7fd41 100644 --- a/api_docs/home.mdx +++ b/api_docs/home.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/home title: "home" image: https://source.unsplash.com/400x175/?github description: API docs for the home plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'home'] --- import homeObj from './home.devdocs.json'; diff --git a/api_docs/image_embeddable.mdx b/api_docs/image_embeddable.mdx index b5f64ad1003da..a285787fe67ac 100644 --- a/api_docs/image_embeddable.mdx +++ b/api_docs/image_embeddable.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/imageEmbeddable title: "imageEmbeddable" image: https://source.unsplash.com/400x175/?github description: API docs for the imageEmbeddable plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'imageEmbeddable'] --- import imageEmbeddableObj from './image_embeddable.devdocs.json'; diff --git a/api_docs/index_lifecycle_management.mdx b/api_docs/index_lifecycle_management.mdx index bf57ddb676b32..d5e4649658817 100644 --- a/api_docs/index_lifecycle_management.mdx +++ b/api_docs/index_lifecycle_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexLifecycleManagement title: "indexLifecycleManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexLifecycleManagement plugin -date: 2024-07-04 +date: 2024-07-11 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 da486f2571083..9e81464ca56ea 100644 --- a/api_docs/index_management.mdx +++ b/api_docs/index_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexManagement title: "indexManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexManagement plugin -date: 2024-07-04 +date: 2024-07-11 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 530c32a0e69d0..20783144b93a1 100644 --- a/api_docs/infra.mdx +++ b/api_docs/infra.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/infra title: "infra" image: https://source.unsplash.com/400x175/?github description: API docs for the infra plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] --- import infraObj from './infra.devdocs.json'; diff --git a/api_docs/ingest_pipelines.mdx b/api_docs/ingest_pipelines.mdx index 9a13d3eb8cb2d..bda1a481df694 100644 --- a/api_docs/ingest_pipelines.mdx +++ b/api_docs/ingest_pipelines.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ingestPipelines title: "ingestPipelines" image: https://source.unsplash.com/400x175/?github description: API docs for the ingestPipelines plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ingestPipelines'] --- import ingestPipelinesObj from './ingest_pipelines.devdocs.json'; diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index 3806f2ea0d909..5f4f529bd6388 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/inspector title: "inspector" image: https://source.unsplash.com/400x175/?github description: API docs for the inspector plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] --- import inspectorObj from './inspector.devdocs.json'; diff --git a/api_docs/integration_assistant.devdocs.json b/api_docs/integration_assistant.devdocs.json index 7bc21089a09fd..fb01a65e33531 100644 --- a/api_docs/integration_assistant.devdocs.json +++ b/api_docs/integration_assistant.devdocs.json @@ -231,7 +231,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; }" + "[] | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }" ], "path": "x-pack/plugins/integration_assistant/common/api/categorization/categorization_route.ts", "deprecated": false, @@ -397,7 +397,7 @@ "label": "EcsMappingRequestBody", "description": [], "signature": [ - "{ connectorId: string; packageName: string; rawSamples: string[]; dataStreamName: string; mapping?: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\"> | undefined; }" + "{ connectorId: string; packageName: string; rawSamples: string[]; dataStreamName: string; mapping?: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\"> | undefined; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }" ], "path": "x-pack/plugins/integration_assistant/common/api/ecs/ecs_route.ts", "deprecated": false, @@ -630,7 +630,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; }" + "[] | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }" ], "path": "x-pack/plugins/integration_assistant/common/api/related/related_route.ts", "deprecated": false, @@ -917,7 +917,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }>; connectorId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; packageName: string; rawSamples: string[]; dataStreamName: string; currentPipeline: { processors: ", + "[] | undefined; }>; connectorId: Zod.ZodString; langSmithOptions: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; packageName: string; rawSamples: string[]; dataStreamName: string; currentPipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -933,7 +933,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; }, { connectorId: string; packageName: string; rawSamples: string[]; dataStreamName: string; currentPipeline: { processors: ", + "[] | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }, { connectorId: string; packageName: string; rawSamples: string[]; dataStreamName: string; currentPipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -949,7 +949,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; }>" + "[] | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }>" ], "path": "x-pack/plugins/integration_assistant/common/api/categorization/categorization_route.ts", "deprecated": false, @@ -1359,7 +1359,7 @@ "label": "EcsMappingRequestBody", "description": [], "signature": [ - "Zod.ZodObject<{ packageName: Zod.ZodString; dataStreamName: Zod.ZodString; rawSamples: Zod.ZodArray; mapping: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">>>; connectorId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; packageName: string; rawSamples: string[]; dataStreamName: string; mapping?: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\"> | undefined; }, { connectorId: string; packageName: string; rawSamples: string[]; dataStreamName: string; mapping?: Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\"> | undefined; }>" + "Zod.ZodObject<{ packageName: Zod.ZodString; dataStreamName: Zod.ZodString; rawSamples: Zod.ZodArray; mapping: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\">>>; connectorId: Zod.ZodString; langSmithOptions: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; packageName: string; rawSamples: string[]; dataStreamName: string; mapping?: Zod.objectOutputType<{}, Zod.ZodTypeAny, \"passthrough\"> | undefined; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }, { connectorId: string; packageName: string; rawSamples: string[]; dataStreamName: string; mapping?: Zod.objectInputType<{}, Zod.ZodTypeAny, \"passthrough\"> | undefined; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }>" ], "path": "x-pack/plugins/integration_assistant/common/api/ecs/ecs_route.ts", "deprecated": false, @@ -1849,7 +1849,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }>; connectorId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; packageName: string; rawSamples: string[]; dataStreamName: string; currentPipeline: { processors: ", + "[] | undefined; }>; connectorId: Zod.ZodString; langSmithOptions: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; packageName: string; rawSamples: string[]; dataStreamName: string; currentPipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -1865,7 +1865,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; }, { connectorId: string; packageName: string; rawSamples: string[]; dataStreamName: string; currentPipeline: { processors: ", + "[] | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }, { connectorId: string; packageName: string; rawSamples: string[]; dataStreamName: string; currentPipeline: { processors: ", { "pluginId": "integrationAssistant", "scope": "common", @@ -1881,7 +1881,7 @@ "section": "def-common.ESProcessorItem", "text": "ESProcessorItem" }, - "[] | undefined; }; }>" + "[] | undefined; }; langSmithOptions?: { apiKey: string; projectName: string; } | undefined; }>" ], "path": "x-pack/plugins/integration_assistant/common/api/related/related_route.ts", "deprecated": false, diff --git a/api_docs/integration_assistant.mdx b/api_docs/integration_assistant.mdx index b4278160dd929..6d0242e8a2069 100644 --- a/api_docs/integration_assistant.mdx +++ b/api_docs/integration_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/integrationAssistant title: "integrationAssistant" image: https://source.unsplash.com/400x175/?github description: API docs for the integrationAssistant plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'integrationAssistant'] --- import integrationAssistantObj from './integration_assistant.devdocs.json'; diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index 87337ba4e3b3a..c47d63303a0a3 100644 --- a/api_docs/interactive_setup.mdx +++ b/api_docs/interactive_setup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/interactiveSetup title: "interactiveSetup" image: https://source.unsplash.com/400x175/?github description: API docs for the interactiveSetup plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] --- import interactiveSetupObj from './interactive_setup.devdocs.json'; diff --git a/api_docs/investigate.mdx b/api_docs/investigate.mdx index 3d2113d301630..7722afcb762e4 100644 --- a/api_docs/investigate.mdx +++ b/api_docs/investigate.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/investigate title: "investigate" image: https://source.unsplash.com/400x175/?github description: API docs for the investigate plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'investigate'] --- import investigateObj from './investigate.devdocs.json'; -Contact [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai-assistant) for questions regarding this plugin. +Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/kbn_ace.mdx b/api_docs/kbn_ace.mdx index d5cdb2ce95870..fc68672cf88f7 100644 --- a/api_docs/kbn_ace.mdx +++ b/api_docs/kbn_ace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ace title: "@kbn/ace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ace plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ace'] --- import kbnAceObj from './kbn_ace.devdocs.json'; diff --git a/api_docs/kbn_actions_types.mdx b/api_docs/kbn_actions_types.mdx index 9fc3108fe6875..7036d7e54f77e 100644 --- a/api_docs/kbn_actions_types.mdx +++ b/api_docs/kbn_actions_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-actions-types title: "@kbn/actions-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/actions-types plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/actions-types'] --- import kbnActionsTypesObj from './kbn_actions_types.devdocs.json'; diff --git a/api_docs/kbn_aiops_components.mdx b/api_docs/kbn_aiops_components.mdx index cfa9af7ad6760..bbf1801c680f1 100644 --- a/api_docs/kbn_aiops_components.mdx +++ b/api_docs/kbn_aiops_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-components title: "@kbn/aiops-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-components plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-components'] --- import kbnAiopsComponentsObj from './kbn_aiops_components.devdocs.json'; diff --git a/api_docs/kbn_aiops_log_pattern_analysis.mdx b/api_docs/kbn_aiops_log_pattern_analysis.mdx index 738a2eb602682..95d4e6f07fcc3 100644 --- a/api_docs/kbn_aiops_log_pattern_analysis.mdx +++ b/api_docs/kbn_aiops_log_pattern_analysis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-log-pattern-analysis title: "@kbn/aiops-log-pattern-analysis" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-log-pattern-analysis plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-log-pattern-analysis'] --- import kbnAiopsLogPatternAnalysisObj from './kbn_aiops_log_pattern_analysis.devdocs.json'; diff --git a/api_docs/kbn_aiops_log_rate_analysis.mdx b/api_docs/kbn_aiops_log_rate_analysis.mdx index de759389c82e2..9e6677bd8b7ae 100644 --- a/api_docs/kbn_aiops_log_rate_analysis.mdx +++ b/api_docs/kbn_aiops_log_rate_analysis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-log-rate-analysis title: "@kbn/aiops-log-rate-analysis" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-log-rate-analysis plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-log-rate-analysis'] --- import kbnAiopsLogRateAnalysisObj from './kbn_aiops_log_rate_analysis.devdocs.json'; diff --git a/api_docs/kbn_alerting_api_integration_helpers.mdx b/api_docs/kbn_alerting_api_integration_helpers.mdx index 9977315783ea8..684e0747d51b3 100644 --- a/api_docs/kbn_alerting_api_integration_helpers.mdx +++ b/api_docs/kbn_alerting_api_integration_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-api-integration-helpers title: "@kbn/alerting-api-integration-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-api-integration-helpers plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-api-integration-helpers'] --- import kbnAlertingApiIntegrationHelpersObj from './kbn_alerting_api_integration_helpers.devdocs.json'; diff --git a/api_docs/kbn_alerting_comparators.mdx b/api_docs/kbn_alerting_comparators.mdx index bd6b2f1f9e3c2..64bbc439d1091 100644 --- a/api_docs/kbn_alerting_comparators.mdx +++ b/api_docs/kbn_alerting_comparators.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-comparators title: "@kbn/alerting-comparators" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-comparators plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-comparators'] --- import kbnAlertingComparatorsObj from './kbn_alerting_comparators.devdocs.json'; diff --git a/api_docs/kbn_alerting_state_types.mdx b/api_docs/kbn_alerting_state_types.mdx index 3b7d7514be488..4b29160e5d927 100644 --- a/api_docs/kbn_alerting_state_types.mdx +++ b/api_docs/kbn_alerting_state_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-state-types title: "@kbn/alerting-state-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-state-types plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-state-types'] --- import kbnAlertingStateTypesObj from './kbn_alerting_state_types.devdocs.json'; diff --git a/api_docs/kbn_alerting_types.mdx b/api_docs/kbn_alerting_types.mdx index eaf12747ee150..b7bbb6492201a 100644 --- a/api_docs/kbn_alerting_types.mdx +++ b/api_docs/kbn_alerting_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-types title: "@kbn/alerting-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-types plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-types'] --- import kbnAlertingTypesObj from './kbn_alerting_types.devdocs.json'; diff --git a/api_docs/kbn_alerts_as_data_utils.mdx b/api_docs/kbn_alerts_as_data_utils.mdx index 140e9ebc8e34f..fd2b3675e12b8 100644 --- a/api_docs/kbn_alerts_as_data_utils.mdx +++ b/api_docs/kbn_alerts_as_data_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts-as-data-utils title: "@kbn/alerts-as-data-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts-as-data-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-as-data-utils'] --- import kbnAlertsAsDataUtilsObj from './kbn_alerts_as_data_utils.devdocs.json'; diff --git a/api_docs/kbn_alerts_grouping.devdocs.json b/api_docs/kbn_alerts_grouping.devdocs.json new file mode 100644 index 0000000000000..f734613aca44b --- /dev/null +++ b/api_docs/kbn_alerts_grouping.devdocs.json @@ -0,0 +1,492 @@ +{ + "id": "@kbn/alerts-grouping", + "client": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGrouping", + "type": "Function", + "tags": [], + "label": "AlertsGrouping", + "description": [ + "\nA coordinator component to show multiple alert tables grouped by one or more fields\n" + ], + "signature": [ + "React.NamedExoticComponent<", + { + "pluginId": "@kbn/alerts-grouping", + "scope": "public", + "docId": "kibKbnAlertsGroupingPluginApi", + "section": "def-public.AlertsGroupingProps", + "text": "AlertsGroupingProps" + }, + "<{}>> & { readonly type: (props: ", + { + "pluginId": "@kbn/alerts-grouping", + "scope": "public", + "docId": "kibKbnAlertsGroupingPluginApi", + "section": "def-public.AlertsGroupingProps", + "text": "AlertsGroupingProps" + }, + "<{}>) => JSX.Element; }" + ], + "path": "packages/kbn-alerts-grouping/src/components/alerts_grouping.tsx", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGrouping.$1", + "type": "Uncategorized", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "P" + ], + "path": "node_modules/@types/react/index.d.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.useAlertsGroupingState", + "type": "Function", + "tags": [], + "label": "useAlertsGroupingState", + "description": [], + "signature": [ + "(groupingId: string) => { grouping: ", + "GroupModel", + "; updateGrouping: (groupModel: Partial<", + "GroupModel", + "> | null) => void; }" + ], + "path": "packages/kbn-alerts-grouping/src/contexts/alerts_grouping_context.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.useAlertsGroupingState.$1", + "type": "string", + "tags": [], + "label": "groupingId", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-alerts-grouping/src/contexts/alerts_grouping_context.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps", + "type": "Interface", + "tags": [], + "label": "AlertsGroupingProps", + "description": [], + "signature": [ + { + "pluginId": "@kbn/alerts-grouping", + "scope": "public", + "docId": "kibKbnAlertsGroupingPluginApi", + "section": "def-public.AlertsGroupingProps", + "text": "AlertsGroupingProps" + }, + "" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.children", + "type": "Function", + "tags": [], + "label": "children", + "description": [ + "\nThe leaf component that will be rendered in the grouping panels" + ], + "signature": [ + "(groupingFilters: ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[]) => React.ReactElement>" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.children.$1", + "type": "Array", + "tags": [], + "label": "groupingFilters", + "description": [], + "signature": [ + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[]" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.renderGroupPanel", + "type": "Function", + "tags": [], + "label": "renderGroupPanel", + "description": [ + "\nRender function for the group panel header" + ], + "signature": [ + "GroupPanelRenderer", + " | undefined" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.getGroupStats", + "type": "Function", + "tags": [], + "label": "getGroupStats", + "description": [ + "\nA function that given the current grouping field and aggregation results, returns an array of\nstat items to be rendered in the group panel" + ], + "signature": [ + "GetGroupStats", + " | undefined" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.defaultFilters", + "type": "Array", + "tags": [], + "label": "defaultFilters", + "description": [ + "\nDefault search filters" + ], + "signature": [ + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[] | undefined" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.globalFilters", + "type": "Array", + "tags": [], + "label": "globalFilters", + "description": [ + "\nGlobal search filters" + ], + "signature": [ + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[]" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.takeActionItems", + "type": "Function", + "tags": [], + "label": "takeActionItems", + "description": [ + "\nItems that will be rendered in the `Take Actions` menu" + ], + "signature": [ + "((groupFilters: ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[], groupNumber: number) => JSX.Element[]) | undefined" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.defaultGroupingOptions", + "type": "Array", + "tags": [], + "label": "defaultGroupingOptions", + "description": [ + "\nThe default fields available for grouping" + ], + "signature": [ + { + "pluginId": "@kbn/grouping", + "scope": "common", + "docId": "kibKbnGroupingPluginApi", + "section": "def-common.GroupOption", + "text": "GroupOption" + }, + "[]" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.featureIds", + "type": "Array", + "tags": [], + "label": "featureIds", + "description": [ + "\nThe alerting feature ids this grouping covers" + ], + "signature": [ + { + "pluginId": "@kbn/rule-data-utils", + "scope": "common", + "docId": "kibKbnRuleDataUtilsPluginApi", + "section": "def-common.AlertConsumers", + "text": "AlertConsumers" + }, + "[]" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.from", + "type": "string", + "tags": [], + "label": "from", + "description": [ + "\nTime filter start" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.to", + "type": "string", + "tags": [], + "label": "to", + "description": [ + "\nTime filter end" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.globalQuery", + "type": "Object", + "tags": [], + "label": "globalQuery", + "description": [ + "\nGlobal search query (i.e. from the KQL bar)" + ], + "signature": [ + "{ query: string | { [key: string]: any; }; language: string; }" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.loading", + "type": "CompoundType", + "tags": [], + "label": "loading", + "description": [ + "\nExternal loading state" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.groupingId", + "type": "string", + "tags": [], + "label": "groupingId", + "description": [ + "\nID used to retrieve the current grouping configuration from the state" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.getAggregationsByGroupingField", + "type": "Function", + "tags": [], + "label": "getAggregationsByGroupingField", + "description": [ + "\nResolves an array of aggregations for a given grouping field" + ], + "signature": [ + "(field: string) => ", + { + "pluginId": "@kbn/grouping", + "scope": "common", + "docId": "kibKbnGroupingPluginApi", + "section": "def-common.NamedAggregation", + "text": "NamedAggregation" + }, + "[]" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.getAggregationsByGroupingField.$1", + "type": "string", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/alerts-grouping", + "id": "def-public.AlertsGroupingProps.services", + "type": "Object", + "tags": [], + "label": "services", + "description": [ + "\nServices required for the grouping component" + ], + "signature": [ + "{ notifications: ", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.NotificationsStart", + "text": "NotificationsStart" + }, + "; dataViews: ", + { + "pluginId": "dataViews", + "scope": "public", + "docId": "kibDataViewsPluginApi", + "section": "def-public.DataViewsServicePublic", + "text": "DataViewsServicePublic" + }, + "; http: ", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + }, + "; }" + ], + "path": "packages/kbn-alerts-grouping/src/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_alerts_grouping.mdx b/api_docs/kbn_alerts_grouping.mdx new file mode 100644 index 0000000000000..77bdc915dbdc3 --- /dev/null +++ b/api_docs/kbn_alerts_grouping.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: kibKbnAlertsGroupingPluginApi +slug: /kibana-dev-docs/api/kbn-alerts-grouping +title: "@kbn/alerts-grouping" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/alerts-grouping plugin +date: 2024-07-11 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-grouping'] +--- +import kbnAlertsGroupingObj from './kbn_alerts_grouping.devdocs.json'; + + + +Contact [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 22 | 0 | 5 | 1 | + +## Client + +### Functions + + +### Interfaces + + diff --git a/api_docs/kbn_alerts_ui_shared.devdocs.json b/api_docs/kbn_alerts_ui_shared.devdocs.json index db705acc3d45a..404c573dafc06 100644 --- a/api_docs/kbn_alerts_ui_shared.devdocs.json +++ b/api_docs/kbn_alerts_ui_shared.devdocs.json @@ -197,253 +197,6 @@ "returnComment": [], "initialIsOpen": false }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.fetchAadFields", - "type": "Function", - "tags": [], - "label": "fetchAadFields", - "description": [], - "signature": [ - "({\n http,\n ruleTypeId,\n}: { http: ", - { - "pluginId": "@kbn/core-http-browser", - "scope": "common", - "docId": "kibKbnCoreHttpBrowserPluginApi", - "section": "def-common.HttpSetup", - "text": "HttpSetup" - }, - "; ruleTypeId?: string | undefined; }) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewField", - "text": "DataViewField" - }, - "[]>" - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_aad_fields.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.fetchAadFields.$1", - "type": "Object", - "tags": [], - "label": "{\n http,\n ruleTypeId,\n}", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_aad_fields.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.fetchAadFields.$1.http", - "type": "Object", - "tags": [], - "label": "http", - "description": [], - "signature": [ - { - "pluginId": "@kbn/core-http-browser", - "scope": "common", - "docId": "kibKbnCoreHttpBrowserPluginApi", - "section": "def-common.HttpSetup", - "text": "HttpSetup" - } - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_aad_fields.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.fetchAadFields.$1.ruleTypeId", - "type": "string", - "tags": [], - "label": "ruleTypeId", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_aad_fields.ts", - "deprecated": false, - "trackAdoption": false - } - ] - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.fetchAlertFields", - "type": "Function", - "tags": [], - "label": "fetchAlertFields", - "description": [], - "signature": [ - "({\n http,\n featureIds,\n}: { http: ", - { - "pluginId": "@kbn/core-http-browser", - "scope": "common", - "docId": "kibKbnCoreHttpBrowserPluginApi", - "section": "def-common.HttpSetup", - "text": "HttpSetup" - }, - "; featureIds: ", - { - "pluginId": "@kbn/rule-data-utils", - "scope": "common", - "docId": "kibKbnRuleDataUtilsPluginApi", - "section": "def-common.AlertConsumers", - "text": "AlertConsumers" - }, - "[]; }) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - "[]>" - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_alert_fields.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.fetchAlertFields.$1", - "type": "Object", - "tags": [], - "label": "{\n http,\n featureIds,\n}", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_alert_fields.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.fetchAlertFields.$1.http", - "type": "Object", - "tags": [], - "label": "http", - "description": [], - "signature": [ - { - "pluginId": "@kbn/core-http-browser", - "scope": "common", - "docId": "kibKbnCoreHttpBrowserPluginApi", - "section": "def-common.HttpSetup", - "text": "HttpSetup" - } - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_alert_fields.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.fetchAlertFields.$1.featureIds", - "type": "Array", - "tags": [], - "label": "featureIds", - "description": [], - "signature": [ - { - "pluginId": "@kbn/rule-data-utils", - "scope": "common", - "docId": "kibKbnRuleDataUtilsPluginApi", - "section": "def-common.AlertConsumers", - "text": "AlertConsumers" - }, - "[]" - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_alert_fields.ts", - "deprecated": false, - "trackAdoption": false - } - ] - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.fetchAlertIndexNames", - "type": "Function", - "tags": [], - "label": "fetchAlertIndexNames", - "description": [], - "signature": [ - "({\n http,\n features,\n}: { http: ", - { - "pluginId": "@kbn/core-http-browser", - "scope": "common", - "docId": "kibKbnCoreHttpBrowserPluginApi", - "section": "def-common.HttpSetup", - "text": "HttpSetup" - }, - "; features: string; }) => Promise" - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_alert_index_names.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.fetchAlertIndexNames.$1", - "type": "Object", - "tags": [], - "label": "{\n http,\n features,\n}", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_alert_index_names.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.fetchAlertIndexNames.$1.http", - "type": "Object", - "tags": [], - "label": "http", - "description": [], - "signature": [ - { - "pluginId": "@kbn/core-http-browser", - "scope": "common", - "docId": "kibKbnCoreHttpBrowserPluginApi", - "section": "def-common.HttpSetup", - "text": "HttpSetup" - } - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_alert_index_names.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.fetchAlertIndexNames.$1.features", - "type": "string", - "tags": [], - "label": "features", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_alert_index_names.ts", - "deprecated": false, - "trackAdoption": false - } - ] - } - ], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "@kbn/alerts-ui-shared", "id": "def-common.MaintenanceWindowCallout", @@ -565,7 +318,7 @@ "text": "UseAlertDataViewResult" } ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_alert_data_view.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_alert_data_view.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -585,7 +338,7 @@ "text": "UseAlertDataViewProps" } ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_alert_data_view.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_alert_data_view.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -596,10 +349,10 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.useRuleAADFields", + "id": "def-common.useCreateRule", "type": "Function", "tags": [], - "label": "useRuleAADFields", + "label": "useCreateRule", "description": [], "signature": [ "(props: ", @@ -607,25 +360,54 @@ "pluginId": "@kbn/alerts-ui-shared", "scope": "common", "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.UseRuleAADFieldsProps", - "text": "UseRuleAADFieldsProps" + "section": "def-common.UseCreateRuleProps", + "text": "UseCreateRuleProps" }, ") => ", + "UseMutationResult", + "<", { "pluginId": "@kbn/alerts-ui-shared", "scope": "common", "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.UseRuleAADFieldsResult", - "text": "UseRuleAADFieldsResult" - } + "section": "def-common.Rule", + "text": "Rule" + }, + "<", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.RuleTypeParams", + "text": "RuleTypeParams" + }, + ">, ", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpFetchError", + "text": "IHttpFetchError" + }, + "<{ message: string; }>, { formData: ", + "CreateRuleBody", + "<", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.RuleTypeParams", + "text": "RuleTypeParams" + }, + ">; }, unknown>" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_rule_aad_fields.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_create_rule.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.useRuleAADFields.$1", + "id": "def-common.useCreateRule.$1", "type": "Object", "tags": [], "label": "props", @@ -635,11 +417,11 @@ "pluginId": "@kbn/alerts-ui-shared", "scope": "common", "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.UseRuleAADFieldsProps", - "text": "UseRuleAADFieldsProps" + "section": "def-common.UseCreateRuleProps", + "text": "UseCreateRuleProps" } ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_rule_aad_fields.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_create_rule.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -647,472 +429,684 @@ ], "returnComment": [], "initialIsOpen": false - } - ], - "interfaces": [ + }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorFieldsProps", - "type": "Interface", + "id": "def-common.useFindAlertsQuery", + "type": "Function", "tags": [], - "label": "ActionConnectorFieldsProps", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "label": "useFindAlertsQuery", + "description": [ + "\nA generic hook to find alerts\n\nStill applies alerts authorization rules but, unlike triggers_actions_ui's `useFetchAlerts` hook,\nallows to perform arbitrary queries" + ], + "signature": [ + "({ http, toasts, enabled, params, }: ", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseFindAlertsQueryProps", + "text": "UseFindAlertsQueryProps" + }, + ") => ", + "UseQueryResult", + "<", + "SearchResponseBody", + "<{}, T>, Error>" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_find_alerts_query.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorFieldsProps.readOnly", - "type": "boolean", - "tags": [], - "label": "readOnly", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorFieldsProps.isEdit", - "type": "boolean", - "tags": [], - "label": "isEdit", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorFieldsProps.registerPreSubmitValidator", - "type": "Function", + "id": "def-common.useFindAlertsQuery.$1", + "type": "Object", "tags": [], - "label": "registerPreSubmitValidator", + "label": "{\n http,\n toasts,\n enabled = true,\n params,\n}", "description": [], "signature": [ - "(validator: ", { "pluginId": "@kbn/alerts-ui-shared", "scope": "common", "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.ConnectorValidationFunc", - "text": "ConnectorValidationFunc" - }, - ") => void" + "section": "def-common.UseFindAlertsQueryProps", + "text": "UseFindAlertsQueryProps" + } ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_find_alerts_query.ts", "deprecated": false, "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorFieldsProps.registerPreSubmitValidator.$1", - "type": "Function", - "tags": [], - "label": "validator", - "description": [], - "signature": [ - { - "pluginId": "@kbn/alerts-ui-shared", - "scope": "common", - "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.ConnectorValidationFunc", - "text": "ConnectorValidationFunc" - } - ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] + "isRequired": true } ], + "returnComment": [], "initialIsOpen": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorProps", - "type": "Interface", + "id": "def-common.useGetAlertsGroupAggregationsQuery", + "type": "Function", "tags": [], - "label": "ActionConnectorProps", - "description": [], + "label": "useGetAlertsGroupAggregationsQuery", + "description": [ + "\nFetches alerts aggregations for a given groupByField.\n\nSome default aggregations are applied:\n- `groupByFields`, to get the buckets based on the provided grouping field,\n - `unitsCount`, to count the number of alerts in each bucket,\n- `unitsCount`, to count the total number of alerts targeted by the query,\n- `groupsCount`, to count the total number of groups.\n\nThe provided `aggregations` are applied within `groupByFields`. Here the `groupByField` runtime\nfield can be used to perform grouping-based aggregations.\n\nApplies alerting RBAC through featureIds." + ], "signature": [ + "({ http, toasts, enabled, params, }: ", { "pluginId": "@kbn/alerts-ui-shared", "scope": "common", "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.ActionConnectorProps", - "text": "ActionConnectorProps" + "section": "def-common.UseGetAlertsGroupAggregationsQueryProps", + "text": "UseGetAlertsGroupAggregationsQueryProps" }, - "" + ") => ", + "UseQueryResult", + "<", + "SearchResponseBody", + "<{}, T>, Error>" ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorProps.secrets", - "type": "Uncategorized", + "id": "def-common.useGetAlertsGroupAggregationsQuery.$1", + "type": "Object", "tags": [], - "label": "secrets", + "label": "{\n http,\n toasts,\n enabled = true,\n params,\n}", "description": [], "signature": [ - "Secrets" + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseGetAlertsGroupAggregationsQueryProps", + "text": "UseGetAlertsGroupAggregationsQueryProps" + } ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.ts", "deprecated": false, - "trackAdoption": false - }, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.useHealthCheck", + "type": "Function", + "tags": [], + "label": "useHealthCheck", + "description": [], + "signature": [ + "(props: ", { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorProps.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseHealthCheckProps", + "text": "UseHealthCheckProps" }, + ") => { isLoading: boolean; isInitialLoading: boolean; error: \"alertsError\" | \"encryptionError\" | \"apiKeysDisabledError\" | \"apiKeysAndEncryptionError\" | null; }" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_health_check.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorProps.actionTypeId", - "type": "string", + "id": "def-common.useHealthCheck.$1", + "type": "Object", "tags": [], - "label": "actionTypeId", + "label": "props", "description": [], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "signature": [ + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseHealthCheckProps", + "text": "UseHealthCheckProps" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_health_check.tsx", "deprecated": false, - "trackAdoption": false - }, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.useLoadAlertingFrameworkHealth", + "type": "Function", + "tags": [], + "label": "useLoadAlertingFrameworkHealth", + "description": [], + "signature": [ + "(props: ", { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorProps.name", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseLoadAlertingFrameworkHealthProps", + "text": "UseLoadAlertingFrameworkHealthProps" }, + ") => { data: ", { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorProps.referencedByCount", - "type": "number", - "tags": [], - "label": "referencedByCount", - "description": [], - "signature": [ - "number | undefined" - ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false + "pluginId": "@kbn/alerting-types", + "scope": "common", + "docId": "kibKbnAlertingTypesPluginApi", + "section": "def-common.AlertingFrameworkHealth", + "text": "AlertingFrameworkHealth" }, + " | undefined; isLoading: boolean; isInitialLoading: boolean; isSuccess: boolean; isError: boolean; error: unknown; }" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_alerting_framework_health.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorProps.config", - "type": "Uncategorized", + "id": "def-common.useLoadAlertingFrameworkHealth.$1", + "type": "Object", "tags": [], - "label": "config", + "label": "props", "description": [], "signature": [ - "Config" + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseLoadAlertingFrameworkHealthProps", + "text": "UseLoadAlertingFrameworkHealthProps" + } ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_alerting_framework_health.ts", "deprecated": false, - "trackAdoption": false - }, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.useLoadRuleTypesQuery", + "type": "Function", + "tags": [], + "label": "useLoadRuleTypesQuery", + "description": [], + "signature": [ + "({ http, toasts, filteredRuleTypes, registeredRuleTypes, enabled, }: ", { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorProps.isPreconfigured", - "type": "boolean", - "tags": [], - "label": "isPreconfigured", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseRuleTypesProps", + "text": "UseRuleTypesProps" }, + ") => { ruleTypesState: { isInitialLoad: boolean; isLoading: boolean; data: ", { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorProps.isDeprecated", - "type": "boolean", - "tags": [], - "label": "isDeprecated", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.RuleTypeIndexWithDescriptions", + "text": "RuleTypeIndexWithDescriptions" }, + "; error: Error | null; }; hasAnyAuthorizedRuleType: boolean; authorizedRuleTypes: ", { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorProps.isSystemAction", - "type": "boolean", - "tags": [], - "label": "isSystemAction", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.RuleTypeWithDescription", + "text": "RuleTypeWithDescription" }, + "[]; authorizedToReadAnyRules: boolean; authorizedToCreateAnyRules: boolean; isSuccess: boolean; }" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_rule_types_query.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionConnectorProps.isMissingSecrets", - "type": "CompoundType", + "id": "def-common.useLoadRuleTypesQuery.$1", + "type": "Object", "tags": [], - "label": "isMissingSecrets", + "label": "{\n http,\n toasts,\n filteredRuleTypes,\n registeredRuleTypes,\n enabled = true,\n}", "description": [], "signature": [ - "boolean | undefined" + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseRuleTypesProps", + "text": "UseRuleTypesProps" + } ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_rule_types_query.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true } ], + "returnComment": [], "initialIsOpen": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps", - "type": "Interface", + "id": "def-common.useLoadUiConfig", + "type": "Function", "tags": [], - "label": "ActionParamsProps", + "label": "useLoadUiConfig", "description": [], "signature": [ + "(props: ", { "pluginId": "@kbn/alerts-ui-shared", "scope": "common", "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.ActionParamsProps", - "text": "ActionParamsProps" + "section": "def-common.UseLoadUiConfigProps", + "text": "UseLoadUiConfigProps" }, - "" + ") => { data: ", + "UiConfig", + " | undefined; isLoading: boolean; isInitialLoading: boolean; isSuccess: boolean; isError: boolean; error: unknown; }" ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_ui_config.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.actionParams", + "id": "def-common.useLoadUiConfig.$1", "type": "Object", "tags": [], - "label": "actionParams", + "label": "props", "description": [], "signature": [ - "{ [P in keyof TParams]?: TParams[P] | undefined; }" + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseLoadUiConfigProps", + "text": "UseLoadUiConfigProps" + } ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_ui_config.ts", "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.index", - "type": "number", - "tags": [], - "label": "index", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.useLoadUiHealth", + "type": "Function", + "tags": [], + "label": "useLoadUiHealth", + "description": [], + "signature": [ + "(props: ", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseLoadUiHealthProps", + "text": "UseLoadUiHealthProps" }, + ") => { data: ", + "UiHealthCheck", + " | undefined; isLoading: boolean; isInitialLoading: boolean; isSuccess: boolean; isError: boolean; error: unknown; }" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_ui_health.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.editAction", - "type": "Function", + "id": "def-common.useLoadUiHealth.$1", + "type": "Object", "tags": [], - "label": "editAction", + "label": "props", "description": [], "signature": [ - "(key: string, value: ", { - "pluginId": "@kbn/core-saved-objects-common", + "pluginId": "@kbn/alerts-ui-shared", "scope": "common", - "docId": "kibKbnCoreSavedObjectsCommonPluginApi", - "section": "def-common.SavedObjectAttribute", - "text": "SavedObjectAttribute" - }, - ", index: number) => void" + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseLoadUiHealthProps", + "text": "UseLoadUiHealthProps" + } ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_ui_health.ts", "deprecated": false, "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.editAction.$1", - "type": "string", - "tags": [], - "label": "key", - "description": [], - "signature": [ - "string" - ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.editAction.$2", - "type": "CompoundType", - "tags": [], - "label": "value", - "description": [], - "signature": [ - { - "pluginId": "@kbn/core-saved-objects-common", - "scope": "common", - "docId": "kibKbnCoreSavedObjectsCommonPluginApi", - "section": "def-common.SavedObjectAttribute", - "text": "SavedObjectAttribute" - } - ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.editAction.$3", - "type": "number", - "tags": [], - "label": "index", - "description": [], - "signature": [ - "number" - ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.useResolveRule", + "type": "Function", + "tags": [], + "label": "useResolveRule", + "description": [], + "signature": [ + "(props: ", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseResolveProps", + "text": "UseResolveProps" + }, + ") => { data: ", + "RuleFormData", + "<", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.RuleTypeParams", + "text": "RuleTypeParams" }, + "> | null | undefined; isLoading: boolean; isInitialLoading: boolean; isSuccess: boolean; isError: boolean; error: unknown; }" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_resolve_rule.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.errors", + "id": "def-common.useResolveRule.$1", "type": "Object", "tags": [], - "label": "errors", + "label": "props", "description": [], "signature": [ { "pluginId": "@kbn/alerts-ui-shared", "scope": "common", "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.RuleFormParamsErrors", - "text": "RuleFormParamsErrors" + "section": "def-common.UseResolveProps", + "text": "UseResolveProps" } ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_resolve_rule.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.useRuleAADFields", + "type": "Function", + "tags": [], + "label": "useRuleAADFields", + "description": [], + "signature": [ + "(props: ", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseRuleAADFieldsProps", + "text": "UseRuleAADFieldsProps" }, + ") => ", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseRuleAADFieldsResult", + "text": "UseRuleAADFieldsResult" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_rule_aad_fields.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.ruleTypeId", - "type": "string", + "id": "def-common.useRuleAADFields.$1", + "type": "Object", "tags": [], - "label": "ruleTypeId", + "label": "props", "description": [], "signature": [ - "string | undefined" + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseRuleAADFieldsProps", + "text": "UseRuleAADFieldsProps" + } ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_rule_aad_fields.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.useUpdateRule", + "type": "Function", + "tags": [], + "label": "useUpdateRule", + "description": [], + "signature": [ + "(props: ", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseUpdateRuleProps", + "text": "UseUpdateRuleProps" + }, + ") => ", + "UseMutationResult", + "<", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.Rule", + "text": "Rule" + }, + "<", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.RuleTypeParams", + "text": "RuleTypeParams" + }, + ">, ", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpFetchError", + "text": "IHttpFetchError" + }, + "<{ message: string; }>, { id: string; formData: ", + "UpdateRuleBody", + "<", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.RuleTypeParams", + "text": "RuleTypeParams" }, + ">; }, unknown>" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_update_rule.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.messageVariables", - "type": "Array", + "id": "def-common.useUpdateRule.$1", + "type": "Object", "tags": [], - "label": "messageVariables", + "label": "props", "description": [], "signature": [ { - "pluginId": "@kbn/alerting-types", + "pluginId": "@kbn/alerts-ui-shared", "scope": "common", - "docId": "kibKbnAlertingTypesPluginApi", - "section": "def-common.ActionVariable", - "text": "ActionVariable" - }, - "[] | undefined" + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.UseUpdateRuleProps", + "text": "UseUpdateRuleProps" + } ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_update_rule.ts", "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.defaultMessage", - "type": "string", - "tags": [], - "label": "defaultMessage", + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.ActionConnectorFieldsProps", + "type": "Interface", + "tags": [], + "label": "ActionConnectorFieldsProps", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.ActionConnectorFieldsProps.readOnly", + "type": "boolean", + "tags": [], + "label": "readOnly", "description": [], - "signature": [ - "string | undefined" - ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.useDefaultMessage", - "type": "CompoundType", + "id": "def-common.ActionConnectorFieldsProps.isEdit", + "type": "boolean", "tags": [], - "label": "useDefaultMessage", + "label": "isEdit", "description": [], - "signature": [ - "boolean | undefined" - ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.actionConnector", - "type": "CompoundType", + "id": "def-common.ActionConnectorFieldsProps.registerPreSubmitValidator", + "type": "Function", "tags": [], - "label": "actionConnector", + "label": "registerPreSubmitValidator", "description": [], "signature": [ + "(validator: ", { "pluginId": "@kbn/alerts-ui-shared", "scope": "common", "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.ActionConnector", - "text": "ActionConnector" + "section": "def-common.ConnectorValidationFunc", + "text": "ConnectorValidationFunc" }, - ", Record> | undefined" + ") => void" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.ActionConnectorFieldsProps.registerPreSubmitValidator.$1", + "type": "Function", + "tags": [], + "label": "validator", + "description": [], + "signature": [ + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.ConnectorValidationFunc", + "text": "ConnectorValidationFunc" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.ActionConnectorProps", + "type": "Interface", + "tags": [], + "label": "ActionConnectorProps", + "description": [], + "signature": [ + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.ActionConnectorProps", + "text": "ActionConnectorProps" }, + "" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.isLoading", - "type": "CompoundType", + "id": "def-common.ActionConnectorProps.secrets", + "type": "Uncategorized", "tags": [], - "label": "isLoading", + "label": "secrets", "description": [], "signature": [ - "boolean | undefined" + "Secrets" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, @@ -1120,62 +1114,46 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.isDisabled", - "type": "CompoundType", + "id": "def-common.ActionConnectorProps.id", + "type": "string", "tags": [], - "label": "isDisabled", + "label": "id", "description": [], - "signature": [ - "boolean | undefined" - ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.selectedActionGroupId", + "id": "def-common.ActionConnectorProps.actionTypeId", "type": "string", "tags": [], - "label": "selectedActionGroupId", + "label": "actionTypeId", "description": [], - "signature": [ - "string | undefined" - ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.showEmailSubjectAndMessage", - "type": "CompoundType", + "id": "def-common.ActionConnectorProps.name", + "type": "string", "tags": [], - "label": "showEmailSubjectAndMessage", + "label": "name", "description": [], - "signature": [ - "boolean | undefined" - ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.executionMode", - "type": "CompoundType", + "id": "def-common.ActionConnectorProps.referencedByCount", + "type": "number", "tags": [], - "label": "executionMode", + "label": "referencedByCount", "description": [], "signature": [ - { - "pluginId": "@kbn/alerts-ui-shared", - "scope": "common", - "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.ActionConnectorMode", - "text": "ActionConnectorMode" - }, - " | undefined" + "number | undefined" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, @@ -1183,70 +1161,35 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.onBlur", - "type": "Function", + "id": "def-common.ActionConnectorProps.config", + "type": "Uncategorized", "tags": [], - "label": "onBlur", + "label": "config", "description": [], "signature": [ - "((field?: string | undefined) => void) | undefined" + "Config" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.onBlur.$1", - "type": "string", - "tags": [], - "label": "field", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } - ], - "returnComment": [] + "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionParamsProps.producerId", - "type": "string", + "id": "def-common.ActionConnectorProps.isPreconfigured", + "type": "boolean", "tags": [], - "label": "producerId", + "label": "isPreconfigured", "description": [], - "signature": [ - "string | undefined" - ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionReadOnlyElementProps", - "type": "Interface", - "tags": [], - "label": "ActionReadOnlyElementProps", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionReadOnlyElementProps.connectorId", - "type": "string", + "id": "def-common.ActionConnectorProps.isDeprecated", + "type": "boolean", "tags": [], - "label": "connectorId", + "label": "isDeprecated", "description": [], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, @@ -1254,11 +1197,25 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionReadOnlyElementProps.connectorName", - "type": "string", + "id": "def-common.ActionConnectorProps.isSystemAction", + "type": "boolean", "tags": [], - "label": "connectorName", + "label": "isSystemAction", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.ActionConnectorProps.isMissingSecrets", + "type": "CompoundType", + "tags": [], + "label": "isMissingSecrets", "description": [], + "signature": [ + "boolean | undefined" + ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false @@ -1268,20 +1225,20 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel", + "id": "def-common.ActionParamsProps", "type": "Interface", "tags": [], - "label": "ActionTypeModel", + "label": "ActionParamsProps", "description": [], "signature": [ { "pluginId": "@kbn/alerts-ui-shared", "scope": "common", "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.ActionTypeModel", - "text": "ActionTypeModel" + "section": "def-common.ActionParamsProps", + "text": "ActionParamsProps" }, - "" + "" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, @@ -1289,71 +1246,46 @@ "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.id", - "type": "string", + "id": "def-common.ActionParamsProps.actionParams", + "type": "Object", "tags": [], - "label": "id", + "label": "actionParams", "description": [], + "signature": [ + "{ [P in keyof TParams]?: TParams[P] | undefined; }" + ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.iconClass", - "type": "CompoundType", + "id": "def-common.ActionParamsProps.index", + "type": "number", "tags": [], - "label": "iconClass", + "label": "index", "description": [], - "signature": [ - "string | React.ComponentType<{}>" - ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.selectMessage", - "type": "string", - "tags": [], - "label": "selectMessage", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.actionTypeTitle", - "type": "string", - "tags": [], - "label": "actionTypeTitle", - "description": [], - "signature": [ - "string | undefined" - ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.validateParams", + "id": "def-common.ActionParamsProps.editAction", "type": "Function", "tags": [], - "label": "validateParams", + "label": "editAction", "description": [], "signature": [ - "(actionParams: ActionParams) => Promise<", + "(key: string, value: ", { - "pluginId": "@kbn/alerts-ui-shared", + "pluginId": "@kbn/core-saved-objects-common", "scope": "common", - "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.GenericValidationResult", - "text": "GenericValidationResult" + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttribute", + "text": "SavedObjectAttribute" }, - ">" + ", index: number) => void" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, @@ -1361,13 +1293,49 @@ "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.validateParams.$1", - "type": "Uncategorized", + "id": "def-common.ActionParamsProps.editAction.$1", + "type": "string", "tags": [], - "label": "actionParams", + "label": "key", "description": [], "signature": [ - "ActionParams" + "string" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.ActionParamsProps.editAction.$2", + "type": "CompoundType", + "tags": [], + "label": "value", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-saved-objects-common", + "scope": "common", + "docId": "kibKbnCoreSavedObjectsCommonPluginApi", + "section": "def-common.SavedObjectAttribute", + "text": "SavedObjectAttribute" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.ActionParamsProps.editAction.$3", + "type": "number", + "tags": [], + "label": "index", + "description": [], + "signature": [ + "number" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, @@ -1379,21 +1347,19 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.actionConnectorFields", - "type": "CompoundType", + "id": "def-common.ActionParamsProps.errors", + "type": "Object", "tags": [], - "label": "actionConnectorFields", + "label": "errors", "description": [], "signature": [ - "React.LazyExoticComponent> | null" + "section": "def-common.RuleFormParamsErrors", + "text": "RuleFormParamsErrors" + } ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, @@ -1401,84 +1367,34 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.actionParamsFields", - "type": "Function", + "id": "def-common.ActionParamsProps.ruleTypeId", + "type": "string", "tags": [], - "label": "actionParamsFields", + "label": "ruleTypeId", "description": [], "signature": [ - "React.ExoticComponent<(", - { - "pluginId": "@kbn/alerts-ui-shared", - "scope": "common", - "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.ActionParamsProps", - "text": "ActionParamsProps" - }, - " & React.RefAttributes, any, any>>) | (", - { - "pluginId": "@kbn/alerts-ui-shared", - "scope": "common", - "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.ActionParamsProps", - "text": "ActionParamsProps" - }, - " & { children?: React.ReactNode; })> & { readonly _result: React.ComponentType<", - { - "pluginId": "@kbn/alerts-ui-shared", - "scope": "common", - "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.ActionParamsProps", - "text": "ActionParamsProps" - }, - ">; }" + "string | undefined" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.actionParamsFields.$1", - "type": "Uncategorized", - "tags": [], - "label": "props", - "description": [], - "signature": [ - "P" - ], - "path": "node_modules/@types/react/index.d.ts", - "deprecated": false, - "trackAdoption": false - } - ] + "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.actionReadOnlyExtraComponent", - "type": "Function", + "id": "def-common.ActionParamsProps.messageVariables", + "type": "Array", "tags": [], - "label": "actionReadOnlyExtraComponent", + "label": "messageVariables", "description": [], "signature": [ - "React.LazyExoticComponent> | undefined" + "[] | undefined" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, @@ -1486,14 +1402,13 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.defaultActionParams", - "type": "Object", + "id": "def-common.ActionParamsProps.defaultMessage", + "type": "string", "tags": [], - "label": "defaultActionParams", + "label": "defaultMessage", "description": [], "signature": [ - "RecursivePartial", - " | undefined" + "string | undefined" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, @@ -1501,14 +1416,13 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.defaultRecoveredActionParams", - "type": "Object", + "id": "def-common.ActionParamsProps.useDefaultMessage", + "type": "CompoundType", "tags": [], - "label": "defaultRecoveredActionParams", + "label": "useDefaultMessage", "description": [], "signature": [ - "RecursivePartial", - " | undefined" + "boolean | undefined" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, @@ -1516,20 +1430,20 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.customConnectorSelectItem", - "type": "Object", + "id": "def-common.ActionParamsProps.actionConnector", + "type": "CompoundType", "tags": [], - "label": "customConnectorSelectItem", + "label": "actionConnector", "description": [], "signature": [ { "pluginId": "@kbn/alerts-ui-shared", "scope": "common", "docId": "kibKbnAlertsUiSharedPluginApi", - "section": "def-common.CustomConnectorSelectionItem", - "text": "CustomConnectorSelectionItem" + "section": "def-common.ActionConnector", + "text": "ActionConnector" }, - " | undefined" + ", Record> | undefined" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, @@ -1537,10 +1451,10 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.isExperimental", + "id": "def-common.ActionParamsProps.isLoading", "type": "CompoundType", "tags": [], - "label": "isExperimental", + "label": "isLoading", "description": [], "signature": [ "boolean | undefined" @@ -1551,13 +1465,13 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.subtype", - "type": "Array", + "id": "def-common.ActionParamsProps.isDisabled", + "type": "CompoundType", "tags": [], - "label": "subtype", + "label": "isDisabled", "description": [], "signature": [ - "{ id: string; name: string; }[] | undefined" + "boolean | undefined" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, @@ -1565,42 +1479,24 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.convertParamsBetweenGroups", - "type": "Function", + "id": "def-common.ActionParamsProps.selectedActionGroupId", + "type": "string", "tags": [], - "label": "convertParamsBetweenGroups", + "label": "selectedActionGroupId", "description": [], "signature": [ - "((params: ActionParams) => {} | ActionParams) | undefined" + "string | undefined" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.convertParamsBetweenGroups.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "ActionParams" - ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] + "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.hideInUi", + "id": "def-common.ActionParamsProps.showEmailSubjectAndMessage", "type": "CompoundType", "tags": [], - "label": "hideInUi", + "label": "showEmailSubjectAndMessage", "description": [], "signature": [ "boolean | undefined" @@ -1611,13 +1507,20 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.modalWidth", - "type": "number", + "id": "def-common.ActionParamsProps.executionMode", + "type": "CompoundType", "tags": [], - "label": "modalWidth", + "label": "executionMode", "description": [], "signature": [ - "number | undefined" + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.ActionConnectorMode", + "text": "ActionConnectorMode" + }, + " | undefined" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, @@ -1625,68 +1528,47 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.ActionTypeModel.isSystemActionType", - "type": "CompoundType", + "id": "def-common.ActionParamsProps.onBlur", + "type": "Function", "tags": [], - "label": "isSystemActionType", + "label": "onBlur", "description": [], "signature": [ - "boolean | undefined" + "((field?: string | undefined) => void) | undefined" ], "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertFieldsTableProps", - "type": "Interface", - "tags": [], - "label": "AlertFieldsTableProps", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alert_fields_table/index.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertFieldsTableProps.alert", - "type": "CompoundType", - "tags": [], - "label": "alert", - "description": [ - "\nThe raw alert object" - ], - "signature": [ + "trackAdoption": false, + "children": [ { - "pluginId": "@kbn/alerting-types", - "scope": "common", - "docId": "kibKbnAlertingTypesPluginApi", - "section": "def-common.BasicFields", - "text": "BasicFields" - }, - " & { \"@timestamp\"?: string[] | undefined; \"event.action\"?: string[] | undefined; tags?: string[] | undefined; kibana?: string[] | undefined; \"kibana.alert.rule.rule_type_id\"?: string[] | undefined; \"kibana.alert.rule.consumer\"?: string[] | undefined; \"kibana.alert.rule.execution.uuid\"?: string[] | undefined; \"kibana.alert.instance.id\"?: string[] | undefined; \"kibana.alert.rule.category\"?: string[] | undefined; \"kibana.alert.rule.name\"?: string[] | undefined; \"kibana.alert.rule.producer\"?: string[] | undefined; \"kibana.alert.rule.uuid\"?: string[] | undefined; \"kibana.alert.status\"?: string[] | undefined; \"kibana.alert.uuid\"?: string[] | undefined; \"kibana.space_ids\"?: string[] | undefined; \"event.kind\"?: string[] | undefined; \"kibana.alert.action_group\"?: string[] | undefined; \"kibana.alert.case_ids\"?: string[] | undefined; \"kibana.alert.duration.us\"?: string[] | undefined; \"kibana.alert.end\"?: string[] | undefined; \"kibana.alert.flapping\"?: string[] | undefined; \"kibana.alert.maintenance_window_ids\"?: string[] | undefined; \"kibana.alert.reason\"?: string[] | undefined; \"kibana.alert.rule.parameters\"?: string[] | undefined; \"kibana.alert.rule.tags\"?: string[] | undefined; \"kibana.alert.start\"?: string[] | undefined; \"kibana.alert.time_range\"?: string[] | undefined; \"kibana.alert.workflow_assignee_ids\"?: string[] | undefined; \"kibana.alert.workflow_status\"?: string[] | undefined; \"kibana.alert.workflow_tags\"?: string[] | undefined; \"kibana.version\"?: string[] | undefined; \"kibana.alert.context\"?: string[] | undefined; \"kibana.alert.evaluation.threshold\"?: string[] | undefined; \"kibana.alert.evaluation.value\"?: string[] | undefined; \"kibana.alert.evaluation.values\"?: string[] | undefined; \"kibana.alert.group\"?: string[] | undefined; \"ecs.version\"?: string[] | undefined; \"kibana.alert.risk_score\"?: string[] | undefined; \"kibana.alert.rule.author\"?: string[] | undefined; \"kibana.alert.rule.created_at\"?: string[] | undefined; \"kibana.alert.rule.created_by\"?: string[] | undefined; \"kibana.alert.rule.description\"?: string[] | undefined; \"kibana.alert.rule.enabled\"?: string[] | undefined; \"kibana.alert.rule.from\"?: string[] | undefined; \"kibana.alert.rule.interval\"?: string[] | undefined; \"kibana.alert.rule.license\"?: string[] | undefined; \"kibana.alert.rule.note\"?: string[] | undefined; \"kibana.alert.rule.references\"?: string[] | undefined; \"kibana.alert.rule.rule_id\"?: string[] | undefined; \"kibana.alert.rule.rule_name_override\"?: string[] | undefined; \"kibana.alert.rule.to\"?: string[] | undefined; \"kibana.alert.rule.type\"?: string[] | undefined; \"kibana.alert.rule.updated_at\"?: string[] | undefined; \"kibana.alert.rule.updated_by\"?: string[] | undefined; \"kibana.alert.rule.version\"?: string[] | undefined; \"kibana.alert.severity\"?: string[] | undefined; \"kibana.alert.suppression.docs_count\"?: string[] | undefined; \"kibana.alert.suppression.end\"?: string[] | undefined; \"kibana.alert.suppression.start\"?: string[] | undefined; \"kibana.alert.suppression.terms.field\"?: string[] | undefined; \"kibana.alert.suppression.terms.value\"?: string[] | undefined; \"kibana.alert.system_status\"?: string[] | undefined; \"kibana.alert.workflow_reason\"?: string[] | undefined; \"kibana.alert.workflow_user\"?: string[] | undefined; \"event.module\"?: string[] | undefined; \"kibana.alert.rule.threat.framework\"?: string[] | undefined; \"kibana.alert.rule.threat.tactic.id\"?: string[] | undefined; \"kibana.alert.rule.threat.tactic.name\"?: string[] | undefined; \"kibana.alert.rule.threat.tactic.reference\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.id\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.name\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.reference\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.subtechnique.id\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.subtechnique.name\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.subtechnique.reference\"?: string[] | undefined; \"kibana.alert.building_block_type\"?: string[] | undefined; \"kibana.alert\"?: string[] | undefined; \"kibana.alert.group.field\"?: string[] | undefined; \"kibana.alert.group.value\"?: string[] | undefined; \"kibana.alert.rule\"?: string[] | undefined; \"kibana.alert.rule.exceptions_list\"?: string[] | undefined; \"kibana.alert.rule.namespace\"?: string[] | undefined; \"kibana.alert.suppression.terms\"?: string[] | undefined; } & { [x: string]: unknown[]; }" + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.ActionParamsProps.onBlur.$1", + "type": "string", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } ], - "path": "packages/kbn-alerts-ui-shared/src/alert_fields_table/index.tsx", - "deprecated": false, - "trackAdoption": false + "returnComment": [] }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertFieldsTableProps.fields", - "type": "Array", + "id": "def-common.ActionParamsProps.producerId", + "type": "string", "tags": [], - "label": "fields", - "description": [ - "\nA list of alert field keys to be shown in the table.\nWhen not defined, all the fields are shown." - ], + "label": "producerId", + "description": [], "signature": [ - "(string | number)[] | undefined" + "string | undefined" ], - "path": "packages/kbn-alerts-ui-shared/src/alert_fields_table/index.tsx", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false } @@ -1695,40 +1577,34 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertLifecycleStatusBadgeProps", + "id": "def-common.ActionReadOnlyElementProps", "type": "Interface", "tags": [], - "label": "AlertLifecycleStatusBadgeProps", + "label": "ActionReadOnlyElementProps", "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alert_lifecycle_status_badge/index.tsx", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertLifecycleStatusBadgeProps.alertStatus", - "type": "CompoundType", + "id": "def-common.ActionReadOnlyElementProps.connectorId", + "type": "string", "tags": [], - "label": "alertStatus", + "label": "connectorId", "description": [], - "signature": [ - "\"recovered\" | \"active\" | \"untracked\"" - ], - "path": "packages/kbn-alerts-ui-shared/src/alert_lifecycle_status_badge/index.tsx", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertLifecycleStatusBadgeProps.flapping", - "type": "CompoundType", + "id": "def-common.ActionReadOnlyElementProps.connectorName", + "type": "string", "tags": [], - "label": "flapping", + "label": "connectorName", "description": [], - "signature": [ - "string | boolean | undefined" - ], - "path": "packages/kbn-alerts-ui-shared/src/alert_lifecycle_status_badge/index.tsx", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false } @@ -1737,364 +1613,326 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps", + "id": "def-common.ActionTypeModel", "type": "Interface", "tags": [], - "label": "AlertsSearchBarProps", + "label": "ActionTypeModel", "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "signature": [ + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.ActionTypeModel", + "text": "ActionTypeModel" + }, + "" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.appName", + "id": "def-common.ActionTypeModel.id", "type": "string", "tags": [], - "label": "appName", + "label": "id", "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.disableQueryLanguageSwitcher", + "id": "def-common.ActionTypeModel.iconClass", "type": "CompoundType", "tags": [], - "label": "disableQueryLanguageSwitcher", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.featureIds", - "type": "Array", - "tags": [], - "label": "featureIds", - "description": [], - "signature": [ - { - "pluginId": "@kbn/rule-data-utils", - "scope": "common", - "docId": "kibKbnRuleDataUtilsPluginApi", - "section": "def-common.AlertConsumers", - "text": "AlertConsumers" - }, - "[]" - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.rangeFrom", - "type": "string", - "tags": [], - "label": "rangeFrom", + "label": "iconClass", "description": [], "signature": [ - "string | undefined" + "string | React.ComponentType<{}>" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.rangeTo", + "id": "def-common.ActionTypeModel.selectMessage", "type": "string", "tags": [], - "label": "rangeTo", + "label": "selectMessage", "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.query", + "id": "def-common.ActionTypeModel.actionTypeTitle", "type": "string", "tags": [], - "label": "query", + "label": "actionTypeTitle", "description": [], "signature": [ "string | undefined" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.filters", - "type": "Array", + "id": "def-common.ActionTypeModel.validateParams", + "type": "Function", "tags": [], - "label": "filters", + "label": "validateParams", "description": [], "signature": [ + "(actionParams: ActionParams) => Promise<", { - "pluginId": "@kbn/es-query", + "pluginId": "@kbn/alerts-ui-shared", "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Filter", - "text": "Filter" + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.GenericValidationResult", + "text": "GenericValidationResult" }, - "[] | undefined" + ">" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.ActionTypeModel.validateParams.$1", + "type": "Uncategorized", + "tags": [], + "label": "actionParams", + "description": [], + "signature": [ + "ActionParams" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.showFilterBar", + "id": "def-common.ActionTypeModel.actionConnectorFields", "type": "CompoundType", "tags": [], - "label": "showFilterBar", + "label": "actionConnectorFields", "description": [], "signature": [ - "boolean | undefined" + "React.LazyExoticComponent> | null" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.showDatePicker", - "type": "CompoundType", + "id": "def-common.ActionTypeModel.actionParamsFields", + "type": "Function", "tags": [], - "label": "showDatePicker", + "label": "actionParamsFields", "description": [], "signature": [ - "boolean | undefined" - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "React.ExoticComponent<(", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.ActionParamsProps", + "text": "ActionParamsProps" + }, + " & React.RefAttributes, any, any>>) | (", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.ActionParamsProps", + "text": "ActionParamsProps" + }, + " & { children?: React.ReactNode; })> & { readonly _result: React.ComponentType<", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.ActionParamsProps", + "text": "ActionParamsProps" + }, + ">; }" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, - "trackAdoption": false + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.ActionTypeModel.actionParamsFields.$1", + "type": "Uncategorized", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "P" + ], + "path": "node_modules/@types/react/index.d.ts", + "deprecated": false, + "trackAdoption": false + } + ] }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.showSubmitButton", - "type": "CompoundType", + "id": "def-common.ActionTypeModel.actionReadOnlyExtraComponent", + "type": "Function", "tags": [], - "label": "showSubmitButton", + "label": "actionReadOnlyExtraComponent", "description": [], "signature": [ - "boolean | undefined" + "React.LazyExoticComponent> | undefined" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.placeholder", - "type": "string", + "id": "def-common.ActionTypeModel.defaultActionParams", + "type": "Object", "tags": [], - "label": "placeholder", + "label": "defaultActionParams", "description": [], "signature": [ - "string | undefined" + "RecursivePartial", + " | undefined" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.submitOnBlur", - "type": "CompoundType", + "id": "def-common.ActionTypeModel.defaultRecoveredActionParams", + "type": "Object", "tags": [], - "label": "submitOnBlur", + "label": "defaultRecoveredActionParams", "description": [], "signature": [ - "boolean | undefined" + "RecursivePartial", + " | undefined" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.ruleTypeId", - "type": "string", + "id": "def-common.ActionTypeModel.customConnectorSelectItem", + "type": "Object", "tags": [], - "label": "ruleTypeId", + "label": "customConnectorSelectItem", "description": [], "signature": [ - "string | undefined" + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.CustomConnectorSelectionItem", + "text": "CustomConnectorSelectionItem" + }, + " | undefined" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.onQueryChange", - "type": "Function", + "id": "def-common.ActionTypeModel.isExperimental", + "type": "CompoundType", "tags": [], - "label": "onQueryChange", + "label": "isExperimental", "description": [], "signature": [ - "((query: { dateRange: { from: string; to: string; mode?: \"absolute\" | \"relative\" | undefined; }; query?: string | undefined; }) => void) | undefined" + "boolean | undefined" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.onQueryChange.$1", - "type": "Object", - "tags": [], - "label": "query", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.onQueryChange.$1.dateRange", - "type": "Object", - "tags": [], - "label": "dateRange", - "description": [], - "signature": [ - "{ from: string; to: string; mode?: \"absolute\" | \"relative\" | undefined; }" - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.onQueryChange.$1.query", - "type": "string", - "tags": [], - "label": "query", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", - "deprecated": false, - "trackAdoption": false - } - ] - } - ], - "returnComment": [] + "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.onQuerySubmit", - "type": "Function", + "id": "def-common.ActionTypeModel.subtype", + "type": "Array", "tags": [], - "label": "onQuerySubmit", + "label": "subtype", "description": [], "signature": [ - "(query: { dateRange: { from: string; to: string; mode?: \"absolute\" | \"relative\" | undefined; }; query?: string | undefined; }) => void" + "{ id: string; name: string; }[] | undefined" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.onQuerySubmit.$1", - "type": "Object", - "tags": [], - "label": "query", - "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.onQuerySubmit.$1.dateRange", - "type": "Object", - "tags": [], - "label": "dateRange", - "description": [], - "signature": [ - "{ from: string; to: string; mode?: \"absolute\" | \"relative\" | undefined; }" - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.onQuerySubmit.$1.query", - "type": "string", - "tags": [], - "label": "query", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", - "deprecated": false, - "trackAdoption": false - } - ] - } - ], - "returnComment": [] + "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.onFiltersUpdated", + "id": "def-common.ActionTypeModel.convertParamsBetweenGroups", "type": "Function", "tags": [], - "label": "onFiltersUpdated", + "label": "convertParamsBetweenGroups", "description": [], "signature": [ - "((filters: ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Filter", - "text": "Filter" - }, - "[]) => void) | undefined" + "((params: ActionParams) => {} | ActionParams) | undefined" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.onFiltersUpdated.$1", - "type": "Array", + "id": "def-common.ActionTypeModel.convertParamsBetweenGroups.$1", + "type": "Uncategorized", "tags": [], - "label": "filters", + "label": "params", "description": [], "signature": [ - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Filter", - "text": "Filter" - }, - "[]" + "ActionParams" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2104,39 +1942,175 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.http", - "type": "Object", + "id": "def-common.ActionTypeModel.hideInUi", + "type": "CompoundType", "tags": [], - "label": "http", + "label": "hideInUi", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.ActionTypeModel.modalWidth", + "type": "number", + "tags": [], + "label": "modalWidth", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.ActionTypeModel.isSystemActionType", + "type": "CompoundType", + "tags": [], + "label": "isSystemActionType", "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertFieldsTableProps", + "type": "Interface", + "tags": [], + "label": "AlertFieldsTableProps", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/alert_fields_table/index.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertFieldsTableProps.alert", + "type": "CompoundType", + "tags": [], + "label": "alert", + "description": [ + "\nThe raw alert object" + ], "signature": [ { - "pluginId": "@kbn/core-http-browser", + "pluginId": "@kbn/alerting-types", "scope": "common", - "docId": "kibKbnCoreHttpBrowserPluginApi", - "section": "def-common.HttpSetup", - "text": "HttpSetup" - } + "docId": "kibKbnAlertingTypesPluginApi", + "section": "def-common.BasicFields", + "text": "BasicFields" + }, + " & { \"@timestamp\"?: string[] | undefined; \"event.action\"?: string[] | undefined; tags?: string[] | undefined; kibana?: string[] | undefined; \"kibana.alert.rule.rule_type_id\"?: string[] | undefined; \"kibana.alert.rule.consumer\"?: string[] | undefined; \"kibana.alert.rule.execution.uuid\"?: string[] | undefined; \"kibana.alert.instance.id\"?: string[] | undefined; \"kibana.alert.rule.category\"?: string[] | undefined; \"kibana.alert.rule.name\"?: string[] | undefined; \"kibana.alert.rule.producer\"?: string[] | undefined; \"kibana.alert.rule.uuid\"?: string[] | undefined; \"kibana.alert.status\"?: string[] | undefined; \"kibana.alert.uuid\"?: string[] | undefined; \"kibana.space_ids\"?: string[] | undefined; \"event.kind\"?: string[] | undefined; \"kibana.alert.action_group\"?: string[] | undefined; \"kibana.alert.case_ids\"?: string[] | undefined; \"kibana.alert.duration.us\"?: string[] | undefined; \"kibana.alert.end\"?: string[] | undefined; \"kibana.alert.flapping\"?: string[] | undefined; \"kibana.alert.maintenance_window_ids\"?: string[] | undefined; \"kibana.alert.reason\"?: string[] | undefined; \"kibana.alert.rule.parameters\"?: string[] | undefined; \"kibana.alert.rule.tags\"?: string[] | undefined; \"kibana.alert.start\"?: string[] | undefined; \"kibana.alert.time_range\"?: string[] | undefined; \"kibana.alert.workflow_assignee_ids\"?: string[] | undefined; \"kibana.alert.workflow_status\"?: string[] | undefined; \"kibana.alert.workflow_tags\"?: string[] | undefined; \"kibana.version\"?: string[] | undefined; \"kibana.alert.context\"?: string[] | undefined; \"kibana.alert.evaluation.threshold\"?: string[] | undefined; \"kibana.alert.evaluation.value\"?: string[] | undefined; \"kibana.alert.evaluation.values\"?: string[] | undefined; \"kibana.alert.group\"?: string[] | undefined; \"ecs.version\"?: string[] | undefined; \"kibana.alert.risk_score\"?: string[] | undefined; \"kibana.alert.rule.author\"?: string[] | undefined; \"kibana.alert.rule.created_at\"?: string[] | undefined; \"kibana.alert.rule.created_by\"?: string[] | undefined; \"kibana.alert.rule.description\"?: string[] | undefined; \"kibana.alert.rule.enabled\"?: string[] | undefined; \"kibana.alert.rule.from\"?: string[] | undefined; \"kibana.alert.rule.interval\"?: string[] | undefined; \"kibana.alert.rule.license\"?: string[] | undefined; \"kibana.alert.rule.note\"?: string[] | undefined; \"kibana.alert.rule.references\"?: string[] | undefined; \"kibana.alert.rule.rule_id\"?: string[] | undefined; \"kibana.alert.rule.rule_name_override\"?: string[] | undefined; \"kibana.alert.rule.to\"?: string[] | undefined; \"kibana.alert.rule.type\"?: string[] | undefined; \"kibana.alert.rule.updated_at\"?: string[] | undefined; \"kibana.alert.rule.updated_by\"?: string[] | undefined; \"kibana.alert.rule.version\"?: string[] | undefined; \"kibana.alert.severity\"?: string[] | undefined; \"kibana.alert.suppression.docs_count\"?: string[] | undefined; \"kibana.alert.suppression.end\"?: string[] | undefined; \"kibana.alert.suppression.start\"?: string[] | undefined; \"kibana.alert.suppression.terms.field\"?: string[] | undefined; \"kibana.alert.suppression.terms.value\"?: string[] | undefined; \"kibana.alert.system_status\"?: string[] | undefined; \"kibana.alert.workflow_reason\"?: string[] | undefined; \"kibana.alert.workflow_user\"?: string[] | undefined; \"event.module\"?: string[] | undefined; \"kibana.alert.rule.threat.framework\"?: string[] | undefined; \"kibana.alert.rule.threat.tactic.id\"?: string[] | undefined; \"kibana.alert.rule.threat.tactic.name\"?: string[] | undefined; \"kibana.alert.rule.threat.tactic.reference\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.id\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.name\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.reference\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.subtechnique.id\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.subtechnique.name\"?: string[] | undefined; \"kibana.alert.rule.threat.technique.subtechnique.reference\"?: string[] | undefined; \"kibana.alert.building_block_type\"?: string[] | undefined; \"kibana.alert\"?: string[] | undefined; \"kibana.alert.group.field\"?: string[] | undefined; \"kibana.alert.group.value\"?: string[] | undefined; \"kibana.alert.rule\"?: string[] | undefined; \"kibana.alert.rule.exceptions_list\"?: string[] | undefined; \"kibana.alert.rule.namespace\"?: string[] | undefined; \"kibana.alert.suppression.terms\"?: string[] | undefined; } & { [x: string]: unknown[]; }" + ], + "path": "packages/kbn-alerts-ui-shared/src/alert_fields_table/index.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertFieldsTableProps.fields", + "type": "Array", + "tags": [], + "label": "fields", + "description": [ + "\nA list of alert field keys to be shown in the table.\nWhen not defined, all the fields are shown." + ], + "signature": [ + "(string | number)[] | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alert_fields_table/index.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertLifecycleStatusBadgeProps", + "type": "Interface", + "tags": [], + "label": "AlertLifecycleStatusBadgeProps", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/alert_lifecycle_status_badge/index.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertLifecycleStatusBadgeProps.alertStatus", + "type": "CompoundType", + "tags": [], + "label": "alertStatus", + "description": [], + "signature": [ + "\"recovered\" | \"active\" | \"untracked\"" + ], + "path": "packages/kbn-alerts-ui-shared/src/alert_lifecycle_status_badge/index.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertLifecycleStatusBadgeProps.flapping", + "type": "CompoundType", + "tags": [], + "label": "flapping", + "description": [], + "signature": [ + "string | boolean | undefined" ], + "path": "packages/kbn-alerts-ui-shared/src/alert_lifecycle_status_badge/index.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps", + "type": "Interface", + "tags": [], + "label": "AlertsSearchBarProps", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.appName", + "type": "string", + "tags": [], + "label": "appName", + "description": [], "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.toasts", - "type": "Object", + "id": "def-common.AlertsSearchBarProps.disableQueryLanguageSwitcher", + "type": "CompoundType", "tags": [], - "label": "toasts", + "label": "disableQueryLanguageSwitcher", "description": [], "signature": [ - { - "pluginId": "@kbn/core-notifications-browser", - "scope": "common", - "docId": "kibKbnCoreNotificationsBrowserPluginApi", - "section": "def-common.IToasts", - "text": "IToasts" - } + "boolean | undefined" ], "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", "deprecated": false, @@ -2144,93 +2118,464 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.unifiedSearchBar", - "type": "Function", + "id": "def-common.AlertsSearchBarProps.featureIds", + "type": "Array", "tags": [], - "label": "unifiedSearchBar", + "label": "featureIds", "description": [], "signature": [ - "(props: ", - { - "pluginId": "unifiedSearch", - "scope": "public", - "docId": "kibUnifiedSearchPluginApi", - "section": "def-public.StatefulSearchBarProps", - "text": "StatefulSearchBarProps" - }, - "<", { - "pluginId": "@kbn/es-query", + "pluginId": "@kbn/rule-data-utils", "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Query", - "text": "Query" + "docId": "kibKbnRuleDataUtilsPluginApi", + "section": "def-common.AlertConsumers", + "text": "AlertConsumers" }, - ">) => React.ReactElement>" + "[]" ], "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.unifiedSearchBar.$1", - "type": "CompoundType", - "tags": [], - "label": "props", - "description": [], - "signature": [ - "Omit<", - "SearchBarOwnProps", - "<", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Query", - "text": "Query" - }, - ">, \"showSaveQuery\"> & { appName: string; useDefaultBehaviors?: boolean | undefined; savedQueryId?: string | undefined; saveQueryMenuVisibility?: ", - "SavedQueryMenuVisibility", - " | undefined; onSavedQueryIdChange?: ((savedQueryId?: string | undefined) => void) | undefined; onFiltersUpdated?: ((filters: ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Filter", - "text": "Filter" - }, - "[]) => void) | undefined; }" - ], - "path": "src/plugins/unified_search/public/types.ts", - "deprecated": false, - "trackAdoption": false - } - ] + "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.AlertsSearchBarProps.dataViewsService", - "type": "Object", + "id": "def-common.AlertsSearchBarProps.rangeFrom", + "type": "string", "tags": [], - "label": "dataViewsService", + "label": "rangeFrom", "description": [], "signature": [ - "{ create: (spec: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewSpec", - "text": "DataViewSpec" - }, - ", skipFetchFields?: boolean, displayErrors?: boolean) => Promise<", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", + "string | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.rangeTo", + "type": "string", + "tags": [], + "label": "rangeTo", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.query", + "type": "string", + "tags": [], + "label": "query", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.filters", + "type": "Array", + "tags": [], + "label": "filters", + "description": [], + "signature": [ + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[] | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.showFilterBar", + "type": "CompoundType", + "tags": [], + "label": "showFilterBar", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.showDatePicker", + "type": "CompoundType", + "tags": [], + "label": "showDatePicker", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.showSubmitButton", + "type": "CompoundType", + "tags": [], + "label": "showSubmitButton", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.placeholder", + "type": "string", + "tags": [], + "label": "placeholder", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.submitOnBlur", + "type": "CompoundType", + "tags": [], + "label": "submitOnBlur", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.ruleTypeId", + "type": "string", + "tags": [], + "label": "ruleTypeId", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.onQueryChange", + "type": "Function", + "tags": [], + "label": "onQueryChange", + "description": [], + "signature": [ + "((query: { dateRange: { from: string; to: string; mode?: \"absolute\" | \"relative\" | undefined; }; query?: string | undefined; }) => void) | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.onQueryChange.$1", + "type": "Object", + "tags": [], + "label": "query", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.onQueryChange.$1.dateRange", + "type": "Object", + "tags": [], + "label": "dateRange", + "description": [], + "signature": [ + "{ from: string; to: string; mode?: \"absolute\" | \"relative\" | undefined; }" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.onQueryChange.$1.query", + "type": "string", + "tags": [], + "label": "query", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.onQuerySubmit", + "type": "Function", + "tags": [], + "label": "onQuerySubmit", + "description": [], + "signature": [ + "(query: { dateRange: { from: string; to: string; mode?: \"absolute\" | \"relative\" | undefined; }; query?: string | undefined; }) => void" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.onQuerySubmit.$1", + "type": "Object", + "tags": [], + "label": "query", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.onQuerySubmit.$1.dateRange", + "type": "Object", + "tags": [], + "label": "dateRange", + "description": [], + "signature": [ + "{ from: string; to: string; mode?: \"absolute\" | \"relative\" | undefined; }" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.onQuerySubmit.$1.query", + "type": "string", + "tags": [], + "label": "query", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.onFiltersUpdated", + "type": "Function", + "tags": [], + "label": "onFiltersUpdated", + "description": [], + "signature": [ + "((filters: ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[]) => void) | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.onFiltersUpdated.$1", + "type": "Array", + "tags": [], + "label": "filters", + "description": [], + "signature": [ + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[]" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.http", + "type": "Object", + "tags": [], + "label": "http", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.toasts", + "type": "Object", + "tags": [], + "label": "toasts", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.unifiedSearchBar", + "type": "Function", + "tags": [], + "label": "unifiedSearchBar", + "description": [], + "signature": [ + "(props: ", + { + "pluginId": "unifiedSearch", + "scope": "public", + "docId": "kibUnifiedSearchPluginApi", + "section": "def-public.StatefulSearchBarProps", + "text": "StatefulSearchBarProps" + }, + "<", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, + ">) => React.ReactElement>" + ], + "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/types.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.unifiedSearchBar.$1", + "type": "CompoundType", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "Omit<", + "SearchBarOwnProps", + "<", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" + }, + ">, \"showSaveQuery\"> & { appName: string; useDefaultBehaviors?: boolean | undefined; savedQueryId?: string | undefined; saveQueryMenuVisibility?: ", + "SavedQueryMenuVisibility", + " | undefined; onSavedQueryIdChange?: ((savedQueryId?: string | undefined) => void) | undefined; onFiltersUpdated?: ((filters: ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[]) => void) | undefined; }" + ], + "path": "src/plugins/unified_search/public/types.ts", + "deprecated": false, + "trackAdoption": false + } + ] + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.AlertsSearchBarProps.dataViewsService", + "type": "Object", + "tags": [], + "label": "dataViewsService", + "description": [], + "signature": [ + "{ create: (spec: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + ", skipFetchFields?: boolean, displayErrors?: boolean) => Promise<", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataView", "text": "DataView" }, ">; get: (id: string, displayErrors?: boolean, refreshFields?: boolean) => Promise<", @@ -3128,15 +3473,62 @@ "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.GenericValidationResult.errors", - "type": "Object", + "id": "def-common.GenericValidationResult.errors", + "type": "Object", + "tags": [], + "label": "errors", + "description": [], + "signature": [ + "{ [P in Extract]: unknown; }" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.HealthStatus", + "type": "Interface", + "tags": [], + "label": "HealthStatus", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_health_check.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.HealthStatus.isRulesAvailable", + "type": "boolean", "tags": [], - "label": "errors", + "label": "isRulesAvailable", "description": [], - "signature": [ - "{ [P in Extract]: unknown; }" - ], - "path": "packages/kbn-alerts-ui-shared/src/common/types/action_types.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_health_check.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.HealthStatus.isSufficientlySecure", + "type": "boolean", + "tags": [], + "label": "isSufficientlySecure", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_health_check.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.HealthStatus.hasPermanentEncryptionKey", + "type": "boolean", + "tags": [], + "label": "hasPermanentEncryptionKey", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_health_check.tsx", "deprecated": false, "trackAdoption": false } @@ -3947,7 +4339,7 @@ "tags": [], "label": "UseAlertDataViewProps", "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_alert_data_view.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_alert_data_view.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3968,7 +4360,7 @@ }, "[]" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_alert_data_view.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_alert_data_view.ts", "deprecated": false, "trackAdoption": false }, @@ -3988,7 +4380,7 @@ "text": "HttpSetup" } ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_alert_data_view.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_alert_data_view.ts", "deprecated": false, "trackAdoption": false }, @@ -4234,91 +4626,625 @@ }, ">; createSavedObject: (dataView: ", { - "pluginId": "dataViews", + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.AbstractDataView", + "text": "AbstractDataView" + }, + ", overwrite?: boolean) => Promise; updateSavedObject: (indexPattern: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.AbstractDataView", + "text": "AbstractDataView" + }, + ", saveAttempts?: number, ignoreErrors?: boolean, displayErrors?: boolean) => Promise; defaultDataViewExists: () => Promise; getDefaultDataViewLazy: () => Promise<", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewLazy", + "text": "DataViewLazy" + }, + " | null>; getDefaultDataView: (options?: { displayErrors?: boolean | undefined; refreshFields?: boolean | undefined; }) => Promise<", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + " | null>; toDataView: (dataViewLazy: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewLazy", + "text": "DataViewLazy" + }, + ") => Promise<", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; toDataViewLazy: (dataView: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ") => Promise<", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewLazy", + "text": "DataViewLazy" + }, + ">; }" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_alert_data_view.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseAlertDataViewProps.toasts", + "type": "Object", + "tags": [], + "label": "toasts", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_alert_data_view.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseAlertDataViewResult", + "type": "Interface", + "tags": [], + "label": "UseAlertDataViewResult", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_alert_data_view.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseAlertDataViewResult.dataViews", + "type": "Array", + "tags": [], + "label": "dataViews", + "description": [], + "signature": [ + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + "[] | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_alert_data_view.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseAlertDataViewResult.loading", + "type": "boolean", + "tags": [], + "label": "loading", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_alert_data_view.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseCreateRuleProps", + "type": "Interface", + "tags": [], + "label": "UseCreateRuleProps", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_create_rule.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseCreateRuleProps.http", + "type": "Object", + "tags": [], + "label": "http", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_create_rule.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseCreateRuleProps.onSuccess", + "type": "Function", + "tags": [], + "label": "onSuccess", + "description": [], + "signature": [ + "((formData: ", + "CreateRuleBody", + "<", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.RuleTypeParams", + "text": "RuleTypeParams" + }, + ">) => void) | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_create_rule.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseCreateRuleProps.onSuccess.$1", + "type": "Object", + "tags": [], + "label": "formData", + "description": [], + "signature": [ + "CreateRuleBody", + "<", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.RuleTypeParams", + "text": "RuleTypeParams" + }, + ">" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_create_rule.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseCreateRuleProps.onError", + "type": "Function", + "tags": [], + "label": "onError", + "description": [], + "signature": [ + "((error: ", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpFetchError", + "text": "IHttpFetchError" + }, + "<{ message: string; }>) => void) | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_create_rule.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseCreateRuleProps.onError.$1", + "type": "Object", + "tags": [], + "label": "error", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpFetchError", + "text": "IHttpFetchError" + }, + "<{ message: string; }>" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_create_rule.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseFindAlertsQueryProps", + "type": "Interface", + "tags": [], + "label": "UseFindAlertsQueryProps", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_find_alerts_query.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseFindAlertsQueryProps.http", + "type": "Object", + "tags": [], + "label": "http", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-browser", "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.AbstractDataView", - "text": "AbstractDataView" - }, - ", overwrite?: boolean) => Promise; updateSavedObject: (indexPattern: ", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_find_alerts_query.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseFindAlertsQueryProps.toasts", + "type": "Object", + "tags": [], + "label": "toasts", + "description": [], + "signature": [ { - "pluginId": "dataViews", + "pluginId": "@kbn/core-notifications-browser", "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.AbstractDataView", - "text": "AbstractDataView" - }, - ", saveAttempts?: number, ignoreErrors?: boolean, displayErrors?: boolean) => Promise; defaultDataViewExists: () => Promise; getDefaultDataViewLazy: () => Promise<", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_find_alerts_query.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseFindAlertsQueryProps.enabled", + "type": "CompoundType", + "tags": [], + "label": "enabled", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_find_alerts_query.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseFindAlertsQueryProps.params", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "{ trackTotalHits?: boolean | undefined; } & ", + "SearchRequest", + " & { feature_ids?: string[] | undefined; }" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_find_alerts_query.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseGetAlertsGroupAggregationsQueryProps", + "type": "Interface", + "tags": [], + "label": "UseGetAlertsGroupAggregationsQueryProps", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseGetAlertsGroupAggregationsQueryProps.http", + "type": "Object", + "tags": [], + "label": "http", + "description": [], + "signature": [ { - "pluginId": "dataViews", + "pluginId": "@kbn/core-http-browser", "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewLazy", - "text": "DataViewLazy" - }, - " | null>; getDefaultDataView: (options?: { displayErrors?: boolean | undefined; refreshFields?: boolean | undefined; }) => Promise<", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseGetAlertsGroupAggregationsQueryProps.toasts", + "type": "Object", + "tags": [], + "label": "toasts", + "description": [], + "signature": [ { - "pluginId": "dataViews", + "pluginId": "@kbn/core-notifications-browser", "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - " | null>; toDataView: (dataViewLazy: ", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseGetAlertsGroupAggregationsQueryProps.enabled", + "type": "CompoundType", + "tags": [], + "label": "enabled", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseGetAlertsGroupAggregationsQueryProps.params", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "{ featureIds: ", { - "pluginId": "dataViews", + "pluginId": "@kbn/rule-data-utils", "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewLazy", - "text": "DataViewLazy" + "docId": "kibKbnRuleDataUtilsPluginApi", + "section": "def-common.AlertConsumers", + "text": "AlertConsumers" }, - ") => Promise<", + "[]; groupByField: string; aggregations?: Record | undefined; filters?: ", + "QueryDslQueryContainer", + "[] | undefined; sort?: ", + "SortCombinations", + "[] | undefined; pageIndex?: number | undefined; pageSize?: number | undefined; }" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseHealthCheckProps", + "type": "Interface", + "tags": [], + "label": "UseHealthCheckProps", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_health_check.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseHealthCheckProps.http", + "type": "Object", + "tags": [], + "label": "http", + "description": [], + "signature": [ { - "pluginId": "dataViews", + "pluginId": "@kbn/core-http-browser", "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - ">; toDataViewLazy: (dataView: ", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_health_check.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseHealthCheckResult", + "type": "Interface", + "tags": [], + "label": "UseHealthCheckResult", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_health_check.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseHealthCheckResult.isLoading", + "type": "boolean", + "tags": [], + "label": "isLoading", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_health_check.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseHealthCheckResult.healthCheckError", + "type": "CompoundType", + "tags": [], + "label": "healthCheckError", + "description": [], + "signature": [ + "HealthCheckErrors", + " | null" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_health_check.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseLoadAlertingFrameworkHealthProps", + "type": "Interface", + "tags": [], + "label": "UseLoadAlertingFrameworkHealthProps", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_alerting_framework_health.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseLoadAlertingFrameworkHealthProps.http", + "type": "Object", + "tags": [], + "label": "http", + "description": [], + "signature": [ { - "pluginId": "dataViews", + "pluginId": "@kbn/core-http-browser", "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - ") => Promise<", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_alerting_framework_health.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseLoadUiConfigProps", + "type": "Interface", + "tags": [], + "label": "UseLoadUiConfigProps", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_ui_config.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseLoadUiConfigProps.http", + "type": "Object", + "tags": [], + "label": "http", + "description": [], + "signature": [ { - "pluginId": "dataViews", + "pluginId": "@kbn/core-http-browser", "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataViewLazy", - "text": "DataViewLazy" - }, - ">; }" + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_alert_data_view.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_ui_config.ts", "deprecated": false, "trackAdoption": false - }, + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseLoadUiHealthProps", + "type": "Interface", + "tags": [], + "label": "UseLoadUiHealthProps", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_ui_health.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.UseAlertDataViewProps.toasts", + "id": "def-common.UseLoadUiHealthProps.http", "type": "Object", "tags": [], - "label": "toasts", + "label": "http", "description": [], "signature": [ { - "pluginId": "@kbn/core-notifications-browser", + "pluginId": "@kbn/core-http-browser", "scope": "common", - "docId": "kibKbnCoreNotificationsBrowserPluginApi", - "section": "def-common.IToasts", - "text": "IToasts" + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" } ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_alert_data_view.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_ui_health.ts", "deprecated": false, "trackAdoption": false } @@ -4327,44 +5253,46 @@ }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.UseAlertDataViewResult", + "id": "def-common.UseResolveProps", "type": "Interface", "tags": [], - "label": "UseAlertDataViewResult", + "label": "UseResolveProps", "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_alert_data_view.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_resolve_rule.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.UseAlertDataViewResult.dataViews", - "type": "Array", + "id": "def-common.UseResolveProps.http", + "type": "Object", "tags": [], - "label": "dataViews", + "label": "http", "description": [], "signature": [ { - "pluginId": "dataViews", + "pluginId": "@kbn/core-http-browser", "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - "[] | undefined" + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_alert_data_view.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_resolve_rule.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/alerts-ui-shared", - "id": "def-common.UseAlertDataViewResult.loading", - "type": "boolean", + "id": "def-common.UseResolveProps.id", + "type": "string", "tags": [], - "label": "loading", + "label": "id", "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_alert_data_view.ts", + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_resolve_rule.ts", "deprecated": false, "trackAdoption": false } @@ -4378,7 +5306,7 @@ "tags": [], "label": "UseRuleAADFieldsProps", "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_rule_aad_fields.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_rule_aad_fields.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4392,7 +5320,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_rule_aad_fields.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_rule_aad_fields.ts", "deprecated": false, "trackAdoption": false }, @@ -4412,7 +5340,7 @@ "text": "HttpSetup" } ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_rule_aad_fields.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_rule_aad_fields.ts", "deprecated": false, "trackAdoption": false }, @@ -4432,7 +5360,7 @@ "text": "IToasts" } ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_rule_aad_fields.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_rule_aad_fields.ts", "deprecated": false, "trackAdoption": false } @@ -4446,7 +5374,7 @@ "tags": [], "label": "UseRuleAADFieldsResult", "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_rule_aad_fields.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_rule_aad_fields.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4467,7 +5395,7 @@ }, "[]" ], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_rule_aad_fields.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_rule_aad_fields.ts", "deprecated": false, "trackAdoption": false }, @@ -4478,9 +5406,237 @@ "tags": [], "label": "loading", "description": [], - "path": "packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_rule_aad_fields.ts", + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_rule_aad_fields.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseRuleTypesProps", + "type": "Interface", + "tags": [], + "label": "UseRuleTypesProps", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_rule_types_query.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseRuleTypesProps.http", + "type": "Object", + "tags": [], + "label": "http", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_rule_types_query.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseRuleTypesProps.toasts", + "type": "Object", + "tags": [], + "label": "toasts", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "common", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-common.IToasts", + "text": "IToasts" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_rule_types_query.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseRuleTypesProps.filteredRuleTypes", + "type": "Array", + "tags": [], + "label": "filteredRuleTypes", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_rule_types_query.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseRuleTypesProps.registeredRuleTypes", + "type": "Array", + "tags": [], + "label": "registeredRuleTypes", + "description": [], + "signature": [ + "{ id: string; description: string; }[] | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_rule_types_query.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseRuleTypesProps.enabled", + "type": "CompoundType", + "tags": [], + "label": "enabled", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_load_rule_types_query.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseUpdateRuleProps", + "type": "Interface", + "tags": [], + "label": "UseUpdateRuleProps", + "description": [], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_update_rule.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseUpdateRuleProps.http", + "type": "Object", + "tags": [], + "label": "http", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.HttpSetup", + "text": "HttpSetup" + } + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_update_rule.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseUpdateRuleProps.onSuccess", + "type": "Function", + "tags": [], + "label": "onSuccess", + "description": [], + "signature": [ + "((formData: ", + "UpdateRuleBody", + "<", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.RuleTypeParams", + "text": "RuleTypeParams" + }, + ">) => void) | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_update_rule.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseUpdateRuleProps.onSuccess.$1", + "type": "Object", + "tags": [], + "label": "formData", + "description": [], + "signature": [ + "UpdateRuleBody", + "<", + { + "pluginId": "@kbn/alerts-ui-shared", + "scope": "common", + "docId": "kibKbnAlertsUiSharedPluginApi", + "section": "def-common.RuleTypeParams", + "text": "RuleTypeParams" + }, + ">" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_update_rule.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseUpdateRuleProps.onError", + "type": "Function", + "tags": [], + "label": "onError", + "description": [], + "signature": [ + "((error: ", + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpFetchError", + "text": "IHttpFetchError" + }, + "<{ message: string; }>) => void) | undefined" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_update_rule.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/alerts-ui-shared", + "id": "def-common.UseUpdateRuleProps.onError.$1", + "type": "Object", + "tags": [], + "label": "error", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-browser", + "scope": "common", + "docId": "kibKbnCoreHttpBrowserPluginApi", + "section": "def-common.IHttpFetchError", + "text": "IHttpFetchError" + }, + "<{ message: string; }>" + ], + "path": "packages/kbn-alerts-ui-shared/src/common/hooks/use_update_rule.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] } ], "initialIsOpen": false diff --git a/api_docs/kbn_alerts_ui_shared.mdx b/api_docs/kbn_alerts_ui_shared.mdx index 3d9460e9d7934..fd5677fce9f74 100644 --- a/api_docs/kbn_alerts_ui_shared.mdx +++ b/api_docs/kbn_alerts_ui_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts-ui-shared title: "@kbn/alerts-ui-shared" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts-ui-shared plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-ui-shared'] --- import kbnAlertsUiSharedObj from './kbn_alerts_ui_shared.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-o | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 245 | 0 | 231 | 2 | +| 299 | 0 | 283 | 8 | ## Common diff --git a/api_docs/kbn_analytics.mdx b/api_docs/kbn_analytics.mdx index 5752c900bff1a..6896546ffb32a 100644 --- a/api_docs/kbn_analytics.mdx +++ b/api_docs/kbn_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics title: "@kbn/analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics'] --- import kbnAnalyticsObj from './kbn_analytics.devdocs.json'; diff --git a/api_docs/kbn_analytics_collection_utils.mdx b/api_docs/kbn_analytics_collection_utils.mdx index 540ad398c9e8b..1c052b7b6c4d2 100644 --- a/api_docs/kbn_analytics_collection_utils.mdx +++ b/api_docs/kbn_analytics_collection_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-collection-utils title: "@kbn/analytics-collection-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-collection-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-collection-utils'] --- import kbnAnalyticsCollectionUtilsObj from './kbn_analytics_collection_utils.devdocs.json'; diff --git a/api_docs/kbn_apm_config_loader.mdx b/api_docs/kbn_apm_config_loader.mdx index cecbf6d87dfe9..52f46921b8a6c 100644 --- a/api_docs/kbn_apm_config_loader.mdx +++ b/api_docs/kbn_apm_config_loader.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-config-loader title: "@kbn/apm-config-loader" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-config-loader plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-config-loader'] --- import kbnApmConfigLoaderObj from './kbn_apm_config_loader.devdocs.json'; diff --git a/api_docs/kbn_apm_data_view.mdx b/api_docs/kbn_apm_data_view.mdx index f85c9d57d3659..8c863c11ca3d9 100644 --- a/api_docs/kbn_apm_data_view.mdx +++ b/api_docs/kbn_apm_data_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-data-view title: "@kbn/apm-data-view" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-data-view plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-data-view'] --- import kbnApmDataViewObj from './kbn_apm_data_view.devdocs.json'; diff --git a/api_docs/kbn_apm_synthtrace.mdx b/api_docs/kbn_apm_synthtrace.mdx index 0ce6f02362ad7..2e6cd4d8a33c6 100644 --- a/api_docs/kbn_apm_synthtrace.mdx +++ b/api_docs/kbn_apm_synthtrace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-synthtrace title: "@kbn/apm-synthtrace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-synthtrace plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace'] --- import kbnApmSynthtraceObj from './kbn_apm_synthtrace.devdocs.json'; diff --git a/api_docs/kbn_apm_synthtrace_client.devdocs.json b/api_docs/kbn_apm_synthtrace_client.devdocs.json index 0456a1802ee4f..c6dbb4c5fa952 100644 --- a/api_docs/kbn_apm_synthtrace_client.devdocs.json +++ b/api_docs/kbn_apm_synthtrace_client.devdocs.json @@ -2631,7 +2631,7 @@ "label": "LogDocument", "description": [], "signature": [ - "{ '@timestamp'?: number | undefined; } & Partial<{ 'input.type': string; 'log.file.path'?: string | undefined; 'service.name'?: string | undefined; 'data_stream.namespace': string; 'data_stream.type': string; 'data_stream.dataset': string; message?: string | undefined; 'error.message'?: string | undefined; 'event.original'?: string | undefined; 'event.dataset': string; 'log.level'?: string | undefined; 'host.name'?: string | undefined; 'container.id'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.id'?: string | undefined; 'agent.id'?: string | undefined; 'agent.name'?: string | undefined; 'orchestrator.cluster.name'?: string | undefined; 'orchestrator.cluster.id'?: string | undefined; 'orchestrator.resource.id'?: string | undefined; 'kubernetes.pod.uid'?: string | undefined; 'aws.s3.bucket.name'?: string | undefined; 'orchestrator.namespace'?: string | undefined; 'container.name'?: string | undefined; 'cloud.provider'?: string | undefined; 'cloud.region'?: string | undefined; 'cloud.availability_zone'?: string | undefined; 'cloud.project.id'?: string | undefined; 'cloud.instance.id'?: string | undefined; 'error.stack_trace'?: string | undefined; 'error.exception.stacktrace'?: string | undefined; 'error.log.stacktrace'?: string | undefined; 'log.custom': Record; }>" + "{ '@timestamp'?: number | undefined; } & Partial<{ 'input.type': string; 'log.file.path'?: string | undefined; 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'data_stream.namespace': string; 'data_stream.type': string; 'data_stream.dataset': string; message?: string | undefined; 'error.message'?: string | undefined; 'event.original'?: string | undefined; 'event.dataset': string; 'log.level'?: string | undefined; 'host.name'?: string | undefined; 'container.id'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.id'?: string | undefined; 'agent.id'?: string | undefined; 'agent.name'?: string | undefined; 'orchestrator.cluster.name'?: string | undefined; 'orchestrator.cluster.id'?: string | undefined; 'orchestrator.resource.id'?: string | undefined; 'kubernetes.pod.uid'?: string | undefined; 'aws.s3.bucket.name'?: string | undefined; 'orchestrator.namespace'?: string | undefined; 'container.name'?: string | undefined; 'cloud.provider'?: string | undefined; 'cloud.region'?: string | undefined; 'cloud.availability_zone'?: string | undefined; 'cloud.project.id'?: string | undefined; 'cloud.instance.id'?: string | undefined; 'error.stack_trace'?: string | undefined; 'error.exception.stacktrace'?: string | undefined; 'error.log.stacktrace'?: string | undefined; 'log.custom': Record; }>" ], "path": "packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts", "deprecated": false, diff --git a/api_docs/kbn_apm_synthtrace_client.mdx b/api_docs/kbn_apm_synthtrace_client.mdx index 57129a7e5d96d..bee339a7a5b96 100644 --- a/api_docs/kbn_apm_synthtrace_client.mdx +++ b/api_docs/kbn_apm_synthtrace_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-synthtrace-client title: "@kbn/apm-synthtrace-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-synthtrace-client plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace-client'] --- import kbnApmSynthtraceClientObj from './kbn_apm_synthtrace_client.devdocs.json'; diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index 6371dfd7d6126..412a59fff7245 100644 --- a/api_docs/kbn_apm_utils.mdx +++ b/api_docs/kbn_apm_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-utils title: "@kbn/apm-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-utils plugin -date: 2024-07-04 +date: 2024-07-11 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 a7a9c93dbdb7c..4802854b39e3e 100644 --- a/api_docs/kbn_axe_config.mdx +++ b/api_docs/kbn_axe_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-axe-config title: "@kbn/axe-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/axe-config plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/axe-config'] --- import kbnAxeConfigObj from './kbn_axe_config.devdocs.json'; diff --git a/api_docs/kbn_bfetch_error.mdx b/api_docs/kbn_bfetch_error.mdx index c95f74cf65901..d42e2b360aebd 100644 --- a/api_docs/kbn_bfetch_error.mdx +++ b/api_docs/kbn_bfetch_error.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-bfetch-error title: "@kbn/bfetch-error" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/bfetch-error plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/bfetch-error'] --- import kbnBfetchErrorObj from './kbn_bfetch_error.devdocs.json'; diff --git a/api_docs/kbn_calculate_auto.mdx b/api_docs/kbn_calculate_auto.mdx index f328b26e73f3e..a4ccd68d6f248 100644 --- a/api_docs/kbn_calculate_auto.mdx +++ b/api_docs/kbn_calculate_auto.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-calculate-auto title: "@kbn/calculate-auto" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/calculate-auto plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/calculate-auto'] --- import kbnCalculateAutoObj from './kbn_calculate_auto.devdocs.json'; diff --git a/api_docs/kbn_calculate_width_from_char_count.mdx b/api_docs/kbn_calculate_width_from_char_count.mdx index 30eade23f7d1e..014436b53055d 100644 --- a/api_docs/kbn_calculate_width_from_char_count.mdx +++ b/api_docs/kbn_calculate_width_from_char_count.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-calculate-width-from-char-count title: "@kbn/calculate-width-from-char-count" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/calculate-width-from-char-count plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/calculate-width-from-char-count'] --- import kbnCalculateWidthFromCharCountObj from './kbn_calculate_width_from_char_count.devdocs.json'; diff --git a/api_docs/kbn_cases_components.mdx b/api_docs/kbn_cases_components.mdx index 49b697256d4a2..be98393f76557 100644 --- a/api_docs/kbn_cases_components.mdx +++ b/api_docs/kbn_cases_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cases-components title: "@kbn/cases-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cases-components plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cases-components'] --- import kbnCasesComponentsObj from './kbn_cases_components.devdocs.json'; diff --git a/api_docs/kbn_cell_actions.mdx b/api_docs/kbn_cell_actions.mdx index c1e2fc81a0154..1de24a4d18c68 100644 --- a/api_docs/kbn_cell_actions.mdx +++ b/api_docs/kbn_cell_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cell-actions title: "@kbn/cell-actions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cell-actions plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cell-actions'] --- import kbnCellActionsObj from './kbn_cell_actions.devdocs.json'; diff --git a/api_docs/kbn_chart_expressions_common.mdx b/api_docs/kbn_chart_expressions_common.mdx index 438e9a3262937..3019f08b578a8 100644 --- a/api_docs/kbn_chart_expressions_common.mdx +++ b/api_docs/kbn_chart_expressions_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-chart-expressions-common title: "@kbn/chart-expressions-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/chart-expressions-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/chart-expressions-common'] --- import kbnChartExpressionsCommonObj from './kbn_chart_expressions_common.devdocs.json'; diff --git a/api_docs/kbn_chart_icons.mdx b/api_docs/kbn_chart_icons.mdx index 7025c7c97d6a8..8703f4965b812 100644 --- a/api_docs/kbn_chart_icons.mdx +++ b/api_docs/kbn_chart_icons.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-chart-icons title: "@kbn/chart-icons" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/chart-icons plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/chart-icons'] --- import kbnChartIconsObj from './kbn_chart_icons.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_core.mdx b/api_docs/kbn_ci_stats_core.mdx index 75f46ca2c08f6..22576ae2eac24 100644 --- a/api_docs/kbn_ci_stats_core.mdx +++ b/api_docs/kbn_ci_stats_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-core title: "@kbn/ci-stats-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-core plugin -date: 2024-07-04 +date: 2024-07-11 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 c20a0443afd1d..d8250347da8aa 100644 --- a/api_docs/kbn_ci_stats_performance_metrics.mdx +++ b/api_docs/kbn_ci_stats_performance_metrics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-performance-metrics title: "@kbn/ci-stats-performance-metrics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-performance-metrics plugin -date: 2024-07-04 +date: 2024-07-11 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 f7452a05fd4a7..d42a537edf4b1 100644 --- a/api_docs/kbn_ci_stats_reporter.mdx +++ b/api_docs/kbn_ci_stats_reporter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-reporter title: "@kbn/ci-stats-reporter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-reporter plugin -date: 2024-07-04 +date: 2024-07-11 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 ffe2574b16f32..2929a1a2162c3 100644 --- a/api_docs/kbn_cli_dev_mode.mdx +++ b/api_docs/kbn_cli_dev_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cli-dev-mode title: "@kbn/cli-dev-mode" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cli-dev-mode plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cli-dev-mode'] --- import kbnCliDevModeObj from './kbn_cli_dev_mode.devdocs.json'; diff --git a/api_docs/kbn_code_editor.mdx b/api_docs/kbn_code_editor.mdx index b35ef9b77b935..48265e3c6f043 100644 --- a/api_docs/kbn_code_editor.mdx +++ b/api_docs/kbn_code_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-code-editor title: "@kbn/code-editor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/code-editor plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/code-editor'] --- import kbnCodeEditorObj from './kbn_code_editor.devdocs.json'; diff --git a/api_docs/kbn_code_editor_mock.mdx b/api_docs/kbn_code_editor_mock.mdx index fa2a193c8f8a0..e7f9b5fa5f2a6 100644 --- a/api_docs/kbn_code_editor_mock.mdx +++ b/api_docs/kbn_code_editor_mock.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-code-editor-mock title: "@kbn/code-editor-mock" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/code-editor-mock plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/code-editor-mock'] --- import kbnCodeEditorMockObj from './kbn_code_editor_mock.devdocs.json'; diff --git a/api_docs/kbn_code_owners.mdx b/api_docs/kbn_code_owners.mdx index c62a5a7d7d696..d980134f35105 100644 --- a/api_docs/kbn_code_owners.mdx +++ b/api_docs/kbn_code_owners.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-code-owners title: "@kbn/code-owners" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/code-owners plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/code-owners'] --- import kbnCodeOwnersObj from './kbn_code_owners.devdocs.json'; diff --git a/api_docs/kbn_coloring.mdx b/api_docs/kbn_coloring.mdx index 1f0e57101a9fd..fe48d5fddc2ff 100644 --- a/api_docs/kbn_coloring.mdx +++ b/api_docs/kbn_coloring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-coloring title: "@kbn/coloring" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/coloring plugin -date: 2024-07-04 +date: 2024-07-11 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 b39d344030a5e..e6d2d81f5268b 100644 --- a/api_docs/kbn_config.mdx +++ b/api_docs/kbn_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config title: "@kbn/config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config plugin -date: 2024-07-04 +date: 2024-07-11 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 ad6514f176a43..dc4eeb2fc1564 100644 --- a/api_docs/kbn_config_mocks.mdx +++ b/api_docs/kbn_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-mocks title: "@kbn/config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 d8f89a770b844..91d2e4c2675af 100644 --- a/api_docs/kbn_config_schema.mdx +++ b/api_docs/kbn_config_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-schema title: "@kbn/config-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-schema plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-schema'] --- import kbnConfigSchemaObj from './kbn_config_schema.devdocs.json'; diff --git a/api_docs/kbn_content_management_content_editor.mdx b/api_docs/kbn_content_management_content_editor.mdx index b54c440c5c105..423028ccf543d 100644 --- a/api_docs/kbn_content_management_content_editor.mdx +++ b/api_docs/kbn_content_management_content_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-content-editor title: "@kbn/content-management-content-editor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-content-editor plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-content-editor'] --- import kbnContentManagementContentEditorObj from './kbn_content_management_content_editor.devdocs.json'; diff --git a/api_docs/kbn_content_management_tabbed_table_list_view.mdx b/api_docs/kbn_content_management_tabbed_table_list_view.mdx index b434e2769fb07..4668b77ab9918 100644 --- a/api_docs/kbn_content_management_tabbed_table_list_view.mdx +++ b/api_docs/kbn_content_management_tabbed_table_list_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-tabbed-table-list-view title: "@kbn/content-management-tabbed-table-list-view" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-tabbed-table-list-view plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-tabbed-table-list-view'] --- import kbnContentManagementTabbedTableListViewObj from './kbn_content_management_tabbed_table_list_view.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list_view.devdocs.json b/api_docs/kbn_content_management_table_list_view.devdocs.json index f3827b9ca8123..2768884c3da7a 100644 --- a/api_docs/kbn_content_management_table_list_view.devdocs.json +++ b/api_docs/kbn_content_management_table_list_view.devdocs.json @@ -19,7 +19,7 @@ "section": "def-common.UserContentCommonSchema", "text": "UserContentCommonSchema" }, - ">({ title, description, entityName, entityNamePlural, initialFilter, headingId, initialPageSize, listingLimit, urlStateEnabled, customTableColumn, emptyPrompt, findItems, createItem, editItem, deleteItems, getDetailViewLink, getOnClickTitle, rowItemActions, id: listingId, contentEditor, children, titleColumnName, additionalRightSideActions, withoutPageTemplateWrapper, createdByEnabled, }: ", + ">({ title, description, entityName, entityNamePlural, initialFilter, headingId, initialPageSize, listingLimit, urlStateEnabled, customTableColumn, emptyPrompt, findItems, createItem, editItem, deleteItems, getDetailViewLink, getOnClickTitle, rowItemActions, id: listingId, contentEditor, children, titleColumnName, additionalRightSideActions, withoutPageTemplateWrapper, createdByEnabled, recentlyAccessed, }: ", { "pluginId": "@kbn/content-management-table-list-view", "scope": "public", @@ -38,7 +38,7 @@ "id": "def-public.TableListView.$1", "type": "CompoundType", "tags": [], - "label": "{\n title,\n description,\n entityName,\n entityNamePlural,\n initialFilter,\n headingId,\n initialPageSize,\n listingLimit,\n urlStateEnabled = true,\n customTableColumn,\n emptyPrompt,\n findItems,\n createItem,\n editItem,\n deleteItems,\n getDetailViewLink,\n getOnClickTitle,\n rowItemActions,\n id: listingId,\n contentEditor,\n children,\n titleColumnName,\n additionalRightSideActions,\n withoutPageTemplateWrapper,\n createdByEnabled,\n}", + "label": "{\n title,\n description,\n entityName,\n entityNamePlural,\n initialFilter,\n headingId,\n initialPageSize,\n listingLimit,\n urlStateEnabled = true,\n customTableColumn,\n emptyPrompt,\n findItems,\n createItem,\n editItem,\n deleteItems,\n getDetailViewLink,\n getOnClickTitle,\n rowItemActions,\n id: listingId,\n contentEditor,\n children,\n titleColumnName,\n additionalRightSideActions,\n withoutPageTemplateWrapper,\n createdByEnabled,\n recentlyAccessed,\n}", "description": [], "signature": [ { @@ -79,7 +79,7 @@ "section": "def-public.TableListViewTableProps", "text": "TableListViewTableProps" }, - ", \"id\" | \"entityName\" | \"entityNamePlural\" | \"initialFilter\" | \"headingId\" | \"initialPageSize\" | \"listingLimit\" | \"urlStateEnabled\" | \"customTableColumn\" | \"emptyPrompt\" | \"findItems\" | \"createItem\" | \"editItem\" | \"deleteItems\" | \"getDetailViewLink\" | \"getOnClickTitle\" | \"rowItemActions\" | \"contentEditor\" | \"titleColumnName\" | \"withoutPageTemplateWrapper\" | \"createdByEnabled\"> & { title: string; description?: string | undefined; additionalRightSideActions?: React.ReactNode[] | undefined; children?: React.ReactNode; }" + ", \"id\" | \"entityName\" | \"entityNamePlural\" | \"initialFilter\" | \"headingId\" | \"initialPageSize\" | \"listingLimit\" | \"urlStateEnabled\" | \"customTableColumn\" | \"emptyPrompt\" | \"findItems\" | \"createItem\" | \"editItem\" | \"deleteItems\" | \"getDetailViewLink\" | \"getOnClickTitle\" | \"rowItemActions\" | \"contentEditor\" | \"titleColumnName\" | \"withoutPageTemplateWrapper\" | \"createdByEnabled\" | \"recentlyAccessed\"> & { title: string; description?: string | undefined; additionalRightSideActions?: React.ReactNode[] | undefined; children?: React.ReactNode; }" ], "path": "packages/content-management/table_list_view/src/table_list_view.tsx", "deprecated": false, diff --git a/api_docs/kbn_content_management_table_list_view.mdx b/api_docs/kbn_content_management_table_list_view.mdx index a5bdb8d78e644..9bc69d95bd8ef 100644 --- a/api_docs/kbn_content_management_table_list_view.mdx +++ b/api_docs/kbn_content_management_table_list_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list-view title: "@kbn/content-management-table-list-view" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list-view plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view'] --- import kbnContentManagementTableListViewObj from './kbn_content_management_table_list_view.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list_view_common.mdx b/api_docs/kbn_content_management_table_list_view_common.mdx index 563e4d0348aa6..b78c1e5f21832 100644 --- a/api_docs/kbn_content_management_table_list_view_common.mdx +++ b/api_docs/kbn_content_management_table_list_view_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list-view-common title: "@kbn/content-management-table-list-view-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list-view-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view-common'] --- import kbnContentManagementTableListViewCommonObj from './kbn_content_management_table_list_view_common.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list_view_table.devdocs.json b/api_docs/kbn_content_management_table_list_view_table.devdocs.json index da65a4c927242..2cd0fa155534b 100644 --- a/api_docs/kbn_content_management_table_list_view_table.devdocs.json +++ b/api_docs/kbn_content_management_table_list_view_table.devdocs.json @@ -109,7 +109,7 @@ "section": "def-common.UserContentCommonSchema", "text": "UserContentCommonSchema" }, - ">({ tableCaption, entityName, entityNamePlural, initialFilter: initialQuery, headingId, initialPageSize, listingLimit, urlStateEnabled, customTableColumn, emptyPrompt, rowItemActions, findItems, createItem, editItem, deleteItems, getDetailViewLink, getOnClickTitle, id: listingId, contentEditor, titleColumnName, withoutPageTemplateWrapper, onFetchSuccess, refreshListBouncer, setPageDataTestSubject, createdByEnabled, }: ", + ">({ tableCaption, entityName, entityNamePlural, initialFilter: initialQuery, headingId, initialPageSize, listingLimit, urlStateEnabled, customTableColumn, emptyPrompt, rowItemActions, findItems, createItem, editItem, deleteItems, getDetailViewLink, getOnClickTitle, id: listingId, contentEditor, titleColumnName, withoutPageTemplateWrapper, onFetchSuccess, refreshListBouncer, setPageDataTestSubject, createdByEnabled, recentlyAccessed, }: ", { "pluginId": "@kbn/content-management-table-list-view-table", "scope": "public", @@ -833,6 +833,28 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "@kbn/content-management-table-list-view-table", + "id": "def-public.TableListViewTableProps.recentlyAccessed", + "type": "Object", + "tags": [], + "label": "recentlyAccessed", + "description": [], + "signature": [ + "Pick<", + { + "pluginId": "@kbn/recently-accessed", + "scope": "common", + "docId": "kibKbnRecentlyAccessedPluginApi", + "section": "def-common.RecentlyAccessed", + "text": "RecentlyAccessed" + }, + ", \"get\"> | undefined" + ], + "path": "packages/content-management/table_list_view_table/src/table_list_view_table.tsx", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "@kbn/content-management-table-list-view-table", "id": "def-public.TableListViewTableProps.tableCaption", diff --git a/api_docs/kbn_content_management_table_list_view_table.mdx b/api_docs/kbn_content_management_table_list_view_table.mdx index 39ab11cb8ba15..bdc5a7d428729 100644 --- a/api_docs/kbn_content_management_table_list_view_table.mdx +++ b/api_docs/kbn_content_management_table_list_view_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list-view-table title: "@kbn/content-management-table-list-view-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list-view-table plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view-table'] --- import kbnContentManagementTableListViewTableObj from './kbn_content_management_table_list_view_table.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sh | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 48 | 0 | 32 | 3 | +| 49 | 0 | 33 | 3 | ## Client diff --git a/api_docs/kbn_content_management_user_profiles.mdx b/api_docs/kbn_content_management_user_profiles.mdx index 872ce70372c79..726b4e50bbf78 100644 --- a/api_docs/kbn_content_management_user_profiles.mdx +++ b/api_docs/kbn_content_management_user_profiles.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-user-profiles title: "@kbn/content-management-user-profiles" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-user-profiles plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-user-profiles'] --- import kbnContentManagementUserProfilesObj from './kbn_content_management_user_profiles.devdocs.json'; diff --git a/api_docs/kbn_content_management_utils.mdx b/api_docs/kbn_content_management_utils.mdx index 2feef09b8d4cf..1a571a6235c67 100644 --- a/api_docs/kbn_content_management_utils.mdx +++ b/api_docs/kbn_content_management_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-utils title: "@kbn/content-management-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-utils'] --- import kbnContentManagementUtilsObj from './kbn_content_management_utils.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser.devdocs.json b/api_docs/kbn_core_analytics_browser.devdocs.json index 0937f6f89d0f3..653be84cc5687 100644 --- a/api_docs/kbn_core_analytics_browser.devdocs.json +++ b/api_docs/kbn_core_analytics_browser.devdocs.json @@ -1427,6 +1427,10 @@ "plugin": "actions", "path": "x-pack/plugins/actions/server/lib/action_executor.test.ts" }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/lib/action_executor.test.ts" + }, { "plugin": "@kbn/ebt", "path": "packages/analytics/ebt/client/src/analytics_client/mocks.ts" diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index 5d60e7bbbf988..376acad1aeca5 100644 --- a/api_docs/kbn_core_analytics_browser.mdx +++ b/api_docs/kbn_core_analytics_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser title: "@kbn/core-analytics-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser plugin -date: 2024-07-04 +date: 2024-07-11 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 1051a8fc09847..20c4f81eaba5d 100644 --- a/api_docs/kbn_core_analytics_browser_internal.mdx +++ b/api_docs/kbn_core_analytics_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-internal title: "@kbn/core-analytics-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 f1d6e83ca9967..bca3557232102 100644 --- a/api_docs/kbn_core_analytics_browser_mocks.mdx +++ b/api_docs/kbn_core_analytics_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-mocks title: "@kbn/core-analytics-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-mocks'] --- import kbnCoreAnalyticsBrowserMocksObj from './kbn_core_analytics_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server.devdocs.json b/api_docs/kbn_core_analytics_server.devdocs.json index 24de9bb5afba1..ea8766e2c7639 100644 --- a/api_docs/kbn_core_analytics_server.devdocs.json +++ b/api_docs/kbn_core_analytics_server.devdocs.json @@ -1427,6 +1427,10 @@ "plugin": "actions", "path": "x-pack/plugins/actions/server/lib/action_executor.test.ts" }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/lib/action_executor.test.ts" + }, { "plugin": "@kbn/ebt", "path": "packages/analytics/ebt/client/src/analytics_client/mocks.ts" diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index da84a8ca0f2fc..9c0d4635cb73f 100644 --- a/api_docs/kbn_core_analytics_server.mdx +++ b/api_docs/kbn_core_analytics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server title: "@kbn/core-analytics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server plugin -date: 2024-07-04 +date: 2024-07-11 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 129879916d7be..3176235db7c47 100644 --- a/api_docs/kbn_core_analytics_server_internal.mdx +++ b/api_docs/kbn_core_analytics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-internal title: "@kbn/core-analytics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 141bf88ba6f87..7e294c2b0f0fe 100644 --- a/api_docs/kbn_core_analytics_server_mocks.mdx +++ b/api_docs/kbn_core_analytics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-mocks title: "@kbn/core-analytics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-mocks'] --- import kbnCoreAnalyticsServerMocksObj from './kbn_core_analytics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser.mdx b/api_docs/kbn_core_application_browser.mdx index ab72b17de203e..988172664fa0a 100644 --- a/api_docs/kbn_core_application_browser.mdx +++ b/api_docs/kbn_core_application_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser title: "@kbn/core-application-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser'] --- import kbnCoreApplicationBrowserObj from './kbn_core_application_browser.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser_internal.mdx b/api_docs/kbn_core_application_browser_internal.mdx index ec1a2decce516..5e75403ef5b0c 100644 --- a/api_docs/kbn_core_application_browser_internal.mdx +++ b/api_docs/kbn_core_application_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser-internal title: "@kbn/core-application-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-internal'] --- import kbnCoreApplicationBrowserInternalObj from './kbn_core_application_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser_mocks.mdx b/api_docs/kbn_core_application_browser_mocks.mdx index 3071caccc3e89..a871b9d73f3f3 100644 --- a/api_docs/kbn_core_application_browser_mocks.mdx +++ b/api_docs/kbn_core_application_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser-mocks title: "@kbn/core-application-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-mocks'] --- import kbnCoreApplicationBrowserMocksObj from './kbn_core_application_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_common.mdx b/api_docs/kbn_core_application_common.mdx index 4b9061264e7ba..50229a02dc606 100644 --- a/api_docs/kbn_core_application_common.mdx +++ b/api_docs/kbn_core_application_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-common title: "@kbn/core-application-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-common'] --- import kbnCoreApplicationCommonObj from './kbn_core_application_common.devdocs.json'; diff --git a/api_docs/kbn_core_apps_browser_internal.mdx b/api_docs/kbn_core_apps_browser_internal.mdx index 15c671d2d7861..c4659d860e4f0 100644 --- a/api_docs/kbn_core_apps_browser_internal.mdx +++ b/api_docs/kbn_core_apps_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-browser-internal title: "@kbn/core-apps-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-browser-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-browser-internal'] --- import kbnCoreAppsBrowserInternalObj from './kbn_core_apps_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_apps_browser_mocks.mdx b/api_docs/kbn_core_apps_browser_mocks.mdx index 729f7776f3c65..367d7d2181417 100644 --- a/api_docs/kbn_core_apps_browser_mocks.mdx +++ b/api_docs/kbn_core_apps_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-browser-mocks title: "@kbn/core-apps-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-browser-mocks'] --- import kbnCoreAppsBrowserMocksObj from './kbn_core_apps_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_apps_server_internal.mdx b/api_docs/kbn_core_apps_server_internal.mdx index 72c3247afee83..cf6fd06bfc153 100644 --- a/api_docs/kbn_core_apps_server_internal.mdx +++ b/api_docs/kbn_core_apps_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-server-internal title: "@kbn/core-apps-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-server-internal'] --- import kbnCoreAppsServerInternalObj from './kbn_core_apps_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_base_browser_mocks.mdx b/api_docs/kbn_core_base_browser_mocks.mdx index 707e32c732619..9d8f9e0739bd5 100644 --- a/api_docs/kbn_core_base_browser_mocks.mdx +++ b/api_docs/kbn_core_base_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-browser-mocks title: "@kbn/core-base-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 b3dfbcee0efc2..5c37132b4f79f 100644 --- a/api_docs/kbn_core_base_common.mdx +++ b/api_docs/kbn_core_base_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-common title: "@kbn/core-base-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-common plugin -date: 2024-07-04 +date: 2024-07-11 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 352da914f0bb3..3b74753424a7e 100644 --- a/api_docs/kbn_core_base_server_internal.mdx +++ b/api_docs/kbn_core_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-internal title: "@kbn/core-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 b0ace97a8c08a..cbdf54801bf0d 100644 --- a/api_docs/kbn_core_base_server_mocks.mdx +++ b/api_docs/kbn_core_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-mocks title: "@kbn/core-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-mocks'] --- import kbnCoreBaseServerMocksObj from './kbn_core_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_browser_mocks.mdx b/api_docs/kbn_core_capabilities_browser_mocks.mdx index d1c5a1f91fe7c..2e61f3936e5f8 100644 --- a/api_docs/kbn_core_capabilities_browser_mocks.mdx +++ b/api_docs/kbn_core_capabilities_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-browser-mocks title: "@kbn/core-capabilities-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-browser-mocks'] --- import kbnCoreCapabilitiesBrowserMocksObj from './kbn_core_capabilities_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_common.mdx b/api_docs/kbn_core_capabilities_common.mdx index 7e8a8f1d16c83..91c2525f2b051 100644 --- a/api_docs/kbn_core_capabilities_common.mdx +++ b/api_docs/kbn_core_capabilities_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-common title: "@kbn/core-capabilities-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-common plugin -date: 2024-07-04 +date: 2024-07-11 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 ae37b966a2919..e18d28c3d1d69 100644 --- a/api_docs/kbn_core_capabilities_server.mdx +++ b/api_docs/kbn_core_capabilities_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server title: "@kbn/core-capabilities-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server plugin -date: 2024-07-04 +date: 2024-07-11 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 e83019eb7a49b..15df05f10bf00 100644 --- a/api_docs/kbn_core_capabilities_server_mocks.mdx +++ b/api_docs/kbn_core_capabilities_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server-mocks title: "@kbn/core-capabilities-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server-mocks'] --- import kbnCoreCapabilitiesServerMocksObj from './kbn_core_capabilities_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser.devdocs.json b/api_docs/kbn_core_chrome_browser.devdocs.json index 19595edba49ec..2a76c438cc5ef 100644 --- a/api_docs/kbn_core_chrome_browser.devdocs.json +++ b/api_docs/kbn_core_chrome_browser.devdocs.json @@ -3716,7 +3716,7 @@ "label": "AppDeepLinkId", "description": [], "signature": [ - "\"fleet\" | \"graph\" | \"ml\" | \"monitoring\" | \"metrics\" | \"management\" | \"synthetics\" | \"ux\" | \"apm\" | \"logs\" | \"profiling\" | \"dashboards\" | \"observabilityAIAssistant\" | \"home\" | \"canvas\" | \"integrations\" | \"discover\" | \"observability-overview\" | \"appSearch\" | \"dev_tools\" | \"maps\" | \"visualize\" | \"dev_tools:console\" | \"dev_tools:searchprofiler\" | \"dev_tools:painless_lab\" | \"dev_tools:grokdebugger\" | \"ml:notifications\" | \"ml:nodes\" | \"ml:overview\" | \"ml:memoryUsage\" | \"ml:settings\" | \"ml:dataVisualizer\" | \"ml:anomalyDetection\" | \"ml:anomalyExplorer\" | \"ml:singleMetricViewer\" | \"ml:dataDrift\" | \"ml:dataFrameAnalytics\" | \"ml:resultExplorer\" | \"ml:analyticsMap\" | \"ml:aiOps\" | \"ml:logRateAnalysis\" | \"ml:logPatternAnalysis\" | \"ml:changePointDetections\" | \"ml:modelManagement\" | \"ml:nodesOverview\" | \"ml:esqlDataVisualizer\" | \"ml:fileUpload\" | \"ml:indexDataVisualizer\" | \"ml:calendarSettings\" | \"ml:filterListsSettings\" | \"osquery\" | \"management:transform\" | \"management:watcher\" | \"management:cases\" | \"management:tags\" | \"management:maintenanceWindows\" | \"management:settings\" | \"management:dataViews\" | \"management:spaces\" | \"management:users\" | \"management:migrate_data\" | \"management:search_sessions\" | \"management:data_quality\" | \"management:filesManagement\" | \"management:roles\" | \"management:reporting\" | \"management:aiAssistantManagementSelection\" | \"management:securityAiAssistantManagement\" | \"management:observabilityAiAssistantManagement\" | \"management:api_keys\" | \"management:cross_cluster_replication\" | \"management:license_management\" | \"management:index_lifecycle_management\" | \"management:index_management\" | \"management:ingest_pipelines\" | \"management:jobsListLink\" | \"management:objects\" | \"management:pipelines\" | \"management:remote_clusters\" | \"management:role_mappings\" | \"management:rollup_jobs\" | \"management:snapshot_restore\" | \"management:triggersActions\" | \"management:triggersActionsConnectors\" | \"management:upgrade_assistant\" | \"enterpriseSearch\" | \"enterpriseSearchContent\" | \"enterpriseSearchApplications\" | \"enterpriseSearchAnalytics\" | \"workplaceSearch\" | \"serverlessElasticsearch\" | \"serverlessConnectors\" | \"searchPlayground\" | \"searchInferenceEndpoints\" | \"searchHomepage\" | \"enterpriseSearchContent:connectors\" | \"enterpriseSearchContent:searchIndices\" | \"enterpriseSearchContent:webCrawlers\" | \"enterpriseSearchApplications:searchApplications\" | \"enterpriseSearchApplications:playground\" | \"appSearch:engines\" | \"observability-logs-explorer\" | \"observabilityOnboarding\" | \"slo\" | \"logs:settings\" | \"logs:stream\" | \"logs:log-categories\" | \"logs:anomalies\" | \"observability-overview:cases\" | \"observability-overview:alerts\" | \"observability-overview:rules\" | \"observability-overview:cases_create\" | \"observability-overview:cases_configure\" | \"metrics:settings\" | \"metrics:hosts\" | \"metrics:inventory\" | \"metrics:metrics-explorer\" | \"metrics:assetDetails\" | \"apm:traces\" | \"apm:dependencies\" | \"apm:service-map\" | \"apm:settings\" | \"apm:services\" | \"apm:service-groups-list\" | \"apm:storage-explorer\" | \"synthetics:overview\" | \"synthetics:certificates\" | \"profiling:stacktraces\" | \"profiling:flamegraphs\" | \"profiling:functions\" | \"securitySolutionUI\" | \"securitySolutionUI:\" | \"securitySolutionUI:cases\" | \"securitySolutionUI:alerts\" | \"securitySolutionUI:rules\" | \"securitySolutionUI:policy\" | \"securitySolutionUI:overview\" | \"securitySolutionUI:dashboards\" | \"securitySolutionUI:cases_create\" | \"securitySolutionUI:cases_configure\" | \"securitySolutionUI:hosts\" | \"securitySolutionUI:users\" | \"securitySolutionUI:cloud_defend-policies\" | \"securitySolutionUI:cloud_security_posture-dashboard\" | \"securitySolutionUI:cloud_security_posture-findings\" | \"securitySolutionUI:cloud_security_posture-benchmarks\" | \"securitySolutionUI:kubernetes\" | \"securitySolutionUI:network\" | \"securitySolutionUI:data_quality\" | \"securitySolutionUI:explore\" | \"securitySolutionUI:assets\" | \"securitySolutionUI:cloud_defend\" | \"securitySolutionUI:administration\" | \"securitySolutionUI:attack_discovery\" | \"securitySolutionUI:blocklist\" | \"securitySolutionUI:cloud_security_posture-rules\" | \"securitySolutionUI:detections\" | \"securitySolutionUI:detection_response\" | \"securitySolutionUI:endpoints\" | \"securitySolutionUI:event_filters\" | \"securitySolutionUI:exceptions\" | \"securitySolutionUI:host_isolation_exceptions\" | \"securitySolutionUI:hosts-all\" | \"securitySolutionUI:hosts-anomalies\" | \"securitySolutionUI:hosts-risk\" | \"securitySolutionUI:hosts-events\" | \"securitySolutionUI:hosts-sessions\" | \"securitySolutionUI:hosts-uncommon_processes\" | \"securitySolutionUI:investigations\" | \"securitySolutionUI:get_started\" | \"securitySolutionUI:machine_learning-landing\" | \"securitySolutionUI:network-anomalies\" | \"securitySolutionUI:network-dns\" | \"securitySolutionUI:network-events\" | \"securitySolutionUI:network-flows\" | \"securitySolutionUI:network-http\" | \"securitySolutionUI:network-tls\" | \"securitySolutionUI:response_actions_history\" | \"securitySolutionUI:rules-add\" | \"securitySolutionUI:rules-create\" | \"securitySolutionUI:rules-landing\" | \"securitySolutionUI:threat_intelligence\" | \"securitySolutionUI:timelines\" | \"securitySolutionUI:timelines-templates\" | \"securitySolutionUI:trusted_apps\" | \"securitySolutionUI:users-all\" | \"securitySolutionUI:users-anomalies\" | \"securitySolutionUI:users-authentications\" | \"securitySolutionUI:users-events\" | \"securitySolutionUI:users-risk\" | \"securitySolutionUI:entity_analytics\" | \"securitySolutionUI:entity_analytics-management\" | \"securitySolutionUI:entity_analytics-asset-classification\" | \"securitySolutionUI:coverage-overview\" | \"securitySolutionUI:notes-management\" | \"fleet:settings\" | \"fleet:policies\" | \"fleet:data_streams\" | \"fleet:enrollment_tokens\" | \"fleet:uninstall_tokens\" | \"fleet:agents\"" + "\"fleet\" | \"graph\" | \"ml\" | \"monitoring\" | \"metrics\" | \"management\" | \"synthetics\" | \"ux\" | \"apm\" | \"logs\" | \"profiling\" | \"dashboards\" | \"observabilityAIAssistant\" | \"home\" | \"canvas\" | \"integrations\" | \"discover\" | \"observability-overview\" | \"appSearch\" | \"dev_tools\" | \"maps\" | \"visualize\" | \"dev_tools:console\" | \"dev_tools:searchprofiler\" | \"dev_tools:painless_lab\" | \"dev_tools:grokdebugger\" | \"ml:notifications\" | \"ml:nodes\" | \"ml:overview\" | \"ml:memoryUsage\" | \"ml:settings\" | \"ml:dataVisualizer\" | \"ml:anomalyDetection\" | \"ml:anomalyExplorer\" | \"ml:singleMetricViewer\" | \"ml:dataDrift\" | \"ml:dataFrameAnalytics\" | \"ml:resultExplorer\" | \"ml:analyticsMap\" | \"ml:aiOps\" | \"ml:logRateAnalysis\" | \"ml:logPatternAnalysis\" | \"ml:changePointDetections\" | \"ml:modelManagement\" | \"ml:nodesOverview\" | \"ml:esqlDataVisualizer\" | \"ml:fileUpload\" | \"ml:indexDataVisualizer\" | \"ml:calendarSettings\" | \"ml:filterListsSettings\" | \"osquery\" | \"management:transform\" | \"management:watcher\" | \"management:cases\" | \"management:tags\" | \"management:maintenanceWindows\" | \"management:dataViews\" | \"management:spaces\" | \"management:settings\" | \"management:users\" | \"management:migrate_data\" | \"management:search_sessions\" | \"management:data_quality\" | \"management:filesManagement\" | \"management:roles\" | \"management:reporting\" | \"management:aiAssistantManagementSelection\" | \"management:securityAiAssistantManagement\" | \"management:observabilityAiAssistantManagement\" | \"management:api_keys\" | \"management:cross_cluster_replication\" | \"management:license_management\" | \"management:index_lifecycle_management\" | \"management:index_management\" | \"management:ingest_pipelines\" | \"management:jobsListLink\" | \"management:objects\" | \"management:pipelines\" | \"management:remote_clusters\" | \"management:role_mappings\" | \"management:rollup_jobs\" | \"management:snapshot_restore\" | \"management:triggersActions\" | \"management:triggersActionsConnectors\" | \"management:upgrade_assistant\" | \"enterpriseSearch\" | \"enterpriseSearchContent\" | \"enterpriseSearchApplications\" | \"enterpriseSearchRelevance\" | \"enterpriseSearchAnalytics\" | \"workplaceSearch\" | \"serverlessElasticsearch\" | \"serverlessConnectors\" | \"searchPlayground\" | \"searchInferenceEndpoints\" | \"searchHomepage\" | \"enterpriseSearchContent:connectors\" | \"enterpriseSearchContent:searchIndices\" | \"enterpriseSearchContent:webCrawlers\" | \"enterpriseSearchApplications:searchApplications\" | \"enterpriseSearchApplications:playground\" | \"appSearch:engines\" | \"enterpriseSearchRelevance:inferenceEndpoints\" | \"observability-logs-explorer\" | \"observabilityOnboarding\" | \"slo\" | \"logs:settings\" | \"logs:stream\" | \"logs:log-categories\" | \"logs:anomalies\" | \"observability-overview:cases\" | \"observability-overview:alerts\" | \"observability-overview:rules\" | \"observability-overview:cases_create\" | \"observability-overview:cases_configure\" | \"metrics:settings\" | \"metrics:hosts\" | \"metrics:inventory\" | \"metrics:metrics-explorer\" | \"metrics:assetDetails\" | \"apm:traces\" | \"apm:dependencies\" | \"apm:service-map\" | \"apm:settings\" | \"apm:services\" | \"apm:service-groups-list\" | \"apm:storage-explorer\" | \"synthetics:overview\" | \"synthetics:certificates\" | \"profiling:stacktraces\" | \"profiling:flamegraphs\" | \"profiling:functions\" | \"securitySolutionUI\" | \"securitySolutionUI:\" | \"securitySolutionUI:cases\" | \"securitySolutionUI:alerts\" | \"securitySolutionUI:rules\" | \"securitySolutionUI:policy\" | \"securitySolutionUI:overview\" | \"securitySolutionUI:dashboards\" | \"securitySolutionUI:cases_create\" | \"securitySolutionUI:cases_configure\" | \"securitySolutionUI:hosts\" | \"securitySolutionUI:users\" | \"securitySolutionUI:cloud_defend-policies\" | \"securitySolutionUI:cloud_security_posture-dashboard\" | \"securitySolutionUI:cloud_security_posture-findings\" | \"securitySolutionUI:cloud_security_posture-benchmarks\" | \"securitySolutionUI:kubernetes\" | \"securitySolutionUI:network\" | \"securitySolutionUI:data_quality\" | \"securitySolutionUI:explore\" | \"securitySolutionUI:assets\" | \"securitySolutionUI:cloud_defend\" | \"securitySolutionUI:administration\" | \"securitySolutionUI:attack_discovery\" | \"securitySolutionUI:blocklist\" | \"securitySolutionUI:cloud_security_posture-rules\" | \"securitySolutionUI:detections\" | \"securitySolutionUI:detection_response\" | \"securitySolutionUI:endpoints\" | \"securitySolutionUI:event_filters\" | \"securitySolutionUI:exceptions\" | \"securitySolutionUI:host_isolation_exceptions\" | \"securitySolutionUI:hosts-all\" | \"securitySolutionUI:hosts-anomalies\" | \"securitySolutionUI:hosts-risk\" | \"securitySolutionUI:hosts-events\" | \"securitySolutionUI:hosts-sessions\" | \"securitySolutionUI:hosts-uncommon_processes\" | \"securitySolutionUI:investigations\" | \"securitySolutionUI:get_started\" | \"securitySolutionUI:machine_learning-landing\" | \"securitySolutionUI:network-anomalies\" | \"securitySolutionUI:network-dns\" | \"securitySolutionUI:network-events\" | \"securitySolutionUI:network-flows\" | \"securitySolutionUI:network-http\" | \"securitySolutionUI:network-tls\" | \"securitySolutionUI:response_actions_history\" | \"securitySolutionUI:rules-add\" | \"securitySolutionUI:rules-create\" | \"securitySolutionUI:rules-landing\" | \"securitySolutionUI:threat_intelligence\" | \"securitySolutionUI:timelines\" | \"securitySolutionUI:timelines-templates\" | \"securitySolutionUI:trusted_apps\" | \"securitySolutionUI:users-all\" | \"securitySolutionUI:users-anomalies\" | \"securitySolutionUI:users-authentications\" | \"securitySolutionUI:users-events\" | \"securitySolutionUI:users-risk\" | \"securitySolutionUI:entity_analytics\" | \"securitySolutionUI:entity_analytics-management\" | \"securitySolutionUI:entity_analytics-asset-classification\" | \"securitySolutionUI:coverage-overview\" | \"securitySolutionUI:notes-management\" | \"fleet:settings\" | \"fleet:policies\" | \"fleet:data_streams\" | \"fleet:enrollment_tokens\" | \"fleet:uninstall_tokens\" | \"fleet:agents\"" ], "path": "packages/core/chrome/core-chrome-browser/src/project_navigation.ts", "deprecated": false, diff --git a/api_docs/kbn_core_chrome_browser.mdx b/api_docs/kbn_core_chrome_browser.mdx index 9cb5d2a53d915..d2f73aae6c56a 100644 --- a/api_docs/kbn_core_chrome_browser.mdx +++ b/api_docs/kbn_core_chrome_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-chrome-browser title: "@kbn/core-chrome-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-chrome-browser plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser'] --- import kbnCoreChromeBrowserObj from './kbn_core_chrome_browser.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser_mocks.mdx b/api_docs/kbn_core_chrome_browser_mocks.mdx index 7373765d0d017..f67dd9ab55dae 100644 --- a/api_docs/kbn_core_chrome_browser_mocks.mdx +++ b/api_docs/kbn_core_chrome_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-chrome-browser-mocks title: "@kbn/core-chrome-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-chrome-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser-mocks'] --- import kbnCoreChromeBrowserMocksObj from './kbn_core_chrome_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_config_server_internal.mdx b/api_docs/kbn_core_config_server_internal.mdx index 378c94028bf64..4d00542bb07f5 100644 --- a/api_docs/kbn_core_config_server_internal.mdx +++ b/api_docs/kbn_core_config_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-config-server-internal title: "@kbn/core-config-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-config-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-config-server-internal'] --- import kbnCoreConfigServerInternalObj from './kbn_core_config_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_browser.mdx b/api_docs/kbn_core_custom_branding_browser.mdx index 06b410cd07319..475603132fb38 100644 --- a/api_docs/kbn_core_custom_branding_browser.mdx +++ b/api_docs/kbn_core_custom_branding_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser title: "@kbn/core-custom-branding-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-browser plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser'] --- import kbnCoreCustomBrandingBrowserObj from './kbn_core_custom_branding_browser.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_browser_internal.mdx b/api_docs/kbn_core_custom_branding_browser_internal.mdx index 9ed9b49db2dac..5a3daa48a0991 100644 --- a/api_docs/kbn_core_custom_branding_browser_internal.mdx +++ b/api_docs/kbn_core_custom_branding_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser-internal title: "@kbn/core-custom-branding-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-browser-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser-internal'] --- import kbnCoreCustomBrandingBrowserInternalObj from './kbn_core_custom_branding_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_browser_mocks.mdx b/api_docs/kbn_core_custom_branding_browser_mocks.mdx index d69e098b41aae..a51c29a157dc7 100644 --- a/api_docs/kbn_core_custom_branding_browser_mocks.mdx +++ b/api_docs/kbn_core_custom_branding_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser-mocks title: "@kbn/core-custom-branding-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser-mocks'] --- import kbnCoreCustomBrandingBrowserMocksObj from './kbn_core_custom_branding_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_common.mdx b/api_docs/kbn_core_custom_branding_common.mdx index b89d96a9f13da..a968a84ebedb8 100644 --- a/api_docs/kbn_core_custom_branding_common.mdx +++ b/api_docs/kbn_core_custom_branding_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-common title: "@kbn/core-custom-branding-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-common'] --- import kbnCoreCustomBrandingCommonObj from './kbn_core_custom_branding_common.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_server.mdx b/api_docs/kbn_core_custom_branding_server.mdx index b3be44399b317..be06b7f5c071f 100644 --- a/api_docs/kbn_core_custom_branding_server.mdx +++ b/api_docs/kbn_core_custom_branding_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-server title: "@kbn/core-custom-branding-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server'] --- import kbnCoreCustomBrandingServerObj from './kbn_core_custom_branding_server.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_server_internal.mdx b/api_docs/kbn_core_custom_branding_server_internal.mdx index 7b5f869203f79..a8469ab10bd6c 100644 --- a/api_docs/kbn_core_custom_branding_server_internal.mdx +++ b/api_docs/kbn_core_custom_branding_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-server-internal title: "@kbn/core-custom-branding-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server-internal'] --- import kbnCoreCustomBrandingServerInternalObj from './kbn_core_custom_branding_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_server_mocks.mdx b/api_docs/kbn_core_custom_branding_server_mocks.mdx index bbf0a59e376b6..ff47ac18f388d 100644 --- a/api_docs/kbn_core_custom_branding_server_mocks.mdx +++ b/api_docs/kbn_core_custom_branding_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-server-mocks title: "@kbn/core-custom-branding-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server-mocks'] --- import kbnCoreCustomBrandingServerMocksObj from './kbn_core_custom_branding_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser.mdx b/api_docs/kbn_core_deprecations_browser.mdx index c451a8f7c07c9..8f547d585c521 100644 --- a/api_docs/kbn_core_deprecations_browser.mdx +++ b/api_docs/kbn_core_deprecations_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser title: "@kbn/core-deprecations-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser plugin -date: 2024-07-04 +date: 2024-07-11 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 7db21e9ea3a7c..0d1f50c631c94 100644 --- a/api_docs/kbn_core_deprecations_browser_internal.mdx +++ b/api_docs/kbn_core_deprecations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-internal title: "@kbn/core-deprecations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 25c2c6800cc6b..588882107a59e 100644 --- a/api_docs/kbn_core_deprecations_browser_mocks.mdx +++ b/api_docs/kbn_core_deprecations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-mocks title: "@kbn/core-deprecations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 15acea6cb1d37..72c2fd828595f 100644 --- a/api_docs/kbn_core_deprecations_common.mdx +++ b/api_docs/kbn_core_deprecations_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-common title: "@kbn/core-deprecations-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-common'] --- import kbnCoreDeprecationsCommonObj from './kbn_core_deprecations_common.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server.mdx b/api_docs/kbn_core_deprecations_server.mdx index 641b5a185ff0a..ad8707b012f6f 100644 --- a/api_docs/kbn_core_deprecations_server.mdx +++ b/api_docs/kbn_core_deprecations_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server title: "@kbn/core-deprecations-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server'] --- import kbnCoreDeprecationsServerObj from './kbn_core_deprecations_server.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server_internal.mdx b/api_docs/kbn_core_deprecations_server_internal.mdx index f34fdd8d60dfa..beb2ee0960c03 100644 --- a/api_docs/kbn_core_deprecations_server_internal.mdx +++ b/api_docs/kbn_core_deprecations_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server-internal title: "@kbn/core-deprecations-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server-internal'] --- import kbnCoreDeprecationsServerInternalObj from './kbn_core_deprecations_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server_mocks.mdx b/api_docs/kbn_core_deprecations_server_mocks.mdx index 75a2b74b810a6..8631921d2992d 100644 --- a/api_docs/kbn_core_deprecations_server_mocks.mdx +++ b/api_docs/kbn_core_deprecations_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server-mocks title: "@kbn/core-deprecations-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server-mocks'] --- import kbnCoreDeprecationsServerMocksObj from './kbn_core_deprecations_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser.mdx b/api_docs/kbn_core_doc_links_browser.mdx index 1f5a4189168dc..c01a5ad288fc7 100644 --- a/api_docs/kbn_core_doc_links_browser.mdx +++ b/api_docs/kbn_core_doc_links_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser title: "@kbn/core-doc-links-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser plugin -date: 2024-07-04 +date: 2024-07-11 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 942dc89e69074..05a02d042fe8f 100644 --- a/api_docs/kbn_core_doc_links_browser_mocks.mdx +++ b/api_docs/kbn_core_doc_links_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser-mocks title: "@kbn/core-doc-links-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 0fbdab2dc825e..34c6ab10fa7b1 100644 --- a/api_docs/kbn_core_doc_links_server.mdx +++ b/api_docs/kbn_core_doc_links_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server title: "@kbn/core-doc-links-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server plugin -date: 2024-07-04 +date: 2024-07-11 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 3205139fd555f..0714172c5b8de 100644 --- a/api_docs/kbn_core_doc_links_server_mocks.mdx +++ b/api_docs/kbn_core_doc_links_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server-mocks title: "@kbn/core-doc-links-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 7dd318b0c67e0..97ca9a1453d76 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-internal title: "@kbn/core-elasticsearch-client-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-internal'] --- import kbnCoreElasticsearchClientServerInternalObj from './kbn_core_elasticsearch_client_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx index f0bf95a1cd52f..7dd9526228567 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-mocks title: "@kbn/core-elasticsearch-client-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-mocks'] --- import kbnCoreElasticsearchClientServerMocksObj from './kbn_core_elasticsearch_client_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server.mdx b/api_docs/kbn_core_elasticsearch_server.mdx index 3351868931096..5eca94f8a20cb 100644 --- a/api_docs/kbn_core_elasticsearch_server.mdx +++ b/api_docs/kbn_core_elasticsearch_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server title: "@kbn/core-elasticsearch-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server'] --- import kbnCoreElasticsearchServerObj from './kbn_core_elasticsearch_server.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_internal.mdx b/api_docs/kbn_core_elasticsearch_server_internal.mdx index 8633efabde5e9..99a59f4b23f87 100644 --- a/api_docs/kbn_core_elasticsearch_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-internal title: "@kbn/core-elasticsearch-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 7b443a8b11fe2..e2e309d7bd0de 100644 --- a/api_docs/kbn_core_elasticsearch_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-mocks title: "@kbn/core-elasticsearch-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 38b4146f24787..bb23363db38e1 100644 --- a/api_docs/kbn_core_environment_server_internal.mdx +++ b/api_docs/kbn_core_environment_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-internal title: "@kbn/core-environment-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 a1a858bb5be89..33b321249e0cc 100644 --- a/api_docs/kbn_core_environment_server_mocks.mdx +++ b/api_docs/kbn_core_environment_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-mocks title: "@kbn/core-environment-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 da02a8935a0d3..fc956352f0656 100644 --- a/api_docs/kbn_core_execution_context_browser.mdx +++ b/api_docs/kbn_core_execution_context_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser title: "@kbn/core-execution-context-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser plugin -date: 2024-07-04 +date: 2024-07-11 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 f59af70e46853..1ef300a06de87 100644 --- a/api_docs/kbn_core_execution_context_browser_internal.mdx +++ b/api_docs/kbn_core_execution_context_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-internal title: "@kbn/core-execution-context-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 4d65437673e39..a33c5c4e26238 100644 --- a/api_docs/kbn_core_execution_context_browser_mocks.mdx +++ b/api_docs/kbn_core_execution_context_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-mocks title: "@kbn/core-execution-context-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 717c142b37295..94084a3fe62d4 100644 --- a/api_docs/kbn_core_execution_context_common.mdx +++ b/api_docs/kbn_core_execution_context_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-common title: "@kbn/core-execution-context-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-common plugin -date: 2024-07-04 +date: 2024-07-11 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 e42630e08b844..e66dbd0069486 100644 --- a/api_docs/kbn_core_execution_context_server.mdx +++ b/api_docs/kbn_core_execution_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server title: "@kbn/core-execution-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server plugin -date: 2024-07-04 +date: 2024-07-11 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 d38a76050d05a..a927c475362de 100644 --- a/api_docs/kbn_core_execution_context_server_internal.mdx +++ b/api_docs/kbn_core_execution_context_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-internal title: "@kbn/core-execution-context-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 19cebee1adc25..20cb7e687ce02 100644 --- a/api_docs/kbn_core_execution_context_server_mocks.mdx +++ b/api_docs/kbn_core_execution_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-mocks title: "@kbn/core-execution-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 09df105043fc1..064521832e249 100644 --- a/api_docs/kbn_core_fatal_errors_browser.mdx +++ b/api_docs/kbn_core_fatal_errors_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser title: "@kbn/core-fatal-errors-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser plugin -date: 2024-07-04 +date: 2024-07-11 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 37b248aad2a74..45f97c1d78e79 100644 --- a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx +++ b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser-mocks title: "@kbn/core-fatal-errors-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 e7f94c4069ab0..39124862a3323 100644 --- a/api_docs/kbn_core_http_browser.mdx +++ b/api_docs/kbn_core_http_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser title: "@kbn/core-http-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser plugin -date: 2024-07-04 +date: 2024-07-11 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 7ac33b69787c7..95dfc7b0d171a 100644 --- a/api_docs/kbn_core_http_browser_internal.mdx +++ b/api_docs/kbn_core_http_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-internal title: "@kbn/core-http-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 0344c80534a39..5ba46583dc125 100644 --- a/api_docs/kbn_core_http_browser_mocks.mdx +++ b/api_docs/kbn_core_http_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-mocks title: "@kbn/core-http-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 27e9324ee3910..93983bf356095 100644 --- a/api_docs/kbn_core_http_common.mdx +++ b/api_docs/kbn_core_http_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-common title: "@kbn/core-http-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-common plugin -date: 2024-07-04 +date: 2024-07-11 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 9cd138367f4bb..01ca25c21e898 100644 --- a/api_docs/kbn_core_http_context_server_mocks.mdx +++ b/api_docs/kbn_core_http_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-context-server-mocks title: "@kbn/core-http-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-context-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-context-server-mocks'] --- import kbnCoreHttpContextServerMocksObj from './kbn_core_http_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_request_handler_context_server.mdx b/api_docs/kbn_core_http_request_handler_context_server.mdx index 8802133a859e9..0cad736e16410 100644 --- a/api_docs/kbn_core_http_request_handler_context_server.mdx +++ b/api_docs/kbn_core_http_request_handler_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-request-handler-context-server title: "@kbn/core-http-request-handler-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-request-handler-context-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-request-handler-context-server'] --- import kbnCoreHttpRequestHandlerContextServerObj from './kbn_core_http_request_handler_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server.mdx b/api_docs/kbn_core_http_resources_server.mdx index 8077c6d898552..5663ea45d0e3e 100644 --- a/api_docs/kbn_core_http_resources_server.mdx +++ b/api_docs/kbn_core_http_resources_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server title: "@kbn/core-http-resources-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server'] --- import kbnCoreHttpResourcesServerObj from './kbn_core_http_resources_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server_internal.mdx b/api_docs/kbn_core_http_resources_server_internal.mdx index 9446bbd64772d..a66883c9f2ebe 100644 --- a/api_docs/kbn_core_http_resources_server_internal.mdx +++ b/api_docs/kbn_core_http_resources_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server-internal title: "@kbn/core-http-resources-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server-internal'] --- import kbnCoreHttpResourcesServerInternalObj from './kbn_core_http_resources_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server_mocks.mdx b/api_docs/kbn_core_http_resources_server_mocks.mdx index 573d50f8a8025..a03d2453be975 100644 --- a/api_docs/kbn_core_http_resources_server_mocks.mdx +++ b/api_docs/kbn_core_http_resources_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server-mocks title: "@kbn/core-http-resources-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server-mocks'] --- import kbnCoreHttpResourcesServerMocksObj from './kbn_core_http_resources_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_internal.mdx b/api_docs/kbn_core_http_router_server_internal.mdx index 05d5c6f837f20..6f7f444953b0e 100644 --- a/api_docs/kbn_core_http_router_server_internal.mdx +++ b/api_docs/kbn_core_http_router_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-internal title: "@kbn/core-http-router-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 72329d8b5e6df..a3d1fa4bc7086 100644 --- a/api_docs/kbn_core_http_router_server_mocks.mdx +++ b/api_docs/kbn_core_http_router_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-mocks title: "@kbn/core-http-router-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-mocks'] --- import kbnCoreHttpRouterServerMocksObj from './kbn_core_http_router_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_server.devdocs.json b/api_docs/kbn_core_http_server.devdocs.json index ec187c7f4458f..6a882bc634e54 100644 --- a/api_docs/kbn_core_http_server.devdocs.json +++ b/api_docs/kbn_core_http_server.devdocs.json @@ -6484,6 +6484,10 @@ "plugin": "alerting", "path": "x-pack/plugins/alerting/server/routes/backfill/apis/find/find_backfill_route.ts" }, + { + "plugin": "ruleRegistry", + "path": "x-pack/plugins/rule_registry/server/routes/get_alerts_group_aggregations.ts" + }, { "plugin": "ruleRegistry", "path": "x-pack/plugins/rule_registry/server/routes/update_alert_by_id.ts" @@ -9634,6 +9638,10 @@ "plugin": "reporting", "path": "x-pack/plugins/reporting/server/test_helpers/create_mock_reportingplugin.ts" }, + { + "plugin": "searchInferenceEndpoints", + "path": "x-pack/plugins/search_inference_endpoints/server/routes.ts" + }, { "plugin": "serverlessSearch", "path": "x-pack/plugins/serverless_search/server/routes/connectors_routes.ts" @@ -14634,6 +14642,22 @@ "plugin": "infra", "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.ts" + }, { "plugin": "osquery", "path": "x-pack/plugins/osquery/server/routes/live_query/get_live_query_details_route.ts" @@ -14706,22 +14730,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/find_rules/route.ts" @@ -14830,6 +14838,10 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/privileges.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/list.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/status.ts" @@ -15309,10 +15321,6 @@ "plugin": "infra", "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts" - }, { "plugin": "osquery", "path": "x-pack/plugins/osquery/server/routes/saved_query/update_saved_query_route.ts" @@ -15321,6 +15329,10 @@ "plugin": "osquery", "path": "x-pack/plugins/osquery/server/routes/pack/update_pack_route.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_update_rules/route.ts" @@ -16070,15 +16082,19 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/index.ts" + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.ts" + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_rule_health/get_rule_health_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/index.ts" + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/setup/setup_health_route.ts" }, { "plugin": "osquery", @@ -16098,35 +16114,31 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_installation/review_rule_installation_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_upgrade/review_rule_upgrade_route.ts" + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_installation/perform_rule_installation_route.ts" + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/perform_rule_upgrade_route.ts" + "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts" + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_installation/review_rule_installation_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_rule_health/get_rule_health_route.ts" + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_upgrade/review_rule_upgrade_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_route.ts" + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_installation/perform_rule_installation_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/setup/setup_health_route.ts" + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/perform_rule_upgrade_route.ts" }, { "plugin": "securitySolution", diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index b9d08d7077575..614c3b9a7b7e2 100644 --- a/api_docs/kbn_core_http_server.mdx +++ b/api_docs/kbn_core_http_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server title: "@kbn/core-http-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server'] --- import kbnCoreHttpServerObj from './kbn_core_http_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_internal.devdocs.json b/api_docs/kbn_core_http_server_internal.devdocs.json index e27b8b2b2a987..db84770e5f81f 100644 --- a/api_docs/kbn_core_http_server_internal.devdocs.json +++ b/api_docs/kbn_core_http_server_internal.devdocs.json @@ -1463,7 +1463,7 @@ "label": "HttpConfigType", "description": [], "signature": [ - "{ readonly uuid?: string | undefined; readonly basePath?: string | undefined; readonly publicBaseUrl?: string | undefined; readonly name: string; readonly ssl: Readonly<{ key?: string | undefined; certificateAuthorities?: string | string[] | undefined; certificate?: string | undefined; keyPassphrase?: string | undefined; redirectHttpFromPort?: number | undefined; } & { enabled: boolean; keystore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; truststore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; cipherSuites: string[]; supportedProtocols: string[]; clientAuthentication: \"none\" | \"optional\" | \"required\"; }>; readonly host: string; readonly http2: Readonly<{} & { allowUnsecure: boolean; }>; readonly protocol: \"http1\" | \"http2\"; readonly port: number; readonly compression: Readonly<{ referrerWhitelist?: string[] | undefined; } & { enabled: boolean; brotli: Readonly<{} & { enabled: boolean; quality: number; }>; }>; readonly cors: Readonly<{} & { enabled: boolean; allowCredentials: boolean; allowOrigin: string[] | \"*\"[]; }>; readonly versioned: Readonly<{} & { useVersionResolutionStrategyForInternalPaths: string[]; versionResolution: \"none\" | \"oldest\" | \"newest\"; strictClientVersionCheck: boolean; }>; readonly autoListen: boolean; readonly shutdownTimeout: moment.Duration; readonly cdn: Readonly<{ url?: string | null | undefined; } & {}>; readonly oas: Readonly<{} & { enabled: boolean; }>; readonly securityResponseHeaders: Readonly<{} & { referrerPolicy: \"origin\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\" | null; strictTransportSecurity: string | null; xContentTypeOptions: \"nosniff\" | null; permissionsPolicy: string | null; disableEmbedding: boolean; crossOriginOpenerPolicy: \"same-origin\" | \"unsafe-none\" | \"same-origin-allow-popups\" | null; }>; readonly customResponseHeaders: Record; readonly maxPayload: ", + "{ readonly uuid?: string | undefined; readonly basePath?: string | undefined; readonly publicBaseUrl?: string | undefined; readonly name: string; readonly ssl: Readonly<{ key?: string | undefined; certificateAuthorities?: string | string[] | undefined; certificate?: string | undefined; keyPassphrase?: string | undefined; redirectHttpFromPort?: number | undefined; } & { enabled: boolean; keystore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; truststore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; cipherSuites: string[]; supportedProtocols: string[]; clientAuthentication: \"none\" | \"optional\" | \"required\"; }>; readonly host: string; readonly http2: Readonly<{} & { allowUnsecure: boolean; }>; readonly protocol: \"http1\" | \"http2\"; readonly port: number; readonly compression: Readonly<{ referrerWhitelist?: string[] | undefined; } & { enabled: boolean; brotli: Readonly<{} & { enabled: boolean; quality: number; }>; }>; readonly cors: Readonly<{} & { enabled: boolean; allowCredentials: boolean; allowOrigin: string[] | \"*\"[]; }>; readonly versioned: Readonly<{} & { useVersionResolutionStrategyForInternalPaths: string[]; versionResolution: \"none\" | \"oldest\" | \"newest\"; strictClientVersionCheck: boolean; }>; readonly autoListen: boolean; readonly shutdownTimeout: moment.Duration; readonly cdn: Readonly<{ url?: string | null | undefined; } & {}>; readonly oas: Readonly<{} & { enabled: boolean; }>; readonly securityResponseHeaders: Readonly<{ permissionsPolicyReportOnly?: string | null | undefined; } & { referrerPolicy: \"origin\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\" | null; strictTransportSecurity: string | null; xContentTypeOptions: \"nosniff\" | null; permissionsPolicy: string | null; disableEmbedding: boolean; crossOriginOpenerPolicy: \"same-origin\" | \"unsafe-none\" | \"same-origin-allow-popups\" | null; }>; readonly customResponseHeaders: Record; readonly maxPayload: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -1717,6 +1717,60 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-http-server-internal", + "id": "def-common.permissionsPolicyConfig", + "type": "Object", + "tags": [], + "label": "permissionsPolicyConfig", + "description": [], + "path": "packages/core/http/core-http-server-internal/src/permissions_policy/config.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-http-server-internal", + "id": "def-common.permissionsPolicyConfig.path", + "type": "string", + "tags": [], + "label": "path", + "description": [], + "path": "packages/core/http/core-http-server-internal/src/permissions_policy/config.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-http-server-internal", + "id": "def-common.permissionsPolicyConfig.schema", + "type": "Object", + "tags": [], + "label": "schema", + "description": [], + "signature": [ + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.ObjectType", + "text": "ObjectType" + }, + "<{ report_to: ", + { + "pluginId": "@kbn/config-schema", + "scope": "common", + "docId": "kibKbnConfigSchemaPluginApi", + "section": "def-common.Type", + "text": "Type" + }, + "; }>" + ], + "path": "packages/core/http/core-http-server-internal/src/permissions_policy/config.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false } ] } diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index 23dd73e1eb0ea..2d330ecb3f7b3 100644 --- a/api_docs/kbn_core_http_server_internal.mdx +++ b/api_docs/kbn_core_http_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-internal title: "@kbn/core-http-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-internal'] --- import kbnCoreHttpServerInternalObj from './kbn_core_http_server_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 92 | 0 | 79 | 10 | +| 95 | 0 | 82 | 10 | ## Common diff --git a/api_docs/kbn_core_http_server_mocks.devdocs.json b/api_docs/kbn_core_http_server_mocks.devdocs.json index 765ba95d4de08..142e3ae6eba5b 100644 --- a/api_docs/kbn_core_http_server_mocks.devdocs.json +++ b/api_docs/kbn_core_http_server_mocks.devdocs.json @@ -27,7 +27,7 @@ "label": "createConfigService", "description": [], "signature": [ - "({ server, externalUrl, csp, }?: Partial<{ server: Partial; truststore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; cipherSuites: string[]; supportedProtocols: string[]; clientAuthentication: \"none\" | \"optional\" | \"required\"; }>; host: string; http2: Readonly<{} & { allowUnsecure: boolean; }>; protocol: \"http1\" | \"http2\"; port: number; compression: Readonly<{ referrerWhitelist?: string[] | undefined; } & { enabled: boolean; brotli: Readonly<{} & { enabled: boolean; quality: number; }>; }>; cors: Readonly<{} & { enabled: boolean; allowCredentials: boolean; allowOrigin: string[] | \"*\"[]; }>; versioned: Readonly<{} & { useVersionResolutionStrategyForInternalPaths: string[]; versionResolution: \"none\" | \"oldest\" | \"newest\"; strictClientVersionCheck: boolean; }>; autoListen: boolean; shutdownTimeout: moment.Duration; cdn: Readonly<{ url?: string | null | undefined; } & {}>; oas: Readonly<{} & { enabled: boolean; }>; securityResponseHeaders: Readonly<{} & { referrerPolicy: \"origin\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\" | null; strictTransportSecurity: string | null; xContentTypeOptions: \"nosniff\" | null; permissionsPolicy: string | null; disableEmbedding: boolean; crossOriginOpenerPolicy: \"same-origin\" | \"unsafe-none\" | \"same-origin-allow-popups\" | null; }>; customResponseHeaders: Record; maxPayload: ", + "({ server, externalUrl, csp, }?: Partial<{ server: Partial; truststore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; cipherSuites: string[]; supportedProtocols: string[]; clientAuthentication: \"none\" | \"optional\" | \"required\"; }>; host: string; http2: Readonly<{} & { allowUnsecure: boolean; }>; protocol: \"http1\" | \"http2\"; port: number; compression: Readonly<{ referrerWhitelist?: string[] | undefined; } & { enabled: boolean; brotli: Readonly<{} & { enabled: boolean; quality: number; }>; }>; cors: Readonly<{} & { enabled: boolean; allowCredentials: boolean; allowOrigin: string[] | \"*\"[]; }>; versioned: Readonly<{} & { useVersionResolutionStrategyForInternalPaths: string[]; versionResolution: \"none\" | \"oldest\" | \"newest\"; strictClientVersionCheck: boolean; }>; autoListen: boolean; shutdownTimeout: moment.Duration; cdn: Readonly<{ url?: string | null | undefined; } & {}>; oas: Readonly<{} & { enabled: boolean; }>; securityResponseHeaders: Readonly<{ permissionsPolicyReportOnly?: string | null | undefined; } & { referrerPolicy: \"origin\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\" | null; strictTransportSecurity: string | null; xContentTypeOptions: \"nosniff\" | null; permissionsPolicy: string | null; disableEmbedding: boolean; crossOriginOpenerPolicy: \"same-origin\" | \"unsafe-none\" | \"same-origin-allow-popups\" | null; }>; customResponseHeaders: Record; maxPayload: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -64,7 +64,7 @@ "label": "{\n server,\n externalUrl,\n csp,\n}", "description": [], "signature": [ - "Partial<{ server: Partial; truststore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; cipherSuites: string[]; supportedProtocols: string[]; clientAuthentication: \"none\" | \"optional\" | \"required\"; }>; host: string; http2: Readonly<{} & { allowUnsecure: boolean; }>; protocol: \"http1\" | \"http2\"; port: number; compression: Readonly<{ referrerWhitelist?: string[] | undefined; } & { enabled: boolean; brotli: Readonly<{} & { enabled: boolean; quality: number; }>; }>; cors: Readonly<{} & { enabled: boolean; allowCredentials: boolean; allowOrigin: string[] | \"*\"[]; }>; versioned: Readonly<{} & { useVersionResolutionStrategyForInternalPaths: string[]; versionResolution: \"none\" | \"oldest\" | \"newest\"; strictClientVersionCheck: boolean; }>; autoListen: boolean; shutdownTimeout: moment.Duration; cdn: Readonly<{ url?: string | null | undefined; } & {}>; oas: Readonly<{} & { enabled: boolean; }>; securityResponseHeaders: Readonly<{} & { referrerPolicy: \"origin\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\" | null; strictTransportSecurity: string | null; xContentTypeOptions: \"nosniff\" | null; permissionsPolicy: string | null; disableEmbedding: boolean; crossOriginOpenerPolicy: \"same-origin\" | \"unsafe-none\" | \"same-origin-allow-popups\" | null; }>; customResponseHeaders: Record; maxPayload: ", + "Partial<{ server: Partial; truststore: Readonly<{ password?: string | undefined; path?: string | undefined; } & {}>; cipherSuites: string[]; supportedProtocols: string[]; clientAuthentication: \"none\" | \"optional\" | \"required\"; }>; host: string; http2: Readonly<{} & { allowUnsecure: boolean; }>; protocol: \"http1\" | \"http2\"; port: number; compression: Readonly<{ referrerWhitelist?: string[] | undefined; } & { enabled: boolean; brotli: Readonly<{} & { enabled: boolean; quality: number; }>; }>; cors: Readonly<{} & { enabled: boolean; allowCredentials: boolean; allowOrigin: string[] | \"*\"[]; }>; versioned: Readonly<{} & { useVersionResolutionStrategyForInternalPaths: string[]; versionResolution: \"none\" | \"oldest\" | \"newest\"; strictClientVersionCheck: boolean; }>; autoListen: boolean; shutdownTimeout: moment.Duration; cdn: Readonly<{ url?: string | null | undefined; } & {}>; oas: Readonly<{} & { enabled: boolean; }>; securityResponseHeaders: Readonly<{ permissionsPolicyReportOnly?: string | null | undefined; } & { referrerPolicy: \"origin\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-when-cross-origin\" | \"same-origin\" | \"strict-origin\" | \"strict-origin-when-cross-origin\" | \"unsafe-url\" | null; strictTransportSecurity: string | null; xContentTypeOptions: \"nosniff\" | null; permissionsPolicy: string | null; disableEmbedding: boolean; crossOriginOpenerPolicy: \"same-origin\" | \"unsafe-none\" | \"same-origin-allow-popups\" | null; }>; customResponseHeaders: Record; maxPayload: ", { "pluginId": "@kbn/config-schema", "scope": "common", diff --git a/api_docs/kbn_core_http_server_mocks.mdx b/api_docs/kbn_core_http_server_mocks.mdx index 22068d6c6344f..cfded8d56635f 100644 --- a/api_docs/kbn_core_http_server_mocks.mdx +++ b/api_docs/kbn_core_http_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-mocks title: "@kbn/core-http-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 0d334ee353c3f..d7a3c9641cc07 100644 --- a/api_docs/kbn_core_i18n_browser.mdx +++ b/api_docs/kbn_core_i18n_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser title: "@kbn/core-i18n-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser plugin -date: 2024-07-04 +date: 2024-07-11 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 5b6acb3311459..b06ad10414620 100644 --- a/api_docs/kbn_core_i18n_browser_mocks.mdx +++ b/api_docs/kbn_core_i18n_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser-mocks title: "@kbn/core-i18n-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser-mocks'] --- import kbnCoreI18nBrowserMocksObj from './kbn_core_i18n_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server.mdx b/api_docs/kbn_core_i18n_server.mdx index 6cd1be3691db1..c7b11d5a18cb9 100644 --- a/api_docs/kbn_core_i18n_server.mdx +++ b/api_docs/kbn_core_i18n_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server title: "@kbn/core-i18n-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server'] --- import kbnCoreI18nServerObj from './kbn_core_i18n_server.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server_internal.mdx b/api_docs/kbn_core_i18n_server_internal.mdx index 74f03676bf70b..dd078b381f972 100644 --- a/api_docs/kbn_core_i18n_server_internal.mdx +++ b/api_docs/kbn_core_i18n_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server-internal title: "@kbn/core-i18n-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server-internal'] --- import kbnCoreI18nServerInternalObj from './kbn_core_i18n_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server_mocks.mdx b/api_docs/kbn_core_i18n_server_mocks.mdx index 03b7e3166b315..0f1a495092a62 100644 --- a/api_docs/kbn_core_i18n_server_mocks.mdx +++ b/api_docs/kbn_core_i18n_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server-mocks title: "@kbn/core-i18n-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server-mocks'] --- import kbnCoreI18nServerMocksObj from './kbn_core_i18n_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx index 9343732449d42..aeb737f9486a5 100644 --- a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx +++ b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser-mocks title: "@kbn/core-injected-metadata-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-injected-metadata-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 09321f2d90d6c..132a752867fed 100644 --- a/api_docs/kbn_core_integrations_browser_internal.mdx +++ b/api_docs/kbn_core_integrations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-internal title: "@kbn/core-integrations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 ea1efdb2409ef..69b7fcfccb430 100644 --- a/api_docs/kbn_core_integrations_browser_mocks.mdx +++ b/api_docs/kbn_core_integrations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-mocks title: "@kbn/core-integrations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-mocks'] --- import kbnCoreIntegrationsBrowserMocksObj from './kbn_core_integrations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_browser.mdx b/api_docs/kbn_core_lifecycle_browser.mdx index edc79194fb8c0..2f90e1916554e 100644 --- a/api_docs/kbn_core_lifecycle_browser.mdx +++ b/api_docs/kbn_core_lifecycle_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-browser title: "@kbn/core-lifecycle-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-browser plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-browser'] --- import kbnCoreLifecycleBrowserObj from './kbn_core_lifecycle_browser.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_browser_mocks.mdx b/api_docs/kbn_core_lifecycle_browser_mocks.mdx index 0e0a13a837f21..20bc6881efb28 100644 --- a/api_docs/kbn_core_lifecycle_browser_mocks.mdx +++ b/api_docs/kbn_core_lifecycle_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-browser-mocks title: "@kbn/core-lifecycle-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-browser-mocks'] --- import kbnCoreLifecycleBrowserMocksObj from './kbn_core_lifecycle_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_server.mdx b/api_docs/kbn_core_lifecycle_server.mdx index 5dae2c747e3af..84afe340bafaf 100644 --- a/api_docs/kbn_core_lifecycle_server.mdx +++ b/api_docs/kbn_core_lifecycle_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-server title: "@kbn/core-lifecycle-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server'] --- import kbnCoreLifecycleServerObj from './kbn_core_lifecycle_server.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_server_mocks.mdx b/api_docs/kbn_core_lifecycle_server_mocks.mdx index 016e933ac2929..09f38b1e9e14b 100644 --- a/api_docs/kbn_core_lifecycle_server_mocks.mdx +++ b/api_docs/kbn_core_lifecycle_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-server-mocks title: "@kbn/core-lifecycle-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server-mocks'] --- import kbnCoreLifecycleServerMocksObj from './kbn_core_lifecycle_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_logging_browser_mocks.mdx b/api_docs/kbn_core_logging_browser_mocks.mdx index 5a8771709a080..4e327029c6e75 100644 --- a/api_docs/kbn_core_logging_browser_mocks.mdx +++ b/api_docs/kbn_core_logging_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-browser-mocks title: "@kbn/core-logging-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-browser-mocks'] --- import kbnCoreLoggingBrowserMocksObj from './kbn_core_logging_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_logging_common_internal.mdx b/api_docs/kbn_core_logging_common_internal.mdx index ea76e4f731e3b..d913047ca8b58 100644 --- a/api_docs/kbn_core_logging_common_internal.mdx +++ b/api_docs/kbn_core_logging_common_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-common-internal title: "@kbn/core-logging-common-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-common-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-common-internal'] --- import kbnCoreLoggingCommonInternalObj from './kbn_core_logging_common_internal.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server.mdx b/api_docs/kbn_core_logging_server.mdx index 16c903cab3135..aa313b06ce52e 100644 --- a/api_docs/kbn_core_logging_server.mdx +++ b/api_docs/kbn_core_logging_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server title: "@kbn/core-logging-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server'] --- import kbnCoreLoggingServerObj from './kbn_core_logging_server.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_internal.mdx b/api_docs/kbn_core_logging_server_internal.mdx index 6465278b4bf60..8f4f0db0e831b 100644 --- a/api_docs/kbn_core_logging_server_internal.mdx +++ b/api_docs/kbn_core_logging_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-internal title: "@kbn/core-logging-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 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.devdocs.json b/api_docs/kbn_core_logging_server_mocks.devdocs.json index 329bb66b1d81f..ea54ba1fab35b 100644 --- a/api_docs/kbn_core_logging_server_mocks.devdocs.json +++ b/api_docs/kbn_core_logging_server_mocks.devdocs.json @@ -158,7 +158,7 @@ "section": "def-common.LoggerFactory", "text": "LoggerFactory" }, - ") => { debug: [message: string, meta?: ", + ") => { debug: ([string] | [string, ", { "pluginId": "@kbn/logging", "scope": "common", @@ -166,7 +166,7 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - " | undefined][]; error: [errorOrMessage: string | Error, meta?: ", + " | undefined])[]; error: ([string | Error] | [string | Error, ", { "pluginId": "@kbn/logging", "scope": "common", @@ -174,7 +174,7 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - " | undefined][]; fatal: [errorOrMessage: string | Error, meta?: ", + " | undefined])[]; fatal: ([string | Error] | [string | Error, ", { "pluginId": "@kbn/logging", "scope": "common", @@ -182,7 +182,7 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - " | undefined][]; info: [message: string, meta?: ", + " | undefined])[]; info: ([string] | [string, ", { "pluginId": "@kbn/logging", "scope": "common", @@ -190,9 +190,9 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - " | undefined][]; log: [record: ", + " | undefined])[]; log: [record: ", "LogRecord", - "][]; trace: [message: string, meta?: ", + "][]; trace: ([string] | [string, ", { "pluginId": "@kbn/logging", "scope": "common", @@ -200,7 +200,7 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - " | undefined][]; warn: [errorOrMessage: string | Error, meta?: ", + " | undefined])[]; warn: ([string | Error] | [string | Error, ", { "pluginId": "@kbn/logging", "scope": "common", @@ -208,7 +208,7 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - " | undefined][]; }" + " | undefined])[]; }" ], "path": "packages/core/logging/core-logging-server-mocks/src/logging_system.mock.ts", "deprecated": false, diff --git a/api_docs/kbn_core_logging_server_mocks.mdx b/api_docs/kbn_core_logging_server_mocks.mdx index fd43647355239..5e3f3f033a40c 100644 --- a/api_docs/kbn_core_logging_server_mocks.mdx +++ b/api_docs/kbn_core_logging_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-mocks title: "@kbn/core-logging-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 9378f2bf4e6ce..b40391cf960de 100644 --- a/api_docs/kbn_core_metrics_collectors_server_internal.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-internal title: "@kbn/core-metrics-collectors-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 52011a479a28e..eae30f58c6863 100644 --- a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-mocks title: "@kbn/core-metrics-collectors-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-mocks'] --- import kbnCoreMetricsCollectorsServerMocksObj from './kbn_core_metrics_collectors_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server.devdocs.json b/api_docs/kbn_core_metrics_server.devdocs.json index 94105c95f94cd..6dfa3e47827bf 100644 --- a/api_docs/kbn_core_metrics_server.devdocs.json +++ b/api_docs/kbn_core_metrics_server.devdocs.json @@ -908,7 +908,7 @@ "\nProtocol(s) used by the Elasticsearch Client" ], "signature": [ - "\"none\" | \"http\" | \"mixed\" | \"https\"" + "\"none\" | \"mixed\" | \"http\" | \"https\"" ], "path": "packages/core/metrics/core-metrics-server/src/metrics.ts", "deprecated": false, diff --git a/api_docs/kbn_core_metrics_server.mdx b/api_docs/kbn_core_metrics_server.mdx index 4b73f7c6e5c61..adb6933ac0b3e 100644 --- a/api_docs/kbn_core_metrics_server.mdx +++ b/api_docs/kbn_core_metrics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server title: "@kbn/core-metrics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server plugin -date: 2024-07-04 +date: 2024-07-11 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 6164195df38cf..bd353e1fbb474 100644 --- a/api_docs/kbn_core_metrics_server_internal.mdx +++ b/api_docs/kbn_core_metrics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-internal title: "@kbn/core-metrics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 6ccf8f3b59c5b..ed05e8b871e13 100644 --- a/api_docs/kbn_core_metrics_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-mocks title: "@kbn/core-metrics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 d52a9efb9c932..785347717a7b0 100644 --- a/api_docs/kbn_core_mount_utils_browser.mdx +++ b/api_docs/kbn_core_mount_utils_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-mount-utils-browser title: "@kbn/core-mount-utils-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-mount-utils-browser plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-mount-utils-browser'] --- import kbnCoreMountUtilsBrowserObj from './kbn_core_mount_utils_browser.devdocs.json'; diff --git a/api_docs/kbn_core_node_server.mdx b/api_docs/kbn_core_node_server.mdx index 3aeeb1d4836d9..6703f92b23c37 100644 --- a/api_docs/kbn_core_node_server.mdx +++ b/api_docs/kbn_core_node_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server title: "@kbn/core-node-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server plugin -date: 2024-07-04 +date: 2024-07-11 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 53f6518c996fa..b36d927b144df 100644 --- a/api_docs/kbn_core_node_server_internal.mdx +++ b/api_docs/kbn_core_node_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-internal title: "@kbn/core-node-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 f5d0a6b98fd4a..2098ce8ef277f 100644 --- a/api_docs/kbn_core_node_server_mocks.mdx +++ b/api_docs/kbn_core_node_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-mocks title: "@kbn/core-node-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-mocks'] --- import kbnCoreNodeServerMocksObj from './kbn_core_node_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser.mdx b/api_docs/kbn_core_notifications_browser.mdx index d1d47b2400ce8..13d674307226e 100644 --- a/api_docs/kbn_core_notifications_browser.mdx +++ b/api_docs/kbn_core_notifications_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser title: "@kbn/core-notifications-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser plugin -date: 2024-07-04 +date: 2024-07-11 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 ea61f98a87994..a537901ed8762 100644 --- a/api_docs/kbn_core_notifications_browser_internal.mdx +++ b/api_docs/kbn_core_notifications_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-internal title: "@kbn/core-notifications-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 8e7b5f8eab110..5708b905aa3c1 100644 --- a/api_docs/kbn_core_notifications_browser_mocks.mdx +++ b/api_docs/kbn_core_notifications_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-mocks title: "@kbn/core-notifications-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-mocks'] --- import kbnCoreNotificationsBrowserMocksObj from './kbn_core_notifications_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser.mdx b/api_docs/kbn_core_overlays_browser.mdx index eeba1761a32fe..98308898b1c03 100644 --- a/api_docs/kbn_core_overlays_browser.mdx +++ b/api_docs/kbn_core_overlays_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser title: "@kbn/core-overlays-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser plugin -date: 2024-07-04 +date: 2024-07-11 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 b7efa868694df..62cf0ec701516 100644 --- a/api_docs/kbn_core_overlays_browser_internal.mdx +++ b/api_docs/kbn_core_overlays_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-internal title: "@kbn/core-overlays-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 84db54c131980..996f481cda36f 100644 --- a/api_docs/kbn_core_overlays_browser_mocks.mdx +++ b/api_docs/kbn_core_overlays_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-mocks title: "@kbn/core-overlays-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-mocks'] --- import kbnCoreOverlaysBrowserMocksObj from './kbn_core_overlays_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_browser.mdx b/api_docs/kbn_core_plugins_browser.mdx index a9c377b5092e5..78fdf2ecdf3a7 100644 --- a/api_docs/kbn_core_plugins_browser.mdx +++ b/api_docs/kbn_core_plugins_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-browser title: "@kbn/core-plugins-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-browser plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser'] --- import kbnCorePluginsBrowserObj from './kbn_core_plugins_browser.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_browser_mocks.mdx b/api_docs/kbn_core_plugins_browser_mocks.mdx index d5b661bdeb583..9e5f4ecc16e7f 100644 --- a/api_docs/kbn_core_plugins_browser_mocks.mdx +++ b/api_docs/kbn_core_plugins_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-browser-mocks title: "@kbn/core-plugins-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser-mocks'] --- import kbnCorePluginsBrowserMocksObj from './kbn_core_plugins_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_contracts_browser.mdx b/api_docs/kbn_core_plugins_contracts_browser.mdx index 6e36c980e38f6..04d4ac0d9b488 100644 --- a/api_docs/kbn_core_plugins_contracts_browser.mdx +++ b/api_docs/kbn_core_plugins_contracts_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-contracts-browser title: "@kbn/core-plugins-contracts-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-contracts-browser plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-contracts-browser'] --- import kbnCorePluginsContractsBrowserObj from './kbn_core_plugins_contracts_browser.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_contracts_server.mdx b/api_docs/kbn_core_plugins_contracts_server.mdx index cd59df2d717e1..6fc8f8d6a7299 100644 --- a/api_docs/kbn_core_plugins_contracts_server.mdx +++ b/api_docs/kbn_core_plugins_contracts_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-contracts-server title: "@kbn/core-plugins-contracts-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-contracts-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-contracts-server'] --- import kbnCorePluginsContractsServerObj from './kbn_core_plugins_contracts_server.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server.mdx b/api_docs/kbn_core_plugins_server.mdx index 88830270e4e1f..4ea22f25705aa 100644 --- a/api_docs/kbn_core_plugins_server.mdx +++ b/api_docs/kbn_core_plugins_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-server title: "@kbn/core-plugins-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server'] --- import kbnCorePluginsServerObj from './kbn_core_plugins_server.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server_mocks.mdx b/api_docs/kbn_core_plugins_server_mocks.mdx index 3267edeb8fe84..5a7b6ad659133 100644 --- a/api_docs/kbn_core_plugins_server_mocks.mdx +++ b/api_docs/kbn_core_plugins_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-server-mocks title: "@kbn/core-plugins-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server-mocks'] --- import kbnCorePluginsServerMocksObj from './kbn_core_plugins_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server.mdx b/api_docs/kbn_core_preboot_server.mdx index 83d3f9b77fa62..64ad58587ebfb 100644 --- a/api_docs/kbn_core_preboot_server.mdx +++ b/api_docs/kbn_core_preboot_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server title: "@kbn/core-preboot-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server plugin -date: 2024-07-04 +date: 2024-07-11 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 739236c540114..7ad29baf7ae44 100644 --- a/api_docs/kbn_core_preboot_server_mocks.mdx +++ b/api_docs/kbn_core_preboot_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server-mocks title: "@kbn/core-preboot-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server-mocks'] --- import kbnCorePrebootServerMocksObj from './kbn_core_preboot_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_browser_mocks.mdx b/api_docs/kbn_core_rendering_browser_mocks.mdx index a46f291daab36..d8fbd475a2841 100644 --- a/api_docs/kbn_core_rendering_browser_mocks.mdx +++ b/api_docs/kbn_core_rendering_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-browser-mocks title: "@kbn/core-rendering-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-browser-mocks'] --- import kbnCoreRenderingBrowserMocksObj from './kbn_core_rendering_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_server_internal.mdx b/api_docs/kbn_core_rendering_server_internal.mdx index c1831f182f50c..4ce95e2b3defe 100644 --- a/api_docs/kbn_core_rendering_server_internal.mdx +++ b/api_docs/kbn_core_rendering_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-server-internal title: "@kbn/core-rendering-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-internal'] --- import kbnCoreRenderingServerInternalObj from './kbn_core_rendering_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_server_mocks.mdx b/api_docs/kbn_core_rendering_server_mocks.mdx index ee41e82b5e4f7..650588837018d 100644 --- a/api_docs/kbn_core_rendering_server_mocks.mdx +++ b/api_docs/kbn_core_rendering_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-server-mocks title: "@kbn/core-rendering-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-mocks'] --- import kbnCoreRenderingServerMocksObj from './kbn_core_rendering_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_root_server_internal.mdx b/api_docs/kbn_core_root_server_internal.mdx index e44d1dcd2fe8a..82850711751d7 100644 --- a/api_docs/kbn_core_root_server_internal.mdx +++ b/api_docs/kbn_core_root_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-root-server-internal title: "@kbn/core-root-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-root-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-root-server-internal'] --- import kbnCoreRootServerInternalObj from './kbn_core_root_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_browser.mdx b/api_docs/kbn_core_saved_objects_api_browser.mdx index 33f2e7a47a52f..74f7284f16963 100644 --- a/api_docs/kbn_core_saved_objects_api_browser.mdx +++ b/api_docs/kbn_core_saved_objects_api_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-browser title: "@kbn/core-saved-objects-api-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-browser plugin -date: 2024-07-04 +date: 2024-07-11 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 086644833edde..f145e5ae7c0cc 100644 --- a/api_docs/kbn_core_saved_objects_api_server.mdx +++ b/api_docs/kbn_core_saved_objects_api_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server title: "@kbn/core-saved-objects-api-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server'] --- import kbnCoreSavedObjectsApiServerObj from './kbn_core_saved_objects_api_server.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server_mocks.mdx b/api_docs/kbn_core_saved_objects_api_server_mocks.mdx index d4e7a50e5aea1..e3f63ec5585af 100644 --- a/api_docs/kbn_core_saved_objects_api_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_api_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server-mocks title: "@kbn/core-saved-objects-api-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server-mocks'] --- import kbnCoreSavedObjectsApiServerMocksObj from './kbn_core_saved_objects_api_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_base_server_internal.mdx b/api_docs/kbn_core_saved_objects_base_server_internal.mdx index 3325b2331e365..d66e01dbe82b9 100644 --- a/api_docs/kbn_core_saved_objects_base_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-base-server-internal title: "@kbn/core-saved-objects-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-base-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-internal'] --- import kbnCoreSavedObjectsBaseServerInternalObj from './kbn_core_saved_objects_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_base_server_mocks.mdx b/api_docs/kbn_core_saved_objects_base_server_mocks.mdx index 752b9f56fea37..8a1b41554edc3 100644 --- a/api_docs/kbn_core_saved_objects_base_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-base-server-mocks title: "@kbn/core-saved-objects-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-base-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-mocks'] --- import kbnCoreSavedObjectsBaseServerMocksObj from './kbn_core_saved_objects_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser.mdx b/api_docs/kbn_core_saved_objects_browser.mdx index b9b665a3f0c41..168d96ec1f10c 100644 --- a/api_docs/kbn_core_saved_objects_browser.mdx +++ b/api_docs/kbn_core_saved_objects_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser title: "@kbn/core-saved-objects-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser plugin -date: 2024-07-04 +date: 2024-07-11 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 d20be59eacc14..bc7163705ce0f 100644 --- a/api_docs/kbn_core_saved_objects_browser_internal.mdx +++ b/api_docs/kbn_core_saved_objects_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-internal title: "@kbn/core-saved-objects-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-internal'] --- import kbnCoreSavedObjectsBrowserInternalObj from './kbn_core_saved_objects_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_mocks.mdx b/api_docs/kbn_core_saved_objects_browser_mocks.mdx index 0395ba563b8f9..2663aabf63307 100644 --- a/api_docs/kbn_core_saved_objects_browser_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-mocks title: "@kbn/core-saved-objects-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 106011e4167f0..14d437efbbeaa 100644 --- a/api_docs/kbn_core_saved_objects_common.mdx +++ b/api_docs/kbn_core_saved_objects_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-common title: "@kbn/core-saved-objects-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-common'] --- import kbnCoreSavedObjectsCommonObj from './kbn_core_saved_objects_common.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx b/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx index 454b5140dfec3..8b33b1b5b0c49 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-import-export-server-internal title: "@kbn/core-saved-objects-import-export-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-import-export-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-internal'] --- import kbnCoreSavedObjectsImportExportServerInternalObj from './kbn_core_saved_objects_import_export_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx b/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx index 3ac43e85365c4..4c80ed2214e6a 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-import-export-server-mocks title: "@kbn/core-saved-objects-import-export-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-import-export-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-mocks'] --- import kbnCoreSavedObjectsImportExportServerMocksObj from './kbn_core_saved_objects_import_export_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx index 77267d3eace43..1d540f8f98d2b 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-migration-server-internal title: "@kbn/core-saved-objects-migration-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-migration-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-internal'] --- import kbnCoreSavedObjectsMigrationServerInternalObj from './kbn_core_saved_objects_migration_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx b/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx index 438cf754e4bc2..fd6aec4a47d93 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-migration-server-mocks title: "@kbn/core-saved-objects-migration-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-migration-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-mocks'] --- import kbnCoreSavedObjectsMigrationServerMocksObj from './kbn_core_saved_objects_migration_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server.devdocs.json b/api_docs/kbn_core_saved_objects_server.devdocs.json index 6fbd41c6e266b..91b0d314d07fb 100644 --- a/api_docs/kbn_core_saved_objects_server.devdocs.json +++ b/api_docs/kbn_core_saved_objects_server.devdocs.json @@ -13819,6 +13819,18 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-saved-objects-server", + "id": "def-common.USAGE_COUNTERS_SAVED_OBJECT_INDEX", + "type": "string", + "tags": [], + "label": "USAGE_COUNTERS_SAVED_OBJECT_INDEX", + "description": [], + "path": "packages/core/saved-objects/core-saved-objects-server/src/saved_objects_index_pattern.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ], "objects": [] diff --git a/api_docs/kbn_core_saved_objects_server.mdx b/api_docs/kbn_core_saved_objects_server.mdx index 72465203160cb..666a471ecf3f7 100644 --- a/api_docs/kbn_core_saved_objects_server.mdx +++ b/api_docs/kbn_core_saved_objects_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server title: "@kbn/core-saved-objects-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server'] --- import kbnCoreSavedObjectsServerObj from './kbn_core_saved_objects_server.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 561 | 1 | 133 | 4 | +| 562 | 1 | 134 | 4 | ## Common diff --git a/api_docs/kbn_core_saved_objects_server_internal.mdx b/api_docs/kbn_core_saved_objects_server_internal.mdx index f157123514920..0c9a42112fec9 100644 --- a/api_docs/kbn_core_saved_objects_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server-internal title: "@kbn/core-saved-objects-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-internal'] --- import kbnCoreSavedObjectsServerInternalObj from './kbn_core_saved_objects_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server_mocks.mdx b/api_docs/kbn_core_saved_objects_server_mocks.mdx index 6618e3fe4f038..f3e5286b53133 100644 --- a/api_docs/kbn_core_saved_objects_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server-mocks title: "@kbn/core-saved-objects-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-mocks'] --- import kbnCoreSavedObjectsServerMocksObj from './kbn_core_saved_objects_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_utils_server.mdx b/api_docs/kbn_core_saved_objects_utils_server.mdx index b5acf243006f4..8156b79846db7 100644 --- a/api_docs/kbn_core_saved_objects_utils_server.mdx +++ b/api_docs/kbn_core_saved_objects_utils_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-utils-server title: "@kbn/core-saved-objects-utils-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-utils-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-utils-server'] --- import kbnCoreSavedObjectsUtilsServerObj from './kbn_core_saved_objects_utils_server.devdocs.json'; diff --git a/api_docs/kbn_core_security_browser.mdx b/api_docs/kbn_core_security_browser.mdx index b69eaa7701e9b..f6ff7e00daefa 100644 --- a/api_docs/kbn_core_security_browser.mdx +++ b/api_docs/kbn_core_security_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-browser title: "@kbn/core-security-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-browser plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-browser'] --- import kbnCoreSecurityBrowserObj from './kbn_core_security_browser.devdocs.json'; diff --git a/api_docs/kbn_core_security_browser_internal.mdx b/api_docs/kbn_core_security_browser_internal.mdx index b45fb35f46230..f13915cbc1a81 100644 --- a/api_docs/kbn_core_security_browser_internal.mdx +++ b/api_docs/kbn_core_security_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-browser-internal title: "@kbn/core-security-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-browser-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-browser-internal'] --- import kbnCoreSecurityBrowserInternalObj from './kbn_core_security_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_security_browser_mocks.mdx b/api_docs/kbn_core_security_browser_mocks.mdx index 3edd53cc76d76..2372dd9eb3f88 100644 --- a/api_docs/kbn_core_security_browser_mocks.mdx +++ b/api_docs/kbn_core_security_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-browser-mocks title: "@kbn/core-security-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-browser-mocks'] --- import kbnCoreSecurityBrowserMocksObj from './kbn_core_security_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_security_common.mdx b/api_docs/kbn_core_security_common.mdx index 8039694a533d9..4678c148eae5b 100644 --- a/api_docs/kbn_core_security_common.mdx +++ b/api_docs/kbn_core_security_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-common title: "@kbn/core-security-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-common'] --- import kbnCoreSecurityCommonObj from './kbn_core_security_common.devdocs.json'; diff --git a/api_docs/kbn_core_security_server.devdocs.json b/api_docs/kbn_core_security_server.devdocs.json index fb144f1f8e2d8..ca536ef16c482 100644 --- a/api_docs/kbn_core_security_server.devdocs.json +++ b/api_docs/kbn_core_security_server.devdocs.json @@ -18,94 +18,1708 @@ }, "common": { "classes": [], - "functions": [], + "functions": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.isCreateRestAPIKeyParams", + "type": "Function", + "tags": [], + "label": "isCreateRestAPIKeyParams", + "description": [], + "signature": [ + "(params: any) => boolean" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.isCreateRestAPIKeyParams.$1", + "type": "Any", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "any" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], "interfaces": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditEvent", + "id": "def-common.APIKeys", + "type": "Interface", + "tags": [], + "label": "APIKeys", + "description": [ + "\nInterface for managing API keys in Elasticsearch, including creation,\nvalidation, and invalidation of API keys,\nas well as checking the status of API key features." + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.areAPIKeysEnabled", + "type": "Function", + "tags": [], + "label": "areAPIKeysEnabled", + "description": [ + "\nDetermines if API Keys are enabled in Elasticsearch." + ], + "signature": [ + "() => Promise" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.areCrossClusterAPIKeysEnabled", + "type": "Function", + "tags": [], + "label": "areCrossClusterAPIKeysEnabled", + "description": [ + "\nDetermines if Cross-Cluster API Keys are enabled in Elasticsearch." + ], + "signature": [ + "() => Promise" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [ + "\nTries to create an API key for the current user.\n\nReturns newly created API key or `null` if API keys are disabled.\n\nUser needs `manage_api_key` privilege to create REST API keys and `manage_security` for Cross-Cluster API keys.\n" + ], + "signature": [ + "(request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + ", createParams: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateAPIKeyParams", + "text": "CreateAPIKeyParams" + }, + ") => Promise<", + "SecurityCreateApiKeyResponse", + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.create.$1", + "type": "Object", + "tags": [], + "label": "request", + "description": [ + "Request instance." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.create.$2", + "type": "CompoundType", + "tags": [], + "label": "createParams", + "description": [ + "The params to create an API key" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateAPIKeyParams", + "text": "CreateAPIKeyParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.update", + "type": "Function", + "tags": [], + "label": "update", + "description": [ + "\nAttempts update an API key with the provided 'role_descriptors' and 'metadata'\n\nReturns `updated`, `true` if the update was successful, `false` if there was nothing to update\n\nUser needs `manage_api_key` privilege to update REST API keys and `manage_security` for cross-cluster API keys.\n" + ], + "signature": [ + "(request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + ", updateParams: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateAPIKeyParams", + "text": "UpdateAPIKeyParams" + }, + ") => Promise<", + "SecurityUpdateApiKeyResponse", + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.update.$1", + "type": "Object", + "tags": [], + "label": "request", + "description": [ + "Request instance." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.update.$2", + "type": "CompoundType", + "tags": [], + "label": "updateParams", + "description": [ + "The params to edit an API key" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateAPIKeyParams", + "text": "UpdateAPIKeyParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.grantAsInternalUser", + "type": "Function", + "tags": [], + "label": "grantAsInternalUser", + "description": [ + "\nTries to grant an API key for the current user." + ], + "signature": [ + "(request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + ", createParams: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyParams", + "text": "CreateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams", + "text": "CreateRestAPIKeyWithKibanaPrivilegesParams" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.GrantAPIKeyResult", + "text": "GrantAPIKeyResult" + }, + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.grantAsInternalUser.$1", + "type": "Object", + "tags": [], + "label": "request", + "description": [ + "Request instance." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.grantAsInternalUser.$2", + "type": "CompoundType", + "tags": [], + "label": "createParams", + "description": [ + "Create operation parameters." + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyParams", + "text": "CreateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams", + "text": "CreateRestAPIKeyWithKibanaPrivilegesParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.validate", + "type": "Function", + "tags": [], + "label": "validate", + "description": [ + "\nTries to validate an API key." + ], + "signature": [ + "(apiKeyPrams: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.ValidateAPIKeyParams", + "text": "ValidateAPIKeyParams" + }, + ") => Promise" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.validate.$1", + "type": "Object", + "tags": [], + "label": "apiKeyPrams", + "description": [ + "ValidateAPIKeyParams." + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.ValidateAPIKeyParams", + "text": "ValidateAPIKeyParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.invalidate", + "type": "Function", + "tags": [], + "label": "invalidate", + "description": [ + "\nTries to invalidate an API keys." + ], + "signature": [ + "(request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + ", params: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", + "text": "InvalidateAPIKeysParams" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeyResult", + "text": "InvalidateAPIKeyResult" + }, + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.invalidate.$1", + "type": "Object", + "tags": [], + "label": "request", + "description": [ + "Request instance." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.invalidate.$2", + "type": "Object", + "tags": [], + "label": "params", + "description": [ + "The params to invalidate an API keys." + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", + "text": "InvalidateAPIKeysParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.invalidateAsInternalUser", + "type": "Function", + "tags": [], + "label": "invalidateAsInternalUser", + "description": [ + "\nTries to invalidate the API keys by using the internal user." + ], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", + "text": "InvalidateAPIKeysParams" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeyResult", + "text": "InvalidateAPIKeyResult" + }, + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeys.invalidateAsInternalUser.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [ + "The params to invalidate the API keys." + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", + "text": "InvalidateAPIKeysParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeysServiceWithContext", + "type": "Interface", + "tags": [], + "label": "APIKeysServiceWithContext", + "description": [ + "\nPublic API Keys service exposed through core context to manage\nAPI keys in Elasticsearch, including creation,\nvalidation, and invalidation of API keys,\nas well as checking the status of API key features." + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys_context.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeysServiceWithContext.areAPIKeysEnabled", + "type": "Function", + "tags": [], + "label": "areAPIKeysEnabled", + "description": [ + "\nDetermines if API Keys are enabled in Elasticsearch." + ], + "signature": [ + "() => Promise" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys_context.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeysServiceWithContext.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [ + "\nTries to create an API key for the current user.\n\nReturns newly created API key or `null` if API keys are disabled.\n\nUser needs `manage_api_key` privilege to create REST API keys and `manage_security` for Cross-Cluster API keys.\n" + ], + "signature": [ + "(createParams: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateAPIKeyParams", + "text": "CreateAPIKeyParams" + }, + ") => Promise<", + "SecurityCreateApiKeyResponse", + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys_context.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeysServiceWithContext.create.$1", + "type": "CompoundType", + "tags": [], + "label": "createParams", + "description": [ + "The params to create an API key" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateAPIKeyParams", + "text": "CreateAPIKeyParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys_context.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeysServiceWithContext.update", + "type": "Function", + "tags": [], + "label": "update", + "description": [ + "\nAttempts update an API key with the provided 'role_descriptors' and 'metadata'\n\nReturns `updated`, `true` if the update was successful, `false` if there was nothing to update\n\nUser needs `manage_api_key` privilege to update REST API keys and `manage_security` for cross-cluster API keys.\n" + ], + "signature": [ + "(updateParams: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateAPIKeyParams", + "text": "UpdateAPIKeyParams" + }, + ") => Promise<", + "SecurityUpdateApiKeyResponse", + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys_context.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeysServiceWithContext.update.$1", + "type": "CompoundType", + "tags": [], + "label": "updateParams", + "description": [ + "The params to edit an API key" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateAPIKeyParams", + "text": "UpdateAPIKeyParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys_context.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeysServiceWithContext.validate", + "type": "Function", + "tags": [], + "label": "validate", + "description": [ + "\nTries to validate an API key." + ], + "signature": [ + "(apiKeyPrams: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.ValidateAPIKeyParams", + "text": "ValidateAPIKeyParams" + }, + ") => Promise" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys_context.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeysServiceWithContext.validate.$1", + "type": "Object", + "tags": [], + "label": "apiKeyPrams", + "description": [ + "ValidateAPIKeyParams." + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.ValidateAPIKeyParams", + "text": "ValidateAPIKeyParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys_context.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeysServiceWithContext.invalidate", + "type": "Function", + "tags": [], + "label": "invalidate", + "description": [ + "\nTries to invalidate an API keys." + ], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", + "text": "InvalidateAPIKeysParams" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeyResult", + "text": "InvalidateAPIKeyResult" + }, + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys_context.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.APIKeysServiceWithContext.invalidate.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [ + "The params to invalidate an API keys." + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", + "text": "InvalidateAPIKeysParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys_context.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditEvent", + "type": "Interface", + "tags": [], + "label": "AuditEvent", + "description": [ + "\nAudit event schema using ECS format: https://www.elastic.co/guide/en/ecs/1.12/index.html\n\nIf you add additional fields to the schema ensure you update the Kibana Filebeat module:\nhttps://github.com/elastic/beats/tree/master/filebeat/module/kibana\n" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.AuditEvent", + "text": "AuditEvent" + }, + " extends ", + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMeta", + "text": "LogMeta" + } + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditEvent.message", + "type": "string", + "tags": [], + "label": "message", + "description": [ + "\nLog message" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditEvent.kibana", + "type": "Object", + "tags": [], + "label": "kibana", + "description": [ + "\nKibana specific fields" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.AuditKibana", + "text": "AuditKibana" + }, + " | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditEvent.http", + "type": "Object", + "tags": [], + "label": "http", + "description": [ + "\nFields describing an HTTP request" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.AuditHttp", + "text": "AuditHttp" + }, + " | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditHttp", + "type": "Interface", + "tags": [], + "label": "AuditHttp", + "description": [ + "\nAudit http schema using ECS format" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.AuditHttp", + "text": "AuditHttp" + }, + " extends ", + "EcsHttp" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditHttp.request", + "type": "Object", + "tags": [], + "label": "request", + "description": [ + "\nHTTP request details" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.AuditRequest", + "text": "AuditRequest" + }, + " | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditKibana", + "type": "Interface", + "tags": [], + "label": "AuditKibana", + "description": [ + "\nAudit kibana schema using ECS format" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditKibana.space_id", + "type": "string", + "tags": [], + "label": "space_id", + "description": [ + "\nThe ID of the space associated with this event." + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditKibana.session_id", + "type": "string", + "tags": [], + "label": "session_id", + "description": [ + "\nThe ID of the user session associated with this event. Each login attempt\nresults in a unique session id." + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditKibana.saved_object", + "type": "Object", + "tags": [], + "label": "saved_object", + "description": [ + "\nSaved object that was created, changed, deleted or accessed as part of this event." + ], + "signature": [ + "{ type: string; id: string; name?: string | undefined; } | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditKibana.authentication_provider", + "type": "string", + "tags": [], + "label": "authentication_provider", + "description": [ + "\nName of authentication provider associated with a login event." + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditKibana.authentication_type", + "type": "string", + "tags": [], + "label": "authentication_type", + "description": [ + "\nType of authentication provider associated with a login event." + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditKibana.authentication_realm", + "type": "string", + "tags": [], + "label": "authentication_realm", + "description": [ + "\nName of Elasticsearch realm that has authenticated the user." + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditKibana.lookup_realm", + "type": "string", + "tags": [], + "label": "lookup_realm", + "description": [ + "\nName of Elasticsearch realm where the user details were retrieved from." + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditKibana.add_to_spaces", + "type": "Object", + "tags": [], + "label": "add_to_spaces", + "description": [ + "\nSet of space IDs that a saved object was shared to." + ], + "signature": [ + "readonly string[] | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditKibana.delete_from_spaces", + "type": "Object", + "tags": [], + "label": "delete_from_spaces", + "description": [ + "\nSet of space IDs that a saved object was removed from." + ], + "signature": [ + "readonly string[] | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditKibana.unauthorized_spaces", + "type": "Object", + "tags": [], + "label": "unauthorized_spaces", + "description": [ + "\nSet of space IDs that are not authorized for an action." + ], + "signature": [ + "readonly string[] | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditKibana.unauthorized_types", + "type": "Object", + "tags": [], + "label": "unauthorized_types", + "description": [ + "\nSet of types that are not authorized for an action." + ], + "signature": [ + "readonly string[] | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditLogger", + "type": "Interface", + "tags": [], + "label": "AuditLogger", + "description": [], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_logger.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditLogger.log", + "type": "Function", + "tags": [], + "label": "log", + "description": [ + "\nLogs an {@link AuditEvent} and automatically adds meta data about the\ncurrent user, space and correlation id.\n\nGuidelines around what events should be logged and how they should be\nstructured can be found in: `/x-pack/plugins/security/README.md`\n" + ], + "signature": [ + "(event: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.AuditEvent", + "text": "AuditEvent" + }, + " | undefined) => void" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_logger.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditLogger.log.$1", + "type": "Object", + "tags": [], + "label": "event", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.AuditEvent", + "text": "AuditEvent" + }, + " | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_logger.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditLogger.enabled", + "type": "boolean", + "tags": [], + "label": "enabled", + "description": [ + "\nIndicates whether audit logging is enabled or not.\n\nUseful for skipping resource-intense operations that don't need to be performed when audit\nlogging is disabled." + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_logger.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditRequest", + "type": "Interface", + "tags": [], + "label": "AuditRequest", + "description": [ + "\nAudit request schema using ECS format" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.AuditRequest", + "text": "AuditRequest" + }, + " extends { body?: { bytes?: number | undefined; content?: string | undefined; } | undefined; bytes?: number | undefined; id?: string | undefined; method?: string | undefined; mime_type?: string | undefined; referrer?: string | undefined; }" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditRequest.headers", + "type": "Object", + "tags": [], + "label": "headers", + "description": [ + "\nHTTP request headers" + ], + "signature": [ + "{ 'x-forwarded-for'?: string | undefined; } | undefined" + ], + "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditRequestHandlerContext", + "type": "Interface", + "tags": [], + "label": "AuditRequestHandlerContext", + "description": [], + "path": "packages/core/security/core-security-server/src/request_handler_context.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuditRequestHandlerContext.logger", + "type": "Object", + "tags": [], + "label": "logger", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.AuditLogger", + "text": "AuditLogger" + } + ], + "path": "packages/core/security/core-security-server/src/request_handler_context.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuthcRequestHandlerContext", + "type": "Interface", + "tags": [], + "label": "AuthcRequestHandlerContext", + "description": [], + "path": "packages/core/security/core-security-server/src/request_handler_context.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuthcRequestHandlerContext.getCurrentUser", + "type": "Function", + "tags": [], + "label": "getCurrentUser", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/core-security-common", + "scope": "common", + "docId": "kibKbnCoreSecurityCommonPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " | null" + ], + "path": "packages/core/security/core-security-server/src/request_handler_context.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.AuthcRequestHandlerContext.apiKeys", + "type": "Object", + "tags": [], + "label": "apiKeys", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.APIKeysServiceWithContext", + "text": "APIKeysServiceWithContext" + } + ], + "path": "packages/core/security/core-security-server/src/request_handler_context.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CoreAuditService", + "type": "Interface", + "tags": [], + "label": "CoreAuditService", + "description": [], + "path": "packages/core/security/core-security-server/src/audit.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CoreAuditService.asScoped", + "type": "Function", + "tags": [], + "label": "asScoped", + "description": [ + "\nCreates an {@link AuditLogger} scoped to the current request.\n\nThis audit logger logs events with all required user and session info and should be used for\nall user-initiated actions.\n" + ], + "signature": [ + "(request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + ") => ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.AuditLogger", + "text": "AuditLogger" + } + ], + "path": "packages/core/security/core-security-server/src/audit.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CoreAuditService.asScoped.$1", + "type": "Object", + "tags": [], + "label": "request", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/security/core-security-server/src/audit.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CoreAuditService.withoutRequest", + "type": "Object", + "tags": [], + "label": "withoutRequest", + "description": [ + "\n{@link AuditLogger} for background tasks only.\n\nThis audit logger logs events without any user or session info and should never be used to log\nuser-initiated actions.\n" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.AuditLogger", + "text": "AuditLogger" + } + ], + "path": "packages/core/security/core-security-server/src/audit.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CoreAuthenticationService", + "type": "Interface", + "tags": [], + "label": "CoreAuthenticationService", + "description": [ + "\nCore's authentication service\n" + ], + "path": "packages/core/security/core-security-server/src/authc.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CoreAuthenticationService.getCurrentUser", + "type": "Function", + "tags": [], + "label": "getCurrentUser", + "description": [ + "\nRetrieve the user bound to the provided request, or null if\nno user is authenticated.\n" + ], + "signature": [ + "(request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + ") => ", + { + "pluginId": "@kbn/core-security-common", + "scope": "common", + "docId": "kibKbnCoreSecurityCommonPluginApi", + "section": "def-common.AuthenticatedUser", + "text": "AuthenticatedUser" + }, + " | null" + ], + "path": "packages/core/security/core-security-server/src/authc.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CoreAuthenticationService.getCurrentUser.$1", + "type": "Object", + "tags": [], + "label": "request", + "description": [ + "The request to retrieve the authenticated user for." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/security/core-security-server/src/authc.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CoreAuthenticationService.apiKeys", + "type": "Object", + "tags": [], + "label": "apiKeys", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.APIKeys", + "text": "APIKeys" + } + ], + "path": "packages/core/security/core-security-server/src/authc.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CoreFipsService", + "type": "Interface", + "tags": [], + "label": "CoreFipsService", + "description": [ + "\nCore's FIPS service\n" + ], + "path": "packages/core/security/core-security-server/src/fips.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CoreFipsService.isEnabled", + "type": "Function", + "tags": [], + "label": "isEnabled", + "description": [ + "\nCheck if Kibana is configured to run in FIPS mode" + ], + "signature": [ + "() => boolean" + ], + "path": "packages/core/security/core-security-server/src/fips.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CoreSecurityDelegateContract", "type": "Interface", "tags": [], - "label": "AuditEvent", + "label": "CoreSecurityDelegateContract", "description": [ - "\nAudit event schema using ECS format: https://www.elastic.co/guide/en/ecs/1.12/index.html\n\nIf you add additional fields to the schema ensure you update the Kibana Filebeat module:\nhttps://github.com/elastic/beats/tree/master/filebeat/module/kibana\n" + "\nThe contract exposed by the security provider for Core to\nconsume and re-expose via its security service.\n" ], - "signature": [ + "path": "packages/core/security/core-security-server/src/api_provider.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.AuditEvent", - "text": "AuditEvent" + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CoreSecurityDelegateContract.authc", + "type": "Object", + "tags": [], + "label": "authc", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CoreAuthenticationService", + "text": "CoreAuthenticationService" + } + ], + "path": "packages/core/security/core-security-server/src/api_provider.ts", + "deprecated": false, + "trackAdoption": false }, - " extends ", { - "pluginId": "@kbn/logging", - "scope": "common", - "docId": "kibKbnLoggingPluginApi", - "section": "def-common.LogMeta", - "text": "LogMeta" + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CoreSecurityDelegateContract.audit", + "type": "Object", + "tags": [], + "label": "audit", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CoreAuditService", + "text": "CoreAuditService" + } + ], + "path": "packages/core/security/core-security-server/src/api_provider.ts", + "deprecated": false, + "trackAdoption": false } ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateCrossClusterAPIKeyParams", + "type": "Interface", + "tags": [], + "label": "CreateCrossClusterAPIKeyParams", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditEvent.message", + "id": "def-common.CreateCrossClusterAPIKeyParams.type", "type": "string", "tags": [], - "label": "message", - "description": [ - "\nLog message" + "label": "type", + "description": [], + "signature": [ + "\"cross_cluster\"" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditEvent.kibana", - "type": "Object", + "id": "def-common.CreateCrossClusterAPIKeyParams.expiration", + "type": "string", "tags": [], - "label": "kibana", - "description": [ - "\nKibana specific fields" - ], + "label": "expiration", + "description": [], "signature": [ - { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.AuditKibana", - "text": "AuditKibana" - }, - " | undefined" + "string | undefined" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditEvent.http", + "id": "def-common.CreateCrossClusterAPIKeyParams.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateCrossClusterAPIKeyParams.metadata", "type": "Object", "tags": [], - "label": "http", - "description": [ - "\nFields describing an HTTP request" + "label": "metadata", + "description": [], + "signature": [ + "{ [key: string]: any; } | undefined" ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateCrossClusterAPIKeyParams.access", + "type": "Object", + "tags": [], + "label": "access", + "description": [], "signature": [ - { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.AuditHttp", - "text": "AuditHttp" - }, - " | undefined" + "{ search?: { names: string[]; query?: unknown; field_security?: unknown; allow_restricted_indices?: boolean | undefined; }[] | undefined; replication?: { names: string[]; }[] | undefined; }" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -114,48 +1728,176 @@ }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditHttp", + "id": "def-common.CreateRestAPIKeyParams", "type": "Interface", "tags": [], - "label": "AuditHttp", - "description": [ - "\nAudit http schema using ECS format" - ], - "signature": [ + "label": "CreateRestAPIKeyParams", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.AuditHttp", - "text": "AuditHttp" + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateRestAPIKeyParams.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"rest\" | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false }, - " extends ", - "EcsHttp" + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateRestAPIKeyParams.expiration", + "type": "string", + "tags": [], + "label": "expiration", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateRestAPIKeyParams.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateRestAPIKeyParams.role_descriptors", + "type": "Object", + "tags": [], + "label": "role_descriptors", + "description": [], + "signature": [ + "{ [x: string]: { [key: string]: any; }; }" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateRestAPIKeyParams.metadata", + "type": "Object", + "tags": [], + "label": "metadata", + "description": [], + "signature": [ + "{ [key: string]: any; } | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + } ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams", + "type": "Interface", + "tags": [], + "label": "CreateRestAPIKeyWithKibanaPrivilegesParams", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditHttp.request", + "id": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"rest\" | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams.expiration", + "type": "string", + "tags": [], + "label": "expiration", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams.metadata", "type": "Object", "tags": [], - "label": "request", - "description": [ - "\nHTTP request details" + "label": "metadata", + "description": [], + "signature": [ + "{ [key: string]: any; } | undefined" ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams.kibana_role_descriptors", + "type": "Object", + "tags": [], + "label": "kibana_role_descriptors", + "description": [], "signature": [ + "{ [x: string]: { elasticsearch: ", { "pluginId": "@kbn/core-security-server", "scope": "common", "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.AuditRequest", - "text": "AuditRequest" + "section": "def-common.ElasticsearchPrivilegesType", + "text": "ElasticsearchPrivilegesType" }, - " | undefined" + " & { [key: string]: unknown; }; kibana: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.KibanaPrivilegesType", + "text": "KibanaPrivilegesType" + }, + "; }; }" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -164,266 +1906,214 @@ }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditKibana", + "id": "def-common.ElasticsearchPrivilegesType", "type": "Interface", "tags": [], - "label": "AuditKibana", + "label": "ElasticsearchPrivilegesType", "description": [ - "\nAudit kibana schema using ECS format" + "\nType representing Elasticsearch specific portion of the role definition." ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/roles/schema.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditKibana.space_id", - "type": "string", + "id": "def-common.ElasticsearchPrivilegesType.cluster", + "type": "Array", "tags": [], - "label": "space_id", - "description": [ - "\nThe ID of the space associated with this event." - ], + "label": "cluster", + "description": [], "signature": [ - "string | undefined" + "string[] | undefined" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/roles/schema.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditKibana.session_id", - "type": "string", + "id": "def-common.ElasticsearchPrivilegesType.remote_cluster", + "type": "Array", "tags": [], - "label": "session_id", - "description": [ - "\nThe ID of the user session associated with this event. Each login attempt\nresults in a unique session id." - ], + "label": "remote_cluster", + "description": [], "signature": [ - "string | undefined" + "{ privileges: string[]; clusters: string[]; }[] | undefined" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/roles/schema.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditKibana.saved_object", - "type": "Object", + "id": "def-common.ElasticsearchPrivilegesType.indices", + "type": "Array", "tags": [], - "label": "saved_object", - "description": [ - "\nSaved object that was created, changed, deleted or accessed as part of this event." - ], + "label": "indices", + "description": [], "signature": [ - "{ type: string; id: string; name?: string | undefined; } | undefined" + "{ names: string[]; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; privileges: string[]; query?: string | undefined; allow_restricted_indices?: boolean | undefined; }[] | undefined" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/roles/schema.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditKibana.authentication_provider", - "type": "string", + "id": "def-common.ElasticsearchPrivilegesType.remote_indices", + "type": "Array", "tags": [], - "label": "authentication_provider", - "description": [ - "\nName of authentication provider associated with a login event." - ], + "label": "remote_indices", + "description": [], "signature": [ - "string | undefined" + "{ clusters: string[]; names: string[]; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; privileges: string[]; query?: string | undefined; allow_restricted_indices?: boolean | undefined; }[] | undefined" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/roles/schema.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditKibana.authentication_type", - "type": "string", + "id": "def-common.ElasticsearchPrivilegesType.run_as", + "type": "Array", "tags": [], - "label": "authentication_type", - "description": [ - "\nType of authentication provider associated with a login event." - ], + "label": "run_as", + "description": [], "signature": [ - "string | undefined" + "string[] | undefined" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/roles/schema.ts", "deprecated": false, "trackAdoption": false - }, + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.GrantAPIKeyResult", + "type": "Interface", + "tags": [], + "label": "GrantAPIKeyResult", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditKibana.authentication_realm", + "id": "def-common.GrantAPIKeyResult.id", "type": "string", "tags": [], - "label": "authentication_realm", + "label": "id", "description": [ - "\nName of Elasticsearch realm that has authenticated the user." - ], - "signature": [ - "string | undefined" + "\nUnique id for this API key" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditKibana.lookup_realm", + "id": "def-common.GrantAPIKeyResult.name", "type": "string", "tags": [], - "label": "lookup_realm", + "label": "name", "description": [ - "\nName of Elasticsearch realm where the user details were retrieved from." - ], - "signature": [ - "string | undefined" + "\nName for this API key" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditKibana.add_to_spaces", - "type": "Object", + "id": "def-common.GrantAPIKeyResult.api_key", + "type": "string", "tags": [], - "label": "add_to_spaces", + "label": "api_key", "description": [ - "\nSet of space IDs that a saved object was shared to." - ], - "signature": [ - "readonly string[] | undefined" + "\nGenerated API key" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false - }, + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.InvalidateAPIKeyResult", + "type": "Interface", + "tags": [], + "label": "InvalidateAPIKeyResult", + "description": [ + "\nThe return value when invalidating an API key in Elasticsearch." + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditKibana.delete_from_spaces", - "type": "Object", + "id": "def-common.InvalidateAPIKeyResult.invalidated_api_keys", + "type": "Array", "tags": [], - "label": "delete_from_spaces", + "label": "invalidated_api_keys", "description": [ - "\nSet of space IDs that a saved object was removed from." + "\nThe IDs of the API keys that were invalidated as part of the request." ], "signature": [ - "readonly string[] | undefined" + "string[]" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditKibana.unauthorized_spaces", - "type": "Object", + "id": "def-common.InvalidateAPIKeyResult.previously_invalidated_api_keys", + "type": "Array", "tags": [], - "label": "unauthorized_spaces", + "label": "previously_invalidated_api_keys", "description": [ - "\nSet of space IDs that are not authorized for an action." + "\nThe IDs of the API keys that were already invalidated." ], "signature": [ - "readonly string[] | undefined" + "string[]" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditKibana.unauthorized_types", - "type": "Object", + "id": "def-common.InvalidateAPIKeyResult.error_count", + "type": "number", "tags": [], - "label": "unauthorized_types", + "label": "error_count", "description": [ - "\nSet of types that are not authorized for an action." + "\nThe number of errors that were encountered when invalidating the API keys." ], - "signature": [ - "readonly string[] | undefined" - ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditLogger", - "type": "Interface", - "tags": [], - "label": "AuditLogger", - "description": [], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_logger.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditLogger.log", - "type": "Function", + "id": "def-common.InvalidateAPIKeyResult.error_details", + "type": "Array", "tags": [], - "label": "log", + "label": "error_details", "description": [ - "\nLogs an {@link AuditEvent} and automatically adds meta data about the\ncurrent user, space and correlation id.\n\nGuidelines around what events should be logged and how they should be\nstructured can be found in: `/x-pack/plugins/security/README.md`\n" + "\nDetails about these errors. This field is not present in the response when error_count is 0." ], "signature": [ - "(event: ", - { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.AuditEvent", - "text": "AuditEvent" - }, - " | undefined) => void" - ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_logger.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditLogger.log.$1", - "type": "Object", - "tags": [], - "label": "event", - "description": [], - "signature": [ - { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.AuditEvent", - "text": "AuditEvent" - }, - " | undefined" - ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_logger.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditLogger.enabled", - "type": "boolean", - "tags": [], - "label": "enabled", - "description": [ - "\nIndicates whether audit logging is enabled or not.\n\nUseful for skipping resource-intense operations that don't need to be performed when audit\nlogging is disabled." + "{ type?: string | undefined; reason?: string | undefined; caused_by?: { type?: string | undefined; reason?: string | undefined; } | undefined; }[] | undefined" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_logger.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -432,40 +2122,30 @@ }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditRequest", + "id": "def-common.InvalidateAPIKeysParams", "type": "Interface", "tags": [], - "label": "AuditRequest", + "label": "InvalidateAPIKeysParams", "description": [ - "\nAudit request schema using ECS format" - ], - "signature": [ - { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.AuditRequest", - "text": "AuditRequest" - }, - " extends { body?: { bytes?: number | undefined; content?: string | undefined; } | undefined; bytes?: number | undefined; id?: string | undefined; method?: string | undefined; mime_type?: string | undefined; referrer?: string | undefined; }" + "\nRepresents the params for invalidating multiple API keys" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditRequest.headers", - "type": "Object", + "id": "def-common.InvalidateAPIKeysParams.ids", + "type": "Array", "tags": [], - "label": "headers", + "label": "ids", "description": [ - "\nHTTP request headers" + "\nList of unique API key IDs" ], "signature": [ - "{ 'x-forwarded-for'?: string | undefined; } | undefined" + "string[]" ], - "path": "packages/core/security/core-security-server/src/audit_logging/audit_events.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -474,10 +2154,10 @@ }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditRequestHandlerContext", + "id": "def-common.SecurityRequestHandlerContext", "type": "Interface", "tags": [], - "label": "AuditRequestHandlerContext", + "label": "SecurityRequestHandlerContext", "description": [], "path": "packages/core/security/core-security-server/src/request_handler_context.ts", "deprecated": false, @@ -485,125 +2165,101 @@ "children": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuditRequestHandlerContext.logger", + "id": "def-common.SecurityRequestHandlerContext.authc", "type": "Object", "tags": [], - "label": "logger", + "label": "authc", "description": [], "signature": [ { "pluginId": "@kbn/core-security-server", "scope": "common", "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.AuditLogger", - "text": "AuditLogger" + "section": "def-common.AuthcRequestHandlerContext", + "text": "AuthcRequestHandlerContext" } ], "path": "packages/core/security/core-security-server/src/request_handler_context.ts", "deprecated": false, "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuthcRequestHandlerContext", - "type": "Interface", - "tags": [], - "label": "AuthcRequestHandlerContext", - "description": [], - "path": "packages/core/security/core-security-server/src/request_handler_context.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.AuthcRequestHandlerContext.getCurrentUser", - "type": "Function", + "id": "def-common.SecurityRequestHandlerContext.audit", + "type": "Object", "tags": [], - "label": "getCurrentUser", + "label": "audit", "description": [], "signature": [ - "() => ", { - "pluginId": "@kbn/core-security-common", + "pluginId": "@kbn/core-security-server", "scope": "common", - "docId": "kibKbnCoreSecurityCommonPluginApi", - "section": "def-common.AuthenticatedUser", - "text": "AuthenticatedUser" - }, - " | null" + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.AuditRequestHandlerContext", + "text": "AuditRequestHandlerContext" + } ], "path": "packages/core/security/core-security-server/src/request_handler_context.ts", "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] + "trackAdoption": false } ], "initialIsOpen": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.CoreAuditService", + "id": "def-common.SecurityServiceSetup", "type": "Interface", "tags": [], - "label": "CoreAuditService", - "description": [], - "path": "packages/core/security/core-security-server/src/audit.ts", + "label": "SecurityServiceSetup", + "description": [ + "\nSetup contract for Core's security service.\n" + ], + "path": "packages/core/security/core-security-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.CoreAuditService.asScoped", + "id": "def-common.SecurityServiceSetup.registerSecurityDelegate", "type": "Function", "tags": [], - "label": "asScoped", + "label": "registerSecurityDelegate", "description": [ - "\nCreates an {@link AuditLogger} scoped to the current request.\n\nThis audit logger logs events with all required user and session info and should be used for\nall user-initiated actions.\n" + "\nRegister the security implementation that then will be used and re-exposed by Core.\n" ], "signature": [ - "(request: ", - { - "pluginId": "@kbn/core-http-server", - "scope": "common", - "docId": "kibKbnCoreHttpServerPluginApi", - "section": "def-common.KibanaRequest", - "text": "KibanaRequest" - }, - ") => ", + "(api: ", { "pluginId": "@kbn/core-security-server", "scope": "common", "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.AuditLogger", - "text": "AuditLogger" - } + "section": "def-common.CoreSecurityDelegateContract", + "text": "CoreSecurityDelegateContract" + }, + ") => void" ], - "path": "packages/core/security/core-security-server/src/audit.ts", + "path": "packages/core/security/core-security-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.CoreAuditService.asScoped.$1", + "id": "def-common.SecurityServiceSetup.registerSecurityDelegate.$1", "type": "Object", "tags": [], - "label": "request", + "label": "api", "description": [], "signature": [ { - "pluginId": "@kbn/core-http-server", + "pluginId": "@kbn/core-security-server", "scope": "common", - "docId": "kibKbnCoreHttpServerPluginApi", - "section": "def-common.KibanaRequest", - "text": "KibanaRequest" - }, - "" + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CoreSecurityDelegateContract", + "text": "CoreSecurityDelegateContract" + } ], - "path": "packages/core/security/core-security-server/src/audit.ts", + "path": "packages/core/security/core-security-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -613,23 +2269,23 @@ }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.CoreAuditService.withoutRequest", + "id": "def-common.SecurityServiceSetup.fips", "type": "Object", "tags": [], - "label": "withoutRequest", + "label": "fips", "description": [ - "\n{@link AuditLogger} for background tasks only.\n\nThis audit logger logs events without any user or session info and should never be used to log\nuser-initiated actions.\n" + "\nThe {@link CoreFipsService | FIPS service}" ], "signature": [ { "pluginId": "@kbn/core-security-server", "scope": "common", "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.AuditLogger", - "text": "AuditLogger" + "section": "def-common.CoreFipsService", + "text": "CoreFipsService" } ], - "path": "packages/core/security/core-security-server/src/audit.ts", + "path": "packages/core/security/core-security-server/src/contracts.ts", "deprecated": false, "trackAdoption": false } @@ -638,163 +2294,220 @@ }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.CoreAuthenticationService", + "id": "def-common.SecurityServiceStart", "type": "Interface", "tags": [], - "label": "CoreAuthenticationService", + "label": "SecurityServiceStart", "description": [ - "\nCore's authentication service\n" + "\nStart contract for Core's security service.\n" ], - "path": "packages/core/security/core-security-server/src/authc.ts", + "path": "packages/core/security/core-security-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.CoreAuthenticationService.getCurrentUser", - "type": "Function", + "id": "def-common.SecurityServiceStart.authc", + "type": "Object", "tags": [], - "label": "getCurrentUser", + "label": "authc", "description": [ - "\nRetrieve the user bound to the provided request, or null if\nno user is authenticated.\n" + "\nThe {@link CoreAuthenticationService | authentication service}" ], "signature": [ - "(request: ", - { - "pluginId": "@kbn/core-http-server", - "scope": "common", - "docId": "kibKbnCoreHttpServerPluginApi", - "section": "def-common.KibanaRequest", - "text": "KibanaRequest" - }, - ") => ", { - "pluginId": "@kbn/core-security-common", + "pluginId": "@kbn/core-security-server", "scope": "common", - "docId": "kibKbnCoreSecurityCommonPluginApi", - "section": "def-common.AuthenticatedUser", - "text": "AuthenticatedUser" - }, - " | null" + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CoreAuthenticationService", + "text": "CoreAuthenticationService" + } ], - "path": "packages/core/security/core-security-server/src/authc.ts", + "path": "packages/core/security/core-security-server/src/contracts.ts", "deprecated": false, - "trackAdoption": false, - "children": [ + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.SecurityServiceStart.audit", + "type": "Object", + "tags": [], + "label": "audit", + "description": [ + "\nThe {@link CoreAuditService | audit service}" + ], + "signature": [ { - "parentPluginId": "@kbn/core-security-server", - "id": "def-common.CoreAuthenticationService.getCurrentUser.$1", - "type": "Object", - "tags": [], - "label": "request", - "description": [ - "The request to retrieve the authenticated user for." - ], - "signature": [ - { - "pluginId": "@kbn/core-http-server", - "scope": "common", - "docId": "kibKbnCoreHttpServerPluginApi", - "section": "def-common.KibanaRequest", - "text": "KibanaRequest" - }, - "" - ], - "path": "packages/core/security/core-security-server/src/authc.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CoreAuditService", + "text": "CoreAuditService" } ], - "returnComment": [] + "path": "packages/core/security/core-security-server/src/contracts.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.CoreFipsService", + "id": "def-common.UpdateCrossClusterAPIKeyParams", "type": "Interface", "tags": [], - "label": "CoreFipsService", - "description": [ - "\nCore's FIPS service\n" - ], - "path": "packages/core/security/core-security-server/src/fips.ts", + "label": "UpdateCrossClusterAPIKeyParams", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.CoreFipsService.isEnabled", - "type": "Function", + "id": "def-common.UpdateCrossClusterAPIKeyParams.id", + "type": "string", "tags": [], - "label": "isEnabled", - "description": [ - "\nCheck if Kibana is configured to run in FIPS mode" + "label": "id", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.UpdateCrossClusterAPIKeyParams.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"cross_cluster\"" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.UpdateCrossClusterAPIKeyParams.expiration", + "type": "string", + "tags": [], + "label": "expiration", + "description": [], + "signature": [ + "string | undefined" ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.UpdateCrossClusterAPIKeyParams.metadata", + "type": "Object", + "tags": [], + "label": "metadata", + "description": [], "signature": [ - "() => boolean" + "{ [key: string]: any; } | undefined" ], - "path": "packages/core/security/core-security-server/src/fips.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.UpdateCrossClusterAPIKeyParams.access", + "type": "Object", + "tags": [], + "label": "access", + "description": [], + "signature": [ + "{ search?: { names: string[]; query?: unknown; field_security?: unknown; allow_restricted_indices?: boolean | undefined; }[] | undefined; replication?: { names: string[]; }[] | undefined; }" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.CoreSecurityDelegateContract", + "id": "def-common.UpdateRestAPIKeyParams", "type": "Interface", "tags": [], - "label": "CoreSecurityDelegateContract", - "description": [ - "\nThe contract exposed by the security provider for Core to\nconsume and re-expose via its security service.\n" - ], - "path": "packages/core/security/core-security-server/src/api_provider.ts", + "label": "UpdateRestAPIKeyParams", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.CoreSecurityDelegateContract.authc", + "id": "def-common.UpdateRestAPIKeyParams.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.UpdateRestAPIKeyParams.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"rest\" | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.UpdateRestAPIKeyParams.expiration", + "type": "string", + "tags": [], + "label": "expiration", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.UpdateRestAPIKeyParams.role_descriptors", "type": "Object", "tags": [], - "label": "authc", + "label": "role_descriptors", "description": [], "signature": [ - { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.CoreAuthenticationService", - "text": "CoreAuthenticationService" - } + "{ [x: string]: { [key: string]: unknown; }; }" ], - "path": "packages/core/security/core-security-server/src/api_provider.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.CoreSecurityDelegateContract.audit", + "id": "def-common.UpdateRestAPIKeyParams.metadata", "type": "Object", "tags": [], - "label": "audit", + "label": "metadata", "description": [], "signature": [ - { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.CoreAuditService", - "text": "CoreAuditService" - } + "{ [key: string]: any; } | undefined" ], - "path": "packages/core/security/core-security-server/src/api_provider.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -803,138 +2516,95 @@ }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.SecurityRequestHandlerContext", + "id": "def-common.UpdateRestAPIKeyWithKibanaPrivilegesParams", "type": "Interface", "tags": [], - "label": "SecurityRequestHandlerContext", + "label": "UpdateRestAPIKeyWithKibanaPrivilegesParams", "description": [], - "path": "packages/core/security/core-security-server/src/request_handler_context.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.SecurityRequestHandlerContext.authc", - "type": "Object", + "id": "def-common.UpdateRestAPIKeyWithKibanaPrivilegesParams.id", + "type": "string", "tags": [], - "label": "authc", + "label": "id", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.UpdateRestAPIKeyWithKibanaPrivilegesParams.type", + "type": "string", + "tags": [], + "label": "type", "description": [], "signature": [ - { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.AuthcRequestHandlerContext", - "text": "AuthcRequestHandlerContext" - } + "\"rest\" | undefined" ], - "path": "packages/core/security/core-security-server/src/request_handler_context.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.SecurityRequestHandlerContext.audit", - "type": "Object", + "id": "def-common.UpdateRestAPIKeyWithKibanaPrivilegesParams.expiration", + "type": "string", "tags": [], - "label": "audit", + "label": "expiration", "description": [], "signature": [ - { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.AuditRequestHandlerContext", - "text": "AuditRequestHandlerContext" - } + "string | undefined" ], - "path": "packages/core/security/core-security-server/src/request_handler_context.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/core-security-server", - "id": "def-common.SecurityServiceSetup", - "type": "Interface", - "tags": [], - "label": "SecurityServiceSetup", - "description": [ - "\nSetup contract for Core's security service.\n" - ], - "path": "packages/core/security/core-security-server/src/contracts.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.SecurityServiceSetup.registerSecurityDelegate", - "type": "Function", + "id": "def-common.UpdateRestAPIKeyWithKibanaPrivilegesParams.metadata", + "type": "Object", "tags": [], - "label": "registerSecurityDelegate", - "description": [ - "\nRegister the security implementation that then will be used and re-exposed by Core.\n" - ], + "label": "metadata", + "description": [], "signature": [ - "(api: ", - { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.CoreSecurityDelegateContract", - "text": "CoreSecurityDelegateContract" - }, - ") => void" + "{ [key: string]: any; } | undefined" ], - "path": "packages/core/security/core-security-server/src/contracts.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/core-security-server", - "id": "def-common.SecurityServiceSetup.registerSecurityDelegate.$1", - "type": "Object", - "tags": [], - "label": "api", - "description": [], - "signature": [ - { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.CoreSecurityDelegateContract", - "text": "CoreSecurityDelegateContract" - } - ], - "path": "packages/core/security/core-security-server/src/contracts.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] + "trackAdoption": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.SecurityServiceSetup.fips", + "id": "def-common.UpdateRestAPIKeyWithKibanaPrivilegesParams.kibana_role_descriptors", "type": "Object", "tags": [], - "label": "fips", - "description": [ - "\nThe {@link CoreFipsService | FIPS service}" - ], + "label": "kibana_role_descriptors", + "description": [], "signature": [ + "{ [x: string]: { elasticsearch: ", { "pluginId": "@kbn/core-security-server", "scope": "common", "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.CoreFipsService", - "text": "CoreFipsService" - } + "section": "def-common.ElasticsearchPrivilegesType", + "text": "ElasticsearchPrivilegesType" + }, + " & { [key: string]: unknown; }; kibana: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.KibanaPrivilegesType", + "text": "KibanaPrivilegesType" + }, + "; }; }" ], - "path": "packages/core/security/core-security-server/src/contracts.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -943,58 +2613,40 @@ }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.SecurityServiceStart", + "id": "def-common.ValidateAPIKeyParams", "type": "Interface", "tags": [], - "label": "SecurityServiceStart", + "label": "ValidateAPIKeyParams", "description": [ - "\nStart contract for Core's security service.\n" + "\nRepresents the parameters for validating API Key credentials." ], - "path": "packages/core/security/core-security-server/src/contracts.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.SecurityServiceStart.authc", - "type": "Object", + "id": "def-common.ValidateAPIKeyParams.id", + "type": "string", "tags": [], - "label": "authc", + "label": "id", "description": [ - "\nThe {@link CoreAuthenticationService | authentication service}" - ], - "signature": [ - { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.CoreAuthenticationService", - "text": "CoreAuthenticationService" - } + "\nUnique id for this API key" ], - "path": "packages/core/security/core-security-server/src/contracts.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/core-security-server", - "id": "def-common.SecurityServiceStart.audit", - "type": "Object", + "id": "def-common.ValidateAPIKeyParams.api_key", + "type": "string", "tags": [], - "label": "audit", + "label": "api_key", "description": [ - "\nThe {@link CoreAuditService | audit service}" - ], - "signature": [ - { - "pluginId": "@kbn/core-security-server", - "scope": "common", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-common.CoreAuditService", - "text": "CoreAuditService" - } + "\nGenerated API Key (secret)" ], - "path": "packages/core/security/core-security-server/src/contracts.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -1045,6 +2697,133 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateAPIKeyParams", + "type": "Type", + "tags": [], + "label": "CreateAPIKeyParams", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyParams", + "text": "CreateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams", + "text": "CreateRestAPIKeyWithKibanaPrivilegesParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateCrossClusterAPIKeyParams", + "text": "CreateCrossClusterAPIKeyParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.CreateAPIKeyResult", + "type": "Type", + "tags": [], + "label": "CreateAPIKeyResult", + "description": [ + "\nResponse of Kibana Create API key endpoint." + ], + "signature": [ + "SecurityCreateApiKeyResponse" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.KibanaPrivilegesType", + "type": "Type", + "tags": [], + "label": "KibanaPrivilegesType", + "description": [ + "\nType representing Kibana specific portion of the role definition." + ], + "signature": [ + "{ spaces: string[]; base?: string[] | undefined; feature?: Record | undefined; }[]" + ], + "path": "packages/core/security/core-security-server/src/roles/schema.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.UpdateAPIKeyParams", + "type": "Type", + "tags": [], + "label": "UpdateAPIKeyParams", + "description": [ + "\nRequest body of Kibana Update API key endpoint." + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateRestAPIKeyParams", + "text": "UpdateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateCrossClusterAPIKeyParams", + "text": "UpdateCrossClusterAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateRestAPIKeyWithKibanaPrivilegesParams", + "text": "UpdateRestAPIKeyWithKibanaPrivilegesParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/core-security-server", + "id": "def-common.UpdateAPIKeyResult", + "type": "Type", + "tags": [], + "label": "UpdateAPIKeyResult", + "description": [ + "\nResponse of Kibana Update API key endpoint." + ], + "signature": [ + "SecurityUpdateApiKeyResponse" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ], "objects": [] diff --git a/api_docs/kbn_core_security_server.mdx b/api_docs/kbn_core_security_server.mdx index e729f9f52e314..4139bf1eae324 100644 --- a/api_docs/kbn_core_security_server.mdx +++ b/api_docs/kbn_core_security_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-server title: "@kbn/core-security-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-server'] --- import kbnCoreSecurityServerObj from './kbn_core_security_server.devdocs.json'; @@ -21,10 +21,13 @@ Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 52 | 0 | 16 | 0 | +| 146 | 1 | 63 | 0 | ## Common +### Functions + + ### Interfaces diff --git a/api_docs/kbn_core_security_server_internal.mdx b/api_docs/kbn_core_security_server_internal.mdx index f7eb563902da3..9c7ad2035ccb2 100644 --- a/api_docs/kbn_core_security_server_internal.mdx +++ b/api_docs/kbn_core_security_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-server-internal title: "@kbn/core-security-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-server-internal'] --- import kbnCoreSecurityServerInternalObj from './kbn_core_security_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_security_server_mocks.devdocs.json b/api_docs/kbn_core_security_server_mocks.devdocs.json index b9910d935968b..686b62e5af8fc 100644 --- a/api_docs/kbn_core_security_server_mocks.devdocs.json +++ b/api_docs/kbn_core_security_server_mocks.devdocs.json @@ -90,6 +90,44 @@ } ], "objects": [ + { + "parentPluginId": "@kbn/core-security-server-mocks", + "id": "def-common.apiKeysMock", + "type": "Object", + "tags": [], + "label": "apiKeysMock", + "description": [], + "path": "packages/core/security/core-security-server-mocks/src/api_keys.mock.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-security-server-mocks", + "id": "def-common.apiKeysMock.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [], + "signature": [ + "() => jest.MockedObjectDeep<", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.APIKeys", + "text": "APIKeys" + }, + ">" + ], + "path": "packages/core/security/core-security-server-mocks/src/api_keys.mock.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/core-security-server-mocks", "id": "def-common.auditLoggerMock", diff --git a/api_docs/kbn_core_security_server_mocks.mdx b/api_docs/kbn_core_security_server_mocks.mdx index 7c4e8bdaf6a34..209c495677293 100644 --- a/api_docs/kbn_core_security_server_mocks.mdx +++ b/api_docs/kbn_core_security_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-server-mocks title: "@kbn/core-security-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-server-mocks'] --- import kbnCoreSecurityServerMocksObj from './kbn_core_security_server_mocks.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 13 | 0 | 13 | 2 | +| 15 | 0 | 15 | 2 | ## Common diff --git a/api_docs/kbn_core_status_common.mdx b/api_docs/kbn_core_status_common.mdx index 94d811e90ba74..fb31caf120bb0 100644 --- a/api_docs/kbn_core_status_common.mdx +++ b/api_docs/kbn_core_status_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-common title: "@kbn/core-status-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common'] --- import kbnCoreStatusCommonObj from './kbn_core_status_common.devdocs.json'; diff --git a/api_docs/kbn_core_status_common_internal.mdx b/api_docs/kbn_core_status_common_internal.mdx index 7c24950586dcc..3565faa7654ca 100644 --- a/api_docs/kbn_core_status_common_internal.mdx +++ b/api_docs/kbn_core_status_common_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-common-internal title: "@kbn/core-status-common-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-common-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common-internal'] --- import kbnCoreStatusCommonInternalObj from './kbn_core_status_common_internal.devdocs.json'; diff --git a/api_docs/kbn_core_status_server.mdx b/api_docs/kbn_core_status_server.mdx index 1f0093e2561d4..39250a7ba184f 100644 --- a/api_docs/kbn_core_status_server.mdx +++ b/api_docs/kbn_core_status_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server title: "@kbn/core-status-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server'] --- import kbnCoreStatusServerObj from './kbn_core_status_server.devdocs.json'; diff --git a/api_docs/kbn_core_status_server_internal.mdx b/api_docs/kbn_core_status_server_internal.mdx index 41c0c5279bf9c..ae5a55848a0ae 100644 --- a/api_docs/kbn_core_status_server_internal.mdx +++ b/api_docs/kbn_core_status_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server-internal title: "@kbn/core-status-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server-internal'] --- import kbnCoreStatusServerInternalObj from './kbn_core_status_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_status_server_mocks.mdx b/api_docs/kbn_core_status_server_mocks.mdx index 4777ddfe711eb..063abbf6f8ce1 100644 --- a/api_docs/kbn_core_status_server_mocks.mdx +++ b/api_docs/kbn_core_status_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server-mocks title: "@kbn/core-status-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server-mocks'] --- import kbnCoreStatusServerMocksObj from './kbn_core_status_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx index 591980e5254c4..2a96726373e10 100644 --- a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx +++ b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-deprecations-getters title: "@kbn/core-test-helpers-deprecations-getters" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-deprecations-getters plugin -date: 2024-07-04 +date: 2024-07-11 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 84122a889e229..359518c3074b2 100644 --- a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx +++ b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-http-setup-browser title: "@kbn/core-test-helpers-http-setup-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-http-setup-browser plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-http-setup-browser'] --- import kbnCoreTestHelpersHttpSetupBrowserObj from './kbn_core_test_helpers_http_setup_browser.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_kbn_server.mdx b/api_docs/kbn_core_test_helpers_kbn_server.mdx index a5cad061f959e..e6fbc69fc4b33 100644 --- a/api_docs/kbn_core_test_helpers_kbn_server.mdx +++ b/api_docs/kbn_core_test_helpers_kbn_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-kbn-server title: "@kbn/core-test-helpers-kbn-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-kbn-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-kbn-server'] --- import kbnCoreTestHelpersKbnServerObj from './kbn_core_test_helpers_kbn_server.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_model_versions.mdx b/api_docs/kbn_core_test_helpers_model_versions.mdx index bc29ce7ffecbe..f99f8627deeca 100644 --- a/api_docs/kbn_core_test_helpers_model_versions.mdx +++ b/api_docs/kbn_core_test_helpers_model_versions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-model-versions title: "@kbn/core-test-helpers-model-versions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-model-versions plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-model-versions'] --- import kbnCoreTestHelpersModelVersionsObj from './kbn_core_test_helpers_model_versions.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_so_type_serializer.mdx b/api_docs/kbn_core_test_helpers_so_type_serializer.mdx index 4dceb5861ab49..c34d787a163f2 100644 --- a/api_docs/kbn_core_test_helpers_so_type_serializer.mdx +++ b/api_docs/kbn_core_test_helpers_so_type_serializer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-so-type-serializer title: "@kbn/core-test-helpers-so-type-serializer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-so-type-serializer plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-so-type-serializer'] --- import kbnCoreTestHelpersSoTypeSerializerObj from './kbn_core_test_helpers_so_type_serializer.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_test_utils.mdx b/api_docs/kbn_core_test_helpers_test_utils.mdx index 13b07110dbe4b..65001a51b1d16 100644 --- a/api_docs/kbn_core_test_helpers_test_utils.mdx +++ b/api_docs/kbn_core_test_helpers_test_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-test-utils title: "@kbn/core-test-helpers-test-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-test-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-test-utils'] --- import kbnCoreTestHelpersTestUtilsObj from './kbn_core_test_helpers_test_utils.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser.mdx b/api_docs/kbn_core_theme_browser.mdx index 01ebb462ca4ab..4142b15b2d9db 100644 --- a/api_docs/kbn_core_theme_browser.mdx +++ b/api_docs/kbn_core_theme_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser title: "@kbn/core-theme-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser'] --- import kbnCoreThemeBrowserObj from './kbn_core_theme_browser.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_mocks.mdx b/api_docs/kbn_core_theme_browser_mocks.mdx index 15466105466b1..b0e6352eb09e9 100644 --- a/api_docs/kbn_core_theme_browser_mocks.mdx +++ b/api_docs/kbn_core_theme_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-mocks title: "@kbn/core-theme-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 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 9884cab812daa..07976f5268389 100644 --- a/api_docs/kbn_core_ui_settings_browser.mdx +++ b/api_docs/kbn_core_ui_settings_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser title: "@kbn/core-ui-settings-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser plugin -date: 2024-07-04 +date: 2024-07-11 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 e1ec8f4e2d892..8403f8135adca 100644 --- a/api_docs/kbn_core_ui_settings_browser_internal.mdx +++ b/api_docs/kbn_core_ui_settings_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-internal title: "@kbn/core-ui-settings-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-internal plugin -date: 2024-07-04 +date: 2024-07-11 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 2603428a344ce..dcd06080ded9f 100644 --- a/api_docs/kbn_core_ui_settings_browser_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-mocks title: "@kbn/core-ui-settings-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-mocks'] --- import kbnCoreUiSettingsBrowserMocksObj from './kbn_core_ui_settings_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_common.mdx b/api_docs/kbn_core_ui_settings_common.mdx index b37d365a0b718..383884d29aa2e 100644 --- a/api_docs/kbn_core_ui_settings_common.mdx +++ b/api_docs/kbn_core_ui_settings_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-common title: "@kbn/core-ui-settings-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-common'] --- import kbnCoreUiSettingsCommonObj from './kbn_core_ui_settings_common.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server.mdx b/api_docs/kbn_core_ui_settings_server.mdx index e2e2c0eec22a8..c0a1d101ad8c1 100644 --- a/api_docs/kbn_core_ui_settings_server.mdx +++ b/api_docs/kbn_core_ui_settings_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server title: "@kbn/core-ui-settings-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server'] --- import kbnCoreUiSettingsServerObj from './kbn_core_ui_settings_server.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server_internal.mdx b/api_docs/kbn_core_ui_settings_server_internal.mdx index 5c6790d3f8644..f4d7730da2efb 100644 --- a/api_docs/kbn_core_ui_settings_server_internal.mdx +++ b/api_docs/kbn_core_ui_settings_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server-internal title: "@kbn/core-ui-settings-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-internal'] --- import kbnCoreUiSettingsServerInternalObj from './kbn_core_ui_settings_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server_mocks.mdx b/api_docs/kbn_core_ui_settings_server_mocks.mdx index 7cb2b5817e90b..b6445e6ef9a56 100644 --- a/api_docs/kbn_core_ui_settings_server_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server-mocks title: "@kbn/core-ui-settings-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-mocks'] --- import kbnCoreUiSettingsServerMocksObj from './kbn_core_ui_settings_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server.mdx b/api_docs/kbn_core_usage_data_server.mdx index 9beb50d12fc73..158a04ff11bc2 100644 --- a/api_docs/kbn_core_usage_data_server.mdx +++ b/api_docs/kbn_core_usage_data_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server title: "@kbn/core-usage-data-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server'] --- import kbnCoreUsageDataServerObj from './kbn_core_usage_data_server.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server_internal.mdx b/api_docs/kbn_core_usage_data_server_internal.mdx index 6d02ecd973803..a6833cfb987d6 100644 --- a/api_docs/kbn_core_usage_data_server_internal.mdx +++ b/api_docs/kbn_core_usage_data_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server-internal title: "@kbn/core-usage-data-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server-internal'] --- import kbnCoreUsageDataServerInternalObj from './kbn_core_usage_data_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server_mocks.mdx b/api_docs/kbn_core_usage_data_server_mocks.mdx index 52d469b7344a7..f878721b6fe12 100644 --- a/api_docs/kbn_core_usage_data_server_mocks.mdx +++ b/api_docs/kbn_core_usage_data_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server-mocks title: "@kbn/core-usage-data-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server-mocks'] --- import kbnCoreUsageDataServerMocksObj from './kbn_core_usage_data_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_browser.mdx b/api_docs/kbn_core_user_profile_browser.mdx index 13fc386f8b20d..f2e6bc1e5f05d 100644 --- a/api_docs/kbn_core_user_profile_browser.mdx +++ b/api_docs/kbn_core_user_profile_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-browser title: "@kbn/core-user-profile-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-browser plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-browser'] --- import kbnCoreUserProfileBrowserObj from './kbn_core_user_profile_browser.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_browser_internal.mdx b/api_docs/kbn_core_user_profile_browser_internal.mdx index 8e69c6a18e447..fe9361ab89076 100644 --- a/api_docs/kbn_core_user_profile_browser_internal.mdx +++ b/api_docs/kbn_core_user_profile_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-browser-internal title: "@kbn/core-user-profile-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-browser-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-browser-internal'] --- import kbnCoreUserProfileBrowserInternalObj from './kbn_core_user_profile_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_browser_mocks.mdx b/api_docs/kbn_core_user_profile_browser_mocks.mdx index 4cb7228e7ba3c..3231c90c05c5d 100644 --- a/api_docs/kbn_core_user_profile_browser_mocks.mdx +++ b/api_docs/kbn_core_user_profile_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-browser-mocks title: "@kbn/core-user-profile-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-browser-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-browser-mocks'] --- import kbnCoreUserProfileBrowserMocksObj from './kbn_core_user_profile_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_common.mdx b/api_docs/kbn_core_user_profile_common.mdx index 36895083829a3..322cae4dfa77c 100644 --- a/api_docs/kbn_core_user_profile_common.mdx +++ b/api_docs/kbn_core_user_profile_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-common title: "@kbn/core-user-profile-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-common'] --- import kbnCoreUserProfileCommonObj from './kbn_core_user_profile_common.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_server.mdx b/api_docs/kbn_core_user_profile_server.mdx index 31efa53412ecf..efe307180e83a 100644 --- a/api_docs/kbn_core_user_profile_server.mdx +++ b/api_docs/kbn_core_user_profile_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-server title: "@kbn/core-user-profile-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-server'] --- import kbnCoreUserProfileServerObj from './kbn_core_user_profile_server.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_server_internal.mdx b/api_docs/kbn_core_user_profile_server_internal.mdx index a4af1347dcbdf..e55bf0b83222d 100644 --- a/api_docs/kbn_core_user_profile_server_internal.mdx +++ b/api_docs/kbn_core_user_profile_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-server-internal title: "@kbn/core-user-profile-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-server-internal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-server-internal'] --- import kbnCoreUserProfileServerInternalObj from './kbn_core_user_profile_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_server_mocks.mdx b/api_docs/kbn_core_user_profile_server_mocks.mdx index c580396871c78..ad5a069dc7c95 100644 --- a/api_docs/kbn_core_user_profile_server_mocks.mdx +++ b/api_docs/kbn_core_user_profile_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-server-mocks title: "@kbn/core-user-profile-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-server-mocks'] --- import kbnCoreUserProfileServerMocksObj from './kbn_core_user_profile_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_user_settings_server.mdx b/api_docs/kbn_core_user_settings_server.mdx index e6520a108e061..bf9468e73fcf9 100644 --- a/api_docs/kbn_core_user_settings_server.mdx +++ b/api_docs/kbn_core_user_settings_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-settings-server title: "@kbn/core-user-settings-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-settings-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-settings-server'] --- import kbnCoreUserSettingsServerObj from './kbn_core_user_settings_server.devdocs.json'; diff --git a/api_docs/kbn_core_user_settings_server_mocks.mdx b/api_docs/kbn_core_user_settings_server_mocks.mdx index 2590924c0c29d..ff3adf35317d2 100644 --- a/api_docs/kbn_core_user_settings_server_mocks.mdx +++ b/api_docs/kbn_core_user_settings_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-settings-server-mocks title: "@kbn/core-user-settings-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-settings-server-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-settings-server-mocks'] --- import kbnCoreUserSettingsServerMocksObj from './kbn_core_user_settings_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_crypto.mdx b/api_docs/kbn_crypto.mdx index c9207cad137a2..b4d26872b24e0 100644 --- a/api_docs/kbn_crypto.mdx +++ b/api_docs/kbn_crypto.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto title: "@kbn/crypto" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto plugin -date: 2024-07-04 +date: 2024-07-11 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 58ddbdb08f508..9a8c74e3bd723 100644 --- a/api_docs/kbn_crypto_browser.mdx +++ b/api_docs/kbn_crypto_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto-browser title: "@kbn/crypto-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto-browser plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto-browser'] --- import kbnCryptoBrowserObj from './kbn_crypto_browser.devdocs.json'; diff --git a/api_docs/kbn_custom_icons.mdx b/api_docs/kbn_custom_icons.mdx index 6494698dbc112..2b03ad087184f 100644 --- a/api_docs/kbn_custom_icons.mdx +++ b/api_docs/kbn_custom_icons.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-custom-icons title: "@kbn/custom-icons" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/custom-icons plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/custom-icons'] --- import kbnCustomIconsObj from './kbn_custom_icons.devdocs.json'; diff --git a/api_docs/kbn_custom_integrations.mdx b/api_docs/kbn_custom_integrations.mdx index b3e0d7ea63ed7..d01d7fe32e132 100644 --- a/api_docs/kbn_custom_integrations.mdx +++ b/api_docs/kbn_custom_integrations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-custom-integrations title: "@kbn/custom-integrations" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/custom-integrations plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/custom-integrations'] --- import kbnCustomIntegrationsObj from './kbn_custom_integrations.devdocs.json'; diff --git a/api_docs/kbn_cypress_config.mdx b/api_docs/kbn_cypress_config.mdx index 08b84e310d557..4daf1d3c445ff 100644 --- a/api_docs/kbn_cypress_config.mdx +++ b/api_docs/kbn_cypress_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cypress-config title: "@kbn/cypress-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cypress-config plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cypress-config'] --- import kbnCypressConfigObj from './kbn_cypress_config.devdocs.json'; diff --git a/api_docs/kbn_data_forge.mdx b/api_docs/kbn_data_forge.mdx index f5e689706d2f9..cf52fa6c3a80e 100644 --- a/api_docs/kbn_data_forge.mdx +++ b/api_docs/kbn_data_forge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-data-forge title: "@kbn/data-forge" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/data-forge plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-forge'] --- import kbnDataForgeObj from './kbn_data_forge.devdocs.json'; diff --git a/api_docs/kbn_data_service.mdx b/api_docs/kbn_data_service.mdx index 450d1e27aadc2..b55dbe1104ec4 100644 --- a/api_docs/kbn_data_service.mdx +++ b/api_docs/kbn_data_service.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-data-service title: "@kbn/data-service" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/data-service plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-service'] --- import kbnDataServiceObj from './kbn_data_service.devdocs.json'; diff --git a/api_docs/kbn_data_stream_adapter.mdx b/api_docs/kbn_data_stream_adapter.mdx index 4ba2da1295d7c..8776bd84a8a67 100644 --- a/api_docs/kbn_data_stream_adapter.mdx +++ b/api_docs/kbn_data_stream_adapter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-data-stream-adapter title: "@kbn/data-stream-adapter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/data-stream-adapter plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-stream-adapter'] --- import kbnDataStreamAdapterObj from './kbn_data_stream_adapter.devdocs.json'; diff --git a/api_docs/kbn_data_view_utils.devdocs.json b/api_docs/kbn_data_view_utils.devdocs.json index bbef9faf79cd5..c1b48a5d1f3b4 100644 --- a/api_docs/kbn_data_view_utils.devdocs.json +++ b/api_docs/kbn_data_view_utils.devdocs.json @@ -19,6 +19,62 @@ "common": { "classes": [], "functions": [ + { + "parentPluginId": "@kbn/data-view-utils", + "id": "def-common.convertDatatableColumnToDataViewFieldSpec", + "type": "Function", + "tags": [], + "label": "convertDatatableColumnToDataViewFieldSpec", + "description": [ + "\nConvert a datatable column to a DataViewFieldSpec" + ], + "signature": [ + "(column: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" + }, + ") => ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + } + ], + "path": "packages/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/data-view-utils", + "id": "def-common.convertDatatableColumnToDataViewFieldSpec.$1", + "type": "Object", + "tags": [], + "label": "column", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" + } + ], + "path": "packages/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/data-view-utils", "id": "def-common.createRegExpPatternFrom", diff --git a/api_docs/kbn_data_view_utils.mdx b/api_docs/kbn_data_view_utils.mdx index abff26dd8777e..37a08519c657c 100644 --- a/api_docs/kbn_data_view_utils.mdx +++ b/api_docs/kbn_data_view_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-data-view-utils title: "@kbn/data-view-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/data-view-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-view-utils'] --- import kbnDataViewUtilsObj from './kbn_data_view_utils.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 5 | 0 | 4 | 0 | +| 7 | 0 | 5 | 0 | ## Common diff --git a/api_docs/kbn_datemath.devdocs.json b/api_docs/kbn_datemath.devdocs.json index 71d5b783708c0..dd5303cfd095e 100644 --- a/api_docs/kbn_datemath.devdocs.json +++ b/api_docs/kbn_datemath.devdocs.json @@ -200,7 +200,7 @@ "label": "UnitsMap", "description": [], "signature": [ - "{ m: { weight: number; type: \"fixed\" | \"calendar\" | \"mixed\"; 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; }; s: { weight: number; type: \"fixed\" | \"calendar\" | \"mixed\"; base: number; }; ms: { weight: number; type: \"fixed\" | \"calendar\" | \"mixed\"; base: number; }; }" + "{ m: { weight: number; type: \"fixed\" | \"mixed\" | \"calendar\"; base: number; }; y: { 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; }; d: { weight: number; type: \"fixed\" | \"mixed\" | \"calendar\"; base: number; }; h: { weight: number; type: \"fixed\" | \"mixed\" | \"calendar\"; base: number; }; s: { weight: number; type: \"fixed\" | \"mixed\" | \"calendar\"; base: number; }; ms: { weight: number; type: \"fixed\" | \"mixed\" | \"calendar\"; base: number; }; }" ], "path": "packages/kbn-datemath/index.ts", "deprecated": false, diff --git a/api_docs/kbn_datemath.mdx b/api_docs/kbn_datemath.mdx index 3b3347cf1c0dd..7f94ca1b6c62f 100644 --- a/api_docs/kbn_datemath.mdx +++ b/api_docs/kbn_datemath.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-datemath title: "@kbn/datemath" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/datemath plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/datemath'] --- import kbnDatemathObj from './kbn_datemath.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_analytics.mdx b/api_docs/kbn_deeplinks_analytics.mdx index 07eb21343d8b7..690ee52302f83 100644 --- a/api_docs/kbn_deeplinks_analytics.mdx +++ b/api_docs/kbn_deeplinks_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-analytics title: "@kbn/deeplinks-analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-analytics plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-analytics'] --- import kbnDeeplinksAnalyticsObj from './kbn_deeplinks_analytics.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_devtools.mdx b/api_docs/kbn_deeplinks_devtools.mdx index 7421cd3c8553e..d9ff350331076 100644 --- a/api_docs/kbn_deeplinks_devtools.mdx +++ b/api_docs/kbn_deeplinks_devtools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-devtools title: "@kbn/deeplinks-devtools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-devtools plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-devtools'] --- import kbnDeeplinksDevtoolsObj from './kbn_deeplinks_devtools.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_fleet.mdx b/api_docs/kbn_deeplinks_fleet.mdx index 8302e2e922c34..01616f8aa7939 100644 --- a/api_docs/kbn_deeplinks_fleet.mdx +++ b/api_docs/kbn_deeplinks_fleet.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-fleet title: "@kbn/deeplinks-fleet" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-fleet plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-fleet'] --- import kbnDeeplinksFleetObj from './kbn_deeplinks_fleet.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_management.devdocs.json b/api_docs/kbn_deeplinks_management.devdocs.json index c4b7d9dd33259..4a7d7e3992fd5 100644 --- a/api_docs/kbn_deeplinks_management.devdocs.json +++ b/api_docs/kbn_deeplinks_management.devdocs.json @@ -45,7 +45,7 @@ "label": "DeepLinkId", "description": [], "signature": [ - "\"fleet\" | \"monitoring\" | \"management\" | \"integrations\" | \"osquery\" | \"management:transform\" | \"management:watcher\" | \"management:cases\" | \"management:tags\" | \"management:maintenanceWindows\" | \"management:settings\" | \"management:dataViews\" | \"management:spaces\" | \"management:users\" | \"management:migrate_data\" | \"management:search_sessions\" | \"management:data_quality\" | \"management:filesManagement\" | \"management:roles\" | \"management:reporting\" | \"management:aiAssistantManagementSelection\" | \"management:securityAiAssistantManagement\" | \"management:observabilityAiAssistantManagement\" | \"management:api_keys\" | \"management:cross_cluster_replication\" | \"management:license_management\" | \"management:index_lifecycle_management\" | \"management:index_management\" | \"management:ingest_pipelines\" | \"management:jobsListLink\" | \"management:objects\" | \"management:pipelines\" | \"management:remote_clusters\" | \"management:role_mappings\" | \"management:rollup_jobs\" | \"management:snapshot_restore\" | \"management:triggersActions\" | \"management:triggersActionsConnectors\" | \"management:upgrade_assistant\"" + "\"fleet\" | \"monitoring\" | \"management\" | \"integrations\" | \"osquery\" | \"management:transform\" | \"management:watcher\" | \"management:cases\" | \"management:tags\" | \"management:maintenanceWindows\" | \"management:dataViews\" | \"management:spaces\" | \"management:settings\" | \"management:users\" | \"management:migrate_data\" | \"management:search_sessions\" | \"management:data_quality\" | \"management:filesManagement\" | \"management:roles\" | \"management:reporting\" | \"management:aiAssistantManagementSelection\" | \"management:securityAiAssistantManagement\" | \"management:observabilityAiAssistantManagement\" | \"management:api_keys\" | \"management:cross_cluster_replication\" | \"management:license_management\" | \"management:index_lifecycle_management\" | \"management:index_management\" | \"management:ingest_pipelines\" | \"management:jobsListLink\" | \"management:objects\" | \"management:pipelines\" | \"management:remote_clusters\" | \"management:role_mappings\" | \"management:rollup_jobs\" | \"management:snapshot_restore\" | \"management:triggersActions\" | \"management:triggersActionsConnectors\" | \"management:upgrade_assistant\"" ], "path": "packages/deeplinks/management/deep_links.ts", "deprecated": false, @@ -60,7 +60,7 @@ "label": "LinkId", "description": [], "signature": [ - "\"transform\" | \"watcher\" | \"cases\" | \"tags\" | \"maintenanceWindows\" | \"settings\" | \"dataViews\" | \"spaces\" | \"users\" | \"migrate_data\" | \"search_sessions\" | \"data_quality\" | \"filesManagement\" | \"roles\" | \"reporting\" | \"aiAssistantManagementSelection\" | \"securityAiAssistantManagement\" | \"observabilityAiAssistantManagement\" | \"api_keys\" | \"cross_cluster_replication\" | \"license_management\" | \"index_lifecycle_management\" | \"index_management\" | \"ingest_pipelines\" | \"jobsListLink\" | \"objects\" | \"pipelines\" | \"remote_clusters\" | \"role_mappings\" | \"rollup_jobs\" | \"snapshot_restore\" | \"triggersActions\" | \"triggersActionsConnectors\" | \"upgrade_assistant\"" + "\"transform\" | \"watcher\" | \"cases\" | \"tags\" | \"maintenanceWindows\" | \"dataViews\" | \"spaces\" | \"settings\" | \"users\" | \"migrate_data\" | \"search_sessions\" | \"data_quality\" | \"filesManagement\" | \"roles\" | \"reporting\" | \"aiAssistantManagementSelection\" | \"securityAiAssistantManagement\" | \"observabilityAiAssistantManagement\" | \"api_keys\" | \"cross_cluster_replication\" | \"license_management\" | \"index_lifecycle_management\" | \"index_management\" | \"ingest_pipelines\" | \"jobsListLink\" | \"objects\" | \"pipelines\" | \"remote_clusters\" | \"role_mappings\" | \"rollup_jobs\" | \"snapshot_restore\" | \"triggersActions\" | \"triggersActionsConnectors\" | \"upgrade_assistant\"" ], "path": "packages/deeplinks/management/deep_links.ts", "deprecated": false, diff --git a/api_docs/kbn_deeplinks_management.mdx b/api_docs/kbn_deeplinks_management.mdx index 131331d7a6f52..9f109f9ac8e27 100644 --- a/api_docs/kbn_deeplinks_management.mdx +++ b/api_docs/kbn_deeplinks_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-management title: "@kbn/deeplinks-management" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-management plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-management'] --- import kbnDeeplinksManagementObj from './kbn_deeplinks_management.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_ml.mdx b/api_docs/kbn_deeplinks_ml.mdx index 09181dd34288a..c7b45bac65b78 100644 --- a/api_docs/kbn_deeplinks_ml.mdx +++ b/api_docs/kbn_deeplinks_ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-ml title: "@kbn/deeplinks-ml" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-ml plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-ml'] --- import kbnDeeplinksMlObj from './kbn_deeplinks_ml.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_observability.devdocs.json b/api_docs/kbn_deeplinks_observability.devdocs.json index b69b1bdad957c..3b151a497e3c5 100644 --- a/api_docs/kbn_deeplinks_observability.devdocs.json +++ b/api_docs/kbn_deeplinks_observability.devdocs.json @@ -22,18 +22,18 @@ "interfaces": [ { "parentPluginId": "@kbn/deeplinks-observability", - "id": "def-common.DatasetQualityLocatorParams", + "id": "def-common.DataQualityLocatorParams", "type": "Interface", "tags": [], - "label": "DatasetQualityLocatorParams", + "label": "DataQualityLocatorParams", "description": [], "signature": [ { "pluginId": "@kbn/deeplinks-observability", "scope": "common", "docId": "kibKbnDeeplinksObservabilityPluginApi", - "section": "def-common.DatasetQualityLocatorParams", - "text": "DatasetQualityLocatorParams" + "section": "def-common.DataQualityLocatorParams", + "text": "DataQualityLocatorParams" }, " extends ", { @@ -50,7 +50,7 @@ "children": [ { "parentPluginId": "@kbn/deeplinks-observability", - "id": "def-common.DatasetQualityLocatorParams.filters", + "id": "def-common.DataQualityLocatorParams.filters", "type": "Object", "tags": [], "label": "filters", @@ -61,6 +61,20 @@ "path": "packages/deeplinks/observability/locators/dataset_quality.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.DataQualityLocatorParams.flyout", + "type": "Object", + "tags": [], + "label": "flyout", + "description": [], + "signature": [ + "{ dataset: DatasetConfig; } | undefined" + ], + "path": "packages/deeplinks/observability/locators/dataset_quality.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -514,6 +528,166 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.UptimeOverviewLocatorInfraParams", + "type": "Interface", + "tags": [], + "label": "UptimeOverviewLocatorInfraParams", + "description": [], + "signature": [ + { + "pluginId": "@kbn/deeplinks-observability", + "scope": "common", + "docId": "kibKbnDeeplinksObservabilityPluginApi", + "section": "def-common.UptimeOverviewLocatorInfraParams", + "text": "UptimeOverviewLocatorInfraParams" + }, + " extends ", + { + "pluginId": "@kbn/utility-types", + "scope": "common", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-common.SerializableRecord", + "text": "SerializableRecord" + } + ], + "path": "packages/deeplinks/observability/locators/uptime.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.UptimeOverviewLocatorInfraParams.ip", + "type": "string", + "tags": [], + "label": "ip", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/deeplinks/observability/locators/uptime.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.UptimeOverviewLocatorInfraParams.host", + "type": "string", + "tags": [], + "label": "host", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/deeplinks/observability/locators/uptime.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.UptimeOverviewLocatorInfraParams.container", + "type": "string", + "tags": [], + "label": "container", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/deeplinks/observability/locators/uptime.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.UptimeOverviewLocatorInfraParams.pod", + "type": "string", + "tags": [], + "label": "pod", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/deeplinks/observability/locators/uptime.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.UptimeOverviewLocatorParams", + "type": "Interface", + "tags": [], + "label": "UptimeOverviewLocatorParams", + "description": [], + "signature": [ + { + "pluginId": "@kbn/deeplinks-observability", + "scope": "common", + "docId": "kibKbnDeeplinksObservabilityPluginApi", + "section": "def-common.UptimeOverviewLocatorParams", + "text": "UptimeOverviewLocatorParams" + }, + " extends ", + { + "pluginId": "@kbn/utility-types", + "scope": "common", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-common.SerializableRecord", + "text": "SerializableRecord" + } + ], + "path": "packages/deeplinks/observability/locators/uptime.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.UptimeOverviewLocatorParams.dateRangeStart", + "type": "string", + "tags": [], + "label": "dateRangeStart", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/deeplinks/observability/locators/uptime.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.UptimeOverviewLocatorParams.dateRangeEnd", + "type": "string", + "tags": [], + "label": "dateRangeEnd", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/deeplinks/observability/locators/uptime.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.UptimeOverviewLocatorParams.search", + "type": "string", + "tags": [], + "label": "search", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/deeplinks/observability/locators/uptime.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false } ], "enums": [], @@ -594,13 +768,13 @@ }, { "parentPluginId": "@kbn/deeplinks-observability", - "id": "def-common.DATASET_QUALITY_LOCATOR_ID", + "id": "def-common.DATA_QUALITY_LOCATOR_ID", "type": "string", "tags": [], - "label": "DATASET_QUALITY_LOCATOR_ID", + "label": "DATA_QUALITY_LOCATOR_ID", "description": [], "signature": [ - "\"DATASET_QUALITY_LOCATOR\"" + "\"DATA_QUALITY_LOCATOR\"" ], "path": "packages/deeplinks/observability/locators/dataset_quality.ts", "deprecated": false, @@ -919,6 +1093,21 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/deeplinks-observability", + "id": "def-common.uptimeOverviewLocatorID", + "type": "string", + "tags": [], + "label": "uptimeOverviewLocatorID", + "description": [], + "signature": [ + "\"UPTIME_OVERVIEW_LOCATOR\"" + ], + "path": "packages/deeplinks/observability/locators/uptime.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ], "objects": [] diff --git a/api_docs/kbn_deeplinks_observability.mdx b/api_docs/kbn_deeplinks_observability.mdx index ac984b80fe854..a9b981ef63b99 100644 --- a/api_docs/kbn_deeplinks_observability.mdx +++ b/api_docs/kbn_deeplinks_observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-observability title: "@kbn/deeplinks-observability" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-observability plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-observability'] --- import kbnDeeplinksObservabilityObj from './kbn_deeplinks_observability.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 45 | 0 | 33 | 0 | +| 56 | 0 | 44 | 0 | ## Common diff --git a/api_docs/kbn_deeplinks_search.devdocs.json b/api_docs/kbn_deeplinks_search.devdocs.json index 312aad5a35d80..d3659c3bf083c 100644 --- a/api_docs/kbn_deeplinks_search.devdocs.json +++ b/api_docs/kbn_deeplinks_search.devdocs.json @@ -30,7 +30,7 @@ "label": "DeepLinkId", "description": [], "signature": [ - "\"appSearch\" | \"enterpriseSearch\" | \"enterpriseSearchContent\" | \"enterpriseSearchApplications\" | \"enterpriseSearchAnalytics\" | \"workplaceSearch\" | \"serverlessElasticsearch\" | \"serverlessConnectors\" | \"searchPlayground\" | \"searchInferenceEndpoints\" | \"searchHomepage\" | \"enterpriseSearchContent:connectors\" | \"enterpriseSearchContent:searchIndices\" | \"enterpriseSearchContent:webCrawlers\" | \"enterpriseSearchApplications:searchApplications\" | \"enterpriseSearchApplications:playground\" | \"appSearch:engines\"" + "\"appSearch\" | \"enterpriseSearch\" | \"enterpriseSearchContent\" | \"enterpriseSearchApplications\" | \"enterpriseSearchRelevance\" | \"enterpriseSearchAnalytics\" | \"workplaceSearch\" | \"serverlessElasticsearch\" | \"serverlessConnectors\" | \"searchPlayground\" | \"searchInferenceEndpoints\" | \"searchHomepage\" | \"enterpriseSearchContent:connectors\" | \"enterpriseSearchContent:searchIndices\" | \"enterpriseSearchContent:webCrawlers\" | \"enterpriseSearchApplications:searchApplications\" | \"enterpriseSearchApplications:playground\" | \"appSearch:engines\" | \"enterpriseSearchRelevance:inferenceEndpoints\"" ], "path": "packages/deeplinks/search/deep_links.ts", "deprecated": false, @@ -114,13 +114,13 @@ }, { "parentPluginId": "@kbn/deeplinks-search", - "id": "def-common.ENTERPRISE_SEARCH_INFERENCE_ENDPOINTS_APP_ID", + "id": "def-common.ENTERPRISE_SEARCH_RELEVANCE_APP_ID", "type": "string", "tags": [], - "label": "ENTERPRISE_SEARCH_INFERENCE_ENDPOINTS_APP_ID", + "label": "ENTERPRISE_SEARCH_RELEVANCE_APP_ID", "description": [], "signature": [ - "\"enterpriseSearchInferenceEndpoints\"" + "\"enterpriseSearchRelevance\"" ], "path": "packages/deeplinks/search/constants.ts", "deprecated": false, diff --git a/api_docs/kbn_deeplinks_search.mdx b/api_docs/kbn_deeplinks_search.mdx index 036266ce738e8..7632d8c3d8574 100644 --- a/api_docs/kbn_deeplinks_search.mdx +++ b/api_docs/kbn_deeplinks_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-search title: "@kbn/deeplinks-search" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-search plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-search'] --- import kbnDeeplinksSearchObj from './kbn_deeplinks_search.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_security.mdx b/api_docs/kbn_deeplinks_security.mdx index 3ed04e94438f6..53f462a5820e4 100644 --- a/api_docs/kbn_deeplinks_security.mdx +++ b/api_docs/kbn_deeplinks_security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-security title: "@kbn/deeplinks-security" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-security plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-security'] --- import kbnDeeplinksSecurityObj from './kbn_deeplinks_security.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_shared.mdx b/api_docs/kbn_deeplinks_shared.mdx index 2a7a079e70947..45f26f34c0bc8 100644 --- a/api_docs/kbn_deeplinks_shared.mdx +++ b/api_docs/kbn_deeplinks_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-shared title: "@kbn/deeplinks-shared" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-shared plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-shared'] --- import kbnDeeplinksSharedObj from './kbn_deeplinks_shared.devdocs.json'; diff --git a/api_docs/kbn_default_nav_analytics.mdx b/api_docs/kbn_default_nav_analytics.mdx index 2a955bdd9590d..077cf495c42a0 100644 --- a/api_docs/kbn_default_nav_analytics.mdx +++ b/api_docs/kbn_default_nav_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-analytics title: "@kbn/default-nav-analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-analytics plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-analytics'] --- import kbnDefaultNavAnalyticsObj from './kbn_default_nav_analytics.devdocs.json'; diff --git a/api_docs/kbn_default_nav_devtools.mdx b/api_docs/kbn_default_nav_devtools.mdx index 8c52d0973c5d2..9b9c2ec67217a 100644 --- a/api_docs/kbn_default_nav_devtools.mdx +++ b/api_docs/kbn_default_nav_devtools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-devtools title: "@kbn/default-nav-devtools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-devtools plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-devtools'] --- import kbnDefaultNavDevtoolsObj from './kbn_default_nav_devtools.devdocs.json'; diff --git a/api_docs/kbn_default_nav_management.mdx b/api_docs/kbn_default_nav_management.mdx index 35869c2d6c35e..01e11369c69c6 100644 --- a/api_docs/kbn_default_nav_management.mdx +++ b/api_docs/kbn_default_nav_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-management title: "@kbn/default-nav-management" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-management plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-management'] --- import kbnDefaultNavManagementObj from './kbn_default_nav_management.devdocs.json'; diff --git a/api_docs/kbn_default_nav_ml.mdx b/api_docs/kbn_default_nav_ml.mdx index c6081004286e8..314ad13865b67 100644 --- a/api_docs/kbn_default_nav_ml.mdx +++ b/api_docs/kbn_default_nav_ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-ml title: "@kbn/default-nav-ml" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-ml plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-ml'] --- import kbnDefaultNavMlObj from './kbn_default_nav_ml.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_errors.mdx b/api_docs/kbn_dev_cli_errors.mdx index 767159ccf2e5f..53fd62dbd5207 100644 --- a/api_docs/kbn_dev_cli_errors.mdx +++ b/api_docs/kbn_dev_cli_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-errors title: "@kbn/dev-cli-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-errors plugin -date: 2024-07-04 +date: 2024-07-11 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 71374e71863aa..adc46e7bed4bf 100644 --- a/api_docs/kbn_dev_cli_runner.mdx +++ b/api_docs/kbn_dev_cli_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-runner title: "@kbn/dev-cli-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-runner plugin -date: 2024-07-04 +date: 2024-07-11 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 29fb9a8bdaf0a..80dc1d84a3bcb 100644 --- a/api_docs/kbn_dev_proc_runner.mdx +++ b/api_docs/kbn_dev_proc_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-proc-runner title: "@kbn/dev-proc-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-proc-runner plugin -date: 2024-07-04 +date: 2024-07-11 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 5c9b58e39fb80..6f8c66c500644 100644 --- a/api_docs/kbn_dev_utils.mdx +++ b/api_docs/kbn_dev_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-utils title: "@kbn/dev-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-utils'] --- import kbnDevUtilsObj from './kbn_dev_utils.devdocs.json'; diff --git a/api_docs/kbn_discover_utils.mdx b/api_docs/kbn_discover_utils.mdx index df15394ec10cf..1013d41512685 100644 --- a/api_docs/kbn_discover_utils.mdx +++ b/api_docs/kbn_discover_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-discover-utils title: "@kbn/discover-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/discover-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/discover-utils'] --- import kbnDiscoverUtilsObj from './kbn_discover_utils.devdocs.json'; diff --git a/api_docs/kbn_doc_links.devdocs.json b/api_docs/kbn_doc_links.devdocs.json index ab331022baa0b..f852d7ecbf732 100644 --- a/api_docs/kbn_doc_links.devdocs.json +++ b/api_docs/kbn_doc_links.devdocs.json @@ -546,7 +546,7 @@ "label": "securitySolution", "description": [], "signature": [ - "{ readonly artifactControl: string; readonly trustedApps: string; readonly eventFilters: string; readonly blocklist: string; readonly endpointArtifacts: string; readonly policyResponseTroubleshooting: { full_disk_access: string; macos_system_ext: string; linux_deadlock: string; }; readonly packageActionTroubleshooting: { es_connection: string; }; readonly threatIntelInt: string; readonly responseActions: string; readonly configureEndpointIntegrationPolicy: string; readonly exceptions: { value_lists: string; }; readonly privileges: string; readonly manageDetectionRules: string; readonly createDetectionRules: string; readonly createEsqlRuleType: string; readonly ruleUiAdvancedParams: string; readonly entityAnalytics: { readonly riskScorePrerequisites: string; readonly hostRiskScore: string; readonly userRiskScore: string; readonly entityRiskScoring: string; readonly assetCriticality: string; }; readonly detectionEngineOverview: string; }" + "{ readonly artifactControl: string; readonly avcResults: string; readonly trustedApps: string; readonly eventFilters: string; readonly blocklist: string; readonly endpointArtifacts: string; readonly policyResponseTroubleshooting: { full_disk_access: string; macos_system_ext: string; linux_deadlock: string; }; readonly packageActionTroubleshooting: { es_connection: string; }; readonly threatIntelInt: string; readonly responseActions: string; readonly configureEndpointIntegrationPolicy: string; readonly exceptions: { value_lists: string; }; readonly privileges: string; readonly manageDetectionRules: string; readonly createDetectionRules: string; readonly createEsqlRuleType: string; readonly ruleUiAdvancedParams: string; readonly entityAnalytics: { readonly riskScorePrerequisites: string; readonly hostRiskScore: string; readonly userRiskScore: string; readonly entityRiskScoring: string; readonly assetCriticality: string; }; readonly detectionEngineOverview: string; }" ], "path": "packages/kbn-doc-links/src/types.ts", "deprecated": false, diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index 590eb9d6ce74b..817bd3ade599a 100644 --- a/api_docs/kbn_doc_links.mdx +++ b/api_docs/kbn_doc_links.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-doc-links title: "@kbn/doc-links" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/doc-links plugin -date: 2024-07-04 +date: 2024-07-11 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 c276d865b1fd1..a6e7f866d5c2a 100644 --- a/api_docs/kbn_docs_utils.mdx +++ b/api_docs/kbn_docs_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-docs-utils title: "@kbn/docs-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/docs-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/docs-utils'] --- import kbnDocsUtilsObj from './kbn_docs_utils.devdocs.json'; diff --git a/api_docs/kbn_dom_drag_drop.mdx b/api_docs/kbn_dom_drag_drop.mdx index e62932c513072..992cd44203b59 100644 --- a/api_docs/kbn_dom_drag_drop.mdx +++ b/api_docs/kbn_dom_drag_drop.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dom-drag-drop title: "@kbn/dom-drag-drop" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dom-drag-drop plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dom-drag-drop'] --- import kbnDomDragDropObj from './kbn_dom_drag_drop.devdocs.json'; diff --git a/api_docs/kbn_ebt.devdocs.json b/api_docs/kbn_ebt.devdocs.json index 1c5899d553ac4..018b79baf453f 100644 --- a/api_docs/kbn_ebt.devdocs.json +++ b/api_docs/kbn_ebt.devdocs.json @@ -2418,6 +2418,10 @@ "plugin": "actions", "path": "x-pack/plugins/actions/server/lib/action_executor.test.ts" }, + { + "plugin": "actions", + "path": "x-pack/plugins/actions/server/lib/action_executor.test.ts" + }, { "plugin": "@kbn/core-analytics-browser-internal", "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.test.mocks.ts" diff --git a/api_docs/kbn_ebt.mdx b/api_docs/kbn_ebt.mdx index 36baf746095d1..e3cc19e3f4e11 100644 --- a/api_docs/kbn_ebt.mdx +++ b/api_docs/kbn_ebt.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ebt title: "@kbn/ebt" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ebt plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ebt'] --- import kbnEbtObj from './kbn_ebt.devdocs.json'; diff --git a/api_docs/kbn_ebt_tools.mdx b/api_docs/kbn_ebt_tools.mdx index 3e18cfac2dc22..3e947e8b7de85 100644 --- a/api_docs/kbn_ebt_tools.mdx +++ b/api_docs/kbn_ebt_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ebt-tools title: "@kbn/ebt-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ebt-tools plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ebt-tools'] --- import kbnEbtToolsObj from './kbn_ebt_tools.devdocs.json'; diff --git a/api_docs/kbn_ecs_data_quality_dashboard.mdx b/api_docs/kbn_ecs_data_quality_dashboard.mdx index adb48638d82d9..422beff42fcd3 100644 --- a/api_docs/kbn_ecs_data_quality_dashboard.mdx +++ b/api_docs/kbn_ecs_data_quality_dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ecs-data-quality-dashboard title: "@kbn/ecs-data-quality-dashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ecs-data-quality-dashboard plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ecs-data-quality-dashboard'] --- import kbnEcsDataQualityDashboardObj from './kbn_ecs_data_quality_dashboard.devdocs.json'; diff --git a/api_docs/kbn_elastic_agent_utils.mdx b/api_docs/kbn_elastic_agent_utils.mdx index 0d14951c4cc0e..2f88ec0fca74b 100644 --- a/api_docs/kbn_elastic_agent_utils.mdx +++ b/api_docs/kbn_elastic_agent_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-elastic-agent-utils title: "@kbn/elastic-agent-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/elastic-agent-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-agent-utils'] --- import kbnElasticAgentUtilsObj from './kbn_elastic_agent_utils.devdocs.json'; diff --git a/api_docs/kbn_elastic_assistant.mdx b/api_docs/kbn_elastic_assistant.mdx index 31c67756716f5..036f02873ccbf 100644 --- a/api_docs/kbn_elastic_assistant.mdx +++ b/api_docs/kbn_elastic_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-elastic-assistant title: "@kbn/elastic-assistant" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/elastic-assistant plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-assistant'] --- import kbnElasticAssistantObj from './kbn_elastic_assistant.devdocs.json'; diff --git a/api_docs/kbn_elastic_assistant_common.mdx b/api_docs/kbn_elastic_assistant_common.mdx index 3d5fa3e461285..283289cb1b986 100644 --- a/api_docs/kbn_elastic_assistant_common.mdx +++ b/api_docs/kbn_elastic_assistant_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-elastic-assistant-common title: "@kbn/elastic-assistant-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/elastic-assistant-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-assistant-common'] --- import kbnElasticAssistantCommonObj from './kbn_elastic_assistant_common.devdocs.json'; diff --git a/api_docs/kbn_entities_schema.devdocs.json b/api_docs/kbn_entities_schema.devdocs.json index 8df1c3650456f..bcb6b2ff87c2b 100644 --- a/api_docs/kbn_entities_schema.devdocs.json +++ b/api_docs/kbn_entities_schema.devdocs.json @@ -43,7 +43,7 @@ "label": "EntityDefinition", "description": [], "signature": [ - "{ id: string; type: string; name: string; history: { interval: moment.Duration; timestampField: string; lookbackPeriod?: moment.Duration | undefined; settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; }; managed: boolean; indexPatterns: string[]; identityFields: ({ field: string; optional: boolean; } | { field: string; optional: boolean; })[]; displayNameTemplate: string; description?: string | undefined; filter?: string | undefined; metadata?: ({ source: string; destination?: string | undefined; limit?: number | undefined; } | { source: string; destination: string; limit: number; })[] | undefined; metrics?: { name: string; metrics: ({ name: string; field: string; aggregation: ", + "{ id: string; type: string; version: string; name: string; history: { interval: moment.Duration; timestampField: string; lookbackPeriod?: moment.Duration | undefined; settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; }; managed: boolean; indexPatterns: string[]; identityFields: ({ field: string; optional: boolean; } | { field: string; optional: boolean; })[]; displayNameTemplate: string; description?: string | undefined; filter?: string | undefined; metadata?: ({ source: string; destination?: string | undefined; limit?: number | undefined; } | { source: string; destination: string; limit: number; })[] | undefined; metrics?: { name: string; metrics: ({ name: string; field: string; aggregation: ", { "pluginId": "@kbn/entities-schema", "scope": "common", @@ -221,7 +221,7 @@ "label": "entityDefinitionSchema", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; name: Zod.ZodString; description: Zod.ZodOptional; type: Zod.ZodString; filter: Zod.ZodOptional; indexPatterns: Zod.ZodArray; identityFields: Zod.ZodArray, Zod.ZodEffects]>, \"many\">; displayNameTemplate: Zod.ZodString; metadata: Zod.ZodOptional; limit: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { source: string; destination?: string | undefined; limit?: number | undefined; }, { source: string; destination?: string | undefined; limit?: number | undefined; }>, Zod.ZodEffects]>, \"many\">>; metrics: Zod.ZodOptional; name: Zod.ZodString; description: Zod.ZodOptional; type: Zod.ZodString; filter: Zod.ZodOptional; indexPatterns: Zod.ZodArray; identityFields: Zod.ZodArray, Zod.ZodEffects]>, \"many\">; displayNameTemplate: Zod.ZodString; metadata: Zod.ZodOptional; limit: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { source: string; destination?: string | undefined; limit?: number | undefined; }, { source: string; destination?: string | undefined; limit?: number | undefined; }>, Zod.ZodEffects]>, \"many\">>; metrics: Zod.ZodOptional, \"many\">>; staticFields: Zod.ZodOptional>; managed: Zod.ZodDefault>; history: Zod.ZodObject<{ timestampField: Zod.ZodString; interval: Zod.ZodEffects, moment.Duration, string>; lookbackPeriod: Zod.ZodOptional>; settings: Zod.ZodOptional; syncDelay: Zod.ZodOptional; frequency: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; }, { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { interval: moment.Duration; timestampField: string; lookbackPeriod?: moment.Duration | undefined; settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; }, { interval: string; timestampField: string; lookbackPeriod?: string | undefined; settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; }>; latest: Zod.ZodOptional; syncDelay: Zod.ZodOptional; frequency: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; }, { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; }, { settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { id: string; type: string; name: string; history: { interval: moment.Duration; timestampField: string; lookbackPeriod?: moment.Duration | undefined; settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; }; managed: boolean; indexPatterns: string[]; identityFields: ({ field: string; optional: boolean; } | { field: string; optional: boolean; })[]; displayNameTemplate: string; description?: string | undefined; filter?: string | undefined; metadata?: ({ source: string; destination?: string | undefined; limit?: number | undefined; } | { source: string; destination: string; limit: number; })[] | undefined; metrics?: { name: string; metrics: ({ name: string; field: string; aggregation: ", + "; filter?: string | undefined; } | { name: string; aggregation: \"doc_count\"; filter?: string | undefined; } | { name: string; field: string; percentile: number; aggregation: \"percentile\"; filter?: string | undefined; })[]; equation: string; }>, \"many\">>; staticFields: Zod.ZodOptional>; managed: Zod.ZodDefault>; history: Zod.ZodObject<{ timestampField: Zod.ZodString; interval: Zod.ZodEffects, moment.Duration, string>; lookbackPeriod: Zod.ZodOptional>; settings: Zod.ZodOptional; syncDelay: Zod.ZodOptional; frequency: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; }, { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { interval: moment.Duration; timestampField: string; lookbackPeriod?: moment.Duration | undefined; settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; }, { interval: string; timestampField: string; lookbackPeriod?: string | undefined; settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; }>; latest: Zod.ZodOptional; syncDelay: Zod.ZodOptional; frequency: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; }, { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; }, { settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { id: string; type: string; version: string; name: string; history: { interval: moment.Duration; timestampField: string; lookbackPeriod?: moment.Duration | undefined; settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; }; managed: boolean; indexPatterns: string[]; identityFields: ({ field: string; optional: boolean; } | { field: string; optional: boolean; })[]; displayNameTemplate: string; description?: string | undefined; filter?: string | undefined; metadata?: ({ source: string; destination?: string | undefined; limit?: number | undefined; } | { source: string; destination: string; limit: number; })[] | undefined; metrics?: { name: string; metrics: ({ name: string; field: string; aggregation: ", { "pluginId": "@kbn/entities-schema", "scope": "common", @@ -269,7 +269,7 @@ "section": "def-common.BasicAggregations", "text": "BasicAggregations" }, - "; filter?: string | undefined; } | { name: string; aggregation: \"doc_count\"; filter?: string | undefined; } | { name: string; field: string; percentile: number; aggregation: \"percentile\"; filter?: string | undefined; })[]; equation: string; }[] | undefined; staticFields?: Record | undefined; latest?: { settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; } | undefined; }, { id: string; type: string; name: string; history: { interval: string; timestampField: string; lookbackPeriod?: string | undefined; settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; }; indexPatterns: string[]; identityFields: (string | { field: string; optional: boolean; })[]; displayNameTemplate: string; description?: string | undefined; filter?: string | undefined; metadata?: (string | { source: string; destination?: string | undefined; limit?: number | undefined; })[] | undefined; metrics?: { name: string; metrics: ({ name: string; field: string; aggregation: ", + "; filter?: string | undefined; } | { name: string; aggregation: \"doc_count\"; filter?: string | undefined; } | { name: string; field: string; percentile: number; aggregation: \"percentile\"; filter?: string | undefined; })[]; equation: string; }[] | undefined; staticFields?: Record | undefined; latest?: { settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; } | undefined; }, { id: string; type: string; version: string; name: string; history: { interval: string; timestampField: string; lookbackPeriod?: string | undefined; settings?: { syncField?: string | undefined; syncDelay?: string | undefined; frequency?: string | undefined; } | undefined; }; indexPatterns: string[]; identityFields: (string | { field: string; optional: boolean; })[]; displayNameTemplate: string; description?: string | undefined; filter?: string | undefined; metadata?: (string | { source: string; destination?: string | undefined; limit?: number | undefined; })[] | undefined; metrics?: { name: string; metrics: ({ name: string; field: string; aggregation: ", { "pluginId": "@kbn/entities-schema", "scope": "common", @@ -292,7 +292,7 @@ "label": "entityHistorySchema", "description": [], "signature": [ - "Zod.ZodIntersection; displayName: Zod.ZodString; spaceId: Zod.ZodString; metrics: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { id: string; spaceId: string; metrics: Record; displayName: string; identityFields: string[]; }, { id: string; spaceId: string; metrics: Record; displayName: string; identityFields: string[]; }>; \"@timestamp\": Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { \"@timestamp\": string; entity: { id: string; spaceId: string; metrics: Record; displayName: string; identityFields: string[]; }; }, { \"@timestamp\": string; entity: { id: string; spaceId: string; metrics: Record; displayName: string; identityFields: string[]; }; }>, Zod.ZodRecord>>" + "Zod.ZodIntersection; displayName: Zod.ZodString; metrics: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { id: string; metrics: Record; displayName: string; identityFields: string[]; }, { id: string; metrics: Record; displayName: string; identityFields: string[]; }>; \"@timestamp\": Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { \"@timestamp\": string; entity: { id: string; metrics: Record; displayName: string; identityFields: string[]; }; }, { \"@timestamp\": string; entity: { id: string; metrics: Record; displayName: string; identityFields: string[]; }; }>, Zod.ZodRecord>>" ], "path": "x-pack/packages/kbn-entities-schema/src/schema/entity.ts", "deprecated": false, @@ -307,7 +307,7 @@ "label": "entitySummarySchema", "description": [], "signature": [ - "Zod.ZodIntersection; displayName: Zod.ZodString; spaceId: Zod.ZodString; metrics: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { id: string; spaceId: string; metrics: Record; displayName: string; identityFields: string[]; }, { id: string; spaceId: string; metrics: Record; displayName: string; identityFields: string[]; }>; lastSeenTimestamp: Zod.ZodString; firstSeenTimestamp: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { entity: { id: string; spaceId: string; metrics: Record; displayName: string; identityFields: string[]; }; lastSeenTimestamp: string; firstSeenTimestamp: string; }, { entity: { id: string; spaceId: string; metrics: Record; displayName: string; identityFields: string[]; }; lastSeenTimestamp: string; firstSeenTimestamp: string; }>, Zod.ZodRecord>>" + "Zod.ZodIntersection; displayName: Zod.ZodString; metrics: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { id: string; metrics: Record; displayName: string; identityFields: string[]; }, { id: string; metrics: Record; displayName: string; identityFields: string[]; }>; lastSeenTimestamp: Zod.ZodString; firstSeenTimestamp: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { entity: { id: string; metrics: Record; displayName: string; identityFields: string[]; }; lastSeenTimestamp: string; firstSeenTimestamp: string; }, { entity: { id: string; metrics: Record; displayName: string; identityFields: string[]; }; lastSeenTimestamp: string; firstSeenTimestamp: string; }>, Zod.ZodRecord>>" ], "path": "x-pack/packages/kbn-entities-schema/src/schema/entity.ts", "deprecated": false, @@ -467,6 +467,21 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/entities-schema", + "id": "def-common.semVerSchema", + "type": "Object", + "tags": [], + "label": "semVerSchema", + "description": [], + "signature": [ + "Zod.ZodEffects" + ], + "path": "x-pack/packages/kbn-entities-schema/src/schema/common.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ] } diff --git a/api_docs/kbn_entities_schema.mdx b/api_docs/kbn_entities_schema.mdx index 20e0f042937f7..36eb8b77f0736 100644 --- a/api_docs/kbn_entities_schema.mdx +++ b/api_docs/kbn_entities_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-entities-schema title: "@kbn/entities-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/entities-schema plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/entities-schema'] --- import kbnEntitiesSchemaObj from './kbn_entities_schema.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 18 | 0 | 18 | 0 | +| 19 | 0 | 19 | 0 | ## Common diff --git a/api_docs/kbn_es.mdx b/api_docs/kbn_es.mdx index 1486693030f77..ac0a3e9ec363e 100644 --- a/api_docs/kbn_es.mdx +++ b/api_docs/kbn_es.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es title: "@kbn/es" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es'] --- import kbnEsObj from './kbn_es.devdocs.json'; diff --git a/api_docs/kbn_es_archiver.mdx b/api_docs/kbn_es_archiver.mdx index 6c66e97b0b2f2..d5998673d4ca5 100644 --- a/api_docs/kbn_es_archiver.mdx +++ b/api_docs/kbn_es_archiver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-archiver title: "@kbn/es-archiver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-archiver plugin -date: 2024-07-04 +date: 2024-07-11 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 1dcbb7c11436e..e6942f63addd1 100644 --- a/api_docs/kbn_es_errors.mdx +++ b/api_docs/kbn_es_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-errors title: "@kbn/es-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-errors plugin -date: 2024-07-04 +date: 2024-07-11 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 986b33fa6491e..126af776fe859 100644 --- a/api_docs/kbn_es_query.mdx +++ b/api_docs/kbn_es_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-query title: "@kbn/es-query" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-query plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-query'] --- import kbnEsQueryObj from './kbn_es_query.devdocs.json'; diff --git a/api_docs/kbn_es_types.mdx b/api_docs/kbn_es_types.mdx index 14471f6c9514b..e7a83316f6d4a 100644 --- a/api_docs/kbn_es_types.mdx +++ b/api_docs/kbn_es_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-types title: "@kbn/es-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-types plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-types'] --- import kbnEsTypesObj from './kbn_es_types.devdocs.json'; diff --git a/api_docs/kbn_eslint_plugin_imports.mdx b/api_docs/kbn_eslint_plugin_imports.mdx index c0edb00b1f375..adfe573c8adcc 100644 --- a/api_docs/kbn_eslint_plugin_imports.mdx +++ b/api_docs/kbn_eslint_plugin_imports.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-eslint-plugin-imports title: "@kbn/eslint-plugin-imports" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/eslint-plugin-imports plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/eslint-plugin-imports'] --- import kbnEslintPluginImportsObj from './kbn_eslint_plugin_imports.devdocs.json'; diff --git a/api_docs/kbn_esql_ast.devdocs.json b/api_docs/kbn_esql_ast.devdocs.json index ba60e35d615c3..9811a14a8fa62 100644 --- a/api_docs/kbn_esql_ast.devdocs.json +++ b/api_docs/kbn_esql_ast.devdocs.json @@ -341,7 +341,13 @@ "text": "ESQLAstNode" }, "[]) => ", - "ESQLParamLiteral", + { + "pluginId": "@kbn/esql-ast", + "scope": "common", + "docId": "kibKbnEsqlAstPluginApi", + "section": "def-common.ESQLParamLiteral", + "text": "ESQLParamLiteral" + }, "[]" ], "path": "packages/kbn-esql-ast/src/walker/walker.ts", @@ -1508,6 +1514,88 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/esql-ast", + "id": "def-common.ESQLParamLiteral", + "type": "Interface", + "tags": [], + "label": "ESQLParamLiteral", + "description": [], + "signature": [ + { + "pluginId": "@kbn/esql-ast", + "scope": "common", + "docId": "kibKbnEsqlAstPluginApi", + "section": "def-common.ESQLParamLiteral", + "text": "ESQLParamLiteral" + }, + " extends ", + "ESQLAstBaseItem", + "" + ], + "path": "packages/kbn-esql-ast/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/esql-ast", + "id": "def-common.ESQLParamLiteral.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"literal\"" + ], + "path": "packages/kbn-esql-ast/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/esql-ast", + "id": "def-common.ESQLParamLiteral.literalType", + "type": "string", + "tags": [], + "label": "literalType", + "description": [], + "signature": [ + "\"param\"" + ], + "path": "packages/kbn-esql-ast/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/esql-ast", + "id": "def-common.ESQLParamLiteral.paramType", + "type": "Uncategorized", + "tags": [], + "label": "paramType", + "description": [], + "signature": [ + "ParamType" + ], + "path": "packages/kbn-esql-ast/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/esql-ast", + "id": "def-common.ESQLParamLiteral.value", + "type": "CompoundType", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "string | number" + ], + "path": "packages/kbn-esql-ast/src/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/esql-ast", "id": "def-common.ESQLSource", @@ -2015,7 +2103,13 @@ " | ", "ESQLStringLiteral", " | ", - "ESQLParamLiteral", + { + "pluginId": "@kbn/esql-ast", + "scope": "common", + "docId": "kibKbnEsqlAstPluginApi", + "section": "def-common.ESQLParamLiteral", + "text": "ESQLParamLiteral" + }, "" ], "path": "packages/kbn-esql-ast/src/types.ts", diff --git a/api_docs/kbn_esql_ast.mdx b/api_docs/kbn_esql_ast.mdx index f5add9c43c982..6bf2b5c4ea9d9 100644 --- a/api_docs/kbn_esql_ast.mdx +++ b/api_docs/kbn_esql_ast.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-esql-ast title: "@kbn/esql-ast" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/esql-ast plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-ast'] --- import kbnEsqlAstObj from './kbn_esql_ast.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 99 | 1 | 96 | 11 | +| 104 | 1 | 101 | 10 | ## Common diff --git a/api_docs/kbn_esql_utils.mdx b/api_docs/kbn_esql_utils.mdx index 9bd6881bc449d..13ea5e35682d5 100644 --- a/api_docs/kbn_esql_utils.mdx +++ b/api_docs/kbn_esql_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-esql-utils title: "@kbn/esql-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/esql-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-utils'] --- import kbnEsqlUtilsObj from './kbn_esql_utils.devdocs.json'; diff --git a/api_docs/kbn_esql_validation_autocomplete.devdocs.json b/api_docs/kbn_esql_validation_autocomplete.devdocs.json index 79100a05ac285..56830eaa4f756 100644 --- a/api_docs/kbn_esql_validation_autocomplete.devdocs.json +++ b/api_docs/kbn_esql_validation_autocomplete.devdocs.json @@ -628,7 +628,13 @@ " | ", "ESQLStringLiteral", " | ", - "ESQLParamLiteral", + { + "pluginId": "@kbn/esql-ast", + "scope": "common", + "docId": "kibKbnEsqlAstPluginApi", + "section": "def-common.ESQLParamLiteral", + "text": "ESQLParamLiteral" + }, " | ", { "pluginId": "@kbn/esql-ast", @@ -740,7 +746,13 @@ " | ", "ESQLStringLiteral", " | ", - "ESQLParamLiteral", + { + "pluginId": "@kbn/esql-ast", + "scope": "common", + "docId": "kibKbnEsqlAstPluginApi", + "section": "def-common.ESQLParamLiteral", + "text": "ESQLParamLiteral" + }, " | ", { "pluginId": "@kbn/esql-ast", @@ -836,7 +848,13 @@ " | ", "ESQLStringLiteral", " | ", - "ESQLParamLiteral", + { + "pluginId": "@kbn/esql-ast", + "scope": "common", + "docId": "kibKbnEsqlAstPluginApi", + "section": "def-common.ESQLParamLiteral", + "text": "ESQLParamLiteral" + }, " | ", { "pluginId": "@kbn/esql-ast", @@ -940,7 +958,13 @@ " | ", "ESQLStringLiteral", " | ", - "ESQLParamLiteral", + { + "pluginId": "@kbn/esql-ast", + "scope": "common", + "docId": "kibKbnEsqlAstPluginApi", + "section": "def-common.ESQLParamLiteral", + "text": "ESQLParamLiteral" + }, " | ", { "pluginId": "@kbn/esql-ast", diff --git a/api_docs/kbn_esql_validation_autocomplete.mdx b/api_docs/kbn_esql_validation_autocomplete.mdx index 691acdff1c9b1..d255b890eab4f 100644 --- a/api_docs/kbn_esql_validation_autocomplete.mdx +++ b/api_docs/kbn_esql_validation_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-esql-validation-autocomplete title: "@kbn/esql-validation-autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/esql-validation-autocomplete plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-validation-autocomplete'] --- import kbnEsqlValidationAutocompleteObj from './kbn_esql_validation_autocomplete.devdocs.json'; diff --git a/api_docs/kbn_event_annotation_common.mdx b/api_docs/kbn_event_annotation_common.mdx index 8424f280baab8..27926b3fe96e7 100644 --- a/api_docs/kbn_event_annotation_common.mdx +++ b/api_docs/kbn_event_annotation_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-event-annotation-common title: "@kbn/event-annotation-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/event-annotation-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/event-annotation-common'] --- import kbnEventAnnotationCommonObj from './kbn_event_annotation_common.devdocs.json'; diff --git a/api_docs/kbn_event_annotation_components.mdx b/api_docs/kbn_event_annotation_components.mdx index 656c01770fd86..55b7e6c390d51 100644 --- a/api_docs/kbn_event_annotation_components.mdx +++ b/api_docs/kbn_event_annotation_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-event-annotation-components title: "@kbn/event-annotation-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/event-annotation-components plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/event-annotation-components'] --- import kbnEventAnnotationComponentsObj from './kbn_event_annotation_components.devdocs.json'; diff --git a/api_docs/kbn_expandable_flyout.mdx b/api_docs/kbn_expandable_flyout.mdx index baf9db952ef9c..5e2858640bb2b 100644 --- a/api_docs/kbn_expandable_flyout.mdx +++ b/api_docs/kbn_expandable_flyout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-expandable-flyout title: "@kbn/expandable-flyout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/expandable-flyout plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/expandable-flyout'] --- import kbnExpandableFlyoutObj from './kbn_expandable_flyout.devdocs.json'; diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index e31ceb0e0f10a..e0ddef62ed19a 100644 --- a/api_docs/kbn_field_types.mdx +++ b/api_docs/kbn_field_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-field-types title: "@kbn/field-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/field-types plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-types'] --- import kbnFieldTypesObj from './kbn_field_types.devdocs.json'; diff --git a/api_docs/kbn_field_utils.mdx b/api_docs/kbn_field_utils.mdx index 4c75aa026214e..4d1d0c518eb9e 100644 --- a/api_docs/kbn_field_utils.mdx +++ b/api_docs/kbn_field_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-field-utils title: "@kbn/field-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/field-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-utils'] --- import kbnFieldUtilsObj from './kbn_field_utils.devdocs.json'; diff --git a/api_docs/kbn_find_used_node_modules.mdx b/api_docs/kbn_find_used_node_modules.mdx index ef1d6d89ee8a2..cffc605081fb0 100644 --- a/api_docs/kbn_find_used_node_modules.mdx +++ b/api_docs/kbn_find_used_node_modules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-find-used-node-modules title: "@kbn/find-used-node-modules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/find-used-node-modules plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/find-used-node-modules'] --- import kbnFindUsedNodeModulesObj from './kbn_find_used_node_modules.devdocs.json'; diff --git a/api_docs/kbn_formatters.mdx b/api_docs/kbn_formatters.mdx index a44c4afb10795..75cc32464a9f7 100644 --- a/api_docs/kbn_formatters.mdx +++ b/api_docs/kbn_formatters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-formatters title: "@kbn/formatters" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/formatters plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/formatters'] --- import kbnFormattersObj from './kbn_formatters.devdocs.json'; diff --git a/api_docs/kbn_ftr_common_functional_services.mdx b/api_docs/kbn_ftr_common_functional_services.mdx index c17ce93d4e155..31550c0a7938a 100644 --- a/api_docs/kbn_ftr_common_functional_services.mdx +++ b/api_docs/kbn_ftr_common_functional_services.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ftr-common-functional-services title: "@kbn/ftr-common-functional-services" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ftr-common-functional-services plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-services'] --- import kbnFtrCommonFunctionalServicesObj from './kbn_ftr_common_functional_services.devdocs.json'; diff --git a/api_docs/kbn_ftr_common_functional_ui_services.mdx b/api_docs/kbn_ftr_common_functional_ui_services.mdx index 43d1c80c3497b..47ea9dbbba60d 100644 --- a/api_docs/kbn_ftr_common_functional_ui_services.mdx +++ b/api_docs/kbn_ftr_common_functional_ui_services.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ftr-common-functional-ui-services title: "@kbn/ftr-common-functional-ui-services" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ftr-common-functional-ui-services plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-ui-services'] --- import kbnFtrCommonFunctionalUiServicesObj from './kbn_ftr_common_functional_ui_services.devdocs.json'; diff --git a/api_docs/kbn_generate.mdx b/api_docs/kbn_generate.mdx index 83cea2ae8cbe9..f8e68b2de7323 100644 --- a/api_docs/kbn_generate.mdx +++ b/api_docs/kbn_generate.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate title: "@kbn/generate" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate'] --- import kbnGenerateObj from './kbn_generate.devdocs.json'; diff --git a/api_docs/kbn_generate_console_definitions.mdx b/api_docs/kbn_generate_console_definitions.mdx index be09e0f47604d..3ae9dc5c41a5f 100644 --- a/api_docs/kbn_generate_console_definitions.mdx +++ b/api_docs/kbn_generate_console_definitions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate-console-definitions title: "@kbn/generate-console-definitions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate-console-definitions plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate-console-definitions'] --- import kbnGenerateConsoleDefinitionsObj from './kbn_generate_console_definitions.devdocs.json'; diff --git a/api_docs/kbn_generate_csv.mdx b/api_docs/kbn_generate_csv.mdx index 4a7bcbf08705a..52db674e1c1e2 100644 --- a/api_docs/kbn_generate_csv.mdx +++ b/api_docs/kbn_generate_csv.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate-csv title: "@kbn/generate-csv" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate-csv plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate-csv'] --- import kbnGenerateCsvObj from './kbn_generate_csv.devdocs.json'; diff --git a/api_docs/kbn_grouping.devdocs.json b/api_docs/kbn_grouping.devdocs.json index f699ea6ae6857..be6c1495f9a0b 100644 --- a/api_docs/kbn_grouping.devdocs.json +++ b/api_docs/kbn_grouping.devdocs.json @@ -175,10 +175,10 @@ }, { "parentPluginId": "@kbn/grouping", - "id": "def-common.StatRenderer", + "id": "def-common.GroupStatsItem", "type": "Interface", "tags": [], - "label": "StatRenderer", + "label": "GroupStatsItem", "description": [], "path": "packages/kbn-grouping/src/components/types.ts", "deprecated": false, @@ -186,7 +186,7 @@ "children": [ { "parentPluginId": "@kbn/grouping", - "id": "def-common.StatRenderer.title", + "id": "def-common.GroupStatsItem.title", "type": "string", "tags": [], "label": "title", @@ -197,10 +197,10 @@ }, { "parentPluginId": "@kbn/grouping", - "id": "def-common.StatRenderer.renderer", + "id": "def-common.GroupStatsItem.component", "type": "Object", "tags": [], - "label": "renderer", + "label": "component", "description": [], "signature": [ "JSX.Element | undefined" @@ -211,7 +211,7 @@ }, { "parentPluginId": "@kbn/grouping", - "id": "def-common.StatRenderer.badge", + "id": "def-common.GroupStatsItem.badge", "type": "Object", "tags": [], "label": "badge", @@ -244,7 +244,7 @@ "signature": [ "{ isLoading: boolean; data?: ", "ParsedGroupingAggregation", - " | undefined; activePage: number; groupingLevel?: number | undefined; inspectButton?: JSX.Element | undefined; itemsPerPage: number; onChangeGroupsItemsPerPage?: ((size: number) => void) | undefined; onChangeGroupsPage?: ((index: number) => void) | undefined; renderChildComponent: (groupFilter: ", + " | undefined; activePage: number; selectedGroup: string; takeActionItems?: ((groupFilters: ", { "pluginId": "@kbn/es-query", "scope": "common", @@ -252,7 +252,7 @@ "section": "def-common.Filter", "text": "Filter" }, - "[]) => React.ReactElement>; onGroupClose: () => void; selectedGroup: string; takeActionItems: (groupFilters: ", + "[], groupNumber: number) => JSX.Element[]) | undefined; groupingLevel?: number | undefined; inspectButton?: JSX.Element | undefined; itemsPerPage: number; onChangeGroupsItemsPerPage?: ((size: number) => void) | undefined; onChangeGroupsPage?: ((index: number) => void) | undefined; renderChildComponent: (groupFilter: ", { "pluginId": "@kbn/es-query", "scope": "common", @@ -260,7 +260,7 @@ "section": "def-common.Filter", "text": "Filter" }, - "[], groupNumber: number) => JSX.Element[]; }" + "[]) => React.ReactElement>; onGroupClose: () => void; }" ], "path": "packages/kbn-grouping/src/hooks/use_grouping.tsx", "deprecated": false, diff --git a/api_docs/kbn_grouping.mdx b/api_docs/kbn_grouping.mdx index 93f4cf0e68e92..3bcd5481373e6 100644 --- a/api_docs/kbn_grouping.mdx +++ b/api_docs/kbn_grouping.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-grouping title: "@kbn/grouping" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/grouping plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/grouping'] --- import kbnGroupingObj from './kbn_grouping.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-o | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 17 | 0 | 12 | 8 | +| 17 | 0 | 12 | 10 | ## Common diff --git a/api_docs/kbn_guided_onboarding.mdx b/api_docs/kbn_guided_onboarding.mdx index c2d0c0877fc8d..978f32edffee7 100644 --- a/api_docs/kbn_guided_onboarding.mdx +++ b/api_docs/kbn_guided_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-guided-onboarding title: "@kbn/guided-onboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/guided-onboarding plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/guided-onboarding'] --- import kbnGuidedOnboardingObj from './kbn_guided_onboarding.devdocs.json'; diff --git a/api_docs/kbn_handlebars.mdx b/api_docs/kbn_handlebars.mdx index d687a2034bd27..5f8a30051949f 100644 --- a/api_docs/kbn_handlebars.mdx +++ b/api_docs/kbn_handlebars.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-handlebars title: "@kbn/handlebars" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/handlebars plugin -date: 2024-07-04 +date: 2024-07-11 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 6f8e5d72854be..07b644cf29279 100644 --- a/api_docs/kbn_hapi_mocks.mdx +++ b/api_docs/kbn_hapi_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-hapi-mocks title: "@kbn/hapi-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/hapi-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/hapi-mocks'] --- import kbnHapiMocksObj from './kbn_hapi_mocks.devdocs.json'; diff --git a/api_docs/kbn_health_gateway_server.mdx b/api_docs/kbn_health_gateway_server.mdx index 642fae2eda79d..4ddb5f39a167c 100644 --- a/api_docs/kbn_health_gateway_server.mdx +++ b/api_docs/kbn_health_gateway_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-health-gateway-server title: "@kbn/health-gateway-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/health-gateway-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/health-gateway-server'] --- import kbnHealthGatewayServerObj from './kbn_health_gateway_server.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_card.mdx b/api_docs/kbn_home_sample_data_card.mdx index 7ca305798ab27..59c0fa084bb94 100644 --- a/api_docs/kbn_home_sample_data_card.mdx +++ b/api_docs/kbn_home_sample_data_card.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-card title: "@kbn/home-sample-data-card" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-card plugin -date: 2024-07-04 +date: 2024-07-11 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 4a1b189dc7e06..983940f971052 100644 --- a/api_docs/kbn_home_sample_data_tab.mdx +++ b/api_docs/kbn_home_sample_data_tab.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-tab title: "@kbn/home-sample-data-tab" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-tab plugin -date: 2024-07-04 +date: 2024-07-11 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 a031d7533418b..0b0634528213b 100644 --- a/api_docs/kbn_i18n.mdx +++ b/api_docs/kbn_i18n.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n title: "@kbn/i18n" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n'] --- import kbnI18nObj from './kbn_i18n.devdocs.json'; diff --git a/api_docs/kbn_i18n_react.mdx b/api_docs/kbn_i18n_react.mdx index 657cd13ebde6f..db2d1f018e895 100644 --- a/api_docs/kbn_i18n_react.mdx +++ b/api_docs/kbn_i18n_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n-react title: "@kbn/i18n-react" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n-react plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n-react'] --- import kbnI18nReactObj from './kbn_i18n_react.devdocs.json'; diff --git a/api_docs/kbn_import_resolver.mdx b/api_docs/kbn_import_resolver.mdx index 284c1c2d06b9c..79d23033a0261 100644 --- a/api_docs/kbn_import_resolver.mdx +++ b/api_docs/kbn_import_resolver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-import-resolver title: "@kbn/import-resolver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/import-resolver plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/import-resolver'] --- import kbnImportResolverObj from './kbn_import_resolver.devdocs.json'; diff --git a/api_docs/kbn_index_management.mdx b/api_docs/kbn_index_management.mdx index 525c62831ae8e..5d986a50981ee 100644 --- a/api_docs/kbn_index_management.mdx +++ b/api_docs/kbn_index_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-index-management title: "@kbn/index-management" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/index-management plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/index-management'] --- import kbnIndexManagementObj from './kbn_index_management.devdocs.json'; diff --git a/api_docs/kbn_inference_integration_flyout.mdx b/api_docs/kbn_inference_integration_flyout.mdx index 7ebff19cd7753..b32bb5f046cb7 100644 --- a/api_docs/kbn_inference_integration_flyout.mdx +++ b/api_docs/kbn_inference_integration_flyout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-inference_integration_flyout title: "@kbn/inference_integration_flyout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/inference_integration_flyout plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/inference_integration_flyout'] --- import kbnInferenceIntegrationFlyoutObj from './kbn_inference_integration_flyout.devdocs.json'; diff --git a/api_docs/kbn_infra_forge.mdx b/api_docs/kbn_infra_forge.mdx index 746628f6111f3..94160bdf5b5ec 100644 --- a/api_docs/kbn_infra_forge.mdx +++ b/api_docs/kbn_infra_forge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-infra-forge title: "@kbn/infra-forge" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/infra-forge plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/infra-forge'] --- import kbnInfraForgeObj from './kbn_infra_forge.devdocs.json'; diff --git a/api_docs/kbn_interpreter.mdx b/api_docs/kbn_interpreter.mdx index 03caecb2e0ee2..bcb7b29b795dc 100644 --- a/api_docs/kbn_interpreter.mdx +++ b/api_docs/kbn_interpreter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-interpreter title: "@kbn/interpreter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/interpreter plugin -date: 2024-07-04 +date: 2024-07-11 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 c2b3fa851c4a3..08950ff96575b 100644 --- a/api_docs/kbn_io_ts_utils.mdx +++ b/api_docs/kbn_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-io-ts-utils title: "@kbn/io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/io-ts-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/io-ts-utils'] --- import kbnIoTsUtilsObj from './kbn_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_ipynb.mdx b/api_docs/kbn_ipynb.mdx index 090d71c7d3a63..c2c9775d6e5ec 100644 --- a/api_docs/kbn_ipynb.mdx +++ b/api_docs/kbn_ipynb.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ipynb title: "@kbn/ipynb" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ipynb plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ipynb'] --- import kbnIpynbObj from './kbn_ipynb.devdocs.json'; diff --git a/api_docs/kbn_jest_serializers.mdx b/api_docs/kbn_jest_serializers.mdx index 7ebe91d1affa1..fd83386622f4d 100644 --- a/api_docs/kbn_jest_serializers.mdx +++ b/api_docs/kbn_jest_serializers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-jest-serializers title: "@kbn/jest-serializers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/jest-serializers plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/jest-serializers'] --- import kbnJestSerializersObj from './kbn_jest_serializers.devdocs.json'; diff --git a/api_docs/kbn_journeys.mdx b/api_docs/kbn_journeys.mdx index c72865248ee79..d4e627ee9dd44 100644 --- a/api_docs/kbn_journeys.mdx +++ b/api_docs/kbn_journeys.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-journeys title: "@kbn/journeys" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/journeys plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/journeys'] --- import kbnJourneysObj from './kbn_journeys.devdocs.json'; diff --git a/api_docs/kbn_json_ast.mdx b/api_docs/kbn_json_ast.mdx index 801f62bd15911..af2d71e1aee9a 100644 --- a/api_docs/kbn_json_ast.mdx +++ b/api_docs/kbn_json_ast.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-json-ast title: "@kbn/json-ast" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/json-ast plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/json-ast'] --- import kbnJsonAstObj from './kbn_json_ast.devdocs.json'; diff --git a/api_docs/kbn_json_schemas.mdx b/api_docs/kbn_json_schemas.mdx index 8fa30ba33fe13..7bcfb8ea1bbe4 100644 --- a/api_docs/kbn_json_schemas.mdx +++ b/api_docs/kbn_json_schemas.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-json-schemas title: "@kbn/json-schemas" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/json-schemas plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/json-schemas'] --- import kbnJsonSchemasObj from './kbn_json_schemas.devdocs.json'; diff --git a/api_docs/kbn_kibana_manifest_schema.mdx b/api_docs/kbn_kibana_manifest_schema.mdx index c11aa7b62a531..7909130f970f4 100644 --- a/api_docs/kbn_kibana_manifest_schema.mdx +++ b/api_docs/kbn_kibana_manifest_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-kibana-manifest-schema title: "@kbn/kibana-manifest-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/kibana-manifest-schema plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/kibana-manifest-schema'] --- import kbnKibanaManifestSchemaObj from './kbn_kibana_manifest_schema.devdocs.json'; diff --git a/api_docs/kbn_language_documentation_popover.mdx b/api_docs/kbn_language_documentation_popover.mdx index b53279e8b82df..0b955032e9fbf 100644 --- a/api_docs/kbn_language_documentation_popover.mdx +++ b/api_docs/kbn_language_documentation_popover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-language-documentation-popover title: "@kbn/language-documentation-popover" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/language-documentation-popover plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/language-documentation-popover'] --- import kbnLanguageDocumentationPopoverObj from './kbn_language_documentation_popover.devdocs.json'; diff --git a/api_docs/kbn_lens_embeddable_utils.mdx b/api_docs/kbn_lens_embeddable_utils.mdx index e98e15c4292e2..1eb0fcf84a30b 100644 --- a/api_docs/kbn_lens_embeddable_utils.mdx +++ b/api_docs/kbn_lens_embeddable_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-lens-embeddable-utils title: "@kbn/lens-embeddable-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/lens-embeddable-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/lens-embeddable-utils'] --- import kbnLensEmbeddableUtilsObj from './kbn_lens_embeddable_utils.devdocs.json'; diff --git a/api_docs/kbn_lens_formula_docs.mdx b/api_docs/kbn_lens_formula_docs.mdx index bd77300b74d03..3e173b1648910 100644 --- a/api_docs/kbn_lens_formula_docs.mdx +++ b/api_docs/kbn_lens_formula_docs.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-lens-formula-docs title: "@kbn/lens-formula-docs" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/lens-formula-docs plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/lens-formula-docs'] --- import kbnLensFormulaDocsObj from './kbn_lens_formula_docs.devdocs.json'; diff --git a/api_docs/kbn_logging.devdocs.json b/api_docs/kbn_logging.devdocs.json index a343c50940b40..c4e148c61e8e5 100644 --- a/api_docs/kbn_logging.devdocs.json +++ b/api_docs/kbn_logging.devdocs.json @@ -59,7 +59,15 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - ">(message: string, meta?: Meta | undefined) => void" + ">(message: ", + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMessageSource", + "text": "LogMessageSource" + }, + ", meta?: Meta | undefined) => void" ], "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, @@ -68,14 +76,20 @@ { "parentPluginId": "@kbn/logging", "id": "def-common.Logger.trace.$1", - "type": "string", + "type": "CompoundType", "tags": [], "label": "message", "description": [ - "- The log message" + "- The log message, or a function returning the log message" ], "signature": [ - "string" + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMessageSource", + "text": "LogMessageSource" + } ], "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, @@ -89,7 +103,7 @@ "tags": [], "label": "meta", "description": [ - "-" + "- The ECS meta to attach to the log entry" ], "signature": [ "Meta | undefined" @@ -109,7 +123,7 @@ "tags": [], "label": "debug", "description": [ - "\nLog messages useful for debugging and interactive investigation" + "\nLog messages useful for debugging and interactive investigation\n" ], "signature": [ "(message: string, meta?: Meta | undefined) => void" + ">(message: ", + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMessageSource", + "text": "LogMessageSource" + }, + ", meta?: Meta | undefined) => void" ], "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, @@ -137,14 +159,20 @@ { "parentPluginId": "@kbn/logging", "id": "def-common.Logger.debug.$1", - "type": "string", + "type": "CompoundType", "tags": [], "label": "message", "description": [ - "- The log message" + "- The log message, or a function returning the log message" ], "signature": [ - "string" + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMessageSource", + "text": "LogMessageSource" + } ], "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, @@ -158,7 +186,7 @@ "tags": [], "label": "meta", "description": [ - "-" + "- The ECS meta to attach to the log entry" ], "signature": [ "Meta | undefined" @@ -178,7 +206,7 @@ "tags": [], "label": "info", "description": [ - "\nLogs messages related to general application flow" + "\nLogs messages related to general application flow\n" ], "signature": [ "(message: string, meta?: Meta | undefined) => void" + ">(message: ", + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMessageSource", + "text": "LogMessageSource" + }, + ", meta?: Meta | undefined) => void" ], "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, @@ -206,14 +242,20 @@ { "parentPluginId": "@kbn/logging", "id": "def-common.Logger.info.$1", - "type": "string", + "type": "CompoundType", "tags": [], "label": "message", "description": [ - "- The log message" + "- The log message, or a function returning the log message" ], "signature": [ - "string" + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMessageSource", + "text": "LogMessageSource" + } ], "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, @@ -227,7 +269,7 @@ "tags": [], "label": "meta", "description": [ - "-" + "- The ECS meta to attach to the log entry" ], "signature": [ "Meta | undefined" @@ -247,7 +289,7 @@ "tags": [], "label": "warn", "description": [ - "\nLogs abnormal or unexpected errors or messages" + "\nLogs abnormal or unexpected errors or messages\n" ], "signature": [ "(errorOrMessage: string | Error, meta?: Meta | undefined) => void" + ">(errorOrMessage: Error | ", + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMessageSource", + "text": "LogMessageSource" + }, + ", meta?: Meta | undefined) => void" ], "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, @@ -279,10 +329,17 @@ "tags": [], "label": "errorOrMessage", "description": [ - "- An Error object or message string to log" + "- An Error object, message string, or function returning the log message" ], "signature": [ - "string | Error" + "Error | ", + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMessageSource", + "text": "LogMessageSource" + } ], "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, @@ -296,7 +353,7 @@ "tags": [], "label": "meta", "description": [ - "-" + "- The ECS meta to attach to the log entry" ], "signature": [ "Meta | undefined" @@ -335,7 +392,15 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - ">(errorOrMessage: string | Error, meta?: Meta | undefined) => void" + ">(errorOrMessage: Error | ", + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMessageSource", + "text": "LogMessageSource" + }, + ", meta?: Meta | undefined) => void" ], "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, @@ -348,10 +413,17 @@ "tags": [], "label": "errorOrMessage", "description": [ - "- An Error object or message string to log" + "- An Error object, message string, or function returning the log message" ], "signature": [ - "string | Error" + "Error | ", + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMessageSource", + "text": "LogMessageSource" + } ], "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, @@ -365,7 +437,7 @@ "tags": [], "label": "meta", "description": [ - "-" + "- The ECS meta to attach to the log entry" ], "signature": [ "Meta | undefined" @@ -404,7 +476,15 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - ">(errorOrMessage: string | Error, meta?: Meta | undefined) => void" + ">(errorOrMessage: Error | ", + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMessageSource", + "text": "LogMessageSource" + }, + ", meta?: Meta | undefined) => void" ], "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, @@ -417,10 +497,17 @@ "tags": [], "label": "errorOrMessage", "description": [ - "- An Error object or message string to log" + "- An Error object, message string, or function returning the log message" ], "signature": [ - "string | Error" + "Error | ", + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMessageSource", + "text": "LogMessageSource" + } ], "path": "packages/kbn-logging/src/logger.ts", "deprecated": false, @@ -434,7 +521,7 @@ "tags": [], "label": "meta", "description": [ - "-" + "- The ECS meta to attach to the log entry" ], "signature": [ "Meta | undefined" @@ -591,6 +678,21 @@ ], "enums": [], "misc": [ + { + "parentPluginId": "@kbn/logging", + "id": "def-common.LogMessageSource", + "type": "Type", + "tags": [], + "label": "LogMessageSource", + "description": [], + "signature": [ + "string | (() => string)" + ], + "path": "packages/kbn-logging/src/logger.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/logging", "id": "def-common.LogMeta", diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index 0d333bb0bc5b0..9b37a6f3f3321 100644 --- a/api_docs/kbn_logging.mdx +++ b/api_docs/kbn_logging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging title: "@kbn/logging" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging'] --- import kbnLoggingObj from './kbn_logging.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 27 | 0 | 1 | 2 | +| 28 | 0 | 2 | 2 | ## Common diff --git a/api_docs/kbn_logging_mocks.devdocs.json b/api_docs/kbn_logging_mocks.devdocs.json index 39e3725849b91..d6ea4b3f63b00 100644 --- a/api_docs/kbn_logging_mocks.devdocs.json +++ b/api_docs/kbn_logging_mocks.devdocs.json @@ -30,7 +30,15 @@ "label": "MockedLogger", "description": [], "signature": [ - "{ trace: jest.MockInstance; debug: jest.MockInstance; debug: jest.MockInstance; info: jest.MockInstance; info: jest.MockInstance; warn: jest.MockInstance; warn: jest.MockInstance; error: jest.MockInstance; error: jest.MockInstance; fatal: jest.MockInstance; fatal: jest.MockInstance; debug: jest.MockInstance; debug: jest.MockInstance; info: jest.MockInstance; info: jest.MockInstance; warn: jest.MockInstance; warn: jest.MockInstance; error: jest.MockInstance; error: jest.MockInstance; fatal: jest.MockInstance; fatal: jest.MockInstance { debug: [message: string, meta?: ", + ") => { debug: ([string] | [string, ", { "pluginId": "@kbn/logging", "scope": "common", @@ -287,7 +383,7 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - " | undefined][]; error: [errorOrMessage: string | Error, meta?: ", + " | undefined])[]; error: ([string | Error] | [string | Error, ", { "pluginId": "@kbn/logging", "scope": "common", @@ -295,7 +391,7 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - " | undefined][]; fatal: [errorOrMessage: string | Error, meta?: ", + " | undefined])[]; fatal: ([string | Error] | [string | Error, ", { "pluginId": "@kbn/logging", "scope": "common", @@ -303,7 +399,7 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - " | undefined][]; info: [message: string, meta?: ", + " | undefined])[]; info: ([string] | [string, ", { "pluginId": "@kbn/logging", "scope": "common", @@ -311,9 +407,9 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - " | undefined][]; log: [record: ", + " | undefined])[]; log: [record: ", "LogRecord", - "][]; trace: [message: string, meta?: ", + "][]; trace: ([string] | [string, ", { "pluginId": "@kbn/logging", "scope": "common", @@ -321,7 +417,7 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - " | undefined][]; warn: [errorOrMessage: string | Error, meta?: ", + " | undefined])[]; warn: ([string | Error] | [string | Error, ", { "pluginId": "@kbn/logging", "scope": "common", @@ -329,7 +425,7 @@ "section": "def-common.LogMeta", "text": "LogMeta" }, - " | undefined][]; }" + " | undefined])[]; }" ], "path": "packages/kbn-logging-mocks/src/logger.mock.ts", "deprecated": false, @@ -344,7 +440,15 @@ "label": "logger", "description": [], "signature": [ - "{ trace: jest.MockInstance; debug: jest.MockInstance; debug: jest.MockInstance; info: jest.MockInstance; info: jest.MockInstance; warn: jest.MockInstance; warn: jest.MockInstance; error: jest.MockInstance; error: jest.MockInstance; fatal: jest.MockInstance; fatal: jest.MockInstance Promise<", + ") => Promise<", { "pluginId": "@kbn/ml-agg-utils", "scope": "common", @@ -126,171 +114,27 @@ "id": "def-common.fetchAggIntervals.$1", "type": "Object", "tags": [], - "label": "client", + "label": "params", "description": [ - "- The Elasticsearch client." - ], - "signature": [ - { - "pluginId": "@kbn/core-elasticsearch-server", - "scope": "common", - "docId": "kibKbnCoreElasticsearchServerPluginApi", - "section": "def-common.ElasticsearchClient", - "text": "ElasticsearchClient" - } - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchAggIntervals.$2", - "type": "string", - "tags": [], - "label": "indexPattern", - "description": [ - "- The index pattern to search." - ], - "signature": [ - "string" - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchAggIntervals.$3", - "type": "Object", - "tags": [], - "label": "query", - "description": [ - "- The query to filter documents." - ], - "signature": [ - "QueryDslQueryContainer" - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchAggIntervals.$4", - "type": "Array", - "tags": [], - "label": "fields", - "description": [ - "- An array of field definitions for which aggregation intervals are requested." + "- The parameters for fetching aggregation intervals." ], "signature": [ { "pluginId": "@kbn/ml-agg-utils", "scope": "common", "docId": "kibKbnMlAggUtilsPluginApi", - "section": "def-common.HistogramField", - "text": "HistogramField" - }, - "[]" - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchAggIntervals.$5", - "type": "number", - "tags": [], - "label": "samplerShardSize", - "description": [ - "- The shard size parameter for sampling aggregations. A value less than 1 indicates no sampling." - ], - "signature": [ - "number" + "section": "def-common.FetchAggIntervalsParams", + "text": "FetchAggIntervalsParams" + } ], "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", "deprecated": false, "trackAdoption": false, "isRequired": true - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchAggIntervals.$6", - "type": "Object", - "tags": [], - "label": "runtimeMappings", - "description": [ - "- Optional runtime mappings to apply." - ], - "signature": [ - "MappingRuntimeFields", - " | undefined" - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchAggIntervals.$7", - "type": "Object", - "tags": [], - "label": "abortSignal", - "description": [ - "- Optional AbortSignal for canceling the request." - ], - "signature": [ - "AbortSignal | undefined" - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchAggIntervals.$8", - "type": "number", - "tags": [], - "label": "randomSamplerProbability", - "description": [ - "- Optional probability value for random sampling." - ], - "signature": [ - "number | undefined" - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchAggIntervals.$9", - "type": "number", - "tags": [], - "label": "randomSamplerSeed", - "description": [ - "- Optional seed value for random sampling." - ], - "signature": [ - "number | undefined" - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false } ], "returnComment": [ - "A promise that resolves to a map of aggregation intervals for the specified fields." + "A promise that resolves to a map of numeric column statistics." ], "initialIsOpen": false }, @@ -301,28 +145,10 @@ "tags": [], "label": "fetchHistogramsForFields", "description": [ - "\nFetches data to be used in mini histogram charts. Supports auto-identifying\nthe histogram interval and min/max values.\n" + "\nAsynchronously fetches histograms for specified fields from an Elasticsearch client.\n" ], "signature": [ - "(client: ", - { - "pluginId": "@kbn/core-elasticsearch-server", - "scope": "common", - "docId": "kibKbnCoreElasticsearchServerPluginApi", - "section": "def-common.ElasticsearchClient", - "text": "ElasticsearchClient" - }, - ", indexPattern: string, query: any, fields: ", - { - "pluginId": "@kbn/ml-agg-utils", - "scope": "common", - "docId": "kibKbnMlAggUtilsPluginApi", - "section": "def-common.FieldsForHistograms", - "text": "FieldsForHistograms" - }, - ", samplerShardSize: number, runtimeMappings?: ", - "MappingRuntimeFields", - " | undefined, abortSignal?: AbortSignal | undefined, randomSamplerProbability?: number | undefined, randomSamplerSeed?: number | undefined) => Promise<(", + "(params: FetchHistogramsForFieldsParams) => Promise<(", { "pluginId": "@kbn/ml-agg-utils", "scope": "common", @@ -341,170 +167,21 @@ "id": "def-common.fetchHistogramsForFields.$1", "type": "Object", "tags": [], - "label": "client", + "label": "params", "description": [ - "Elasticsearch Client" + "The parameters for fetching histograms." ], "signature": [ - { - "pluginId": "@kbn/core-elasticsearch-server", - "scope": "common", - "docId": "kibKbnCoreElasticsearchServerPluginApi", - "section": "def-common.ElasticsearchClient", - "text": "ElasticsearchClient" - } + "FetchHistogramsForFieldsParams" ], "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", "deprecated": false, "trackAdoption": false, "isRequired": true - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchHistogramsForFields.$2", - "type": "string", - "tags": [], - "label": "indexPattern", - "description": [ - "index pattern to be queried" - ], - "signature": [ - "string" - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchHistogramsForFields.$3", - "type": "Any", - "tags": [], - "label": "query", - "description": [ - "Elasticsearch query" - ], - "signature": [ - "any" - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchHistogramsForFields.$4", - "type": "Array", - "tags": [], - "label": "fields", - "description": [ - "the fields the histograms should be generated for" - ], - "signature": [ - { - "pluginId": "@kbn/ml-agg-utils", - "scope": "common", - "docId": "kibKbnMlAggUtilsPluginApi", - "section": "def-common.FieldsForHistograms", - "text": "FieldsForHistograms" - } - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchHistogramsForFields.$5", - "type": "number", - "tags": [], - "label": "samplerShardSize", - "description": [ - "shard_size parameter of the sampler aggregation" - ], - "signature": [ - "number" - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchHistogramsForFields.$6", - "type": "Object", - "tags": [], - "label": "runtimeMappings", - "description": [ - "optional runtime mappings" - ], - "signature": [ - "MappingRuntimeFields", - " | undefined" - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchHistogramsForFields.$7", - "type": "Object", - "tags": [], - "label": "abortSignal", - "description": [ - "optional abort signal" - ], - "signature": [ - "AbortSignal | undefined" - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchHistogramsForFields.$8", - "type": "number", - "tags": [], - "label": "randomSamplerProbability", - "description": [ - "optional random sampler probability" - ], - "signature": [ - "number | undefined" - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - }, - { - "parentPluginId": "@kbn/ml-agg-utils", - "id": "def-common.fetchHistogramsForFields.$9", - "type": "number", - "tags": [], - "label": "randomSamplerSeed", - "description": [ - "optional random sampler seed" - ], - "signature": [ - "number | undefined" - ], - "path": "x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false } ], "returnComment": [ - "an array of histogram data for each supplied field" + "A promise that resolves with the fetched histograms." ], "initialIsOpen": false }, @@ -821,6 +498,1304 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-common.FetchAggIntervalsParams", + "type": "Interface", + "tags": [], + "label": "FetchAggIntervalsParams", + "description": [ + "\nInterface for the parameters required to fetch aggregation intervals." + ], + "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-common.FetchAggIntervalsParams.esClient", + "type": "Object", + "tags": [], + "label": "esClient", + "description": [ + "The Elasticsearch client to use for the query." + ], + "signature": [ + "{ create: { (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "WriteResponseBase", + ">; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "WriteResponseBase", + ", unknown>>; (this: That, params: ", + "CreateRequest", + " | ", + "CreateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "WriteResponseBase", + ">; }; update: { (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateResponse", + ">; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateResponse", + ", unknown>>; (this: That, params: ", + "UpdateRequest", + " | ", + "UpdateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateResponse", + ">; }; get: { (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetResponse", + ">; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetResponse", + ", unknown>>; (this: That, params: ", + "GetRequest", + " | ", + "GetRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetResponse", + ">; }; delete: { (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "WriteResponseBase", + ">; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "WriteResponseBase", + ", unknown>>; (this: That, params: ", + "DeleteRequest", + " | ", + "DeleteRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "WriteResponseBase", + ">; }; helpers: ", + "default", + "; search: { >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchResponse", + ">; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchResponse", + ", unknown>>; >(this: That, params?: ", + "SearchRequest", + " | ", + "SearchRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchResponse", + ">; }; name: string | symbol; [kAsyncSearch]: symbol | null; [kAutoscaling]: symbol | null; [kCat]: symbol | null; [kCcr]: symbol | null; [kCluster]: symbol | null; [kDanglingIndices]: symbol | null; [kEnrich]: symbol | null; [kEql]: symbol | null; [kEsql]: symbol | null; [kFeatures]: symbol | null; [kFleet]: symbol | null; [kGraph]: symbol | null; [kIlm]: symbol | null; [kIndices]: symbol | null; [kInference]: symbol | null; [kIngest]: symbol | null; [kLicense]: symbol | null; [kLogstash]: symbol | null; [kMigration]: symbol | null; [kMl]: symbol | null; [kMonitoring]: symbol | null; [kNodes]: symbol | null; [kQueryRuleset]: symbol | null; [kRollup]: symbol | null; [kSearchApplication]: symbol | null; [kSearchableSnapshots]: symbol | null; [kSecurity]: symbol | null; [kShutdown]: symbol | null; [kSlm]: symbol | null; [kSnapshot]: symbol | null; [kSql]: symbol | null; [kSsl]: symbol | null; [kSynonyms]: symbol | null; [kTasks]: symbol | null; [kTextStructure]: symbol | null; [kTransform]: symbol | null; [kWatcher]: symbol | null; [kXpack]: symbol | null; transport: ", + "default", + "; child: (opts: ", + "ClientOptions", + ") => ", + "default", + "; asyncSearch: ", + "default", + "; autoscaling: ", + "default", + "; bulk: { (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "BulkResponse", + ">; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "BulkResponse", + ", unknown>>; (this: That, params: ", + "BulkRequest", + " | ", + "BulkRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "BulkResponse", + ">; }; cat: ", + "default", + "; ccr: ", + "default", + "; clearScroll: { (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClearScrollResponse", + ">; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClearScrollResponse", + ", unknown>>; (this: That, params?: ", + "ClearScrollRequest", + " | ", + "ClearScrollRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClearScrollResponse", + ">; }; closePointInTime: { (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ClosePointInTimeResponse", + ", unknown>>; (this: That, params: ", + "ClosePointInTimeRequest", + " | ", + "ClosePointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ClosePointInTimeResponse", + ">; }; cluster: ", + "default", + "; count: { (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "CountResponse", + ">; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "CountResponse", + ", unknown>>; (this: That, params?: ", + "CountRequest", + " | ", + "CountRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "CountResponse", + ">; }; danglingIndices: ", + "default", + "; deleteByQuery: { (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "DeleteByQueryResponse", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRequest", + " | ", + "DeleteByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "DeleteByQueryResponse", + ">; }; deleteByQueryRethrottle: { (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TasksTaskListResponseBase", + ">; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TasksTaskListResponseBase", + ", unknown>>; (this: That, params: ", + "DeleteByQueryRethrottleRequest", + " | ", + "DeleteByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TasksTaskListResponseBase", + ">; }; deleteScript: { (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "AcknowledgedResponseBase", + ">; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "AcknowledgedResponseBase", + ", unknown>>; (this: That, params: ", + "DeleteScriptRequest", + " | ", + "DeleteScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "AcknowledgedResponseBase", + ">; }; enrich: ", + "default", + "; eql: ", + "default", + "; esql: ", + "default", + "; exists: { (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsRequest", + " | ", + "ExistsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; existsSource: { (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "ExistsSourceRequest", + " | ", + "ExistsSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; explain: { (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ExplainResponse", + ">; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ExplainResponse", + ", unknown>>; (this: That, params: ", + "ExplainRequest", + " | ", + "ExplainRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ExplainResponse", + ">; }; features: ", + "default", + "; fieldCaps: { (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "FieldCapsResponse", + ">; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "FieldCapsResponse", + ", unknown>>; (this: That, params?: ", + "FieldCapsRequest", + " | ", + "FieldCapsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "FieldCapsResponse", + ">; }; fleet: ", + "default", + "; getScript: { (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptResponse", + ">; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptResponse", + ", unknown>>; (this: That, params: ", + "GetScriptRequest", + " | ", + "GetScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptResponse", + ">; }; getScriptContext: { (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptContextResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptContextRequest", + " | ", + "GetScriptContextRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptContextResponse", + ">; }; getScriptLanguages: { (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "GetScriptLanguagesResponse", + ", unknown>>; (this: That, params?: ", + "GetScriptLanguagesRequest", + " | ", + "GetScriptLanguagesRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "GetScriptLanguagesResponse", + ">; }; getSource: { (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "GetSourceRequest", + " | ", + "GetSourceRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; graph: ", + "default", + "; healthReport: { (this: That, params?: ", + "HealthReportRequest", + " | ", + "HealthReportRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "HealthReportResponse", + ">; (this: That, params?: ", + "HealthReportRequest", + " | ", + "HealthReportRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "HealthReportResponse", + ", unknown>>; (this: That, params?: ", + "HealthReportRequest", + " | ", + "HealthReportRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "HealthReportResponse", + ">; }; ilm: ", + "default", + "; index: { (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "WriteResponseBase", + ">; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "WriteResponseBase", + ", unknown>>; (this: That, params: ", + "IndexRequest", + " | ", + "IndexRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "WriteResponseBase", + ">; }; indices: ", + "default", + "; inference: ", + "default", + "; info: { (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "InfoResponse", + ">; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "InfoResponse", + ", unknown>>; (this: That, params?: ", + "InfoRequest", + " | ", + "InfoRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "InfoResponse", + ">; }; ingest: ", + "default", + "; knnSearch: { (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "KnnSearchResponse", + ">; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "KnnSearchResponse", + ", unknown>>; (this: That, params: ", + "KnnSearchRequest", + " | ", + "KnnSearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "KnnSearchResponse", + ">; }; license: ", + "default", + "; logstash: ", + "default", + "; mget: { (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MgetResponse", + ">; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MgetResponse", + ", unknown>>; (this: That, params?: ", + "MgetRequest", + " | ", + "MgetRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MgetResponse", + ">; }; migration: ", + "default", + "; ml: ", + "default", + "; monitoring: ", + "default", + "; msearch: { >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchResponse", + ">; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchResponse", + ", unknown>>; >(this: That, params: ", + "MsearchRequest", + " | ", + "MsearchRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchResponse", + ">; }; msearchTemplate: { >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MsearchTemplateResponse", + ", unknown>>; >(this: That, params: ", + "MsearchTemplateRequest", + " | ", + "MsearchTemplateRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MsearchTemplateResponse", + ">; }; mtermvectors: { (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "MtermvectorsResponse", + ", unknown>>; (this: That, params?: ", + "MtermvectorsRequest", + " | ", + "MtermvectorsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "MtermvectorsResponse", + ">; }; nodes: ", + "default", + "; openPointInTime: { (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "OpenPointInTimeResponse", + ", unknown>>; (this: That, params: ", + "OpenPointInTimeRequest", + " | ", + "OpenPointInTimeRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "OpenPointInTimeResponse", + ">; }; ping: { (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params?: ", + "PingRequest", + " | ", + "PingRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; putScript: { (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "AcknowledgedResponseBase", + ">; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "AcknowledgedResponseBase", + ", unknown>>; (this: That, params: ", + "PutScriptRequest", + " | ", + "PutScriptRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "AcknowledgedResponseBase", + ">; }; queryRuleset: ", + "default", + "; rankEval: { (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RankEvalResponse", + ">; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RankEvalResponse", + ", unknown>>; (this: That, params: ", + "RankEvalRequest", + " | ", + "RankEvalRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RankEvalResponse", + ">; }; reindex: { (this: That, params: ", + "ReindexRequest", + " | ", + "ReindexRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexResponse", + ">; (this: That, params: ", + "ReindexRequest", + " | ", + "ReindexRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexResponse", + ", unknown>>; (this: That, params: ", + "ReindexRequest", + " | ", + "ReindexRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexResponse", + ">; }; reindexRethrottle: { (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ReindexRethrottleResponse", + ", unknown>>; (this: That, params: ", + "ReindexRethrottleRequest", + " | ", + "ReindexRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ReindexRethrottleResponse", + ">; }; renderSearchTemplate: { (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "RenderSearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "RenderSearchTemplateRequest", + " | ", + "RenderSearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "RenderSearchTemplateResponse", + ">; }; rollup: ", + "default", + "; scriptsPainlessExecute: { (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScriptsPainlessExecuteResponse", + ", unknown>>; (this: That, params?: ", + "ScriptsPainlessExecuteRequest", + " | ", + "ScriptsPainlessExecuteRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScriptsPainlessExecuteResponse", + ">; }; scroll: { >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "ScrollResponse", + ">; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "ScrollResponse", + ", unknown>>; >(this: That, params: ", + "ScrollRequest", + " | ", + "ScrollRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "ScrollResponse", + ">; }; searchApplication: ", + "default", + "; searchMvt: { (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + ">; (this: That, params: ", + "SearchMvtRequest", + " | ", + "SearchMvtRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise; }; searchShards: { (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchShardsResponse", + ">; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchShardsResponse", + ", unknown>>; (this: That, params?: ", + "SearchShardsRequest", + " | ", + "SearchShardsRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchShardsResponse", + ">; }; searchTemplate: { (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "SearchTemplateResponse", + ", unknown>>; (this: That, params?: ", + "SearchTemplateRequest", + " | ", + "SearchTemplateRequest", + " | undefined, options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "SearchTemplateResponse", + ">; }; searchableSnapshots: ", + "default", + "; security: ", + "default", + "; shutdown: ", + "default", + "; slm: ", + "default", + "; snapshot: ", + "default", + "; sql: ", + "default", + "; ssl: ", + "default", + "; synonyms: ", + "default", + "; tasks: ", + "default", + "; termsEnum: { (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermsEnumResponse", + ">; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermsEnumResponse", + ", unknown>>; (this: That, params: ", + "TermsEnumRequest", + " | ", + "TermsEnumRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermsEnumResponse", + ">; }; termvectors: { (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "TermvectorsResponse", + ">; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "TermvectorsResponse", + ", unknown>>; (this: That, params: ", + "TermvectorsRequest", + " | ", + "TermvectorsRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TermvectorsResponse", + ">; }; textStructure: ", + "default", + "; transform: ", + "default", + "; updateByQuery: { (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRequest", + " | ", + "UpdateByQueryRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryResponse", + ">; }; updateByQueryRethrottle: { (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithOutMeta", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptionsWithMeta", + " | undefined): Promise<", + "TransportResult", + "<", + "UpdateByQueryRethrottleResponse", + ", unknown>>; (this: That, params: ", + "UpdateByQueryRethrottleRequest", + " | ", + "UpdateByQueryRethrottleRequest", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "UpdateByQueryRethrottleResponse", + ">; }; watcher: ", + "default", + "; xpack: ", + "default", + "; }" + ], + "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-common.FetchAggIntervalsParams.abortSignal", + "type": "Object", + "tags": [], + "label": "abortSignal", + "description": [ + "An optional abort signal to cancel the request." + ], + "signature": [ + "AbortSignal | undefined" + ], + "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ml-agg-utils", + "id": "def-common.FetchAggIntervalsParams.arguments", + "type": "Object", + "tags": [], + "label": "arguments", + "description": [ + "The arguments for the aggregation query." + ], + "signature": [ + "{ indexPattern: string; query: ", + "QueryDslQueryContainer", + "; fields: ", + { + "pluginId": "@kbn/ml-agg-utils", + "scope": "common", + "docId": "kibKbnMlAggUtilsPluginApi", + "section": "def-common.HistogramField", + "text": "HistogramField" + }, + "[]; samplerShardSize: number; runtimeMappings?: ", + "MappingRuntimeFields", + " | undefined; randomSamplerProbability?: number | undefined; randomSamplerSeed?: number | undefined; }" + ], + "path": "x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/ml-agg-utils", "id": "def-common.FieldValuePair", diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index d2c9848d3c251..8ee3938cb02c0 100644 --- a/api_docs/kbn_ml_agg_utils.mdx +++ b/api_docs/kbn_ml_agg_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-agg-utils title: "@kbn/ml-agg-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-agg-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-agg-utils'] --- import kbnMlAggUtilsObj from './kbn_ml_agg_utils.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) for questi | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 102 | 2 | 0 | 0 | +| 90 | 1 | 0 | 0 | ## Common diff --git a/api_docs/kbn_ml_anomaly_utils.mdx b/api_docs/kbn_ml_anomaly_utils.mdx index de5e88c806647..d07f30cc90659 100644 --- a/api_docs/kbn_ml_anomaly_utils.mdx +++ b/api_docs/kbn_ml_anomaly_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-anomaly-utils title: "@kbn/ml-anomaly-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-anomaly-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-anomaly-utils'] --- import kbnMlAnomalyUtilsObj from './kbn_ml_anomaly_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_cancellable_search.mdx b/api_docs/kbn_ml_cancellable_search.mdx index 04fdfd3fbe85c..2c2828919b7b8 100644 --- a/api_docs/kbn_ml_cancellable_search.mdx +++ b/api_docs/kbn_ml_cancellable_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-cancellable-search title: "@kbn/ml-cancellable-search" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-cancellable-search plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-cancellable-search'] --- import kbnMlCancellableSearchObj from './kbn_ml_cancellable_search.devdocs.json'; diff --git a/api_docs/kbn_ml_category_validator.mdx b/api_docs/kbn_ml_category_validator.mdx index b0d491a2e0c20..8b302035202b3 100644 --- a/api_docs/kbn_ml_category_validator.mdx +++ b/api_docs/kbn_ml_category_validator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-category-validator title: "@kbn/ml-category-validator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-category-validator plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-category-validator'] --- import kbnMlCategoryValidatorObj from './kbn_ml_category_validator.devdocs.json'; diff --git a/api_docs/kbn_ml_chi2test.mdx b/api_docs/kbn_ml_chi2test.mdx index e0244c98f484d..e4d590eed7f62 100644 --- a/api_docs/kbn_ml_chi2test.mdx +++ b/api_docs/kbn_ml_chi2test.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-chi2test title: "@kbn/ml-chi2test" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-chi2test plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-chi2test'] --- import kbnMlChi2testObj from './kbn_ml_chi2test.devdocs.json'; diff --git a/api_docs/kbn_ml_data_frame_analytics_utils.mdx b/api_docs/kbn_ml_data_frame_analytics_utils.mdx index 5b22e9a8077b6..093530d03119f 100644 --- a/api_docs/kbn_ml_data_frame_analytics_utils.mdx +++ b/api_docs/kbn_ml_data_frame_analytics_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-data-frame-analytics-utils title: "@kbn/ml-data-frame-analytics-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-data-frame-analytics-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-data-frame-analytics-utils'] --- import kbnMlDataFrameAnalyticsUtilsObj from './kbn_ml_data_frame_analytics_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_data_grid.mdx b/api_docs/kbn_ml_data_grid.mdx index 6597e2a1a88bc..a3d030058419c 100644 --- a/api_docs/kbn_ml_data_grid.mdx +++ b/api_docs/kbn_ml_data_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-data-grid title: "@kbn/ml-data-grid" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-data-grid plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-data-grid'] --- import kbnMlDataGridObj from './kbn_ml_data_grid.devdocs.json'; diff --git a/api_docs/kbn_ml_date_picker.mdx b/api_docs/kbn_ml_date_picker.mdx index 88e5c19c868a7..9cac3bf2ef225 100644 --- a/api_docs/kbn_ml_date_picker.mdx +++ b/api_docs/kbn_ml_date_picker.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-date-picker title: "@kbn/ml-date-picker" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-date-picker plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-date-picker'] --- import kbnMlDatePickerObj from './kbn_ml_date_picker.devdocs.json'; diff --git a/api_docs/kbn_ml_date_utils.mdx b/api_docs/kbn_ml_date_utils.mdx index ba97c53c9c921..436156f2347f8 100644 --- a/api_docs/kbn_ml_date_utils.mdx +++ b/api_docs/kbn_ml_date_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-date-utils title: "@kbn/ml-date-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-date-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-date-utils'] --- import kbnMlDateUtilsObj from './kbn_ml_date_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_error_utils.mdx b/api_docs/kbn_ml_error_utils.mdx index 9aa6d4c55e3c0..3db201316a013 100644 --- a/api_docs/kbn_ml_error_utils.mdx +++ b/api_docs/kbn_ml_error_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-error-utils title: "@kbn/ml-error-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-error-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-error-utils'] --- import kbnMlErrorUtilsObj from './kbn_ml_error_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_in_memory_table.mdx b/api_docs/kbn_ml_in_memory_table.mdx index b4b44ee8d41b5..9b4b68d42407c 100644 --- a/api_docs/kbn_ml_in_memory_table.mdx +++ b/api_docs/kbn_ml_in_memory_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-in-memory-table title: "@kbn/ml-in-memory-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-in-memory-table plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-in-memory-table'] --- import kbnMlInMemoryTableObj from './kbn_ml_in_memory_table.devdocs.json'; diff --git a/api_docs/kbn_ml_is_defined.mdx b/api_docs/kbn_ml_is_defined.mdx index e4ebc025c2157..cd216d15d16f0 100644 --- a/api_docs/kbn_ml_is_defined.mdx +++ b/api_docs/kbn_ml_is_defined.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-defined title: "@kbn/ml-is-defined" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-is-defined plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-defined'] --- import kbnMlIsDefinedObj from './kbn_ml_is_defined.devdocs.json'; diff --git a/api_docs/kbn_ml_is_populated_object.mdx b/api_docs/kbn_ml_is_populated_object.mdx index 2600c1a9d8d23..ea033faa0200f 100644 --- a/api_docs/kbn_ml_is_populated_object.mdx +++ b/api_docs/kbn_ml_is_populated_object.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-populated-object title: "@kbn/ml-is-populated-object" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-is-populated-object plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-populated-object'] --- import kbnMlIsPopulatedObjectObj from './kbn_ml_is_populated_object.devdocs.json'; diff --git a/api_docs/kbn_ml_kibana_theme.mdx b/api_docs/kbn_ml_kibana_theme.mdx index dc096bc4ad965..80762c216bf6c 100644 --- a/api_docs/kbn_ml_kibana_theme.mdx +++ b/api_docs/kbn_ml_kibana_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-kibana-theme title: "@kbn/ml-kibana-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-kibana-theme plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-kibana-theme'] --- import kbnMlKibanaThemeObj from './kbn_ml_kibana_theme.devdocs.json'; diff --git a/api_docs/kbn_ml_local_storage.mdx b/api_docs/kbn_ml_local_storage.mdx index de89382bcf1f1..bd8d0d600928d 100644 --- a/api_docs/kbn_ml_local_storage.mdx +++ b/api_docs/kbn_ml_local_storage.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-local-storage title: "@kbn/ml-local-storage" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-local-storage plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-local-storage'] --- import kbnMlLocalStorageObj from './kbn_ml_local_storage.devdocs.json'; diff --git a/api_docs/kbn_ml_nested_property.mdx b/api_docs/kbn_ml_nested_property.mdx index 71ee9c742da1b..1082fde885fc4 100644 --- a/api_docs/kbn_ml_nested_property.mdx +++ b/api_docs/kbn_ml_nested_property.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-nested-property title: "@kbn/ml-nested-property" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-nested-property plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-nested-property'] --- import kbnMlNestedPropertyObj from './kbn_ml_nested_property.devdocs.json'; diff --git a/api_docs/kbn_ml_number_utils.mdx b/api_docs/kbn_ml_number_utils.mdx index 812432087622f..ed61af11d2d1a 100644 --- a/api_docs/kbn_ml_number_utils.mdx +++ b/api_docs/kbn_ml_number_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-number-utils title: "@kbn/ml-number-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-number-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-number-utils'] --- import kbnMlNumberUtilsObj from './kbn_ml_number_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_query_utils.mdx b/api_docs/kbn_ml_query_utils.mdx index 113ef4815c075..18a95ece0efc5 100644 --- a/api_docs/kbn_ml_query_utils.mdx +++ b/api_docs/kbn_ml_query_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-query-utils title: "@kbn/ml-query-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-query-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-query-utils'] --- import kbnMlQueryUtilsObj from './kbn_ml_query_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_random_sampler_utils.mdx b/api_docs/kbn_ml_random_sampler_utils.mdx index c202080d43d53..4df647011e94d 100644 --- a/api_docs/kbn_ml_random_sampler_utils.mdx +++ b/api_docs/kbn_ml_random_sampler_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-random-sampler-utils title: "@kbn/ml-random-sampler-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-random-sampler-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-random-sampler-utils'] --- import kbnMlRandomSamplerUtilsObj from './kbn_ml_random_sampler_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_route_utils.mdx b/api_docs/kbn_ml_route_utils.mdx index 573fc92042f40..e96069e4faf31 100644 --- a/api_docs/kbn_ml_route_utils.mdx +++ b/api_docs/kbn_ml_route_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-route-utils title: "@kbn/ml-route-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-route-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-route-utils'] --- import kbnMlRouteUtilsObj from './kbn_ml_route_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_runtime_field_utils.mdx b/api_docs/kbn_ml_runtime_field_utils.mdx index c482e6d34d392..9d726ccce7d64 100644 --- a/api_docs/kbn_ml_runtime_field_utils.mdx +++ b/api_docs/kbn_ml_runtime_field_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-runtime-field-utils title: "@kbn/ml-runtime-field-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-runtime-field-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-runtime-field-utils'] --- import kbnMlRuntimeFieldUtilsObj from './kbn_ml_runtime_field_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_string_hash.mdx b/api_docs/kbn_ml_string_hash.mdx index b24d0ebec9a40..b4cea76738fd9 100644 --- a/api_docs/kbn_ml_string_hash.mdx +++ b/api_docs/kbn_ml_string_hash.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-string-hash title: "@kbn/ml-string-hash" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-string-hash plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-string-hash'] --- import kbnMlStringHashObj from './kbn_ml_string_hash.devdocs.json'; diff --git a/api_docs/kbn_ml_time_buckets.mdx b/api_docs/kbn_ml_time_buckets.mdx index df48e410183f0..994f6b4aae2eb 100644 --- a/api_docs/kbn_ml_time_buckets.mdx +++ b/api_docs/kbn_ml_time_buckets.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-time-buckets title: "@kbn/ml-time-buckets" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-time-buckets plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-time-buckets'] --- import kbnMlTimeBucketsObj from './kbn_ml_time_buckets.devdocs.json'; diff --git a/api_docs/kbn_ml_trained_models_utils.mdx b/api_docs/kbn_ml_trained_models_utils.mdx index 4a65edb43c46f..672547666a301 100644 --- a/api_docs/kbn_ml_trained_models_utils.mdx +++ b/api_docs/kbn_ml_trained_models_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-trained-models-utils title: "@kbn/ml-trained-models-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-trained-models-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-trained-models-utils'] --- import kbnMlTrainedModelsUtilsObj from './kbn_ml_trained_models_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_ui_actions.mdx b/api_docs/kbn_ml_ui_actions.mdx index b9528b3fd9f87..88278dbc812c8 100644 --- a/api_docs/kbn_ml_ui_actions.mdx +++ b/api_docs/kbn_ml_ui_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-ui-actions title: "@kbn/ml-ui-actions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-ui-actions plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-ui-actions'] --- import kbnMlUiActionsObj from './kbn_ml_ui_actions.devdocs.json'; diff --git a/api_docs/kbn_ml_url_state.mdx b/api_docs/kbn_ml_url_state.mdx index 29826c0bc7ffc..07ae4c27e45aa 100644 --- a/api_docs/kbn_ml_url_state.mdx +++ b/api_docs/kbn_ml_url_state.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-url-state title: "@kbn/ml-url-state" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-url-state plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-url-state'] --- import kbnMlUrlStateObj from './kbn_ml_url_state.devdocs.json'; diff --git a/api_docs/kbn_mock_idp_utils.mdx b/api_docs/kbn_mock_idp_utils.mdx index faa009fc58089..638c50fdb137f 100644 --- a/api_docs/kbn_mock_idp_utils.mdx +++ b/api_docs/kbn_mock_idp_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-mock-idp-utils title: "@kbn/mock-idp-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/mock-idp-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mock-idp-utils'] --- import kbnMockIdpUtilsObj from './kbn_mock_idp_utils.devdocs.json'; diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index 44de1094cccff..85062f7b2a077 100644 --- a/api_docs/kbn_monaco.mdx +++ b/api_docs/kbn_monaco.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-monaco title: "@kbn/monaco" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/monaco plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] --- import kbnMonacoObj from './kbn_monaco.devdocs.json'; diff --git a/api_docs/kbn_object_versioning.mdx b/api_docs/kbn_object_versioning.mdx index 0cdd112d2586f..bc6e8573c93e8 100644 --- a/api_docs/kbn_object_versioning.mdx +++ b/api_docs/kbn_object_versioning.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-object-versioning title: "@kbn/object-versioning" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/object-versioning plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/object-versioning'] --- import kbnObjectVersioningObj from './kbn_object_versioning.devdocs.json'; diff --git a/api_docs/kbn_observability_alert_details.mdx b/api_docs/kbn_observability_alert_details.mdx index 48088869aac6d..01805fd74a6ff 100644 --- a/api_docs/kbn_observability_alert_details.mdx +++ b/api_docs/kbn_observability_alert_details.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-alert-details title: "@kbn/observability-alert-details" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-alert-details plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-alert-details'] --- import kbnObservabilityAlertDetailsObj from './kbn_observability_alert_details.devdocs.json'; diff --git a/api_docs/kbn_observability_alerting_test_data.mdx b/api_docs/kbn_observability_alerting_test_data.mdx index ae29534c8abf7..4af6c43f357c5 100644 --- a/api_docs/kbn_observability_alerting_test_data.mdx +++ b/api_docs/kbn_observability_alerting_test_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-alerting-test-data title: "@kbn/observability-alerting-test-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-alerting-test-data plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-alerting-test-data'] --- import kbnObservabilityAlertingTestDataObj from './kbn_observability_alerting_test_data.devdocs.json'; diff --git a/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx b/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx index 3aeb8ede66d8e..0516477727aba 100644 --- a/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx +++ b/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-get-padded-alert-time-range-util title: "@kbn/observability-get-padded-alert-time-range-util" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-get-padded-alert-time-range-util plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-get-padded-alert-time-range-util'] --- import kbnObservabilityGetPaddedAlertTimeRangeUtilObj from './kbn_observability_get_padded_alert_time_range_util.devdocs.json'; diff --git a/api_docs/kbn_openapi_bundler.mdx b/api_docs/kbn_openapi_bundler.mdx index 19f7bc2af5e57..84247ae5afaff 100644 --- a/api_docs/kbn_openapi_bundler.mdx +++ b/api_docs/kbn_openapi_bundler.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-openapi-bundler title: "@kbn/openapi-bundler" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/openapi-bundler plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/openapi-bundler'] --- import kbnOpenapiBundlerObj from './kbn_openapi_bundler.devdocs.json'; diff --git a/api_docs/kbn_openapi_generator.mdx b/api_docs/kbn_openapi_generator.mdx index eebae8cde4d4e..0d2ac208b7e6f 100644 --- a/api_docs/kbn_openapi_generator.mdx +++ b/api_docs/kbn_openapi_generator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-openapi-generator title: "@kbn/openapi-generator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/openapi-generator plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/openapi-generator'] --- import kbnOpenapiGeneratorObj from './kbn_openapi_generator.devdocs.json'; diff --git a/api_docs/kbn_optimizer.mdx b/api_docs/kbn_optimizer.mdx index 2b36ba70c0145..545592c9554b1 100644 --- a/api_docs/kbn_optimizer.mdx +++ b/api_docs/kbn_optimizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer title: "@kbn/optimizer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer plugin -date: 2024-07-04 +date: 2024-07-11 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 c79c2416e4445..c5fefaebc736f 100644 --- a/api_docs/kbn_optimizer_webpack_helpers.mdx +++ b/api_docs/kbn_optimizer_webpack_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer-webpack-helpers title: "@kbn/optimizer-webpack-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer-webpack-helpers plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer-webpack-helpers'] --- import kbnOptimizerWebpackHelpersObj from './kbn_optimizer_webpack_helpers.devdocs.json'; diff --git a/api_docs/kbn_osquery_io_ts_types.mdx b/api_docs/kbn_osquery_io_ts_types.mdx index 1dd1cba3f776f..c60dba038b7cd 100644 --- a/api_docs/kbn_osquery_io_ts_types.mdx +++ b/api_docs/kbn_osquery_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-osquery-io-ts-types title: "@kbn/osquery-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/osquery-io-ts-types plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/osquery-io-ts-types'] --- import kbnOsqueryIoTsTypesObj from './kbn_osquery_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_panel_loader.mdx b/api_docs/kbn_panel_loader.mdx index c99b483ad6c49..f133e2beda4cc 100644 --- a/api_docs/kbn_panel_loader.mdx +++ b/api_docs/kbn_panel_loader.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-panel-loader title: "@kbn/panel-loader" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/panel-loader plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/panel-loader'] --- import kbnPanelLoaderObj from './kbn_panel_loader.devdocs.json'; diff --git a/api_docs/kbn_performance_testing_dataset_extractor.mdx b/api_docs/kbn_performance_testing_dataset_extractor.mdx index 35817380bf090..ca1145ef455dc 100644 --- a/api_docs/kbn_performance_testing_dataset_extractor.mdx +++ b/api_docs/kbn_performance_testing_dataset_extractor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-performance-testing-dataset-extractor title: "@kbn/performance-testing-dataset-extractor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/performance-testing-dataset-extractor plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/performance-testing-dataset-extractor'] --- import kbnPerformanceTestingDatasetExtractorObj from './kbn_performance_testing_dataset_extractor.devdocs.json'; diff --git a/api_docs/kbn_plugin_check.mdx b/api_docs/kbn_plugin_check.mdx index f8dbbd0aa5d35..6c54037c12a98 100644 --- a/api_docs/kbn_plugin_check.mdx +++ b/api_docs/kbn_plugin_check.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-check title: "@kbn/plugin-check" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-check plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-check'] --- import kbnPluginCheckObj from './kbn_plugin_check.devdocs.json'; diff --git a/api_docs/kbn_plugin_generator.mdx b/api_docs/kbn_plugin_generator.mdx index 585de235d00c9..99c83018e5239 100644 --- a/api_docs/kbn_plugin_generator.mdx +++ b/api_docs/kbn_plugin_generator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-generator title: "@kbn/plugin-generator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-generator plugin -date: 2024-07-04 +date: 2024-07-11 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 a45ccc921f441..de815490846ac 100644 --- a/api_docs/kbn_plugin_helpers.mdx +++ b/api_docs/kbn_plugin_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-helpers title: "@kbn/plugin-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-helpers plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] --- import kbnPluginHelpersObj from './kbn_plugin_helpers.devdocs.json'; diff --git a/api_docs/kbn_presentation_containers.mdx b/api_docs/kbn_presentation_containers.mdx index 328c9ee94ba80..c1391988264a9 100644 --- a/api_docs/kbn_presentation_containers.mdx +++ b/api_docs/kbn_presentation_containers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-presentation-containers title: "@kbn/presentation-containers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/presentation-containers plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/presentation-containers'] --- import kbnPresentationContainersObj from './kbn_presentation_containers.devdocs.json'; diff --git a/api_docs/kbn_presentation_publishing.devdocs.json b/api_docs/kbn_presentation_publishing.devdocs.json index e77aadbe13c1c..f4d2eb257223f 100644 --- a/api_docs/kbn_presentation_publishing.devdocs.json +++ b/api_docs/kbn_presentation_publishing.devdocs.json @@ -1696,6 +1696,39 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/presentation-publishing", + "id": "def-common.hasBlockingError", + "type": "Function", + "tags": [], + "label": "hasBlockingError", + "description": [], + "signature": [ + "(api: unknown) => boolean" + ], + "path": "packages/presentation/presentation_publishing/interfaces/publishes_blocking_error.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/presentation-publishing", + "id": "def-common.hasBlockingError.$1", + "type": "Unknown", + "tags": [], + "label": "api", + "description": [], + "signature": [ + "unknown" + ], + "path": "packages/presentation/presentation_publishing/interfaces/publishes_blocking_error.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/presentation-publishing", "id": "def-common.hasEditCapabilities", diff --git a/api_docs/kbn_presentation_publishing.mdx b/api_docs/kbn_presentation_publishing.mdx index fe6817612b298..9a6a8ae21d312 100644 --- a/api_docs/kbn_presentation_publishing.mdx +++ b/api_docs/kbn_presentation_publishing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-presentation-publishing title: "@kbn/presentation-publishing" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/presentation-publishing plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/presentation-publishing'] --- import kbnPresentationPublishingObj from './kbn_presentation_publishing.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kib | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 214 | 0 | 179 | 5 | +| 216 | 0 | 181 | 5 | ## Common diff --git a/api_docs/kbn_profiling_utils.mdx b/api_docs/kbn_profiling_utils.mdx index c0c8c05b4a2c4..09e6baea4b78c 100644 --- a/api_docs/kbn_profiling_utils.mdx +++ b/api_docs/kbn_profiling_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-profiling-utils title: "@kbn/profiling-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/profiling-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/profiling-utils'] --- import kbnProfilingUtilsObj from './kbn_profiling_utils.devdocs.json'; diff --git a/api_docs/kbn_random_sampling.mdx b/api_docs/kbn_random_sampling.mdx index 8a19557b81cb3..07d27c59202c7 100644 --- a/api_docs/kbn_random_sampling.mdx +++ b/api_docs/kbn_random_sampling.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-random-sampling title: "@kbn/random-sampling" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/random-sampling plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/random-sampling'] --- import kbnRandomSamplingObj from './kbn_random_sampling.devdocs.json'; diff --git a/api_docs/kbn_react_field.mdx b/api_docs/kbn_react_field.mdx index a814aece8c0a6..7b49a30a3d724 100644 --- a/api_docs/kbn_react_field.mdx +++ b/api_docs/kbn_react_field.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-field title: "@kbn/react-field" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-field plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-field'] --- import kbnReactFieldObj from './kbn_react_field.devdocs.json'; diff --git a/api_docs/kbn_react_hooks.mdx b/api_docs/kbn_react_hooks.mdx index 9bffc52ba86d1..46c0819bf7568 100644 --- a/api_docs/kbn_react_hooks.mdx +++ b/api_docs/kbn_react_hooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-hooks title: "@kbn/react-hooks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-hooks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-hooks'] --- import kbnReactHooksObj from './kbn_react_hooks.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_common.mdx b/api_docs/kbn_react_kibana_context_common.mdx index 66dfa11b94e8d..739a94c2e424a 100644 --- a/api_docs/kbn_react_kibana_context_common.mdx +++ b/api_docs/kbn_react_kibana_context_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-common title: "@kbn/react-kibana-context-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-common'] --- import kbnReactKibanaContextCommonObj from './kbn_react_kibana_context_common.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_render.mdx b/api_docs/kbn_react_kibana_context_render.mdx index 951f6c6ea4bf9..3326520edc59e 100644 --- a/api_docs/kbn_react_kibana_context_render.mdx +++ b/api_docs/kbn_react_kibana_context_render.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-render title: "@kbn/react-kibana-context-render" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-render plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-render'] --- import kbnReactKibanaContextRenderObj from './kbn_react_kibana_context_render.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_root.mdx b/api_docs/kbn_react_kibana_context_root.mdx index 44535e9c7e45d..31606dac7f3c0 100644 --- a/api_docs/kbn_react_kibana_context_root.mdx +++ b/api_docs/kbn_react_kibana_context_root.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-root title: "@kbn/react-kibana-context-root" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-root plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-root'] --- import kbnReactKibanaContextRootObj from './kbn_react_kibana_context_root.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_styled.mdx b/api_docs/kbn_react_kibana_context_styled.mdx index feab9cefca614..7113b40106640 100644 --- a/api_docs/kbn_react_kibana_context_styled.mdx +++ b/api_docs/kbn_react_kibana_context_styled.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-styled title: "@kbn/react-kibana-context-styled" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-styled plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-styled'] --- import kbnReactKibanaContextStyledObj from './kbn_react_kibana_context_styled.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_theme.mdx b/api_docs/kbn_react_kibana_context_theme.mdx index d83fd0970cdfb..868356cefda9e 100644 --- a/api_docs/kbn_react_kibana_context_theme.mdx +++ b/api_docs/kbn_react_kibana_context_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-theme title: "@kbn/react-kibana-context-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-theme plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-theme'] --- import kbnReactKibanaContextThemeObj from './kbn_react_kibana_context_theme.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_mount.mdx b/api_docs/kbn_react_kibana_mount.mdx index b87d6b150a421..0c1a70db3e0bd 100644 --- a/api_docs/kbn_react_kibana_mount.mdx +++ b/api_docs/kbn_react_kibana_mount.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-mount title: "@kbn/react-kibana-mount" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-mount plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-mount'] --- import kbnReactKibanaMountObj from './kbn_react_kibana_mount.devdocs.json'; diff --git a/api_docs/kbn_recently_accessed.devdocs.json b/api_docs/kbn_recently_accessed.devdocs.json new file mode 100644 index 0000000000000..972588291edf7 --- /dev/null +++ b/api_docs/kbn_recently_accessed.devdocs.json @@ -0,0 +1,269 @@ +{ + "id": "@kbn/recently-accessed", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [ + { + "parentPluginId": "@kbn/recently-accessed", + "id": "def-common.RecentlyAccessedService", + "type": "Class", + "tags": [], + "label": "RecentlyAccessedService", + "description": [], + "path": "packages/kbn-recently-accessed/src/recently_accessed_service.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/recently-accessed", + "id": "def-common.RecentlyAccessedService.start", + "type": "Function", + "tags": [], + "label": "start", + "description": [], + "signature": [ + "({ http, key }: StartDeps) => ", + { + "pluginId": "@kbn/recently-accessed", + "scope": "common", + "docId": "kibKbnRecentlyAccessedPluginApi", + "section": "def-common.RecentlyAccessed", + "text": "RecentlyAccessed" + } + ], + "path": "packages/kbn-recently-accessed/src/recently_accessed_service.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/recently-accessed", + "id": "def-common.RecentlyAccessedService.start.$1", + "type": "Object", + "tags": [], + "label": "{ http, key }", + "description": [], + "signature": [ + "StartDeps" + ], + "path": "packages/kbn-recently-accessed/src/recently_accessed_service.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [], + "interfaces": [ + { + "parentPluginId": "@kbn/recently-accessed", + "id": "def-common.RecentlyAccessed", + "type": "Interface", + "tags": [], + "label": "RecentlyAccessed", + "description": [ + "\n{@link RecentlyAccessed | APIs} for recently accessed history." + ], + "path": "packages/kbn-recently-accessed/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/recently-accessed", + "id": "def-common.RecentlyAccessed.add", + "type": "Function", + "tags": [], + "label": "add", + "description": [ + "\nAdds a new item to the recently accessed history.\n" + ], + "signature": [ + "(link: string, label: string, id: string) => void" + ], + "path": "packages/kbn-recently-accessed/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/recently-accessed", + "id": "def-common.RecentlyAccessed.add.$1", + "type": "string", + "tags": [], + "label": "link", + "description": [ + "a relative URL to the resource (not including the {@link HttpStart.basePath | `http.basePath`})" + ], + "signature": [ + "string" + ], + "path": "packages/kbn-recently-accessed/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/recently-accessed", + "id": "def-common.RecentlyAccessed.add.$2", + "type": "string", + "tags": [], + "label": "label", + "description": [ + "the label to display in the UI" + ], + "signature": [ + "string" + ], + "path": "packages/kbn-recently-accessed/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/recently-accessed", + "id": "def-common.RecentlyAccessed.add.$3", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "a unique string used to de-duplicate the recently accessed list." + ], + "signature": [ + "string" + ], + "path": "packages/kbn-recently-accessed/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/recently-accessed", + "id": "def-common.RecentlyAccessed.get", + "type": "Function", + "tags": [], + "label": "get", + "description": [ + "\nGets an Array of the current recently accessed history.\n" + ], + "signature": [ + "() => ", + { + "pluginId": "@kbn/recently-accessed", + "scope": "common", + "docId": "kibKbnRecentlyAccessedPluginApi", + "section": "def-common.RecentlyAccessedHistoryItem", + "text": "RecentlyAccessedHistoryItem" + }, + "[]" + ], + "path": "packages/kbn-recently-accessed/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/recently-accessed", + "id": "def-common.RecentlyAccessed.get$", + "type": "Function", + "tags": [], + "label": "get$", + "description": [ + "\nGets an Observable of the array of recently accessed history.\n" + ], + "signature": [ + "() => ", + "Observable", + "<", + { + "pluginId": "@kbn/recently-accessed", + "scope": "common", + "docId": "kibKbnRecentlyAccessedPluginApi", + "section": "def-common.RecentlyAccessedHistoryItem", + "text": "RecentlyAccessedHistoryItem" + }, + "[]>" + ], + "path": "packages/kbn-recently-accessed/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/recently-accessed", + "id": "def-common.RecentlyAccessedHistoryItem", + "type": "Interface", + "tags": [], + "label": "RecentlyAccessedHistoryItem", + "description": [], + "path": "packages/kbn-recently-accessed/src/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/recently-accessed", + "id": "def-common.RecentlyAccessedHistoryItem.link", + "type": "string", + "tags": [], + "label": "link", + "description": [], + "path": "packages/kbn-recently-accessed/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/recently-accessed", + "id": "def-common.RecentlyAccessedHistoryItem.label", + "type": "string", + "tags": [], + "label": "label", + "description": [], + "path": "packages/kbn-recently-accessed/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/recently-accessed", + "id": "def-common.RecentlyAccessedHistoryItem.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "packages/kbn-recently-accessed/src/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_recently_accessed.mdx b/api_docs/kbn_recently_accessed.mdx new file mode 100644 index 0000000000000..21964aa57344b --- /dev/null +++ b/api_docs/kbn_recently_accessed.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: kibKbnRecentlyAccessedPluginApi +slug: /kibana-dev-docs/api/kbn-recently-accessed +title: "@kbn/recently-accessed" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/recently-accessed plugin +date: 2024-07-11 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/recently-accessed'] +--- +import kbnRecentlyAccessedObj from './kbn_recently_accessed.devdocs.json'; + + + +Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 14 | 0 | 7 | 0 | + +## Common + +### Classes + + +### Interfaces + + diff --git a/api_docs/kbn_repo_file_maps.mdx b/api_docs/kbn_repo_file_maps.mdx index f9760eda4bb12..eb7ab9f741927 100644 --- a/api_docs/kbn_repo_file_maps.mdx +++ b/api_docs/kbn_repo_file_maps.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-file-maps title: "@kbn/repo-file-maps" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-file-maps plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-file-maps'] --- import kbnRepoFileMapsObj from './kbn_repo_file_maps.devdocs.json'; diff --git a/api_docs/kbn_repo_linter.mdx b/api_docs/kbn_repo_linter.mdx index ba87d94c375ec..d1085688553ef 100644 --- a/api_docs/kbn_repo_linter.mdx +++ b/api_docs/kbn_repo_linter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-linter title: "@kbn/repo-linter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-linter plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-linter'] --- import kbnRepoLinterObj from './kbn_repo_linter.devdocs.json'; diff --git a/api_docs/kbn_repo_path.mdx b/api_docs/kbn_repo_path.mdx index 740573d536a43..1a0d8707d891f 100644 --- a/api_docs/kbn_repo_path.mdx +++ b/api_docs/kbn_repo_path.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-path title: "@kbn/repo-path" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-path plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-path'] --- import kbnRepoPathObj from './kbn_repo_path.devdocs.json'; diff --git a/api_docs/kbn_repo_source_classifier.mdx b/api_docs/kbn_repo_source_classifier.mdx index 0808dddf4a15b..0c17e23fa2c11 100644 --- a/api_docs/kbn_repo_source_classifier.mdx +++ b/api_docs/kbn_repo_source_classifier.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-source-classifier title: "@kbn/repo-source-classifier" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-source-classifier plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-source-classifier'] --- import kbnRepoSourceClassifierObj from './kbn_repo_source_classifier.devdocs.json'; diff --git a/api_docs/kbn_reporting_common.mdx b/api_docs/kbn_reporting_common.mdx index 0320e13262a19..da8a398b36802 100644 --- a/api_docs/kbn_reporting_common.mdx +++ b/api_docs/kbn_reporting_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-common title: "@kbn/reporting-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-common'] --- import kbnReportingCommonObj from './kbn_reporting_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_csv_share_panel.mdx b/api_docs/kbn_reporting_csv_share_panel.mdx index 07c987083c0e3..1480f6658b029 100644 --- a/api_docs/kbn_reporting_csv_share_panel.mdx +++ b/api_docs/kbn_reporting_csv_share_panel.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-csv-share-panel title: "@kbn/reporting-csv-share-panel" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-csv-share-panel plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-csv-share-panel'] --- import kbnReportingCsvSharePanelObj from './kbn_reporting_csv_share_panel.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_csv.mdx b/api_docs/kbn_reporting_export_types_csv.mdx index 6eac15588bcb5..5b1446f671584 100644 --- a/api_docs/kbn_reporting_export_types_csv.mdx +++ b/api_docs/kbn_reporting_export_types_csv.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-csv title: "@kbn/reporting-export-types-csv" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-csv plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-csv'] --- import kbnReportingExportTypesCsvObj from './kbn_reporting_export_types_csv.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_csv_common.mdx b/api_docs/kbn_reporting_export_types_csv_common.mdx index ed2b73db07b16..164f7409fdf07 100644 --- a/api_docs/kbn_reporting_export_types_csv_common.mdx +++ b/api_docs/kbn_reporting_export_types_csv_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-csv-common title: "@kbn/reporting-export-types-csv-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-csv-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-csv-common'] --- import kbnReportingExportTypesCsvCommonObj from './kbn_reporting_export_types_csv_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_pdf.mdx b/api_docs/kbn_reporting_export_types_pdf.mdx index fa1ce3b66e1b1..9ec8ece7caf4a 100644 --- a/api_docs/kbn_reporting_export_types_pdf.mdx +++ b/api_docs/kbn_reporting_export_types_pdf.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-pdf title: "@kbn/reporting-export-types-pdf" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-pdf plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-pdf'] --- import kbnReportingExportTypesPdfObj from './kbn_reporting_export_types_pdf.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_pdf_common.mdx b/api_docs/kbn_reporting_export_types_pdf_common.mdx index 07068f24bbcdb..6661bc6008aaa 100644 --- a/api_docs/kbn_reporting_export_types_pdf_common.mdx +++ b/api_docs/kbn_reporting_export_types_pdf_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-pdf-common title: "@kbn/reporting-export-types-pdf-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-pdf-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-pdf-common'] --- import kbnReportingExportTypesPdfCommonObj from './kbn_reporting_export_types_pdf_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_png.mdx b/api_docs/kbn_reporting_export_types_png.mdx index 490c7ba18a64b..3a0ec5768f52b 100644 --- a/api_docs/kbn_reporting_export_types_png.mdx +++ b/api_docs/kbn_reporting_export_types_png.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-png title: "@kbn/reporting-export-types-png" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-png plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-png'] --- import kbnReportingExportTypesPngObj from './kbn_reporting_export_types_png.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_png_common.mdx b/api_docs/kbn_reporting_export_types_png_common.mdx index 03d0eb8a26608..0af88df1fc84b 100644 --- a/api_docs/kbn_reporting_export_types_png_common.mdx +++ b/api_docs/kbn_reporting_export_types_png_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-png-common title: "@kbn/reporting-export-types-png-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-png-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-png-common'] --- import kbnReportingExportTypesPngCommonObj from './kbn_reporting_export_types_png_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_mocks_server.mdx b/api_docs/kbn_reporting_mocks_server.mdx index 02f300ecf625f..d49952a3ec283 100644 --- a/api_docs/kbn_reporting_mocks_server.mdx +++ b/api_docs/kbn_reporting_mocks_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-mocks-server title: "@kbn/reporting-mocks-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-mocks-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-mocks-server'] --- import kbnReportingMocksServerObj from './kbn_reporting_mocks_server.devdocs.json'; diff --git a/api_docs/kbn_reporting_public.mdx b/api_docs/kbn_reporting_public.mdx index 35b72c18a923f..7e1216c8367c6 100644 --- a/api_docs/kbn_reporting_public.mdx +++ b/api_docs/kbn_reporting_public.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-public title: "@kbn/reporting-public" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-public plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-public'] --- import kbnReportingPublicObj from './kbn_reporting_public.devdocs.json'; diff --git a/api_docs/kbn_reporting_server.mdx b/api_docs/kbn_reporting_server.mdx index 5496a590082a4..dca1b1a9269cc 100644 --- a/api_docs/kbn_reporting_server.mdx +++ b/api_docs/kbn_reporting_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-server title: "@kbn/reporting-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-server'] --- import kbnReportingServerObj from './kbn_reporting_server.devdocs.json'; diff --git a/api_docs/kbn_resizable_layout.mdx b/api_docs/kbn_resizable_layout.mdx index 2ab0ccdc67e2d..fec364f156d12 100644 --- a/api_docs/kbn_resizable_layout.mdx +++ b/api_docs/kbn_resizable_layout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-resizable-layout title: "@kbn/resizable-layout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/resizable-layout plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/resizable-layout'] --- import kbnResizableLayoutObj from './kbn_resizable_layout.devdocs.json'; diff --git a/api_docs/kbn_response_ops_feature_flag_service.mdx b/api_docs/kbn_response_ops_feature_flag_service.mdx index ea36ed4b94f47..3ee0b47d3fe68 100644 --- a/api_docs/kbn_response_ops_feature_flag_service.mdx +++ b/api_docs/kbn_response_ops_feature_flag_service.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-response-ops-feature-flag-service title: "@kbn/response-ops-feature-flag-service" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/response-ops-feature-flag-service plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/response-ops-feature-flag-service'] --- import kbnResponseOpsFeatureFlagServiceObj from './kbn_response_ops_feature_flag_service.devdocs.json'; diff --git a/api_docs/kbn_rison.mdx b/api_docs/kbn_rison.mdx index 21ee3dc3a1979..d659bb58baa7e 100644 --- a/api_docs/kbn_rison.mdx +++ b/api_docs/kbn_rison.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rison title: "@kbn/rison" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rison plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rison'] --- import kbnRisonObj from './kbn_rison.devdocs.json'; diff --git a/api_docs/kbn_rollup.mdx b/api_docs/kbn_rollup.mdx index 565701c8b58be..988491b2a2274 100644 --- a/api_docs/kbn_rollup.mdx +++ b/api_docs/kbn_rollup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rollup title: "@kbn/rollup" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rollup plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rollup'] --- import kbnRollupObj from './kbn_rollup.devdocs.json'; diff --git a/api_docs/kbn_router_to_openapispec.mdx b/api_docs/kbn_router_to_openapispec.mdx index 34e132bb97bca..94444ebbcb5d2 100644 --- a/api_docs/kbn_router_to_openapispec.mdx +++ b/api_docs/kbn_router_to_openapispec.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-router-to-openapispec title: "@kbn/router-to-openapispec" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/router-to-openapispec plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/router-to-openapispec'] --- import kbnRouterToOpenapispecObj from './kbn_router_to_openapispec.devdocs.json'; diff --git a/api_docs/kbn_router_utils.mdx b/api_docs/kbn_router_utils.mdx index bda7681dee2d8..9ccba988fe0bc 100644 --- a/api_docs/kbn_router_utils.mdx +++ b/api_docs/kbn_router_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-router-utils title: "@kbn/router-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/router-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/router-utils'] --- import kbnRouterUtilsObj from './kbn_router_utils.devdocs.json'; diff --git a/api_docs/kbn_rrule.mdx b/api_docs/kbn_rrule.mdx index 30b91fc5f14fc..6a5734a591024 100644 --- a/api_docs/kbn_rrule.mdx +++ b/api_docs/kbn_rrule.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rrule title: "@kbn/rrule" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rrule plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rrule'] --- import kbnRruleObj from './kbn_rrule.devdocs.json'; diff --git a/api_docs/kbn_rule_data_utils.mdx b/api_docs/kbn_rule_data_utils.mdx index c53f4d15510b2..4d54c20885721 100644 --- a/api_docs/kbn_rule_data_utils.mdx +++ b/api_docs/kbn_rule_data_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rule-data-utils title: "@kbn/rule-data-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rule-data-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rule-data-utils'] --- import kbnRuleDataUtilsObj from './kbn_rule_data_utils.devdocs.json'; diff --git a/api_docs/kbn_saved_objects_settings.mdx b/api_docs/kbn_saved_objects_settings.mdx index 609b9777a0d06..07fb03fc1dfb5 100644 --- a/api_docs/kbn_saved_objects_settings.mdx +++ b/api_docs/kbn_saved_objects_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-saved-objects-settings title: "@kbn/saved-objects-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/saved-objects-settings plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/saved-objects-settings'] --- import kbnSavedObjectsSettingsObj from './kbn_saved_objects_settings.devdocs.json'; diff --git a/api_docs/kbn_search_api_panels.mdx b/api_docs/kbn_search_api_panels.mdx index 4e02bf7f2a890..741c6454818d0 100644 --- a/api_docs/kbn_search_api_panels.mdx +++ b/api_docs/kbn_search_api_panels.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-api-panels title: "@kbn/search-api-panels" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-api-panels plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-api-panels'] --- import kbnSearchApiPanelsObj from './kbn_search_api_panels.devdocs.json'; diff --git a/api_docs/kbn_search_connectors.devdocs.json b/api_docs/kbn_search_connectors.devdocs.json index 5ef0ca703940d..d99fdba6e9359 100644 --- a/api_docs/kbn_search_connectors.devdocs.json +++ b/api_docs/kbn_search_connectors.devdocs.json @@ -5250,7 +5250,7 @@ "label": "rule", "description": [], "signature": [ - "\"<\" | \">\" | \"contains\" | \"equals\" | \"regex\" | \"ends_with\" | \"starts_with\"" + "\"contains\" | \"<\" | \">\" | \"equals\" | \"regex\" | \"ends_with\" | \"starts_with\"" ], "path": "packages/kbn-search-connectors/types/connectors.ts", "deprecated": false, @@ -6850,7 +6850,7 @@ "label": "FilteringRuleRule", "description": [], "signature": [ - "\"<\" | \">\" | \"contains\" | \"equals\" | \"regex\" | \"ends_with\" | \"starts_with\"" + "\"contains\" | \"<\" | \">\" | \"equals\" | \"regex\" | \"ends_with\" | \"starts_with\"" ], "path": "packages/kbn-search-connectors/types/connectors.ts", "deprecated": false, diff --git a/api_docs/kbn_search_connectors.mdx b/api_docs/kbn_search_connectors.mdx index b778bdf1db172..7c330dfcd2ecb 100644 --- a/api_docs/kbn_search_connectors.mdx +++ b/api_docs/kbn_search_connectors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-connectors title: "@kbn/search-connectors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-connectors plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-connectors'] --- import kbnSearchConnectorsObj from './kbn_search_connectors.devdocs.json'; diff --git a/api_docs/kbn_search_errors.mdx b/api_docs/kbn_search_errors.mdx index 4ea96f2ca5241..9f80b84162264 100644 --- a/api_docs/kbn_search_errors.mdx +++ b/api_docs/kbn_search_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-errors title: "@kbn/search-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-errors plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-errors'] --- import kbnSearchErrorsObj from './kbn_search_errors.devdocs.json'; diff --git a/api_docs/kbn_search_index_documents.mdx b/api_docs/kbn_search_index_documents.mdx index 7c2c709daab80..31a11cc8b570d 100644 --- a/api_docs/kbn_search_index_documents.mdx +++ b/api_docs/kbn_search_index_documents.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-index-documents title: "@kbn/search-index-documents" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-index-documents plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-index-documents'] --- import kbnSearchIndexDocumentsObj from './kbn_search_index_documents.devdocs.json'; diff --git a/api_docs/kbn_search_response_warnings.mdx b/api_docs/kbn_search_response_warnings.mdx index d9ac4cacf89d9..c4fe5de6f8813 100644 --- a/api_docs/kbn_search_response_warnings.mdx +++ b/api_docs/kbn_search_response_warnings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-response-warnings title: "@kbn/search-response-warnings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-response-warnings plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-response-warnings'] --- import kbnSearchResponseWarningsObj from './kbn_search_response_warnings.devdocs.json'; diff --git a/api_docs/kbn_search_types.mdx b/api_docs/kbn_search_types.mdx index 07ea5fad9bca2..507efef4c33fc 100644 --- a/api_docs/kbn_search_types.mdx +++ b/api_docs/kbn_search_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-types title: "@kbn/search-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-types plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-types'] --- import kbnSearchTypesObj from './kbn_search_types.devdocs.json'; diff --git a/api_docs/kbn_security_api_key_management.devdocs.json b/api_docs/kbn_security_api_key_management.devdocs.json index 5fd86dcf3f8c8..661a3acf9b5c9 100644 --- a/api_docs/kbn_security_api_key_management.devdocs.json +++ b/api_docs/kbn_security_api_key_management.devdocs.json @@ -186,10 +186,10 @@ "signature": [ "(apiKey: ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CreateAPIKeyParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateAPIKeyParams", "text": "CreateAPIKeyParams" }, ") => Promise<", @@ -209,10 +209,10 @@ "description": [], "signature": [ { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CreateAPIKeyParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateAPIKeyParams", "text": "CreateAPIKeyParams" } ], @@ -234,10 +234,10 @@ "signature": [ "(apiKey: ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.UpdateAPIKeyParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateAPIKeyParams", "text": "UpdateAPIKeyParams" }, ") => Promise<", @@ -257,10 +257,10 @@ "description": [], "signature": [ { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.UpdateAPIKeyParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateAPIKeyParams", "text": "UpdateAPIKeyParams" } ], @@ -532,10 +532,10 @@ }, ") => ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CreateAPIKeyParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateAPIKeyParams", "text": "CreateAPIKeyParams" } ], @@ -586,10 +586,10 @@ }, ") => ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.UpdateAPIKeyParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateAPIKeyParams", "text": "UpdateAPIKeyParams" } ], @@ -976,7 +976,7 @@ "label": "sort", "description": [], "signature": [ - "{ field: \"id\" | \"type\" | \"name\" | \"username\" | \"profile_uid\" | \"metadata\" | \"expired\" | \"creation\" | \"expiration\" | \"role_descriptors\" | \"realm\" | \"invalidated\" | \"realm_type\" | \"limited_by\" | \"_sort\"; direction: \"asc\" | \"desc\"; }" + "{ field: \"id\" | \"type\" | \"name\" | \"username\" | \"profile_uid\" | \"metadata\" | \"expired\" | \"creation\" | \"realm\" | \"role_descriptors\" | \"expiration\" | \"invalidated\" | \"realm_type\" | \"limited_by\" | \"_sort\"; direction: \"asc\" | \"desc\"; }" ], "path": "x-pack/packages/security/api_key_management/src/components/api_keys_api_client.ts", "deprecated": false, @@ -1131,9 +1131,31 @@ "label": "CreateAPIKeyParams", "description": [], "signature": [ - "Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { name: string; role_descriptors: Record>; }> | Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { name: string; kibana_role_descriptors: Record | undefined; } & { spaces: string[] | \"*\"[]; }>[]; elasticsearch: Readonly<{ cluster?: string[] | undefined; indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; }>[] | undefined; remote_cluster?: Readonly<{} & { privileges: string[]; clusters: string[]; }>[] | undefined; remote_indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; clusters: string[]; }>[] | undefined; run_as?: string[] | undefined; } & {}>; }>>; }> | Readonly<{ metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { type: \"cross_cluster\"; name: string; access: Readonly<{ search?: Readonly<{ query?: any; field_security?: any; allow_restricted_indices?: boolean | undefined; } & { names: string[]; }>[] | undefined; replication?: Readonly<{} & { names: string[]; }>[] | undefined; } & {}>; }>" + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyParams", + "text": "CreateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams", + "text": "CreateRestAPIKeyWithKibanaPrivilegesParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateCrossClusterAPIKeyParams", + "text": "CreateCrossClusterAPIKeyParams" + } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1150,7 +1172,7 @@ "signature": [ "SecurityCreateApiKeyResponse" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1163,7 +1185,7 @@ "label": "QueryApiKeySortOptions", "description": [], "signature": [ - "{ field: \"id\" | \"type\" | \"name\" | \"username\" | \"profile_uid\" | \"metadata\" | \"expired\" | \"creation\" | \"expiration\" | \"role_descriptors\" | \"realm\" | \"invalidated\" | \"realm_type\" | \"limited_by\" | \"_sort\"; direction: \"asc\" | \"desc\"; }" + "{ field: \"id\" | \"type\" | \"name\" | \"username\" | \"profile_uid\" | \"metadata\" | \"expired\" | \"creation\" | \"realm\" | \"role_descriptors\" | \"expiration\" | \"invalidated\" | \"realm_type\" | \"limited_by\" | \"_sort\"; direction: \"asc\" | \"desc\"; }" ], "path": "x-pack/packages/security/api_key_management/src/components/api_keys_api_client.ts", "deprecated": false, @@ -1180,9 +1202,31 @@ "\nRequest body of Kibana Update API key endpoint." ], "signature": [ - "Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { id: string; role_descriptors: Record>; }> | Readonly<{ metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { id: string; type: \"cross_cluster\"; access: Readonly<{ search?: Readonly<{ query?: any; field_security?: any; allow_restricted_indices?: boolean | undefined; } & { names: string[]; }>[] | undefined; replication?: Readonly<{} & { names: string[]; }>[] | undefined; } & {}>; }> | Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { id: string; kibana_role_descriptors: Record | undefined; } & { spaces: string[] | \"*\"[]; }>[]; elasticsearch: Readonly<{ cluster?: string[] | undefined; indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; }>[] | undefined; remote_cluster?: Readonly<{} & { privileges: string[]; clusters: string[]; }>[] | undefined; remote_indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; clusters: string[]; }>[] | undefined; run_as?: string[] | undefined; } & {}>; }>>; }>" + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateRestAPIKeyParams", + "text": "UpdateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateCrossClusterAPIKeyParams", + "text": "UpdateCrossClusterAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateRestAPIKeyWithKibanaPrivilegesParams", + "text": "UpdateRestAPIKeyWithKibanaPrivilegesParams" + } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1199,7 +1243,7 @@ "signature": [ "SecurityUpdateApiKeyResponse" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_security_api_key_management.mdx b/api_docs/kbn_security_api_key_management.mdx index 8afb71115e250..9de2544ada759 100644 --- a/api_docs/kbn_security_api_key_management.mdx +++ b/api_docs/kbn_security_api_key_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-api-key-management title: "@kbn/security-api-key-management" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-api-key-management plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-api-key-management'] --- import kbnSecurityApiKeyManagementObj from './kbn_security_api_key_management.devdocs.json'; diff --git a/api_docs/kbn_security_form_components.mdx b/api_docs/kbn_security_form_components.mdx index 50267cc4264db..3c1d11c315a2f 100644 --- a/api_docs/kbn_security_form_components.mdx +++ b/api_docs/kbn_security_form_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-form-components title: "@kbn/security-form-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-form-components plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-form-components'] --- import kbnSecurityFormComponentsObj from './kbn_security_form_components.devdocs.json'; diff --git a/api_docs/kbn_security_hardening.mdx b/api_docs/kbn_security_hardening.mdx index 1a63e35c11b14..9f2daaf952d3b 100644 --- a/api_docs/kbn_security_hardening.mdx +++ b/api_docs/kbn_security_hardening.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-hardening title: "@kbn/security-hardening" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-hardening plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-hardening'] --- import kbnSecurityHardeningObj from './kbn_security_hardening.devdocs.json'; diff --git a/api_docs/kbn_security_plugin_types_common.mdx b/api_docs/kbn_security_plugin_types_common.mdx index f13241dcbb463..6698483b04855 100644 --- a/api_docs/kbn_security_plugin_types_common.mdx +++ b/api_docs/kbn_security_plugin_types_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-plugin-types-common title: "@kbn/security-plugin-types-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-plugin-types-common plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-common'] --- import kbnSecurityPluginTypesCommonObj from './kbn_security_plugin_types_common.devdocs.json'; diff --git a/api_docs/kbn_security_plugin_types_public.mdx b/api_docs/kbn_security_plugin_types_public.mdx index 46e64f9385298..2d1b1c4829cdf 100644 --- a/api_docs/kbn_security_plugin_types_public.mdx +++ b/api_docs/kbn_security_plugin_types_public.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-plugin-types-public title: "@kbn/security-plugin-types-public" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-plugin-types-public plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-public'] --- import kbnSecurityPluginTypesPublicObj from './kbn_security_plugin_types_public.devdocs.json'; diff --git a/api_docs/kbn_security_plugin_types_server.devdocs.json b/api_docs/kbn_security_plugin_types_server.devdocs.json index dbd001d28def1..7650af308a8fd 100644 --- a/api_docs/kbn_security_plugin_types_server.devdocs.json +++ b/api_docs/kbn_security_plugin_types_server.devdocs.json @@ -62,15 +62,15 @@ "label": "getRestApiKeyWithKibanaPrivilegesSchema", "description": [], "signature": [ - "(getBasePrivilegeNames: () => { global: string[]; space: string[]; }) => ExtendedObjectType<{ type: ", + "(getBasePrivilegeNames: () => { global: string[]; space: string[]; }) => ", { "pluginId": "@kbn/config-schema", "scope": "common", "docId": "kibKbnConfigSchemaPluginApi", - "section": "def-common.Type", - "text": "Type" + "section": "def-common.ObjectType", + "text": "ObjectType" }, - "<\"rest\" | undefined>; name: ", + "<{ type: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -78,7 +78,7 @@ "section": "def-common.Type", "text": "Type" }, - "; expiration: ", + "<\"rest\" | undefined>; name: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -86,7 +86,7 @@ "section": "def-common.Type", "text": "Type" }, - "; role_descriptors: ", + "; expiration: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -94,7 +94,7 @@ "section": "def-common.Type", "text": "Type" }, - ">>; metadata: ", + "; metadata: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -102,7 +102,7 @@ "section": "def-common.Type", "text": "Type" }, - " | undefined>; }, { role_descriptors: null; kibana_role_descriptors: ", + " | undefined>; kibana_role_descriptors: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -143,23 +143,15 @@ "label": "getUpdateRestApiKeyWithKibanaPrivilegesSchema", "description": [], "signature": [ - "(getBasePrivilegeNames: () => { global: string[]; space: string[]; }) => ExtendedObjectType<{ type: ", - { - "pluginId": "@kbn/config-schema", - "scope": "common", - "docId": "kibKbnConfigSchemaPluginApi", - "section": "def-common.Type", - "text": "Type" - }, - "<\"rest\" | undefined>; name: ", + "(getBasePrivilegeNames: () => { global: string[]; space: string[]; }) => ", { "pluginId": "@kbn/config-schema", "scope": "common", "docId": "kibKbnConfigSchemaPluginApi", - "section": "def-common.Type", - "text": "Type" + "section": "def-common.ObjectType", + "text": "ObjectType" }, - "; expiration: ", + "<{ type: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -167,7 +159,7 @@ "section": "def-common.Type", "text": "Type" }, - "; role_descriptors: ", + "<\"rest\" | undefined>; expiration: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -175,7 +167,7 @@ "section": "def-common.Type", "text": "Type" }, - ">>; metadata: ", + "; metadata: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -183,7 +175,7 @@ "section": "def-common.Type", "text": "Type" }, - " | undefined>; }, { role_descriptors: null; name: null; id: ", + " | undefined>; id: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -223,6 +215,39 @@ ], "returnComment": [], "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.isCreateRestAPIKeyParams", + "type": "Function", + "tags": [], + "label": "isCreateRestAPIKeyParams", + "description": [], + "signature": [ + "(params: any) => boolean" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.isCreateRestAPIKeyParams.$1", + "type": "Any", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "any" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false } ], "interfaces": [ @@ -536,8 +561,10 @@ "type": "Interface", "tags": [], "label": "APIKeys", - "description": [], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "description": [ + "\nInterface for managing API keys in Elasticsearch, including creation,\nvalidation, and invalidation of API keys,\nas well as checking the status of API key features." + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -553,7 +580,7 @@ "signature": [ "() => Promise" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -571,7 +598,7 @@ "signature": [ "() => Promise" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -597,17 +624,17 @@ }, ", createParams: ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CreateAPIKeyParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateAPIKeyParams", "text": "CreateAPIKeyParams" }, ") => Promise<", "SecurityCreateApiKeyResponse", " | null>" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -630,7 +657,7 @@ }, "" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -646,14 +673,98 @@ ], "signature": [ { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CreateAPIKeyParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateAPIKeyParams", "text": "CreateAPIKeyParams" } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.update", + "type": "Function", + "tags": [], + "label": "update", + "description": [ + "\nAttempts update an API key with the provided 'role_descriptors' and 'metadata'\n\nReturns `updated`, `true` if the update was successful, `false` if there was nothing to update\n\nUser needs `manage_api_key` privilege to update REST API keys and `manage_security` for cross-cluster API keys.\n" + ], + "signature": [ + "(request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + ", updateParams: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateAPIKeyParams", + "text": "UpdateAPIKeyParams" + }, + ") => Promise<", + "SecurityUpdateApiKeyResponse", + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.update.$1", + "type": "Object", + "tags": [], + "label": "request", + "description": [ + "Request instance." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.update.$2", + "type": "CompoundType", + "tags": [], + "label": "updateParams", + "description": [ + "The params to edit an API key" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateAPIKeyParams", + "text": "UpdateAPIKeyParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -679,17 +790,33 @@ "section": "def-common.KibanaRequest", "text": "KibanaRequest" }, - ", createParams: Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { name: string; role_descriptors: Record>; }> | Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { name: string; kibana_role_descriptors: Record | undefined; } & { spaces: string[] | \"*\"[]; }>[]; elasticsearch: Readonly<{ cluster?: string[] | undefined; indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; }>[] | undefined; remote_cluster?: Readonly<{} & { privileges: string[]; clusters: string[]; }>[] | undefined; remote_indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; clusters: string[]; }>[] | undefined; run_as?: string[] | undefined; } & {}>; }>>; }>) => Promise<", + ", createParams: ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.GrantAPIKeyResult", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyParams", + "text": "CreateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams", + "text": "CreateRestAPIKeyWithKibanaPrivilegesParams" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.GrantAPIKeyResult", "text": "GrantAPIKeyResult" }, " | null>" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -712,7 +839,7 @@ }, "" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -727,9 +854,23 @@ "Create operation parameters." ], "signature": [ - "Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { name: string; role_descriptors: Record>; }> | Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { name: string; kibana_role_descriptors: Record | undefined; } & { spaces: string[] | \"*\"[]; }>[]; elasticsearch: Readonly<{ cluster?: string[] | undefined; indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; }>[] | undefined; remote_cluster?: Readonly<{} & { privileges: string[]; clusters: string[]; }>[] | undefined; remote_indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; clusters: string[]; }>[] | undefined; run_as?: string[] | undefined; } & {}>; }>>; }>" + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyParams", + "text": "CreateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams", + "text": "CreateRestAPIKeyWithKibanaPrivilegesParams" + } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -749,15 +890,15 @@ "signature": [ "(apiKeyPrams: ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.ValidateAPIKeyParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.ValidateAPIKeyParams", "text": "ValidateAPIKeyParams" }, ") => Promise" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -772,14 +913,14 @@ ], "signature": [ { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.ValidateAPIKeyParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.ValidateAPIKeyParams", "text": "ValidateAPIKeyParams" } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -807,23 +948,23 @@ }, ", params: ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.InvalidateAPIKeysParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", "text": "InvalidateAPIKeysParams" }, ") => Promise<", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.InvalidateAPIKeyResult", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeyResult", "text": "InvalidateAPIKeyResult" }, " | null>" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -846,7 +987,7 @@ }, "" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -862,14 +1003,14 @@ ], "signature": [ { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.InvalidateAPIKeysParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", "text": "InvalidateAPIKeysParams" } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -889,23 +1030,23 @@ "signature": [ "(params: ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.InvalidateAPIKeysParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", "text": "InvalidateAPIKeysParams" }, ") => Promise<", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.InvalidateAPIKeyResult", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeyResult", "text": "InvalidateAPIKeyResult" }, " | null>" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -920,14 +1061,14 @@ ], "signature": [ { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.InvalidateAPIKeysParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", "text": "InvalidateAPIKeysParams" } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -940,45 +1081,569 @@ }, { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.AppActions", + "id": "def-server.APIKeys", "type": "Interface", "tags": [], - "label": "AppActions", - "description": [], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/actions/app.ts", + "label": "APIKeys", + "description": [ + "\nInterface for managing API keys in Elasticsearch, including creation,\nvalidation, and invalidation of API keys,\nas well as checking the status of API key features." + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.AppActions.get", + "id": "def-server.APIKeys.areAPIKeysEnabled", "type": "Function", "tags": [], - "label": "get", - "description": [], + "label": "areAPIKeysEnabled", + "description": [ + "\nDetermines if API Keys are enabled in Elasticsearch." + ], "signature": [ - "(operation: string) => string" + "() => Promise" ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/actions/app.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.AppActions.get.$1", - "type": "string", - "tags": [], - "label": "operation", - "description": [], - "signature": [ - "string" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/actions/app.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.areCrossClusterAPIKeysEnabled", + "type": "Function", + "tags": [], + "label": "areCrossClusterAPIKeysEnabled", + "description": [ + "\nDetermines if Cross-Cluster API Keys are enabled in Elasticsearch." + ], + "signature": [ + "() => Promise" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [ + "\nTries to create an API key for the current user.\n\nReturns newly created API key or `null` if API keys are disabled.\n\nUser needs `manage_api_key` privilege to create REST API keys and `manage_security` for Cross-Cluster API keys.\n" + ], + "signature": [ + "(request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + ", createParams: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateAPIKeyParams", + "text": "CreateAPIKeyParams" + }, + ") => Promise<", + "SecurityCreateApiKeyResponse", + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.create.$1", + "type": "Object", + "tags": [], + "label": "request", + "description": [ + "Request instance." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.create.$2", + "type": "CompoundType", + "tags": [], + "label": "createParams", + "description": [ + "The params to create an API key" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateAPIKeyParams", + "text": "CreateAPIKeyParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.update", + "type": "Function", + "tags": [], + "label": "update", + "description": [ + "\nAttempts update an API key with the provided 'role_descriptors' and 'metadata'\n\nReturns `updated`, `true` if the update was successful, `false` if there was nothing to update\n\nUser needs `manage_api_key` privilege to update REST API keys and `manage_security` for cross-cluster API keys.\n" + ], + "signature": [ + "(request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + ", updateParams: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateAPIKeyParams", + "text": "UpdateAPIKeyParams" + }, + ") => Promise<", + "SecurityUpdateApiKeyResponse", + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.update.$1", + "type": "Object", + "tags": [], + "label": "request", + "description": [ + "Request instance." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.update.$2", + "type": "CompoundType", + "tags": [], + "label": "updateParams", + "description": [ + "The params to edit an API key" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateAPIKeyParams", + "text": "UpdateAPIKeyParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.grantAsInternalUser", + "type": "Function", + "tags": [], + "label": "grantAsInternalUser", + "description": [ + "\nTries to grant an API key for the current user." + ], + "signature": [ + "(request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + ", createParams: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyParams", + "text": "CreateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams", + "text": "CreateRestAPIKeyWithKibanaPrivilegesParams" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.GrantAPIKeyResult", + "text": "GrantAPIKeyResult" + }, + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.grantAsInternalUser.$1", + "type": "Object", + "tags": [], + "label": "request", + "description": [ + "Request instance." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.grantAsInternalUser.$2", + "type": "CompoundType", + "tags": [], + "label": "createParams", + "description": [ + "Create operation parameters." + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyParams", + "text": "CreateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams", + "text": "CreateRestAPIKeyWithKibanaPrivilegesParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.validate", + "type": "Function", + "tags": [], + "label": "validate", + "description": [ + "\nTries to validate an API key." + ], + "signature": [ + "(apiKeyPrams: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.ValidateAPIKeyParams", + "text": "ValidateAPIKeyParams" + }, + ") => Promise" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.validate.$1", + "type": "Object", + "tags": [], + "label": "apiKeyPrams", + "description": [ + "ValidateAPIKeyParams." + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.ValidateAPIKeyParams", + "text": "ValidateAPIKeyParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.invalidate", + "type": "Function", + "tags": [], + "label": "invalidate", + "description": [ + "\nTries to invalidate an API keys." + ], + "signature": [ + "(request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + ", params: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", + "text": "InvalidateAPIKeysParams" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeyResult", + "text": "InvalidateAPIKeyResult" + }, + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.invalidate.$1", + "type": "Object", + "tags": [], + "label": "request", + "description": [ + "Request instance." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.invalidate.$2", + "type": "Object", + "tags": [], + "label": "params", + "description": [ + "The params to invalidate an API keys." + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", + "text": "InvalidateAPIKeysParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.invalidateAsInternalUser", + "type": "Function", + "tags": [], + "label": "invalidateAsInternalUser", + "description": [ + "\nTries to invalidate the API keys by using the internal user." + ], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", + "text": "InvalidateAPIKeysParams" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeyResult", + "text": "InvalidateAPIKeyResult" + }, + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.APIKeys.invalidateAsInternalUser.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [ + "The params to invalidate the API keys." + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", + "text": "InvalidateAPIKeysParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.AppActions", + "type": "Interface", + "tags": [], + "label": "AppActions", + "description": [], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/actions/app.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.AppActions.get", + "type": "Function", + "tags": [], + "label": "get", + "description": [], + "signature": [ + "(operation: string) => string" + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/actions/app.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.AppActions.get.$1", + "type": "string", + "tags": [], + "label": "operation", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/actions/app.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], "returnComment": [] } ], @@ -1550,10 +2215,10 @@ "description": [], "signature": [ { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.APIKeys", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.APIKeys", "text": "APIKeys" } ], @@ -2169,35 +2834,257 @@ }, { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckPrivileges.globally", + "id": "def-server.CheckPrivileges.globally", + "type": "Function", + "tags": [], + "label": "globally", + "description": [], + "signature": [ + "(privileges: ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.CheckPrivilegesPayload", + "text": "CheckPrivilegesPayload" + }, + ", options?: ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.CheckPrivilegesOptions", + "text": "CheckPrivilegesOptions" + }, + " | undefined) => Promise<", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.CheckPrivilegesResponse", + "text": "CheckPrivilegesResponse" + }, + ">" + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckPrivileges.globally.$1", + "type": "Object", + "tags": [], + "label": "privileges", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.CheckPrivilegesPayload", + "text": "CheckPrivilegesPayload" + } + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckPrivileges.globally.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.CheckPrivilegesOptions", + "text": "CheckPrivilegesOptions" + }, + " | undefined" + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckPrivilegesOptions", + "type": "Interface", + "tags": [], + "label": "CheckPrivilegesOptions", + "description": [ + "\nOptions to influce the privilege checks." + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckPrivilegesOptions.requireLoginAction", + "type": "CompoundType", + "tags": [], + "label": "requireLoginAction", + "description": [ + "\nWhether or not the `login` action should be required (default: true).\nSetting this to false is not advised except for special circumstances, when you do not require\nthe request to belong to a user capable of logging into Kibana." + ], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckPrivilegesPayload", + "type": "Interface", + "tags": [], + "label": "CheckPrivilegesPayload", + "description": [ + "\nPrivileges that can be checked for the Kibana users." + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckPrivilegesPayload.kibana", + "type": "CompoundType", + "tags": [], + "label": "kibana", + "description": [ + "\nA list of the Kibana specific privileges (usually generated with `security.authz.actions.*.get(...)`)." + ], + "signature": [ + "string | string[] | undefined" + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckPrivilegesPayload.elasticsearch", + "type": "Object", + "tags": [], + "label": "elasticsearch", + "description": [ + "\nA set of the Elasticsearch cluster and index privileges." + ], + "signature": [ + "{ cluster: string[]; index: Record; } | undefined" + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckPrivilegesResponse", + "type": "Interface", + "tags": [], + "label": "CheckPrivilegesResponse", + "description": [], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckPrivilegesResponse.hasAllRequested", + "type": "boolean", + "tags": [], + "label": "hasAllRequested", + "description": [], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckPrivilegesResponse.username", + "type": "string", + "tags": [], + "label": "username", + "description": [], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckPrivilegesResponse.privileges", + "type": "Object", + "tags": [], + "label": "privileges", + "description": [], + "signature": [ + "{ kibana: { resource?: string | undefined; privilege: string; authorized: boolean; }[]; elasticsearch: { cluster: { privilege: string; authorized: boolean; }[]; index: { [indexName: string]: { privilege: string; authorized: boolean; }[]; }; }; }" + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckUserProfilesPrivileges", + "type": "Interface", + "tags": [], + "label": "CheckUserProfilesPrivileges", + "description": [ + "\nAn interface to check users profiles privileges in a specific context (only a single-space context is supported at\nthe moment)." + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckUserProfilesPrivileges.atSpace", "type": "Function", "tags": [], - "label": "globally", + "label": "atSpace", "description": [], "signature": [ - "(privileges: ", - { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CheckPrivilegesPayload", - "text": "CheckPrivilegesPayload" - }, - ", options?: ", + "(spaceId: string, privileges: ", { "pluginId": "@kbn/security-plugin-types-server", "scope": "server", "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CheckPrivilegesOptions", - "text": "CheckPrivilegesOptions" + "section": "def-server.CheckUserProfilesPrivilegesPayload", + "text": "CheckUserProfilesPrivilegesPayload" }, - " | undefined) => Promise<", + ") => Promise<", { "pluginId": "@kbn/security-plugin-types-server", "scope": "server", "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CheckPrivilegesResponse", - "text": "CheckPrivilegesResponse" + "section": "def-server.CheckUserProfilesPrivilegesResponse", + "text": "CheckUserProfilesPrivilegesResponse" }, ">" ], @@ -2207,19 +3094,13 @@ "children": [ { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckPrivileges.globally.$1", - "type": "Object", + "id": "def-server.CheckUserProfilesPrivileges.atSpace.$1", + "type": "string", "tags": [], - "label": "privileges", + "label": "spaceId", "description": [], "signature": [ - { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CheckPrivilegesPayload", - "text": "CheckPrivilegesPayload" - } + "string" ], "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", "deprecated": false, @@ -2228,25 +3109,24 @@ }, { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckPrivileges.globally.$2", + "id": "def-server.CheckUserProfilesPrivileges.atSpace.$2", "type": "Object", "tags": [], - "label": "options", + "label": "privileges", "description": [], "signature": [ { "pluginId": "@kbn/security-plugin-types-server", "scope": "server", "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CheckPrivilegesOptions", - "text": "CheckPrivilegesOptions" - }, - " | undefined" + "section": "def-server.CheckUserProfilesPrivilegesPayload", + "text": "CheckUserProfilesPrivilegesPayload" + } ], "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -2256,12 +3136,12 @@ }, { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckPrivilegesOptions", + "id": "def-server.CheckUserProfilesPrivilegesPayload", "type": "Interface", "tags": [], - "label": "CheckPrivilegesOptions", + "label": "CheckUserProfilesPrivilegesPayload", "description": [ - "\nOptions to influce the privilege checks." + "\nPrivileges that can be checked for the users profiles (only Kibana specific privileges are supported at the moment)." ], "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", "deprecated": false, @@ -2269,65 +3149,227 @@ "children": [ { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckPrivilegesOptions.requireLoginAction", - "type": "CompoundType", + "id": "def-server.CheckUserProfilesPrivilegesPayload.kibana", + "type": "Array", "tags": [], - "label": "requireLoginAction", + "label": "kibana", "description": [ - "\nWhether or not the `login` action should be required (default: true).\nSetting this to false is not advised except for special circumstances, when you do not require\nthe request to belong to a user capable of logging into Kibana." + "\nA list of the Kibana specific privileges (usually generated with `security.authz.actions.*.get(...)`)." ], "signature": [ - "boolean | undefined" + "string[]" + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckUserProfilesPrivilegesResponse", + "type": "Interface", + "tags": [], + "label": "CheckUserProfilesPrivilegesResponse", + "description": [ + "\nResponse of the check privileges operation for the users profiles." + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckUserProfilesPrivilegesResponse.hasPrivilegeUids", + "type": "Array", + "tags": [], + "label": "hasPrivilegeUids", + "description": [ + "\nThe subset of the requested profile IDs of the users that have all the requested privileges." + ], + "signature": [ + "string[]" + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CheckUserProfilesPrivilegesResponse.errors", + "type": "Object", + "tags": [], + "label": "errors", + "description": [ + "\nAn errors object that may be returned from ES that contains a `count` of UIDs that have errors in the `details` property.\n\nEach entry in `details` will contain an error `type`, e.g 'resource_not_found_exception', and a `reason` message, e.g. 'profile document not found'" + ], + "signature": [ + "{ count: number; details: Record; } | undefined" ], "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", "deprecated": false, "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckPrivilegesPayload", - "type": "Interface", - "tags": [], - "label": "CheckPrivilegesPayload", - "description": [ - "\nPrivileges that can be checked for the Kibana users." - ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CreateCrossClusterAPIKeyParams", + "type": "Interface", + "tags": [], + "label": "CreateCrossClusterAPIKeyParams", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CreateCrossClusterAPIKeyParams.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"cross_cluster\"" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CreateCrossClusterAPIKeyParams.expiration", + "type": "string", + "tags": [], + "label": "expiration", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CreateCrossClusterAPIKeyParams.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CreateCrossClusterAPIKeyParams.metadata", + "type": "Object", + "tags": [], + "label": "metadata", + "description": [], + "signature": [ + "{ [key: string]: any; } | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CreateCrossClusterAPIKeyParams.access", + "type": "Object", + "tags": [], + "label": "access", + "description": [], + "signature": [ + "{ search?: { names: string[]; query?: unknown; field_security?: unknown; allow_restricted_indices?: boolean | undefined; }[] | undefined; replication?: { names: string[]; }[] | undefined; }" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CreateRestAPIKeyParams", + "type": "Interface", + "tags": [], + "label": "CreateRestAPIKeyParams", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CreateRestAPIKeyParams.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"rest\" | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CreateRestAPIKeyParams.expiration", + "type": "string", + "tags": [], + "label": "expiration", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CreateRestAPIKeyParams.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckPrivilegesPayload.kibana", - "type": "CompoundType", + "id": "def-server.CreateRestAPIKeyParams.role_descriptors", + "type": "Object", "tags": [], - "label": "kibana", - "description": [ - "\nA list of the Kibana specific privileges (usually generated with `security.authz.actions.*.get(...)`)." - ], + "label": "role_descriptors", + "description": [], "signature": [ - "string | string[] | undefined" + "{ [x: string]: { [key: string]: any; }; }" ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckPrivilegesPayload.elasticsearch", + "id": "def-server.CreateRestAPIKeyParams.metadata", "type": "Object", "tags": [], - "label": "elasticsearch", - "description": [ - "\nA set of the Elasticsearch cluster and index privileges." - ], + "label": "metadata", + "description": [], "signature": [ - "{ cluster: string[]; index: Record; } | undefined" + "{ [key: string]: any; } | undefined" ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -2336,213 +3378,181 @@ }, { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckPrivilegesResponse", + "id": "def-server.CreateRestAPIKeyWithKibanaPrivilegesParams", "type": "Interface", "tags": [], - "label": "CheckPrivilegesResponse", + "label": "CreateRestAPIKeyWithKibanaPrivilegesParams", "description": [], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckPrivilegesResponse.hasAllRequested", - "type": "boolean", + "id": "def-server.CreateRestAPIKeyWithKibanaPrivilegesParams.type", + "type": "string", "tags": [], - "label": "hasAllRequested", + "label": "type", "description": [], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "signature": [ + "\"rest\" | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckPrivilegesResponse.username", + "id": "def-server.CreateRestAPIKeyWithKibanaPrivilegesParams.expiration", "type": "string", "tags": [], - "label": "username", + "label": "expiration", "description": [], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckPrivilegesResponse.privileges", + "id": "def-server.CreateRestAPIKeyWithKibanaPrivilegesParams.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.CreateRestAPIKeyWithKibanaPrivilegesParams.metadata", "type": "Object", "tags": [], - "label": "privileges", + "label": "metadata", "description": [], "signature": [ - "{ kibana: { resource?: string | undefined; privilege: string; authorized: boolean; }[]; elasticsearch: { cluster: { privilege: string; authorized: boolean; }[]; index: { [indexName: string]: { privilege: string; authorized: boolean; }[]; }; }; }" + "{ [key: string]: any; } | undefined" ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckUserProfilesPrivileges", - "type": "Interface", - "tags": [], - "label": "CheckUserProfilesPrivileges", - "description": [ - "\nAn interface to check users profiles privileges in a specific context (only a single-space context is supported at\nthe moment)." - ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + }, { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckUserProfilesPrivileges.atSpace", - "type": "Function", + "id": "def-server.CreateRestAPIKeyWithKibanaPrivilegesParams.kibana_role_descriptors", + "type": "Object", "tags": [], - "label": "atSpace", + "label": "kibana_role_descriptors", "description": [], "signature": [ - "(spaceId: string, privileges: ", + "{ [x: string]: { elasticsearch: ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CheckUserProfilesPrivilegesPayload", - "text": "CheckUserProfilesPrivilegesPayload" + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.ElasticsearchPrivilegesType", + "text": "ElasticsearchPrivilegesType" }, - ") => Promise<", + " & { [key: string]: unknown; }; kibana: ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CheckUserProfilesPrivilegesResponse", - "text": "CheckUserProfilesPrivilegesResponse" + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.KibanaPrivilegesType", + "text": "KibanaPrivilegesType" }, - ">" + "; }; }" ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckUserProfilesPrivileges.atSpace.$1", - "type": "string", - "tags": [], - "label": "spaceId", - "description": [], - "signature": [ - "string" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckUserProfilesPrivileges.atSpace.$2", - "type": "Object", - "tags": [], - "label": "privileges", - "description": [], - "signature": [ - { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CheckUserProfilesPrivilegesPayload", - "text": "CheckUserProfilesPrivilegesPayload" - } - ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] + "trackAdoption": false } ], "initialIsOpen": false }, { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckUserProfilesPrivilegesPayload", + "id": "def-server.ElasticsearchPrivilegesType", "type": "Interface", "tags": [], - "label": "CheckUserProfilesPrivilegesPayload", + "label": "ElasticsearchPrivilegesType", "description": [ - "\nPrivileges that can be checked for the users profiles (only Kibana specific privileges are supported at the moment)." + "\nType representing Elasticsearch specific portion of the role definition." ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "path": "packages/core/security/core-security-server/src/roles/schema.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckUserProfilesPrivilegesPayload.kibana", + "id": "def-server.ElasticsearchPrivilegesType.cluster", "type": "Array", "tags": [], - "label": "kibana", - "description": [ - "\nA list of the Kibana specific privileges (usually generated with `security.authz.actions.*.get(...)`)." - ], + "label": "cluster", + "description": [], "signature": [ - "string[]" + "string[] | undefined" ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "path": "packages/core/security/core-security-server/src/roles/schema.ts", "deprecated": false, "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckUserProfilesPrivilegesResponse", - "type": "Interface", - "tags": [], - "label": "CheckUserProfilesPrivilegesResponse", - "description": [ - "\nResponse of the check privileges operation for the users profiles." - ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + }, { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckUserProfilesPrivilegesResponse.hasPrivilegeUids", + "id": "def-server.ElasticsearchPrivilegesType.remote_cluster", "type": "Array", "tags": [], - "label": "hasPrivilegeUids", - "description": [ - "\nThe subset of the requested profile IDs of the users that have all the requested privileges." + "label": "remote_cluster", + "description": [], + "signature": [ + "{ privileges: string[]; clusters: string[]; }[] | undefined" ], + "path": "packages/core/security/core-security-server/src/roles/schema.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.ElasticsearchPrivilegesType.indices", + "type": "Array", + "tags": [], + "label": "indices", + "description": [], "signature": [ - "string[]" + "{ names: string[]; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; privileges: string[]; query?: string | undefined; allow_restricted_indices?: boolean | undefined; }[] | undefined" ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "path": "packages/core/security/core-security-server/src/roles/schema.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CheckUserProfilesPrivilegesResponse.errors", - "type": "Object", + "id": "def-server.ElasticsearchPrivilegesType.remote_indices", + "type": "Array", "tags": [], - "label": "errors", - "description": [ - "\nAn errors object that may be returned from ES that contains a `count` of UIDs that have errors in the `details` property.\n\nEach entry in `details` will contain an error `type`, e.g 'resource_not_found_exception', and a `reason` message, e.g. 'profile document not found'" + "label": "remote_indices", + "description": [], + "signature": [ + "{ clusters: string[]; names: string[]; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; privileges: string[]; query?: string | undefined; allow_restricted_indices?: boolean | undefined; }[] | undefined" ], + "path": "packages/core/security/core-security-server/src/roles/schema.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.ElasticsearchPrivilegesType.run_as", + "type": "Array", + "tags": [], + "label": "run_as", + "description": [], "signature": [ - "{ count: number; details: Record; } | undefined" + "string[] | undefined" ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/check_privileges.ts", + "path": "packages/core/security/core-security-server/src/roles/schema.ts", "deprecated": false, "trackAdoption": false } @@ -2556,7 +3566,7 @@ "tags": [], "label": "GrantAPIKeyResult", "description": [], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2569,7 +3579,7 @@ "description": [ "\nUnique id for this API key" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, @@ -2582,7 +3592,7 @@ "description": [ "\nName for this API key" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, @@ -2595,7 +3605,7 @@ "description": [ "\nGenerated API key" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -2725,7 +3735,7 @@ "description": [ "\nThe return value when invalidating an API key in Elasticsearch." ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2741,7 +3751,7 @@ "signature": [ "string[]" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, @@ -2757,7 +3767,7 @@ "signature": [ "string[]" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, @@ -2770,7 +3780,7 @@ "description": [ "\nThe number of errors that were encountered when invalidating the API keys." ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, @@ -2786,7 +3796,7 @@ "signature": [ "{ type?: string | undefined; reason?: string | undefined; caused_by?: { type?: string | undefined; reason?: string | undefined; } | undefined; }[] | undefined" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -2802,7 +3812,7 @@ "description": [ "\nRepresents the params for invalidating multiple API keys" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2812,11 +3822,13 @@ "type": "Array", "tags": [], "label": "ids", - "description": [], + "description": [ + "\nList of unique API key IDs" + ], "signature": [ "string[]" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -3277,32 +4289,8 @@ "path": "x-pack/plugins/enterprise_search/server/lib/indices/create_api_key.ts" }, { - "plugin": "enterpriseSearch", - "path": "x-pack/plugins/enterprise_search/server/routes/enterprise_search/api_keys.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "plugin": "enterpriseSearch", + "path": "x-pack/plugins/enterprise_search/server/routes/enterprise_search/api_keys.ts" }, { "plugin": "serverlessSearch", @@ -3403,30 +4391,6 @@ { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/routes/setup/handlers.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/list.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/state.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/suggestions/index.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts" } ] }, @@ -3543,65 +4507,324 @@ "children": [ { "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.UIActions.get", - "type": "Function", + "id": "def-server.UIActions.get", + "type": "Function", + "tags": [], + "label": "get", + "description": [], + "signature": [ + "(featureId: keyof ", + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + }, + ", ...uiCapabilityParts: string[]) => string" + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/actions/ui.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UIActions.get.$1", + "type": "CompoundType", + "tags": [], + "label": "featureId", + "description": [], + "signature": [ + "keyof ", + { + "pluginId": "@kbn/core-capabilities-common", + "scope": "common", + "docId": "kibKbnCoreCapabilitiesCommonPluginApi", + "section": "def-common.Capabilities", + "text": "Capabilities" + } + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/actions/ui.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UIActions.get.$2", + "type": "Array", + "tags": [], + "label": "uiCapabilityParts", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/actions/ui.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateCrossClusterAPIKeyParams", + "type": "Interface", + "tags": [], + "label": "UpdateCrossClusterAPIKeyParams", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateCrossClusterAPIKeyParams.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateCrossClusterAPIKeyParams.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"cross_cluster\"" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateCrossClusterAPIKeyParams.expiration", + "type": "string", + "tags": [], + "label": "expiration", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateCrossClusterAPIKeyParams.metadata", + "type": "Object", + "tags": [], + "label": "metadata", + "description": [], + "signature": [ + "{ [key: string]: any; } | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateCrossClusterAPIKeyParams.access", + "type": "Object", + "tags": [], + "label": "access", + "description": [], + "signature": [ + "{ search?: { names: string[]; query?: unknown; field_security?: unknown; allow_restricted_indices?: boolean | undefined; }[] | undefined; replication?: { names: string[]; }[] | undefined; }" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateRestAPIKeyParams", + "type": "Interface", + "tags": [], + "label": "UpdateRestAPIKeyParams", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateRestAPIKeyParams.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateRestAPIKeyParams.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"rest\" | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateRestAPIKeyParams.expiration", + "type": "string", + "tags": [], + "label": "expiration", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateRestAPIKeyParams.role_descriptors", + "type": "Object", + "tags": [], + "label": "role_descriptors", + "description": [], + "signature": [ + "{ [x: string]: { [key: string]: unknown; }; }" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateRestAPIKeyParams.metadata", + "type": "Object", + "tags": [], + "label": "metadata", + "description": [], + "signature": [ + "{ [key: string]: any; } | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateRestAPIKeyWithKibanaPrivilegesParams", + "type": "Interface", + "tags": [], + "label": "UpdateRestAPIKeyWithKibanaPrivilegesParams", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateRestAPIKeyWithKibanaPrivilegesParams.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateRestAPIKeyWithKibanaPrivilegesParams.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"rest\" | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateRestAPIKeyWithKibanaPrivilegesParams.expiration", + "type": "string", + "tags": [], + "label": "expiration", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateRestAPIKeyWithKibanaPrivilegesParams.metadata", + "type": "Object", + "tags": [], + "label": "metadata", + "description": [], + "signature": [ + "{ [key: string]: any; } | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.UpdateRestAPIKeyWithKibanaPrivilegesParams.kibana_role_descriptors", + "type": "Object", "tags": [], - "label": "get", + "label": "kibana_role_descriptors", "description": [], "signature": [ - "(featureId: keyof ", + "{ [x: string]: { elasticsearch: ", { - "pluginId": "@kbn/core-capabilities-common", + "pluginId": "@kbn/core-security-server", "scope": "common", - "docId": "kibKbnCoreCapabilitiesCommonPluginApi", - "section": "def-common.Capabilities", - "text": "Capabilities" + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.ElasticsearchPrivilegesType", + "text": "ElasticsearchPrivilegesType" }, - ", ...uiCapabilityParts: string[]) => string" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/actions/ui.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + " & { [key: string]: unknown; }; kibana: ", { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.UIActions.get.$1", - "type": "CompoundType", - "tags": [], - "label": "featureId", - "description": [], - "signature": [ - "keyof ", - { - "pluginId": "@kbn/core-capabilities-common", - "scope": "common", - "docId": "kibKbnCoreCapabilitiesCommonPluginApi", - "section": "def-common.Capabilities", - "text": "Capabilities" - } - ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/actions/ui.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.KibanaPrivilegesType", + "text": "KibanaPrivilegesType" }, - { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.UIActions.get.$2", - "type": "Array", - "tags": [], - "label": "uiCapabilityParts", - "description": [], - "signature": [ - "string[]" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/actions/ui.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } + "; }; }" ], - "returnComment": [] + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -3866,7 +5089,7 @@ "description": [ "\nRepresents the parameters for validating API Key credentials." ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3879,7 +5102,7 @@ "description": [ "\nUnique id for this API key" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, @@ -3892,7 +5115,7 @@ "description": [ "\nGenerated API Key (secret)" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -4209,9 +5432,31 @@ "label": "CreateAPIKeyParams", "description": [], "signature": [ - "Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { name: string; role_descriptors: Record>; }> | Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { name: string; kibana_role_descriptors: Record | undefined; } & { spaces: string[] | \"*\"[]; }>[]; elasticsearch: Readonly<{ cluster?: string[] | undefined; indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; }>[] | undefined; remote_cluster?: Readonly<{} & { privileges: string[]; clusters: string[]; }>[] | undefined; remote_indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; clusters: string[]; }>[] | undefined; run_as?: string[] | undefined; } & {}>; }>>; }> | Readonly<{ metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { type: \"cross_cluster\"; name: string; access: Readonly<{ search?: Readonly<{ query?: any; field_security?: any; allow_restricted_indices?: boolean | undefined; } & { names: string[]; }>[] | undefined; replication?: Readonly<{} & { names: string[]; }>[] | undefined; } & {}>; }>" + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyParams", + "text": "CreateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams", + "text": "CreateRestAPIKeyWithKibanaPrivilegesParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateCrossClusterAPIKeyParams", + "text": "CreateCrossClusterAPIKeyParams" + } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4228,67 +5473,7 @@ "signature": [ "SecurityCreateApiKeyResponse" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CreateCrossClusterAPIKeyParams", - "type": "Type", - "tags": [], - "label": "CreateCrossClusterAPIKeyParams", - "description": [], - "signature": [ - "{ readonly metadata?: Readonly<{} & {}> | undefined; readonly expiration?: string | undefined; readonly type: \"cross_cluster\"; readonly name: string; readonly access: Readonly<{ search?: Readonly<{ query?: any; field_security?: any; allow_restricted_indices?: boolean | undefined; } & { names: string[]; }>[] | undefined; replication?: Readonly<{} & { names: string[]; }>[] | undefined; } & {}>; }" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CreateRestAPIKeyParams", - "type": "Type", - "tags": [], - "label": "CreateRestAPIKeyParams", - "description": [], - "signature": [ - "{ readonly type?: \"rest\" | undefined; readonly metadata?: Readonly<{} & {}> | undefined; readonly expiration?: string | undefined; readonly name: string; readonly role_descriptors: Record>; }" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.CreateRestAPIKeyWithKibanaPrivilegesParams", - "type": "Type", - "tags": [], - "label": "CreateRestAPIKeyWithKibanaPrivilegesParams", - "description": [], - "signature": [ - "{ readonly type?: \"rest\" | undefined; readonly metadata?: Readonly<{} & {}> | undefined; readonly expiration?: string | undefined; readonly name: string; readonly kibana_role_descriptors: Record | undefined; } & { spaces: string[] | \"*\"[]; }>[]; elasticsearch: Readonly<{ cluster?: string[] | undefined; indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; }>[] | undefined; remote_cluster?: Readonly<{} & { privileges: string[]; clusters: string[]; }>[] | undefined; remote_indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; clusters: string[]; }>[] | undefined; run_as?: string[] | undefined; } & {}>; }>>; }" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.ElasticsearchPrivilegesType", - "type": "Type", - "tags": [], - "label": "ElasticsearchPrivilegesType", - "description": [], - "signature": [ - "{ readonly cluster?: string[] | undefined; readonly indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; }>[] | undefined; readonly remote_cluster?: Readonly<{} & { privileges: string[]; clusters: string[]; }>[] | undefined; readonly remote_indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; clusters: string[]; }>[] | undefined; readonly run_as?: string[] | undefined; }" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/role_schema.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4314,11 +5499,13 @@ "type": "Type", "tags": [], "label": "KibanaPrivilegesType", - "description": [], + "description": [ + "\nType representing Kibana specific portion of the role definition." + ], "signature": [ - "Readonly<{ base?: string[] | undefined; feature?: Record | undefined; } & { spaces: string[] | \"*\"[]; }>[]" + "{ spaces: string[]; base?: string[] | undefined; feature?: Record | undefined; }[]" ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/role_schema.ts", + "path": "packages/core/security/core-security-server/src/roles/schema.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4333,9 +5520,31 @@ "\nRequest body of Kibana Update API key endpoint." ], "signature": [ - "Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { id: string; role_descriptors: Record>; }> | Readonly<{ metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { id: string; type: \"cross_cluster\"; access: Readonly<{ search?: Readonly<{ query?: any; field_security?: any; allow_restricted_indices?: boolean | undefined; } & { names: string[]; }>[] | undefined; replication?: Readonly<{} & { names: string[]; }>[] | undefined; } & {}>; }> | Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { id: string; kibana_role_descriptors: Record | undefined; } & { spaces: string[] | \"*\"[]; }>[]; elasticsearch: Readonly<{ cluster?: string[] | undefined; indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; }>[] | undefined; remote_cluster?: Readonly<{} & { privileges: string[]; clusters: string[]; }>[] | undefined; remote_indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; clusters: string[]; }>[] | undefined; run_as?: string[] | undefined; } & {}>; }>>; }>" + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateRestAPIKeyParams", + "text": "UpdateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateCrossClusterAPIKeyParams", + "text": "UpdateCrossClusterAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateRestAPIKeyWithKibanaPrivilegesParams", + "text": "UpdateRestAPIKeyWithKibanaPrivilegesParams" + } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4352,52 +5561,7 @@ "signature": [ "SecurityUpdateApiKeyResponse" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.UpdateCrossClusterAPIKeyParams", - "type": "Type", - "tags": [], - "label": "UpdateCrossClusterAPIKeyParams", - "description": [], - "signature": [ - "{ readonly metadata?: Readonly<{} & {}> | undefined; readonly expiration?: string | undefined; readonly id: string; readonly type: \"cross_cluster\"; readonly access: Readonly<{ search?: Readonly<{ query?: any; field_security?: any; allow_restricted_indices?: boolean | undefined; } & { names: string[]; }>[] | undefined; replication?: Readonly<{} & { names: string[]; }>[] | undefined; } & {}>; }" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.UpdateRestAPIKeyParams", - "type": "Type", - "tags": [], - "label": "UpdateRestAPIKeyParams", - "description": [], - "signature": [ - "{ readonly type?: \"rest\" | undefined; readonly metadata?: Readonly<{} & {}> | undefined; readonly expiration?: string | undefined; readonly id: string; readonly role_descriptors: Record>; }" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/security-plugin-types-server", - "id": "def-server.UpdateRestAPIKeyWithKibanaPrivilegesParams", - "type": "Type", - "tags": [], - "label": "UpdateRestAPIKeyWithKibanaPrivilegesParams", - "description": [], - "signature": [ - "{ readonly type?: \"rest\" | undefined; readonly metadata?: Readonly<{} & {}> | undefined; readonly expiration?: string | undefined; readonly id: string; readonly kibana_role_descriptors: Record | undefined; } & { spaces: string[] | \"*\"[]; }>[]; elasticsearch: Readonly<{ cluster?: string[] | undefined; indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; }>[] | undefined; remote_cluster?: Readonly<{} & { privileges: string[]; clusters: string[]; }>[] | undefined; remote_indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; clusters: string[]; }>[] | undefined; run_as?: string[] | undefined; } & {}>; }>>; }" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4442,7 +5606,7 @@ "section": "def-common.ObjectType", "text": "ObjectType" }, - "; name: ", + "<\"cross_cluster\">; name: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -4466,23 +5630,7 @@ "section": "def-common.Type", "text": "Type" }, - "; role_descriptors: ", - { - "pluginId": "@kbn/config-schema", - "scope": "common", - "docId": "kibKbnConfigSchemaPluginApi", - "section": "def-common.Type", - "text": "Type" - }, - ">>; metadata: ", - { - "pluginId": "@kbn/config-schema", - "scope": "common", - "docId": "kibKbnConfigSchemaPluginApi", - "section": "def-common.Type", - "text": "Type" - }, - " | undefined>; }, { type: ", + "; metadata: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -4490,7 +5638,7 @@ "section": "def-common.Type", "text": "Type" }, - "<\"cross_cluster\">; role_descriptors: null; access: ", + " | undefined>; access: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -4514,7 +5662,7 @@ "section": "def-common.Type", "text": "Type" }, - "[] | undefined>; }>; }>>" + "[] | undefined>; }>; }>" ], "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", "deprecated": false, @@ -4662,23 +5810,7 @@ "section": "def-common.ObjectType", "text": "ObjectType" }, - "; name: ", - { - "pluginId": "@kbn/config-schema", - "scope": "common", - "docId": "kibKbnConfigSchemaPluginApi", - "section": "def-common.Type", - "text": "Type" - }, - "; expiration: ", + "<{ id: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -4686,7 +5818,7 @@ "section": "def-common.Type", "text": "Type" }, - "; role_descriptors: ", + "; type: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -4694,7 +5826,7 @@ "section": "def-common.Type", "text": "Type" }, - ">>; metadata: ", + "<\"cross_cluster\">; expiration: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -4702,7 +5834,7 @@ "section": "def-common.Type", "text": "Type" }, - " | undefined>; }, { type: ", + "; metadata: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -4710,7 +5842,7 @@ "section": "def-common.Type", "text": "Type" }, - "<\"cross_cluster\">; role_descriptors: null; access: ", + " | undefined>; access: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -4734,15 +5866,7 @@ "section": "def-common.Type", "text": "Type" }, - "[] | undefined>; }>; }>, { name: null; id: ", - { - "pluginId": "@kbn/config-schema", - "scope": "common", - "docId": "kibKbnConfigSchemaPluginApi", - "section": "def-common.Type", - "text": "Type" - }, - "; }>>" + "[] | undefined>; }>; }>" ], "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", "deprecated": false, @@ -4764,7 +5888,7 @@ "section": "def-common.ObjectType", "text": "ObjectType" }, - "; name: ", + "; type: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -4780,7 +5904,7 @@ "section": "def-common.Type", "text": "Type" }, - "; expiration: ", + "<\"rest\" | undefined>; expiration: ", { "pluginId": "@kbn/config-schema", "scope": "common", @@ -4804,15 +5928,7 @@ "section": "def-common.Type", "text": "Type" }, - " | undefined>; }, { name: null; id: ", - { - "pluginId": "@kbn/config-schema", - "scope": "common", - "docId": "kibKbnConfigSchemaPluginApi", - "section": "def-common.Type", - "text": "Type" - }, - "; }>>" + " | undefined>; }>" ], "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", "deprecated": false, diff --git a/api_docs/kbn_security_plugin_types_server.mdx b/api_docs/kbn_security_plugin_types_server.mdx index 8ff72147e8d3a..3e7061f677932 100644 --- a/api_docs/kbn_security_plugin_types_server.mdx +++ b/api_docs/kbn_security_plugin_types_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-plugin-types-server title: "@kbn/security-plugin-types-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-plugin-types-server plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-server'] --- import kbnSecurityPluginTypesServerObj from './kbn_security_plugin_types_server.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 216 | 0 | 121 | 0 | +| 275 | 1 | 154 | 0 | ## Server diff --git a/api_docs/kbn_security_solution_features.mdx b/api_docs/kbn_security_solution_features.mdx index 152d223011906..dfbe39ed26008 100644 --- a/api_docs/kbn_security_solution_features.mdx +++ b/api_docs/kbn_security_solution_features.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-features title: "@kbn/security-solution-features" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-features plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-features'] --- import kbnSecuritySolutionFeaturesObj from './kbn_security_solution_features.devdocs.json'; diff --git a/api_docs/kbn_security_solution_navigation.mdx b/api_docs/kbn_security_solution_navigation.mdx index 6e31397905d62..1c82c1fb5fab6 100644 --- a/api_docs/kbn_security_solution_navigation.mdx +++ b/api_docs/kbn_security_solution_navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-navigation title: "@kbn/security-solution-navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-navigation plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-navigation'] --- import kbnSecuritySolutionNavigationObj from './kbn_security_solution_navigation.devdocs.json'; diff --git a/api_docs/kbn_security_solution_side_nav.mdx b/api_docs/kbn_security_solution_side_nav.mdx index 47d138031a171..96abbad087170 100644 --- a/api_docs/kbn_security_solution_side_nav.mdx +++ b/api_docs/kbn_security_solution_side_nav.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-side-nav title: "@kbn/security-solution-side-nav" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-side-nav plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-side-nav'] --- import kbnSecuritySolutionSideNavObj from './kbn_security_solution_side_nav.devdocs.json'; diff --git a/api_docs/kbn_security_solution_storybook_config.mdx b/api_docs/kbn_security_solution_storybook_config.mdx index 479ada4dffb16..7e64d4df30fde 100644 --- a/api_docs/kbn_security_solution_storybook_config.mdx +++ b/api_docs/kbn_security_solution_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-storybook-config title: "@kbn/security-solution-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-storybook-config plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-storybook-config'] --- import kbnSecuritySolutionStorybookConfigObj from './kbn_security_solution_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index d337ec8da2f90..2cc69fe03cf35 100644 --- a/api_docs/kbn_securitysolution_autocomplete.mdx +++ b/api_docs/kbn_securitysolution_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-autocomplete title: "@kbn/securitysolution-autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-autocomplete plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-autocomplete'] --- import kbnSecuritysolutionAutocompleteObj from './kbn_securitysolution_autocomplete.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_data_table.mdx b/api_docs/kbn_securitysolution_data_table.mdx index 3b5a0950ac1b7..f5ddcbbdec00f 100644 --- a/api_docs/kbn_securitysolution_data_table.mdx +++ b/api_docs/kbn_securitysolution_data_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-data-table title: "@kbn/securitysolution-data-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-data-table plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-data-table'] --- import kbnSecuritysolutionDataTableObj from './kbn_securitysolution_data_table.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_ecs.mdx b/api_docs/kbn_securitysolution_ecs.mdx index a0d3c010a7838..0d015da9e8c91 100644 --- a/api_docs/kbn_securitysolution_ecs.mdx +++ b/api_docs/kbn_securitysolution_ecs.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-ecs title: "@kbn/securitysolution-ecs" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-ecs plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-ecs'] --- import kbnSecuritysolutionEcsObj from './kbn_securitysolution_ecs.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index 1aef92127570f..c4d3ed200cb01 100644 --- a/api_docs/kbn_securitysolution_es_utils.mdx +++ b/api_docs/kbn_securitysolution_es_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-es-utils title: "@kbn/securitysolution-es-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-es-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-es-utils'] --- import kbnSecuritysolutionEsUtilsObj from './kbn_securitysolution_es_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_exception_list_components.devdocs.json b/api_docs/kbn_securitysolution_exception_list_components.devdocs.json index 40dc8909e03ed..7d1c51ca40ea9 100644 --- a/api_docs/kbn_securitysolution_exception_list_components.devdocs.json +++ b/api_docs/kbn_securitysolution_exception_list_components.devdocs.json @@ -851,7 +851,7 @@ "label": "formattedDateComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"main\" | \"path\" | \"form\" | \"body\" | \"q\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"stop\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"html\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"line\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" + "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"main\" | \"path\" | \"form\" | \"body\" | \"html\" | \"stop\" | \"q\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"line\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx", "deprecated": false, @@ -865,7 +865,7 @@ "label": "securityLinkAnchorComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"main\" | \"path\" | \"form\" | \"body\" | \"q\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"stop\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"html\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"line\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" + "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"main\" | \"path\" | \"form\" | \"body\" | \"html\" | \"stop\" | \"q\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"line\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx", "deprecated": false, @@ -1004,7 +1004,7 @@ "label": "securityLinkAnchorComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"main\" | \"path\" | \"form\" | \"body\" | \"q\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"stop\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"html\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"line\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" + "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"main\" | \"path\" | \"form\" | \"body\" | \"html\" | \"stop\" | \"q\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"line\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx", "deprecated": false, @@ -1018,7 +1018,7 @@ "label": "formattedDateComponent", "description": [], "signature": [ - "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"main\" | \"path\" | \"form\" | \"body\" | \"q\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"stop\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"html\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"line\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" + "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"main\" | \"path\" | \"form\" | \"body\" | \"html\" | \"stop\" | \"q\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"line\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx", "deprecated": false, @@ -1144,7 +1144,7 @@ "label": "showValueListModal", "description": [], "signature": [ - "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"main\" | \"path\" | \"form\" | \"body\" | \"q\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"stop\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"html\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"line\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" + "\"symbol\" | \"object\" | \"source\" | \"meta\" | \"desc\" | \"filter\" | \"big\" | \"link\" | \"small\" | \"sub\" | \"sup\" | \"text\" | \"map\" | \"head\" | \"slot\" | \"style\" | \"title\" | \"data\" | \"pattern\" | \"summary\" | \"template\" | \"span\" | \"main\" | \"path\" | \"form\" | \"body\" | \"html\" | \"stop\" | \"q\" | \"label\" | \"progress\" | \"article\" | \"image\" | \"menu\" | \"base\" | React.ComponentType | \"s\" | \"legend\" | \"canvas\" | \"svg\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"select\" | \"output\" | \"script\" | \"time\" | \"mask\" | \"input\" | \"table\" | \"a\" | \"abbr\" | \"address\" | \"area\" | \"aside\" | \"audio\" | \"b\" | \"bdi\" | \"bdo\" | \"blockquote\" | \"br\" | \"button\" | \"caption\" | \"cite\" | \"code\" | \"col\" | \"colgroup\" | \"datalist\" | \"dd\" | \"del\" | \"details\" | \"dfn\" | \"dialog\" | \"div\" | \"dl\" | \"dt\" | \"em\" | \"embed\" | \"fieldset\" | \"figcaption\" | \"figure\" | \"footer\" | \"header\" | \"hgroup\" | \"hr\" | \"i\" | \"iframe\" | \"img\" | \"ins\" | \"kbd\" | \"keygen\" | \"li\" | \"mark\" | \"menuitem\" | \"meter\" | \"nav\" | \"noindex\" | \"noscript\" | \"ol\" | \"optgroup\" | \"option\" | \"param\" | \"picture\" | \"pre\" | \"rp\" | \"rt\" | \"ruby\" | \"samp\" | \"section\" | \"strong\" | \"tbody\" | \"td\" | \"textarea\" | \"tfoot\" | \"th\" | \"thead\" | \"tr\" | \"track\" | \"u\" | \"ul\" | \"var\" | \"video\" | \"wbr\" | \"webview\" | \"animate\" | \"animateMotion\" | \"animateTransform\" | \"circle\" | \"clipPath\" | \"defs\" | \"ellipse\" | \"feBlend\" | \"feColorMatrix\" | \"feComponentTransfer\" | \"feComposite\" | \"feConvolveMatrix\" | \"feDiffuseLighting\" | \"feDisplacementMap\" | \"feDistantLight\" | \"feDropShadow\" | \"feFlood\" | \"feFuncA\" | \"feFuncB\" | \"feFuncG\" | \"feFuncR\" | \"feGaussianBlur\" | \"feImage\" | \"feMerge\" | \"feMergeNode\" | \"feMorphology\" | \"feOffset\" | \"fePointLight\" | \"feSpecularLighting\" | \"feSpotLight\" | \"feTile\" | \"feTurbulence\" | \"foreignObject\" | \"g\" | \"line\" | \"linearGradient\" | \"marker\" | \"metadata\" | \"mpath\" | \"polygon\" | \"polyline\" | \"radialGradient\" | \"rect\" | \"switch\" | \"textPath\" | \"tspan\" | \"use\" | \"view\"" ], "path": "packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx", "deprecated": false, diff --git a/api_docs/kbn_securitysolution_exception_list_components.mdx b/api_docs/kbn_securitysolution_exception_list_components.mdx index 53846ba0e3823..523d9999543fa 100644 --- a/api_docs/kbn_securitysolution_exception_list_components.mdx +++ b/api_docs/kbn_securitysolution_exception_list_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-exception-list-components title: "@kbn/securitysolution-exception-list-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-exception-list-components plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-exception-list-components'] --- import kbnSecuritysolutionExceptionListComponentsObj from './kbn_securitysolution_exception_list_components.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_hook_utils.mdx b/api_docs/kbn_securitysolution_hook_utils.mdx index 0ed014cb136bb..75effaccc574a 100644 --- a/api_docs/kbn_securitysolution_hook_utils.mdx +++ b/api_docs/kbn_securitysolution_hook_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-hook-utils title: "@kbn/securitysolution-hook-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-hook-utils plugin -date: 2024-07-04 +date: 2024-07-11 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 33cdd4715ac06..1e6a0aabed154 100644 --- a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-alerting-types title: "@kbn/securitysolution-io-ts-alerting-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-alerting-types plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-alerting-types'] --- import kbnSecuritysolutionIoTsAlertingTypesObj from './kbn_securitysolution_io_ts_alerting_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.mdx b/api_docs/kbn_securitysolution_io_ts_list_types.mdx index a367a1629a9e0..4c8aae94e6133 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_list_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-list-types title: "@kbn/securitysolution-io-ts-list-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-list-types plugin -date: 2024-07-04 +date: 2024-07-11 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 11a27ebeb19cf..490c848990154 100644 --- a/api_docs/kbn_securitysolution_io_ts_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-types title: "@kbn/securitysolution-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-types plugin -date: 2024-07-04 +date: 2024-07-11 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 230f10e9ff23f..ae97799bc3aba 100644 --- a/api_docs/kbn_securitysolution_io_ts_utils.mdx +++ b/api_docs/kbn_securitysolution_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-utils title: "@kbn/securitysolution-io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-utils'] --- import kbnSecuritysolutionIoTsUtilsObj from './kbn_securitysolution_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_api.mdx b/api_docs/kbn_securitysolution_list_api.mdx index 07a3718c94ec9..faf11f193c183 100644 --- a/api_docs/kbn_securitysolution_list_api.mdx +++ b/api_docs/kbn_securitysolution_list_api.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-api title: "@kbn/securitysolution-list-api" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-api plugin -date: 2024-07-04 +date: 2024-07-11 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 cfd156223a6a4..342491854dedd 100644 --- a/api_docs/kbn_securitysolution_list_constants.mdx +++ b/api_docs/kbn_securitysolution_list_constants.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-constants title: "@kbn/securitysolution-list-constants" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-constants plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-constants'] --- import kbnSecuritysolutionListConstantsObj from './kbn_securitysolution_list_constants.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_hooks.mdx b/api_docs/kbn_securitysolution_list_hooks.mdx index 224320b967554..55361e2a7237b 100644 --- a/api_docs/kbn_securitysolution_list_hooks.mdx +++ b/api_docs/kbn_securitysolution_list_hooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-hooks title: "@kbn/securitysolution-list-hooks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-hooks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-hooks'] --- import kbnSecuritysolutionListHooksObj from './kbn_securitysolution_list_hooks.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_utils.mdx b/api_docs/kbn_securitysolution_list_utils.mdx index 7b2f62b6b05c2..1080ee46832bc 100644 --- a/api_docs/kbn_securitysolution_list_utils.mdx +++ b/api_docs/kbn_securitysolution_list_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-utils title: "@kbn/securitysolution-list-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-utils plugin -date: 2024-07-04 +date: 2024-07-11 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 6a00d13fb3b5e..bcb12e8d0cfa7 100644 --- a/api_docs/kbn_securitysolution_rules.mdx +++ b/api_docs/kbn_securitysolution_rules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-rules title: "@kbn/securitysolution-rules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-rules plugin -date: 2024-07-04 +date: 2024-07-11 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 424f784abadf5..3cc6dfa8ac1e9 100644 --- a/api_docs/kbn_securitysolution_t_grid.mdx +++ b/api_docs/kbn_securitysolution_t_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-t-grid title: "@kbn/securitysolution-t-grid" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-t-grid plugin -date: 2024-07-04 +date: 2024-07-11 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 d0c5d655632b1..6070497ba89f5 100644 --- a/api_docs/kbn_securitysolution_utils.mdx +++ b/api_docs/kbn_securitysolution_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-utils title: "@kbn/securitysolution-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-utils plugin -date: 2024-07-04 +date: 2024-07-11 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 d26e7f2837e49..bfed07e3aee98 100644 --- a/api_docs/kbn_server_http_tools.mdx +++ b/api_docs/kbn_server_http_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-http-tools title: "@kbn/server-http-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-http-tools plugin -date: 2024-07-04 +date: 2024-07-11 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 1a225d92b53aa..5fb1689a44c0e 100644 --- a/api_docs/kbn_server_route_repository.mdx +++ b/api_docs/kbn_server_route_repository.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository title: "@kbn/server-route-repository" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] --- import kbnServerRouteRepositoryObj from './kbn_server_route_repository.devdocs.json'; diff --git a/api_docs/kbn_serverless_common_settings.mdx b/api_docs/kbn_serverless_common_settings.mdx index 7fe380e0bf54b..37268e7c5d084 100644 --- a/api_docs/kbn_serverless_common_settings.mdx +++ b/api_docs/kbn_serverless_common_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-common-settings title: "@kbn/serverless-common-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-common-settings plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-common-settings'] --- import kbnServerlessCommonSettingsObj from './kbn_serverless_common_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_observability_settings.mdx b/api_docs/kbn_serverless_observability_settings.mdx index 023e2b19d8624..dcf3b3e7304fa 100644 --- a/api_docs/kbn_serverless_observability_settings.mdx +++ b/api_docs/kbn_serverless_observability_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-observability-settings title: "@kbn/serverless-observability-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-observability-settings plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-observability-settings'] --- import kbnServerlessObservabilitySettingsObj from './kbn_serverless_observability_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_project_switcher.mdx b/api_docs/kbn_serverless_project_switcher.mdx index 3fa7c46d002e0..573c06ab10754 100644 --- a/api_docs/kbn_serverless_project_switcher.mdx +++ b/api_docs/kbn_serverless_project_switcher.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-project-switcher title: "@kbn/serverless-project-switcher" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-project-switcher plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-project-switcher'] --- import kbnServerlessProjectSwitcherObj from './kbn_serverless_project_switcher.devdocs.json'; diff --git a/api_docs/kbn_serverless_search_settings.mdx b/api_docs/kbn_serverless_search_settings.mdx index 5c9df1a51fd74..8da691192d30c 100644 --- a/api_docs/kbn_serverless_search_settings.mdx +++ b/api_docs/kbn_serverless_search_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-search-settings title: "@kbn/serverless-search-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-search-settings plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-search-settings'] --- import kbnServerlessSearchSettingsObj from './kbn_serverless_search_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_security_settings.mdx b/api_docs/kbn_serverless_security_settings.mdx index 90764c414c671..32592b9530781 100644 --- a/api_docs/kbn_serverless_security_settings.mdx +++ b/api_docs/kbn_serverless_security_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-security-settings title: "@kbn/serverless-security-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-security-settings plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-security-settings'] --- import kbnServerlessSecuritySettingsObj from './kbn_serverless_security_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_storybook_config.mdx b/api_docs/kbn_serverless_storybook_config.mdx index ee14bf49416db..4b103166e9861 100644 --- a/api_docs/kbn_serverless_storybook_config.mdx +++ b/api_docs/kbn_serverless_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-storybook-config title: "@kbn/serverless-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-storybook-config plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-storybook-config'] --- import kbnServerlessStorybookConfigObj from './kbn_serverless_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_shared_svg.devdocs.json b/api_docs/kbn_shared_svg.devdocs.json index 588b106773268..cf0d7002279b3 100644 --- a/api_docs/kbn_shared_svg.devdocs.json +++ b/api_docs/kbn_shared_svg.devdocs.json @@ -58,6 +58,18 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/shared-svg", + "id": "def-common.content", + "type": "string", + "tags": [], + "label": "content", + "description": [], + "path": "packages/kbn-ambient-ui-types/index.d.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/shared-svg", "id": "def-common.content", diff --git a/api_docs/kbn_shared_svg.mdx b/api_docs/kbn_shared_svg.mdx index 3ca354d31f59f..0ae891156019a 100644 --- a/api_docs/kbn_shared_svg.mdx +++ b/api_docs/kbn_shared_svg.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-svg title: "@kbn/shared-svg" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-svg plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-svg'] --- import kbnSharedSvgObj from './kbn_shared_svg.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/te | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 4 | 0 | 4 | 0 | +| 5 | 0 | 5 | 0 | ## Common diff --git a/api_docs/kbn_shared_ux_avatar_solution.mdx b/api_docs/kbn_shared_ux_avatar_solution.mdx index 0c028e69275fe..400fabf3a166e 100644 --- a/api_docs/kbn_shared_ux_avatar_solution.mdx +++ b/api_docs/kbn_shared_ux_avatar_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-avatar-solution title: "@kbn/shared-ux-avatar-solution" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-avatar-solution plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-avatar-solution'] --- import kbnSharedUxAvatarSolutionObj from './kbn_shared_ux_avatar_solution.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx index adf957ecf75c7..997ed2a4ff707 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx +++ b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-exit-full-screen title: "@kbn/shared-ux-button-exit-full-screen" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-exit-full-screen plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen'] --- import kbnSharedUxButtonExitFullScreenObj from './kbn_shared_ux_button_exit_full_screen.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_toolbar.mdx b/api_docs/kbn_shared_ux_button_toolbar.mdx index ec994d4e18b71..a658f1ba95d35 100644 --- a/api_docs/kbn_shared_ux_button_toolbar.mdx +++ b/api_docs/kbn_shared_ux_button_toolbar.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-toolbar title: "@kbn/shared-ux-button-toolbar" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-toolbar plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-toolbar'] --- import kbnSharedUxButtonToolbarObj from './kbn_shared_ux_button_toolbar.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data.mdx b/api_docs/kbn_shared_ux_card_no_data.mdx index 4724a4a6e4657..bd4c4f5703aa1 100644 --- a/api_docs/kbn_shared_ux_card_no_data.mdx +++ b/api_docs/kbn_shared_ux_card_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data title: "@kbn/shared-ux-card-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data'] --- import kbnSharedUxCardNoDataObj from './kbn_shared_ux_card_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx index 2a59b198fc4a8..43361f2463328 100644 --- a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data-mocks title: "@kbn/shared-ux-card-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data-mocks'] --- import kbnSharedUxCardNoDataMocksObj from './kbn_shared_ux_card_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_chrome_navigation.mdx b/api_docs/kbn_shared_ux_chrome_navigation.mdx index 7adfd40f09b5c..6ce92b6cf411a 100644 --- a/api_docs/kbn_shared_ux_chrome_navigation.mdx +++ b/api_docs/kbn_shared_ux_chrome_navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-chrome-navigation title: "@kbn/shared-ux-chrome-navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-chrome-navigation plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-chrome-navigation'] --- import kbnSharedUxChromeNavigationObj from './kbn_shared_ux_chrome_navigation.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_error_boundary.mdx b/api_docs/kbn_shared_ux_error_boundary.mdx index 4420335334892..058ca848fa53a 100644 --- a/api_docs/kbn_shared_ux_error_boundary.mdx +++ b/api_docs/kbn_shared_ux_error_boundary.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-error-boundary title: "@kbn/shared-ux-error-boundary" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-error-boundary plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-error-boundary'] --- import kbnSharedUxErrorBoundaryObj from './kbn_shared_ux_error_boundary.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_context.mdx b/api_docs/kbn_shared_ux_file_context.mdx index a25cff2f66b5f..afabf5111ee83 100644 --- a/api_docs/kbn_shared_ux_file_context.mdx +++ b/api_docs/kbn_shared_ux_file_context.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-context title: "@kbn/shared-ux-file-context" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-context plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-context'] --- import kbnSharedUxFileContextObj from './kbn_shared_ux_file_context.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_image.mdx b/api_docs/kbn_shared_ux_file_image.mdx index 7276b3a6cb970..5e76afeaeafac 100644 --- a/api_docs/kbn_shared_ux_file_image.mdx +++ b/api_docs/kbn_shared_ux_file_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-image title: "@kbn/shared-ux-file-image" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-image plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-image'] --- import kbnSharedUxFileImageObj from './kbn_shared_ux_file_image.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_image_mocks.mdx b/api_docs/kbn_shared_ux_file_image_mocks.mdx index 576b46f0a128a..bb3b7effbf9c8 100644 --- a/api_docs/kbn_shared_ux_file_image_mocks.mdx +++ b/api_docs/kbn_shared_ux_file_image_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-image-mocks title: "@kbn/shared-ux-file-image-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-image-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-image-mocks'] --- import kbnSharedUxFileImageMocksObj from './kbn_shared_ux_file_image_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_mocks.mdx b/api_docs/kbn_shared_ux_file_mocks.mdx index affcb80b62baf..1b00907123e87 100644 --- a/api_docs/kbn_shared_ux_file_mocks.mdx +++ b/api_docs/kbn_shared_ux_file_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-mocks title: "@kbn/shared-ux-file-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-mocks'] --- import kbnSharedUxFileMocksObj from './kbn_shared_ux_file_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_picker.mdx b/api_docs/kbn_shared_ux_file_picker.mdx index c8d74eac32e1e..aaa49e0082044 100644 --- a/api_docs/kbn_shared_ux_file_picker.mdx +++ b/api_docs/kbn_shared_ux_file_picker.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-picker title: "@kbn/shared-ux-file-picker" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-picker plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-picker'] --- import kbnSharedUxFilePickerObj from './kbn_shared_ux_file_picker.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_types.mdx b/api_docs/kbn_shared_ux_file_types.mdx index 609605213abe4..4cae17904f628 100644 --- a/api_docs/kbn_shared_ux_file_types.mdx +++ b/api_docs/kbn_shared_ux_file_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-types title: "@kbn/shared-ux-file-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-types plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-types'] --- import kbnSharedUxFileTypesObj from './kbn_shared_ux_file_types.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_upload.mdx b/api_docs/kbn_shared_ux_file_upload.mdx index cdc4cc148af48..d0f5305b3a0e3 100644 --- a/api_docs/kbn_shared_ux_file_upload.mdx +++ b/api_docs/kbn_shared_ux_file_upload.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-upload title: "@kbn/shared-ux-file-upload" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-upload plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-upload'] --- import kbnSharedUxFileUploadObj from './kbn_shared_ux_file_upload.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_util.mdx b/api_docs/kbn_shared_ux_file_util.mdx index c238beb9f0876..2d7045010a304 100644 --- a/api_docs/kbn_shared_ux_file_util.mdx +++ b/api_docs/kbn_shared_ux_file_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-util title: "@kbn/shared-ux-file-util" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-util plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-util'] --- import kbnSharedUxFileUtilObj from './kbn_shared_ux_file_util.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_link_redirect_app.mdx b/api_docs/kbn_shared_ux_link_redirect_app.mdx index e3b0fef1518b1..0ca47d74e2d82 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app title: "@kbn/shared-ux-link-redirect-app" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app'] --- import kbnSharedUxLinkRedirectAppObj from './kbn_shared_ux_link_redirect_app.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx index 79fe7bfe77225..3c3351144621d 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app-mocks title: "@kbn/shared-ux-link-redirect-app-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app-mocks'] --- import kbnSharedUxLinkRedirectAppMocksObj from './kbn_shared_ux_link_redirect_app_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_markdown.mdx b/api_docs/kbn_shared_ux_markdown.mdx index 9d13ad8c7dc44..f309286b16a73 100644 --- a/api_docs/kbn_shared_ux_markdown.mdx +++ b/api_docs/kbn_shared_ux_markdown.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-markdown title: "@kbn/shared-ux-markdown" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-markdown plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-markdown'] --- import kbnSharedUxMarkdownObj from './kbn_shared_ux_markdown.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_markdown_mocks.mdx b/api_docs/kbn_shared_ux_markdown_mocks.mdx index e5ef32d881ae3..4bb82443adc55 100644 --- a/api_docs/kbn_shared_ux_markdown_mocks.mdx +++ b/api_docs/kbn_shared_ux_markdown_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-markdown-mocks title: "@kbn/shared-ux-markdown-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-markdown-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-markdown-mocks'] --- import kbnSharedUxMarkdownMocksObj from './kbn_shared_ux_markdown_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx index 87bbd83be92f3..e5ff02b811d69 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data title: "@kbn/shared-ux-page-analytics-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data'] --- import kbnSharedUxPageAnalyticsNoDataObj from './kbn_shared_ux_page_analytics_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx index d5b24608c8165..38badc96b8e15 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data-mocks title: "@kbn/shared-ux-page-analytics-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data-mocks'] --- import kbnSharedUxPageAnalyticsNoDataMocksObj from './kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx index 01f745c3f7158..e7642c35ca433 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data title: "@kbn/shared-ux-page-kibana-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data'] --- import kbnSharedUxPageKibanaNoDataObj from './kbn_shared_ux_page_kibana_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx index 76c3d9c634b65..914449bc2a88a 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data-mocks title: "@kbn/shared-ux-page-kibana-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data-mocks'] --- import kbnSharedUxPageKibanaNoDataMocksObj from './kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_template.mdx b/api_docs/kbn_shared_ux_page_kibana_template.mdx index e9fe2259bfab0..52ef3c3592ba5 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_template.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template title: "@kbn/shared-ux-page-kibana-template" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-template plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template'] --- import kbnSharedUxPageKibanaTemplateObj from './kbn_shared_ux_page_kibana_template.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx index 6f08c619612fb..0474b58e8bf76 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template-mocks title: "@kbn/shared-ux-page-kibana-template-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-template-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template-mocks'] --- import kbnSharedUxPageKibanaTemplateMocksObj from './kbn_shared_ux_page_kibana_template_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data.mdx b/api_docs/kbn_shared_ux_page_no_data.mdx index 5e9e46ad65c71..40eef9e7e6769 100644 --- a/api_docs/kbn_shared_ux_page_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data title: "@kbn/shared-ux-page-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data'] --- import kbnSharedUxPageNoDataObj from './kbn_shared_ux_page_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_config.mdx b/api_docs/kbn_shared_ux_page_no_data_config.mdx index 62798a05c5105..fddc72556aa1d 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config title: "@kbn/shared-ux-page-no-data-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-config plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config'] --- import kbnSharedUxPageNoDataConfigObj from './kbn_shared_ux_page_no_data_config.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx index 0fb02e8559a2a..d6a56bb022bb8 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config-mocks title: "@kbn/shared-ux-page-no-data-config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-config-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config-mocks'] --- import kbnSharedUxPageNoDataConfigMocksObj from './kbn_shared_ux_page_no_data_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx index 62b4761142156..d223d7704040f 100644 --- a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-mocks title: "@kbn/shared-ux-page-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-mocks'] --- import kbnSharedUxPageNoDataMocksObj from './kbn_shared_ux_page_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_solution_nav.mdx b/api_docs/kbn_shared_ux_page_solution_nav.mdx index 5f353f432c6d7..34a962b8ecb3a 100644 --- a/api_docs/kbn_shared_ux_page_solution_nav.mdx +++ b/api_docs/kbn_shared_ux_page_solution_nav.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-solution-nav title: "@kbn/shared-ux-page-solution-nav" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-solution-nav plugin -date: 2024-07-04 +date: 2024-07-11 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 3a87ab5b316a9..335a8ce3c4eff 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 @@ -259,7 +259,7 @@ "The background color of the prompt; defaults to `plain`." ], "signature": [ - "\"warning\" | \"success\" | \"subdued\" | \"primary\" | \"accent\" | \"danger\" | \"plain\" | \"transparent\" | undefined" + "\"warning\" | \"success\" | \"plain\" | \"subdued\" | \"primary\" | \"accent\" | \"danger\" | \"transparent\" | undefined" ], "path": "packages/shared-ux/prompt/no_data_views/types/index.d.ts", "deprecated": false, diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx index a9250e7f475ab..f1dc1b7bdca18 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views title: "@kbn/shared-ux-prompt-no-data-views" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views'] --- import kbnSharedUxPromptNoDataViewsObj from './kbn_shared_ux_prompt_no_data_views.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx index 677ce30369836..713cb9f1bc23d 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views-mocks title: "@kbn/shared-ux-prompt-no-data-views-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views-mocks'] --- import kbnSharedUxPromptNoDataViewsMocksObj from './kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_not_found.mdx b/api_docs/kbn_shared_ux_prompt_not_found.mdx index fe7fdd18c8f3e..2e7305429d011 100644 --- a/api_docs/kbn_shared_ux_prompt_not_found.mdx +++ b/api_docs/kbn_shared_ux_prompt_not_found.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-not-found title: "@kbn/shared-ux-prompt-not-found" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-not-found plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-not-found'] --- import kbnSharedUxPromptNotFoundObj from './kbn_shared_ux_prompt_not_found.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_router.mdx b/api_docs/kbn_shared_ux_router.mdx index a918fd6567914..f17a5d8e7f7d4 100644 --- a/api_docs/kbn_shared_ux_router.mdx +++ b/api_docs/kbn_shared_ux_router.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-router title: "@kbn/shared-ux-router" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-router plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-router'] --- import kbnSharedUxRouterObj from './kbn_shared_ux_router.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_router_mocks.mdx b/api_docs/kbn_shared_ux_router_mocks.mdx index 3f433e8353bd5..909854dc37fb6 100644 --- a/api_docs/kbn_shared_ux_router_mocks.mdx +++ b/api_docs/kbn_shared_ux_router_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-router-mocks title: "@kbn/shared-ux-router-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-router-mocks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-router-mocks'] --- import kbnSharedUxRouterMocksObj from './kbn_shared_ux_router_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_storybook_config.mdx b/api_docs/kbn_shared_ux_storybook_config.mdx index e1d49975125a1..9c97e78796c88 100644 --- a/api_docs/kbn_shared_ux_storybook_config.mdx +++ b/api_docs/kbn_shared_ux_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-config title: "@kbn/shared-ux-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-config plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-config'] --- import kbnSharedUxStorybookConfigObj from './kbn_shared_ux_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_storybook_mock.mdx b/api_docs/kbn_shared_ux_storybook_mock.mdx index b5362b262c525..516e98c6ed266 100644 --- a/api_docs/kbn_shared_ux_storybook_mock.mdx +++ b/api_docs/kbn_shared_ux_storybook_mock.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-mock title: "@kbn/shared-ux-storybook-mock" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-mock plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-mock'] --- import kbnSharedUxStorybookMockObj from './kbn_shared_ux_storybook_mock.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_tabbed_modal.mdx b/api_docs/kbn_shared_ux_tabbed_modal.mdx index cc8522ad022f6..d723cb532045d 100644 --- a/api_docs/kbn_shared_ux_tabbed_modal.mdx +++ b/api_docs/kbn_shared_ux_tabbed_modal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-tabbed-modal title: "@kbn/shared-ux-tabbed-modal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-tabbed-modal plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-tabbed-modal'] --- import kbnSharedUxTabbedModalObj from './kbn_shared_ux_tabbed_modal.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index 0abe79d90ca55..4af82c552186c 100644 --- a/api_docs/kbn_shared_ux_utility.mdx +++ b/api_docs/kbn_shared_ux_utility.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-utility title: "@kbn/shared-ux-utility" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-utility plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-utility'] --- import kbnSharedUxUtilityObj from './kbn_shared_ux_utility.devdocs.json'; diff --git a/api_docs/kbn_slo_schema.mdx b/api_docs/kbn_slo_schema.mdx index ebd938fd31b27..2a496ddbfa6d9 100644 --- a/api_docs/kbn_slo_schema.mdx +++ b/api_docs/kbn_slo_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-slo-schema title: "@kbn/slo-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/slo-schema plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/slo-schema'] --- import kbnSloSchemaObj from './kbn_slo_schema.devdocs.json'; diff --git a/api_docs/kbn_some_dev_log.mdx b/api_docs/kbn_some_dev_log.mdx index 375566d760261..f64585581fb59 100644 --- a/api_docs/kbn_some_dev_log.mdx +++ b/api_docs/kbn_some_dev_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-some-dev-log title: "@kbn/some-dev-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/some-dev-log plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/some-dev-log'] --- import kbnSomeDevLogObj from './kbn_some_dev_log.devdocs.json'; diff --git a/api_docs/kbn_sort_predicates.mdx b/api_docs/kbn_sort_predicates.mdx index 21265792e07e7..572f4d38cd2b1 100644 --- a/api_docs/kbn_sort_predicates.mdx +++ b/api_docs/kbn_sort_predicates.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-sort-predicates title: "@kbn/sort-predicates" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/sort-predicates plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sort-predicates'] --- import kbnSortPredicatesObj from './kbn_sort_predicates.devdocs.json'; diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index b35afc4b8a8d5..531a7d9f3f299 100644 --- a/api_docs/kbn_std.mdx +++ b/api_docs/kbn_std.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-std title: "@kbn/std" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/std plugin -date: 2024-07-04 +date: 2024-07-11 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 b5afd2e18e900..9d0d9644a0539 100644 --- a/api_docs/kbn_stdio_dev_helpers.mdx +++ b/api_docs/kbn_stdio_dev_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-stdio-dev-helpers title: "@kbn/stdio-dev-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/stdio-dev-helpers plugin -date: 2024-07-04 +date: 2024-07-11 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 28645f2265682..7e01852d0d379 100644 --- a/api_docs/kbn_storybook.mdx +++ b/api_docs/kbn_storybook.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-storybook title: "@kbn/storybook" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/storybook plugin -date: 2024-07-04 +date: 2024-07-11 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 07b7aaa0e835f..153170ae15de1 100644 --- a/api_docs/kbn_telemetry_tools.mdx +++ b/api_docs/kbn_telemetry_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-telemetry-tools title: "@kbn/telemetry-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/telemetry-tools plugin -date: 2024-07-04 +date: 2024-07-11 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 448de6ac1349a..b8cbca02207f7 100644 --- a/api_docs/kbn_test.mdx +++ b/api_docs/kbn_test.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test title: "@kbn/test" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] --- import kbnTestObj from './kbn_test.devdocs.json'; diff --git a/api_docs/kbn_test_eui_helpers.devdocs.json b/api_docs/kbn_test_eui_helpers.devdocs.json index aab4d099fcc9a..d3276c2634aba 100644 --- a/api_docs/kbn_test_eui_helpers.devdocs.json +++ b/api_docs/kbn_test_eui_helpers.devdocs.json @@ -140,7 +140,7 @@ "tags": [], "label": "selected", "description": [ - "\nReturns selected value of button group" + "\nReturns selected option of button group" ], "signature": [ "HTMLElement" @@ -186,6 +186,171 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/test-eui-helpers", + "id": "def-common.EuiSelectTestHarness", + "type": "Class", + "tags": [], + "label": "EuiSelectTestHarness", + "description": [], + "path": "packages/kbn-test-eui-helpers/src/rtl_helpers.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/test-eui-helpers", + "id": "def-common.EuiSelectTestHarness.testId", + "type": "string", + "tags": [], + "label": "#testId", + "description": [], + "path": "packages/kbn-test-eui-helpers/src/rtl_helpers.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/test-eui-helpers", + "id": "def-common.EuiSelectTestHarness.selectEl", + "type": "Object", + "tags": [], + "label": "#selectEl", + "description": [ + "\nReturns select or throws" + ], + "signature": [ + "HTMLElement" + ], + "path": "packages/kbn-test-eui-helpers/src/rtl_helpers.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/test-eui-helpers", + "id": "def-common.EuiSelectTestHarness.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "packages/kbn-test-eui-helpers/src/rtl_helpers.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/test-eui-helpers", + "id": "def-common.EuiSelectTestHarness.Unnamed.$1", + "type": "string", + "tags": [], + "label": "testId", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-test-eui-helpers/src/rtl_helpers.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/test-eui-helpers", + "id": "def-common.EuiSelectTestHarness.testId", + "type": "string", + "tags": [], + "label": "testId", + "description": [ + "\nReturns `data-test-subj` of select" + ], + "path": "packages/kbn-test-eui-helpers/src/rtl_helpers.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/test-eui-helpers", + "id": "def-common.EuiSelectTestHarness.self", + "type": "CompoundType", + "tags": [], + "label": "self", + "description": [ + "\nReturns button select if found, otherwise `null`" + ], + "signature": [ + "HTMLElement | null" + ], + "path": "packages/kbn-test-eui-helpers/src/rtl_helpers.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/test-eui-helpers", + "id": "def-common.EuiSelectTestHarness.options", + "type": "Array", + "tags": [], + "label": "options", + "description": [ + "\nReturns all options of select" + ], + "signature": [ + "HTMLOptionElement[]" + ], + "path": "packages/kbn-test-eui-helpers/src/rtl_helpers.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/test-eui-helpers", + "id": "def-common.EuiSelectTestHarness.selected", + "type": "string", + "tags": [], + "label": "selected", + "description": [ + "\nReturns selected option" + ], + "path": "packages/kbn-test-eui-helpers/src/rtl_helpers.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/test-eui-helpers", + "id": "def-common.EuiSelectTestHarness.select", + "type": "Function", + "tags": [], + "label": "select", + "description": [ + "\nSelect option by value" + ], + "signature": [ + "(optionName: string | RegExp) => void" + ], + "path": "packages/kbn-test-eui-helpers/src/rtl_helpers.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/test-eui-helpers", + "id": "def-common.EuiSelectTestHarness.select.$1", + "type": "CompoundType", + "tags": [], + "label": "optionName", + "description": [], + "signature": [ + "string | RegExp" + ], + "path": "packages/kbn-test-eui-helpers/src/rtl_helpers.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/test-eui-helpers", "id": "def-common.EuiSuperDatePickerTestHarness", diff --git a/api_docs/kbn_test_eui_helpers.mdx b/api_docs/kbn_test_eui_helpers.mdx index d0a18a49c5589..6c562a0c1b9a3 100644 --- a/api_docs/kbn_test_eui_helpers.mdx +++ b/api_docs/kbn_test_eui_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-eui-helpers title: "@kbn/test-eui-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-eui-helpers plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-eui-helpers'] --- import kbnTestEuiHelpersObj from './kbn_test_eui_helpers.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 25 | 0 | 13 | 0 | +| 36 | 0 | 18 | 0 | ## Common diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index 4a6a82ed89657..b973f23ecc14e 100644 --- a/api_docs/kbn_test_jest_helpers.mdx +++ b/api_docs/kbn_test_jest_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-jest-helpers title: "@kbn/test-jest-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-jest-helpers plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-jest-helpers'] --- import kbnTestJestHelpersObj from './kbn_test_jest_helpers.devdocs.json'; diff --git a/api_docs/kbn_test_subj_selector.mdx b/api_docs/kbn_test_subj_selector.mdx index 12e87ff060996..282504963c042 100644 --- a/api_docs/kbn_test_subj_selector.mdx +++ b/api_docs/kbn_test_subj_selector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-subj-selector title: "@kbn/test-subj-selector" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-subj-selector plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-subj-selector'] --- import kbnTestSubjSelectorObj from './kbn_test_subj_selector.devdocs.json'; diff --git a/api_docs/kbn_text_based_editor.mdx b/api_docs/kbn_text_based_editor.mdx index 334d43dd475a4..a658d88790f29 100644 --- a/api_docs/kbn_text_based_editor.mdx +++ b/api_docs/kbn_text_based_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-text-based-editor title: "@kbn/text-based-editor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/text-based-editor plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/text-based-editor'] --- import kbnTextBasedEditorObj from './kbn_text_based_editor.devdocs.json'; diff --git a/api_docs/kbn_timerange.mdx b/api_docs/kbn_timerange.mdx index 9b6b25878d5cf..95919e349f2e8 100644 --- a/api_docs/kbn_timerange.mdx +++ b/api_docs/kbn_timerange.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-timerange title: "@kbn/timerange" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/timerange plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/timerange'] --- import kbnTimerangeObj from './kbn_timerange.devdocs.json'; diff --git a/api_docs/kbn_tooling_log.mdx b/api_docs/kbn_tooling_log.mdx index 0240ee8f36502..5100c90c43a4d 100644 --- a/api_docs/kbn_tooling_log.mdx +++ b/api_docs/kbn_tooling_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-tooling-log title: "@kbn/tooling-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/tooling-log plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/tooling-log'] --- import kbnToolingLogObj from './kbn_tooling_log.devdocs.json'; diff --git a/api_docs/kbn_triggers_actions_ui_types.mdx b/api_docs/kbn_triggers_actions_ui_types.mdx index c595a5de6729c..74dd99c686fe5 100644 --- a/api_docs/kbn_triggers_actions_ui_types.mdx +++ b/api_docs/kbn_triggers_actions_ui_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-triggers-actions-ui-types title: "@kbn/triggers-actions-ui-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/triggers-actions-ui-types plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/triggers-actions-ui-types'] --- import kbnTriggersActionsUiTypesObj from './kbn_triggers_actions_ui_types.devdocs.json'; diff --git a/api_docs/kbn_try_in_console.mdx b/api_docs/kbn_try_in_console.mdx index baeb628c7b421..86cbfe71989d6 100644 --- a/api_docs/kbn_try_in_console.mdx +++ b/api_docs/kbn_try_in_console.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-try-in-console title: "@kbn/try-in-console" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/try-in-console plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/try-in-console'] --- import kbnTryInConsoleObj from './kbn_try_in_console.devdocs.json'; diff --git a/api_docs/kbn_ts_projects.mdx b/api_docs/kbn_ts_projects.mdx index f2f8984b6423d..48c59ca0bc025 100644 --- a/api_docs/kbn_ts_projects.mdx +++ b/api_docs/kbn_ts_projects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ts-projects title: "@kbn/ts-projects" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ts-projects plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ts-projects'] --- import kbnTsProjectsObj from './kbn_ts_projects.devdocs.json'; diff --git a/api_docs/kbn_typed_react_router_config.mdx b/api_docs/kbn_typed_react_router_config.mdx index 97cf3f5bfed89..bb1e9dd0ff611 100644 --- a/api_docs/kbn_typed_react_router_config.mdx +++ b/api_docs/kbn_typed_react_router_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-typed-react-router-config title: "@kbn/typed-react-router-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/typed-react-router-config plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/typed-react-router-config'] --- import kbnTypedReactRouterConfigObj from './kbn_typed_react_router_config.devdocs.json'; diff --git a/api_docs/kbn_ui_actions_browser.mdx b/api_docs/kbn_ui_actions_browser.mdx index 506836ede7fd2..a6f1a9ca28495 100644 --- a/api_docs/kbn_ui_actions_browser.mdx +++ b/api_docs/kbn_ui_actions_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-actions-browser title: "@kbn/ui-actions-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-actions-browser plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-actions-browser'] --- import kbnUiActionsBrowserObj from './kbn_ui_actions_browser.devdocs.json'; diff --git a/api_docs/kbn_ui_shared_deps_src.devdocs.json b/api_docs/kbn_ui_shared_deps_src.devdocs.json index 5a4f7663f18a0..d80ea1cd158c8 100644 --- a/api_docs/kbn_ui_shared_deps_src.devdocs.json +++ b/api_docs/kbn_ui_shared_deps_src.devdocs.json @@ -342,6 +342,17 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-common.externals.fastestlevenshtein", + "type": "string", + "tags": [], + "label": "'fastest-levenshtein'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "@kbn/ui-shared-deps-src", "id": "def-common.externals.rxjs", @@ -524,6 +535,17 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-common.externals.kbncryptobrowser", + "type": "string", + "tags": [], + "label": "'@kbn/crypto-browser'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "@kbn/ui-shared-deps-src", "id": "def-common.externals.kbnesquery", diff --git a/api_docs/kbn_ui_shared_deps_src.mdx b/api_docs/kbn_ui_shared_deps_src.mdx index f9b114d5775e6..d35d8cab4a032 100644 --- a/api_docs/kbn_ui_shared_deps_src.mdx +++ b/api_docs/kbn_ui_shared_deps_src.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-shared-deps-src title: "@kbn/ui-shared-deps-src" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-shared-deps-src plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-shared-deps-src'] --- import kbnUiSharedDepsSrcObj from './kbn_ui_shared_deps_src.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kiban | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 55 | 0 | 46 | 0 | +| 57 | 0 | 48 | 0 | ## Common diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index c305850a1d839..f110f52a44591 100644 --- a/api_docs/kbn_ui_theme.mdx +++ b/api_docs/kbn_ui_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-theme title: "@kbn/ui-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-theme plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-theme'] --- import kbnUiThemeObj from './kbn_ui_theme.devdocs.json'; diff --git a/api_docs/kbn_unified_data_table.mdx b/api_docs/kbn_unified_data_table.mdx index 3668c93f7f02b..0ba9e177c6af7 100644 --- a/api_docs/kbn_unified_data_table.mdx +++ b/api_docs/kbn_unified_data_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unified-data-table title: "@kbn/unified-data-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unified-data-table plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-data-table'] --- import kbnUnifiedDataTableObj from './kbn_unified_data_table.devdocs.json'; diff --git a/api_docs/kbn_unified_doc_viewer.mdx b/api_docs/kbn_unified_doc_viewer.mdx index d368739b28ec2..d285fd99e8b66 100644 --- a/api_docs/kbn_unified_doc_viewer.mdx +++ b/api_docs/kbn_unified_doc_viewer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unified-doc-viewer title: "@kbn/unified-doc-viewer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unified-doc-viewer plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-doc-viewer'] --- import kbnUnifiedDocViewerObj from './kbn_unified_doc_viewer.devdocs.json'; diff --git a/api_docs/kbn_unified_field_list.devdocs.json b/api_docs/kbn_unified_field_list.devdocs.json index c9bc5510c86c2..66ee3fbfb7d49 100644 --- a/api_docs/kbn_unified_field_list.devdocs.json +++ b/api_docs/kbn_unified_field_list.devdocs.json @@ -2211,7 +2211,7 @@ "section": "def-common.CoreStart", "text": "CoreStart" }, - ", \"analytics\" | \"uiSettings\">; data: ", + ", \"uiSettings\" | \"analytics\">; data: ", { "pluginId": "data", "scope": "public", @@ -4585,7 +4585,7 @@ "label": "type", "description": [], "signature": [ - "\"other\" | \"normal\" | undefined" + "\"normal\" | \"other\" | undefined" ], "path": "packages/kbn-unified-field-list/src/components/field_stats/field_top_values_bucket.tsx", "deprecated": false, diff --git a/api_docs/kbn_unified_field_list.mdx b/api_docs/kbn_unified_field_list.mdx index 8905189feec0b..1c7b53d1945d5 100644 --- a/api_docs/kbn_unified_field_list.mdx +++ b/api_docs/kbn_unified_field_list.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unified-field-list title: "@kbn/unified-field-list" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unified-field-list plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-field-list'] --- import kbnUnifiedFieldListObj from './kbn_unified_field_list.devdocs.json'; diff --git a/api_docs/kbn_unsaved_changes_badge.mdx b/api_docs/kbn_unsaved_changes_badge.mdx index b903bb956cd22..a4afc63d92d45 100644 --- a/api_docs/kbn_unsaved_changes_badge.mdx +++ b/api_docs/kbn_unsaved_changes_badge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unsaved-changes-badge title: "@kbn/unsaved-changes-badge" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unsaved-changes-badge plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unsaved-changes-badge'] --- import kbnUnsavedChangesBadgeObj from './kbn_unsaved_changes_badge.devdocs.json'; diff --git a/api_docs/kbn_unsaved_changes_prompt.mdx b/api_docs/kbn_unsaved_changes_prompt.mdx index 7e5698023d2f5..ec0570e3e2d31 100644 --- a/api_docs/kbn_unsaved_changes_prompt.mdx +++ b/api_docs/kbn_unsaved_changes_prompt.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unsaved-changes-prompt title: "@kbn/unsaved-changes-prompt" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unsaved-changes-prompt plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unsaved-changes-prompt'] --- import kbnUnsavedChangesPromptObj from './kbn_unsaved_changes_prompt.devdocs.json'; diff --git a/api_docs/kbn_use_tracked_promise.mdx b/api_docs/kbn_use_tracked_promise.mdx index a571febf22373..e19ce298d1d99 100644 --- a/api_docs/kbn_use_tracked_promise.mdx +++ b/api_docs/kbn_use_tracked_promise.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-use-tracked-promise title: "@kbn/use-tracked-promise" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/use-tracked-promise plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/use-tracked-promise'] --- import kbnUseTrackedPromiseObj from './kbn_use_tracked_promise.devdocs.json'; diff --git a/api_docs/kbn_user_profile_components.mdx b/api_docs/kbn_user_profile_components.mdx index 6a17df36f5658..6a2ef5267d5d6 100644 --- a/api_docs/kbn_user_profile_components.mdx +++ b/api_docs/kbn_user_profile_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-user-profile-components title: "@kbn/user-profile-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/user-profile-components plugin -date: 2024-07-04 +date: 2024-07-11 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 5ffdec9cf0bb6..2be5b84d99b5d 100644 --- a/api_docs/kbn_utility_types.mdx +++ b/api_docs/kbn_utility_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types title: "@kbn/utility-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types plugin -date: 2024-07-04 +date: 2024-07-11 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 1854302ae52f4..e21d08b1df36e 100644 --- a/api_docs/kbn_utility_types_jest.mdx +++ b/api_docs/kbn_utility_types_jest.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types-jest title: "@kbn/utility-types-jest" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types-jest plugin -date: 2024-07-04 +date: 2024-07-11 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 08a86a63ee2ea..610b0552aaec8 100644 --- a/api_docs/kbn_utils.mdx +++ b/api_docs/kbn_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utils title: "@kbn/utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] --- import kbnUtilsObj from './kbn_utils.devdocs.json'; diff --git a/api_docs/kbn_visualization_ui_components.devdocs.json b/api_docs/kbn_visualization_ui_components.devdocs.json index 80f0cff7f6a2d..92f8f1ee2a02b 100644 --- a/api_docs/kbn_visualization_ui_components.devdocs.json +++ b/api_docs/kbn_visualization_ui_components.devdocs.json @@ -441,7 +441,7 @@ "label": "DragDropBuckets", "description": [], "signature": [ - "({\n items,\n onDragStart,\n onDragEnd,\n droppableId,\n children,\n bgColor,\n}: { items: T[]; droppableId: string; children: React.ReactElement>[]; onDragStart?: (() => void) | undefined; onDragEnd?: ((items: T[]) => void) | undefined; bgColor?: \"warning\" | \"success\" | \"subdued\" | \"primary\" | \"accent\" | \"danger\" | \"plain\" | \"transparent\" | undefined; }) => JSX.Element" + "({\n items,\n onDragStart,\n onDragEnd,\n droppableId,\n children,\n bgColor,\n}: { items: T[]; droppableId: string; children: React.ReactElement>[]; onDragStart?: (() => void) | undefined; onDragEnd?: ((items: T[]) => void) | undefined; bgColor?: \"warning\" | \"success\" | \"plain\" | \"subdued\" | \"primary\" | \"accent\" | \"danger\" | \"transparent\" | undefined; }) => JSX.Element" ], "path": "packages/kbn-visualization-ui-components/components/drag_drop_bucket/buckets.tsx", "deprecated": false, @@ -553,7 +553,7 @@ "label": "bgColor", "description": [], "signature": [ - "\"warning\" | \"success\" | \"subdued\" | \"primary\" | \"accent\" | \"danger\" | \"plain\" | \"transparent\" | undefined" + "\"warning\" | \"success\" | \"plain\" | \"subdued\" | \"primary\" | \"accent\" | \"danger\" | \"transparent\" | undefined" ], "path": "packages/kbn-visualization-ui-components/components/drag_drop_bucket/buckets.tsx", "deprecated": false, @@ -1980,126 +1980,6 @@ "returnComment": [], "initialIsOpen": false }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.useDebouncedValue", - "type": "Function", - "tags": [], - "label": "useDebouncedValue", - "description": [ - "\nDebounces value changes and updates inputValue on root state changes if no debounced changes\nare in flight because the user is currently modifying the value.\n\n* allowFalsyValue: update upstream with all falsy values but null or undefined\n\nWhen testing this function mock the \"debounce\" function in lodash (see this module test for an example)" - ], - "signature": [ - "({ onChange, value, defaultValue, }: { onChange: (val: T) => void; value: T; defaultValue?: T | undefined; }, { allowFalsyValue }?: { allowFalsyValue?: boolean | undefined; }) => { inputValue: T; handleInputChange: (val: T) => void; initialValue: T; }" - ], - "path": "packages/kbn-visualization-ui-components/components/debounced_value.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.useDebouncedValue.$1", - "type": "Object", - "tags": [], - "label": "{\n onChange,\n value,\n defaultValue,\n }", - "description": [], - "path": "packages/kbn-visualization-ui-components/components/debounced_value.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.useDebouncedValue.$1.onChange", - "type": "Function", - "tags": [], - "label": "onChange", - "description": [], - "signature": [ - "(val: T) => void" - ], - "path": "packages/kbn-visualization-ui-components/components/debounced_value.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.useDebouncedValue.$1.onChange.$1", - "type": "Uncategorized", - "tags": [], - "label": "val", - "description": [], - "signature": [ - "T" - ], - "path": "packages/kbn-visualization-ui-components/components/debounced_value.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.useDebouncedValue.$1.value", - "type": "Uncategorized", - "tags": [], - "label": "value", - "description": [], - "signature": [ - "T" - ], - "path": "packages/kbn-visualization-ui-components/components/debounced_value.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.useDebouncedValue.$1.defaultValue", - "type": "Uncategorized", - "tags": [], - "label": "defaultValue", - "description": [], - "signature": [ - "T | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/debounced_value.ts", - "deprecated": false, - "trackAdoption": false - } - ] - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.useDebouncedValue.$2", - "type": "Object", - "tags": [], - "label": "{ allowFalsyValue }", - "description": [], - "path": "packages/kbn-visualization-ui-components/components/debounced_value.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.useDebouncedValue.$2.allowFalsyValue", - "type": "CompoundType", - "tags": [], - "label": "allowFalsyValue", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/debounced_value.ts", - "deprecated": false, - "trackAdoption": false - } - ] - } - ], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "@kbn/visualization-ui-components", "id": "def-public.validateQuery", diff --git a/api_docs/kbn_visualization_ui_components.mdx b/api_docs/kbn_visualization_ui_components.mdx index 91dd35a796e22..fdb610951ae99 100644 --- a/api_docs/kbn_visualization_ui_components.mdx +++ b/api_docs/kbn_visualization_ui_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-visualization-ui-components title: "@kbn/visualization-ui-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/visualization-ui-components plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/visualization-ui-components'] --- import kbnVisualizationUiComponentsObj from './kbn_visualization_ui_components.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 154 | 0 | 150 | 3 | +| 146 | 0 | 143 | 3 | ## Client diff --git a/api_docs/kbn_visualization_utils.devdocs.json b/api_docs/kbn_visualization_utils.devdocs.json index e20561e6cecba..cfab1eba9dc94 100644 --- a/api_docs/kbn_visualization_utils.devdocs.json +++ b/api_docs/kbn_visualization_utils.devdocs.json @@ -274,6 +274,140 @@ ], "returnComment": [], "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/visualization-utils", + "id": "def-common.useDebouncedValue", + "type": "Function", + "tags": [], + "label": "useDebouncedValue", + "description": [ + "\nDebounces value changes and updates inputValue on root state changes if no debounced changes\nare in flight because the user is currently modifying the value.\n\n* allowFalsyValue: update upstream with all falsy values but null or undefined\n* wait: debounce timeout" + ], + "signature": [ + "({ onChange, value, defaultValue, }: { onChange: (val: T) => void; value: T; defaultValue?: T | undefined; }, { allowFalsyValue, wait }?: { allowFalsyValue?: boolean | undefined; wait?: number | undefined; }) => { inputValue: T; handleInputChange: (val: T) => void; initialValue: T; }" + ], + "path": "packages/kbn-visualization-utils/src/debounced_value.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/visualization-utils", + "id": "def-common.useDebouncedValue.$1", + "type": "Object", + "tags": [], + "label": "{\n onChange,\n value,\n defaultValue,\n }", + "description": [], + "path": "packages/kbn-visualization-utils/src/debounced_value.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/visualization-utils", + "id": "def-common.useDebouncedValue.$1.onChange", + "type": "Function", + "tags": [], + "label": "onChange", + "description": [], + "signature": [ + "(val: T) => void" + ], + "path": "packages/kbn-visualization-utils/src/debounced_value.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/visualization-utils", + "id": "def-common.useDebouncedValue.$1.onChange.$1", + "type": "Uncategorized", + "tags": [], + "label": "val", + "description": [], + "signature": [ + "T" + ], + "path": "packages/kbn-visualization-utils/src/debounced_value.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/visualization-utils", + "id": "def-common.useDebouncedValue.$1.value", + "type": "Uncategorized", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "T" + ], + "path": "packages/kbn-visualization-utils/src/debounced_value.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-utils", + "id": "def-common.useDebouncedValue.$1.defaultValue", + "type": "Uncategorized", + "tags": [], + "label": "defaultValue", + "description": [], + "signature": [ + "T | undefined" + ], + "path": "packages/kbn-visualization-utils/src/debounced_value.ts", + "deprecated": false, + "trackAdoption": false + } + ] + }, + { + "parentPluginId": "@kbn/visualization-utils", + "id": "def-common.useDebouncedValue.$2", + "type": "Object", + "tags": [], + "label": "{ allowFalsyValue, wait = DEFAULT_TIMEOUT }", + "description": [], + "path": "packages/kbn-visualization-utils/src/debounced_value.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/visualization-utils", + "id": "def-common.useDebouncedValue.$2.allowFalsyValue", + "type": "CompoundType", + "tags": [], + "label": "allowFalsyValue", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-visualization-utils/src/debounced_value.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-utils", + "id": "def-common.useDebouncedValue.$2.wait", + "type": "number", + "tags": [], + "label": "wait", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "packages/kbn-visualization-utils/src/debounced_value.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false } ], "interfaces": [], diff --git a/api_docs/kbn_visualization_utils.mdx b/api_docs/kbn_visualization_utils.mdx index dbb54a80b7f87..f15b60025e25c 100644 --- a/api_docs/kbn_visualization_utils.mdx +++ b/api_docs/kbn_visualization_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-visualization-utils title: "@kbn/visualization-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/visualization-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/visualization-utils'] --- import kbnVisualizationUtilsObj from './kbn_visualization_utils.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 10 | 0 | 9 | 1 | +| 19 | 0 | 17 | 1 | ## Common diff --git a/api_docs/kbn_xstate_utils.mdx b/api_docs/kbn_xstate_utils.mdx index 979805b0144ec..7d775c092d435 100644 --- a/api_docs/kbn_xstate_utils.mdx +++ b/api_docs/kbn_xstate_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-xstate-utils title: "@kbn/xstate-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/xstate-utils plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/xstate-utils'] --- import kbnXstateUtilsObj from './kbn_xstate_utils.devdocs.json'; diff --git a/api_docs/kbn_yarn_lock_validator.mdx b/api_docs/kbn_yarn_lock_validator.mdx index b1c3b0539048f..f7c3bbfd7710d 100644 --- a/api_docs/kbn_yarn_lock_validator.mdx +++ b/api_docs/kbn_yarn_lock_validator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-yarn-lock-validator title: "@kbn/yarn-lock-validator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/yarn-lock-validator plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/yarn-lock-validator'] --- import kbnYarnLockValidatorObj from './kbn_yarn_lock_validator.devdocs.json'; diff --git a/api_docs/kbn_zod_helpers.mdx b/api_docs/kbn_zod_helpers.mdx index f6be23d9593de..d1ab58512efea 100644 --- a/api_docs/kbn_zod_helpers.mdx +++ b/api_docs/kbn_zod_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-zod-helpers title: "@kbn/zod-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/zod-helpers plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/zod-helpers'] --- import kbnZodHelpersObj from './kbn_zod_helpers.devdocs.json'; diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index 799026a521b55..9d52f95b68f65 100644 --- a/api_docs/kibana_overview.mdx +++ b/api_docs/kibana_overview.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaOverview title: "kibanaOverview" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaOverview plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaOverview'] --- import kibanaOverviewObj from './kibana_overview.devdocs.json'; diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index d86b9b3631791..2edf16ed37065 100644 --- a/api_docs/kibana_react.mdx +++ b/api_docs/kibana_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaReact title: "kibanaReact" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaReact plugin -date: 2024-07-04 +date: 2024-07-11 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 103779c04280f..05bcd7119c127 100644 --- a/api_docs/kibana_utils.mdx +++ b/api_docs/kibana_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaUtils title: "kibanaUtils" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaUtils plugin -date: 2024-07-04 +date: 2024-07-11 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 ad0727f0e3d79..87a253ec3a36c 100644 --- a/api_docs/kubernetes_security.mdx +++ b/api_docs/kubernetes_security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kubernetesSecurity title: "kubernetesSecurity" image: https://source.unsplash.com/400x175/?github description: API docs for the kubernetesSecurity plugin -date: 2024-07-04 +date: 2024-07-11 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 efd0ff8b1c20c..0534b92e8b64c 100644 --- a/api_docs/lens.devdocs.json +++ b/api_docs/lens.devdocs.json @@ -1297,7 +1297,7 @@ "label": "mode", "description": [], "signature": [ - "\"full\" | \"custom\" | \"dataBounds\"" + "\"custom\" | \"full\" | \"dataBounds\"" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false, @@ -4455,6 +4455,63 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "lens", + "id": "def-public.MetricVisualizationState.titlesTextAlign", + "type": "CompoundType", + "tags": [], + "label": "titlesTextAlign", + "description": [], + "signature": [ + "\"right\" | \"left\" | \"center\" | undefined" + ], + "path": "x-pack/plugins/lens/public/visualizations/metric/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "lens", + "id": "def-public.MetricVisualizationState.valuesTextAlign", + "type": "CompoundType", + "tags": [], + "label": "valuesTextAlign", + "description": [], + "signature": [ + "\"right\" | \"left\" | \"center\" | undefined" + ], + "path": "x-pack/plugins/lens/public/visualizations/metric/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "lens", + "id": "def-public.MetricVisualizationState.iconAlign", + "type": "CompoundType", + "tags": [], + "label": "iconAlign", + "description": [], + "signature": [ + "\"right\" | \"left\" | undefined" + ], + "path": "x-pack/plugins/lens/public/visualizations/metric/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "lens", + "id": "def-public.MetricVisualizationState.valueFontMode", + "type": "CompoundType", + "tags": [], + "label": "valueFontMode", + "description": [], + "signature": [ + "ValueFontMode", + " | undefined" + ], + "path": "x-pack/plugins/lens/public/visualizations/metric/types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "lens", "id": "def-public.MetricVisualizationState.color", @@ -4469,6 +4526,20 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "lens", + "id": "def-public.MetricVisualizationState.icon", + "type": "string", + "tags": [], + "label": "icon", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/lens/public/visualizations/metric/types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "lens", "id": "def-public.MetricVisualizationState.palette", @@ -5545,7 +5616,7 @@ "label": "changeType", "description": [], "signature": [ - "\"layers\" | \"initial\" | \"unchanged\" | \"reduced\" | \"extended\" | \"reorder\"" + "\"extended\" | \"layers\" | \"initial\" | \"unchanged\" | \"reduced\" | \"reorder\"" ], "path": "x-pack/plugins/lens/public/types.ts", "deprecated": false, @@ -5836,7 +5907,7 @@ "\nThe change type indicates what was changed in this table compared to the currently active table of this layer." ], "signature": [ - "\"layers\" | \"initial\" | \"unchanged\" | \"reduced\" | \"extended\" | \"reorder\"" + "\"extended\" | \"layers\" | \"initial\" | \"unchanged\" | \"reduced\" | \"reorder\"" ], "path": "x-pack/plugins/lens/public/types.ts", "deprecated": false, @@ -10687,7 +10758,7 @@ "label": "AxisExtentMode", "description": [], "signature": [ - "\"full\" | \"custom\" | \"dataBounds\"" + "\"custom\" | \"full\" | \"dataBounds\"" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false, @@ -11091,7 +11162,15 @@ }, " | undefined>; canViewUnderlyingData: () => Promise; getViewUnderlyingDataArgs: () => ", "ViewUnderlyingDataArgs", - "; } & ", + "; getFullAttributes: () => ", + { + "pluginId": "lens", + "scope": "public", + "docId": "kibLensPluginApi", + "section": "def-public.LensSavedObjectAttributes", + "text": "LensSavedObjectAttributes" + }, + " | undefined; } & ", { "pluginId": "@kbn/presentation-publishing", "scope": "common", @@ -11147,7 +11226,15 @@ "section": "def-common.HasParentApi", "text": "HasParentApi" }, - ">" + ">>" ], "path": "x-pack/plugins/lens/public/embeddable/interfaces/lens_api.ts", "deprecated": false, @@ -12000,7 +12087,7 @@ "label": "YScaleType", "description": [], "signature": [ - "\"log\" | \"time\" | \"linear\" | \"sqrt\"" + "\"log\" | \"sqrt\" | \"time\" | \"linear\"" ], "path": "src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts", "deprecated": false, diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index a60ddd7a5b0b4..dfed4b921904a 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lens title: "lens" image: https://source.unsplash.com/400x175/?github description: API docs for the lens plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] --- import lensObj from './lens.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 672 | 0 | 570 | 62 | +| 677 | 0 | 575 | 63 | ## Client diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index 71e7f45ad5a21..5287fcc22423c 100644 --- a/api_docs/license_api_guard.mdx +++ b/api_docs/license_api_guard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseApiGuard title: "licenseApiGuard" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseApiGuard plugin -date: 2024-07-04 +date: 2024-07-11 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 932ec13479be7..c63e0fec1868a 100644 --- a/api_docs/license_management.mdx +++ b/api_docs/license_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseManagement title: "licenseManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseManagement plugin -date: 2024-07-04 +date: 2024-07-11 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 53b85119a88b4..805961d08f569 100644 --- a/api_docs/licensing.mdx +++ b/api_docs/licensing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licensing title: "licensing" image: https://source.unsplash.com/400x175/?github description: API docs for the licensing plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] --- import licensingObj from './licensing.devdocs.json'; diff --git a/api_docs/links.devdocs.json b/api_docs/links.devdocs.json index e242c392dcd42..1ab91b751ab1f 100644 --- a/api_docs/links.devdocs.json +++ b/api_docs/links.devdocs.json @@ -1,1184 +1,11 @@ { "id": "links", "client": { - "classes": [ - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable", - "type": "Class", - "tags": [], - "label": "LinksEmbeddable", - "description": [], - "signature": [ - { - "pluginId": "links", - "scope": "public", - "docId": "kibLinksPluginApi", - "section": "def-public.LinksEmbeddable", - "text": "LinksEmbeddable" - }, - " extends ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.Embeddable", - "text": "Embeddable" - }, - "<", - "LinksInput", - ", ", - "LinksOutput", - ", any> implements ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ReferenceOrValueEmbeddable", - "text": "ReferenceOrValueEmbeddable" - }, - "<", - "LinksByValueInput", - ", ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.SavedObjectEmbeddableInput", - "text": "SavedObjectEmbeddableInput" - }, - ">" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "\"links\"" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.deferEmbeddableLoad", - "type": "boolean", - "tags": [], - "label": "deferEmbeddableLoad", - "description": [], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.attributes", - "type": "Object", - "tags": [], - "label": "attributes", - "description": [], - "signature": [ - "LinksAttributes", - " | undefined" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.attributes$", - "type": "Object", - "tags": [], - "label": "attributes$", - "description": [], - "signature": [ - "Subject", - "<", - "LinksAttributes", - ">" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.grouping", - "type": "Array", - "tags": [], - "label": "grouping", - "description": [], - "signature": [ - { - "pluginId": "@kbn/ui-actions-browser", - "scope": "common", - "docId": "kibKbnUiActionsBrowserPluginApi", - "section": "def-common.PresentableGroup", - "text": "PresentableGroup" - }, - "[]" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.Unnamed.$1", - "type": "Object", - "tags": [], - "label": "config", - "description": [], - "signature": [ - "LinksConfig" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.Unnamed.$2", - "type": "CompoundType", - "tags": [], - "label": "initialInput", - "description": [], - "signature": [ - "LinksInput" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.Unnamed.$3", - "type": "Object", - "tags": [], - "label": "attributeService", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.AttributeService", - "text": "AttributeService" - }, - "<", - "LinksAttributes", - ", ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - " & { attributes: ", - "LinksAttributes", - "; }, ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.SavedObjectEmbeddableInput", - "text": "SavedObjectEmbeddableInput" - }, - ", unknown>" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.Unnamed.$4", - "type": "Object", - "tags": [], - "label": "parent", - "description": [], - "signature": [ - "DashboardContainer", - " | undefined" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } - ], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.onRender", - "type": "Function", - "tags": [], - "label": "onRender", - "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.onLoading", - "type": "Function", - "tags": [], - "label": "onLoading", - "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.inputIsRefType", - "type": "Function", - "tags": [], - "label": "inputIsRefType", - "description": [], - "signature": [ - "(input: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.SavedObjectEmbeddableInput", - "text": "SavedObjectEmbeddableInput" - }, - " | ", - "LinksByValueInput", - ") => input is ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.SavedObjectEmbeddableInput", - "text": "SavedObjectEmbeddableInput" - } - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.inputIsRefType.$1", - "type": "CompoundType", - "tags": [], - "label": "input", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.SavedObjectEmbeddableInput", - "text": "SavedObjectEmbeddableInput" - }, - " | ", - "LinksByValueInput" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.getInputAsRefType", - "type": "Function", - "tags": [], - "label": "getInputAsRefType", - "description": [], - "signature": [ - "() => Promise<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.SavedObjectEmbeddableInput", - "text": "SavedObjectEmbeddableInput" - }, - ">" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.getInputAsValueType", - "type": "Function", - "tags": [], - "label": "getInputAsValueType", - "description": [], - "signature": [ - "() => Promise<", - "LinksByValueInput", - ">" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.reload", - "type": "Function", - "tags": [], - "label": "reload", - "description": [], - "signature": [ - "() => Promise" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.destroy", - "type": "Function", - "tags": [], - "label": "destroy", - "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.render", - "type": "Function", - "tags": [], - "label": "render", - "description": [], - "signature": [ - "(domNode: HTMLElement) => JSX.Element | undefined" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "links", - "id": "def-public.LinksEmbeddable.render.$1", - "type": "Object", - "tags": [], - "label": "domNode", - "description": [], - "signature": [ - "HTMLElement" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition", - "type": "Class", - "tags": [], - "label": "LinksFactoryDefinition", - "description": [], - "signature": [ - { - "pluginId": "links", - "scope": "public", - "docId": "kibLinksPluginApi", - "section": "def-public.LinksFactoryDefinition", - "text": "LinksFactoryDefinition" - }, - " implements ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableFactoryDefinition", - "text": "EmbeddableFactoryDefinition" - }, - "<", - "LinksInput", - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" - }, - "<", - "LinksInput", - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", any>, ", - { - "pluginId": "savedObjectsFinder", - "scope": "common", - "docId": "kibSavedObjectsFinderPluginApi", - "section": "def-common.FinderAttributes", - "text": "FinderAttributes" - }, - ">,", - { - "pluginId": "dashboard", - "scope": "public", - "docId": "kibDashboardPluginApi", - "section": "def-public.IProvidesLegacyPanelPlacementSettings", - "text": "IProvidesLegacyPanelPlacementSettings" - }, - "<", - "LinksInput", - ", unknown>" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.latestVersion", - "type": "string", - "tags": [], - "label": "latestVersion", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.telemetry", - "type": "Function", - "tags": [], - "label": "telemetry", - "description": [], - "signature": [ - "((state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - ", stats: Record) => Record) | undefined" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.migrations", - "type": "CompoundType", - "tags": [], - "label": "migrations", - "description": [], - "signature": [ - { - "pluginId": "kibanaUtils", - "scope": "common", - "docId": "kibKibanaUtilsPluginApi", - "section": "def-common.MigrateFunctionsObject", - "text": "MigrateFunctionsObject" - }, - " | ", - { - "pluginId": "kibanaUtils", - "scope": "common", - "docId": "kibKibanaUtilsPluginApi", - "section": "def-common.GetMigrationFunctionObjectFn", - "text": "GetMigrationFunctionObjectFn" - }, - " | undefined" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.grouping", - "type": "Array", - "tags": [], - "label": "grouping", - "description": [], - "signature": [ - { - "pluginId": "@kbn/ui-actions-browser", - "scope": "common", - "docId": "kibKbnUiActionsBrowserPluginApi", - "section": "def-common.PresentableGroup", - "text": "PresentableGroup" - }, - "[]" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "\"links\"" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.isContainerType", - "type": "boolean", - "tags": [], - "label": "isContainerType", - "description": [], - "signature": [ - "false" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.savedObjectMetaData", - "type": "Object", - "tags": [], - "label": "savedObjectMetaData", - "description": [], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.savedObjectMetaData.name", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.savedObjectMetaData.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.savedObjectMetaData.getIconForSavedObject", - "type": "Function", - "tags": [], - "label": "getIconForSavedObject", - "description": [], - "signature": [ - "() => string" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - } - ] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.getLegacyPanelPlacementSettings", - "type": "Function", - "tags": [], - "label": "getLegacyPanelPlacementSettings", - "description": [], - "signature": [ - "(input: ", - "LinksInput", - ", attributes: unknown) => { width?: undefined; height?: undefined; strategy?: undefined; } | { width: number; height: number; strategy: ", - { - "pluginId": "dashboard", - "scope": "public", - "docId": "kibDashboardPluginApi", - "section": "def-public.PanelPlacementStrategy", - "text": "PanelPlacementStrategy" - }, - ".placeAtTop; }" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.getLegacyPanelPlacementSettings.$1", - "type": "CompoundType", - "tags": [], - "label": "input", - "description": [], - "signature": [ - "LinksInput" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.getLegacyPanelPlacementSettings.$2", - "type": "Unknown", - "tags": [], - "label": "attributes", - "description": [], - "signature": [ - "unknown" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.isEditable", - "type": "Function", - "tags": [], - "label": "isEditable", - "description": [], - "signature": [ - "() => Promise" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.canCreateNew", - "type": "Function", - "tags": [], - "label": "canCreateNew", - "description": [], - "signature": [ - "() => boolean" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.getDefaultInput", - "type": "Function", - "tags": [], - "label": "getDefaultInput", - "description": [], - "signature": [ - "() => Partial<", - "LinksInput", - ">" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.createFromSavedObject", - "type": "Function", - "tags": [], - "label": "createFromSavedObject", - "description": [], - "signature": [ - "(savedObjectId: string, input: ", - "LinksInput", - ", parent: ", - "DashboardContainer", - ") => Promise<", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ErrorEmbeddable", - "text": "ErrorEmbeddable" - }, - " | ", - { - "pluginId": "links", - "scope": "public", - "docId": "kibLinksPluginApi", - "section": "def-public.LinksEmbeddable", - "text": "LinksEmbeddable" - }, - ">" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.createFromSavedObject.$1", - "type": "string", - "tags": [], - "label": "savedObjectId", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.createFromSavedObject.$2", - "type": "CompoundType", - "tags": [], - "label": "input", - "description": [], - "signature": [ - "LinksInput" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.createFromSavedObject.$3", - "type": "Object", - "tags": [], - "label": "parent", - "description": [], - "signature": [ - "DashboardContainer" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.create", - "type": "Function", - "tags": [], - "label": "create", - "description": [], - "signature": [ - "(initialInput: ", - "LinksInput", - ", parent: ", - "DashboardContainer", - ") => Promise<", - { - "pluginId": "links", - "scope": "public", - "docId": "kibLinksPluginApi", - "section": "def-public.LinksEmbeddable", - "text": "LinksEmbeddable" - }, - ">" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.create.$1", - "type": "CompoundType", - "tags": [], - "label": "initialInput", - "description": [], - "signature": [ - "LinksInput" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.create.$2", - "type": "Object", - "tags": [], - "label": "parent", - "description": [], - "signature": [ - "DashboardContainer" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.getExplicitInput", - "type": "Function", - "tags": [], - "label": "getExplicitInput", - "description": [], - "signature": [ - "(initialInput: ", - "LinksInput", - ", parent?: ", - "DashboardContainer", - " | undefined) => Promise<", - "LinksEditorFlyoutReturn", - ">" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.getExplicitInput.$1", - "type": "CompoundType", - "tags": [], - "label": "initialInput", - "description": [], - "signature": [ - "LinksInput" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.getExplicitInput.$2", - "type": "Object", - "tags": [], - "label": "parent", - "description": [], - "signature": [ - "DashboardContainer", - " | undefined" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } - ], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.getDisplayName", - "type": "Function", - "tags": [], - "label": "getDisplayName", - "description": [], - "signature": [ - "() => string" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.getIconType", - "type": "Function", - "tags": [], - "label": "getIconType", - "description": [], - "signature": [ - "() => string" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.getDescription", - "type": "Function", - "tags": [], - "label": "getDescription", - "description": [], - "signature": [ - "() => string" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.inject", - "type": "Function", - "tags": [], - "label": "inject", - "description": [], - "signature": [ - "((state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - ", references: ", - { - "pluginId": "@kbn/core-saved-objects-common", - "scope": "common", - "docId": "kibKbnCoreSavedObjectsCommonPluginApi", - "section": "def-common.SavedObjectReference", - "text": "SavedObjectReference" - }, - "[]) => ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - ") | undefined" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "links", - "id": "def-public.LinksFactoryDefinition.extract", - "type": "Function", - "tags": [], - "label": "extract", - "description": [], - "signature": [ - "((state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - ") => { state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - "; references: ", - { - "pluginId": "@kbn/core-saved-objects-common", - "scope": "common", - "docId": "kibKbnCoreSavedObjectsCommonPluginApi", - "section": "def-common.SavedObjectReference", - "text": "SavedObjectReference" - }, - "[]; }) | undefined" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - } - ], + "classes": [], "functions": [], "interfaces": [], "enums": [], - "misc": [ - { - "parentPluginId": "links", - "id": "def-public.LinksFactory", - "type": "Type", - "tags": [], - "label": "LinksFactory", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableFactory", - "text": "EmbeddableFactory" - }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" - }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", any>, ", - { - "pluginId": "savedObjectsFinder", - "scope": "common", - "docId": "kibSavedObjectsFinderPluginApi", - "section": "def-common.FinderAttributes", - "text": "FinderAttributes" - }, - ">" - ], - "path": "src/plugins/links/public/embeddable/links_embeddable_factory.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - } - ], + "misc": [], "objects": [] }, "server": { @@ -1237,6 +64,18 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "links", + "id": "def-common.DISPLAY_NAME", + "type": "string", + "tags": [], + "label": "DISPLAY_NAME", + "description": [], + "path": "src/plugins/links/common/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "links", "id": "def-common.LATEST_VERSION", diff --git a/api_docs/links.mdx b/api_docs/links.mdx index dd9983cca1f55..ef7ea92166ec3 100644 --- a/api_docs/links.mdx +++ b/api_docs/links.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/links title: "links" image: https://source.unsplash.com/400x175/?github description: API docs for the links plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'links'] --- import linksObj from './links.devdocs.json'; @@ -21,15 +21,7 @@ Contact [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kib | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 58 | 0 | 58 | 6 | - -## Client - -### Classes - - -### Consts, variables and types - +| 5 | 0 | 5 | 0 | ## Common diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index 1fe215e6756d3..2ffa82c931dd4 100644 --- a/api_docs/lists.mdx +++ b/api_docs/lists.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lists title: "lists" image: https://source.unsplash.com/400x175/?github description: API docs for the lists plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] --- import listsObj from './lists.devdocs.json'; diff --git a/api_docs/logs_data_access.devdocs.json b/api_docs/logs_data_access.devdocs.json index c4f3b466d53a4..31566796c9ade 100644 --- a/api_docs/logs_data_access.devdocs.json +++ b/api_docs/logs_data_access.devdocs.json @@ -124,6 +124,14 @@ "section": "def-server.LogsRatesServiceReturnType", "text": "LogsRatesServiceReturnType" }, + ">; getLogsRateTimeseries: ({ esClient, identifyingMetadata, serviceNames, timeFrom, timeTo, kuery, serviceEnvironmentQuery, }: ", + "LogsRateTimeseries", + ") => Promise<", + "LogsRateTimeseriesReturnType", + ">; getLogsErrorRateTimeseries: ({ esClient, identifyingMetadata, serviceNames, timeFrom, timeTo, kuery, serviceEnvironmentQuery, }: ", + "LogsErrorRateTimeseries", + ") => Promise<", + "LogsErrorRateTimeseriesReturnType", ">; getLogSourcesService: (request: ", { "pluginId": "@kbn/core-http-server", diff --git a/api_docs/logs_data_access.mdx b/api_docs/logs_data_access.mdx index 76dc5414b4d91..b9cdbfba6e59b 100644 --- a/api_docs/logs_data_access.mdx +++ b/api_docs/logs_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/logsDataAccess title: "logsDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the logsDataAccess plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsDataAccess'] --- import logsDataAccessObj from './logs_data_access.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 7 | 0 | 7 | 2 | +| 7 | 0 | 7 | 6 | ## Server diff --git a/api_docs/logs_explorer.mdx b/api_docs/logs_explorer.mdx index a49adadcbbcdf..a1f93ab35aae0 100644 --- a/api_docs/logs_explorer.mdx +++ b/api_docs/logs_explorer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/logsExplorer title: "logsExplorer" image: https://source.unsplash.com/400x175/?github description: API docs for the logsExplorer plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsExplorer'] --- import logsExplorerObj from './logs_explorer.devdocs.json'; diff --git a/api_docs/logs_shared.devdocs.json b/api_docs/logs_shared.devdocs.json index c5092240bfaea..37a481c7d4075 100644 --- a/api_docs/logs_shared.devdocs.json +++ b/api_docs/logs_shared.devdocs.json @@ -2926,6 +2926,46 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "logsShared", + "id": "def-public.LogsSharedClientStartDeps.share", + "type": "CompoundType", + "tags": [], + "label": "share", + "description": [], + "signature": [ + "{ toggleShareContextMenu: (options: ", + { + "pluginId": "share", + "scope": "public", + "docId": "kibSharePluginApi", + "section": "def-public.ShowShareMenuOptions", + "text": "ShowShareMenuOptions" + }, + ") => void; } & { url: ", + { + "pluginId": "share", + "scope": "public", + "docId": "kibSharePluginApi", + "section": "def-public.BrowserUrlService", + "text": "BrowserUrlService" + }, + "; navigate(options: ", + "RedirectOptions", + "<", + { + "pluginId": "@kbn/utility-types", + "scope": "common", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-common.SerializableRecord", + "text": "SerializableRecord" + }, + ">): void; }" + ], + "path": "x-pack/plugins/observability_solution/logs_shared/public/types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "logsShared", "id": "def-public.LogsSharedClientStartDeps.uiActions", @@ -5902,7 +5942,7 @@ "label": "LogEntryAfterCursor", "description": [], "signature": [ - "{ after: { time: string; tiebreaker: number; } | \"first\"; }" + "{ after: \"first\" | { time: string; tiebreaker: number; }; }" ], "path": "x-pack/plugins/observability_solution/logs_shared/common/log_entry/log_entry_cursor.ts", "deprecated": false, diff --git a/api_docs/logs_shared.mdx b/api_docs/logs_shared.mdx index 653a49f95abf9..d753ec97f3141 100644 --- a/api_docs/logs_shared.mdx +++ b/api_docs/logs_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/logsShared title: "logsShared" image: https://source.unsplash.com/400x175/?github description: API docs for the logsShared plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsShared'] --- import logsSharedObj from './logs_shared.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 296 | 0 | 268 | 32 | +| 297 | 0 | 269 | 32 | ## Client diff --git a/api_docs/management.mdx b/api_docs/management.mdx index d7a37b9b78075..88e95befdc61e 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/management title: "management" image: https://source.unsplash.com/400x175/?github description: API docs for the management plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'management'] --- import managementObj from './management.devdocs.json'; diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index 02a6ccf22b599..46d7c7405c2a7 100644 --- a/api_docs/maps.mdx +++ b/api_docs/maps.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/maps title: "maps" image: https://source.unsplash.com/400x175/?github description: API docs for the maps plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] --- import mapsObj from './maps.devdocs.json'; diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index 88577ac6485fd..cea152f5e2b51 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/mapsEms title: "mapsEms" image: https://source.unsplash.com/400x175/?github description: API docs for the mapsEms plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] --- import mapsEmsObj from './maps_ems.devdocs.json'; diff --git a/api_docs/metrics_data_access.devdocs.json b/api_docs/metrics_data_access.devdocs.json index 13625c031de7f..f23875b86c871 100644 --- a/api_docs/metrics_data_access.devdocs.json +++ b/api_docs/metrics_data_access.devdocs.json @@ -1507,7 +1507,7 @@ "label": "SnapshotMetricType", "description": [], "signature": [ - "\"count\" | \"custom\" | \"memory\" | \"rx\" | \"normalizedLoad1m\" | \"memoryFree\" | \"tx\" | \"logRate\" | \"cpu\" | \"s3BucketSize\" | \"s3NumberOfObjects\" | \"s3TotalRequests\" | \"s3UploadBytes\" | \"s3DownloadBytes\" | \"diskLatency\" | \"diskSpaceUsage\" | \"load\" | \"memoryTotal\" | \"diskIOReadBytes\" | \"diskIOWriteBytes\" | \"rdsLatency\" | \"rdsConnections\" | \"rdsQueriesExecuted\" | \"rdsActiveTransactions\" | \"sqsMessagesVisible\" | \"sqsMessagesDelayed\" | \"sqsMessagesEmpty\" | \"sqsMessagesSent\" | \"sqsOldestMessage\"" + "\"count\" | \"memory\" | \"custom\" | \"rx\" | \"normalizedLoad1m\" | \"memoryFree\" | \"tx\" | \"logRate\" | \"cpu\" | \"s3BucketSize\" | \"s3NumberOfObjects\" | \"s3TotalRequests\" | \"s3UploadBytes\" | \"s3DownloadBytes\" | \"diskLatency\" | \"diskSpaceUsage\" | \"load\" | \"memoryTotal\" | \"diskIOReadBytes\" | \"diskIOWriteBytes\" | \"rdsLatency\" | \"rdsConnections\" | \"rdsQueriesExecuted\" | \"rdsActiveTransactions\" | \"sqsMessagesVisible\" | \"sqsMessagesDelayed\" | \"sqsMessagesEmpty\" | \"sqsMessagesSent\" | \"sqsOldestMessage\"" ], "path": "x-pack/plugins/observability_solution/metrics_data_access/common/inventory_models/types.ts", "deprecated": false, diff --git a/api_docs/metrics_data_access.mdx b/api_docs/metrics_data_access.mdx index 54350b0924c4a..0b09dfea10e80 100644 --- a/api_docs/metrics_data_access.mdx +++ b/api_docs/metrics_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/metricsDataAccess title: "metricsDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the metricsDataAccess plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'metricsDataAccess'] --- import metricsDataAccessObj from './metrics_data_access.devdocs.json'; diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index f493e07f7e0bb..b2807f2a051a2 100644 --- a/api_docs/ml.mdx +++ b/api_docs/ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ml title: "ml" image: https://source.unsplash.com/400x175/?github description: API docs for the ml plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ml'] --- import mlObj from './ml.devdocs.json'; diff --git a/api_docs/mock_idp_plugin.mdx b/api_docs/mock_idp_plugin.mdx index 15be7829533ad..4909a1e634bc6 100644 --- a/api_docs/mock_idp_plugin.mdx +++ b/api_docs/mock_idp_plugin.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/mockIdpPlugin title: "mockIdpPlugin" image: https://source.unsplash.com/400x175/?github description: API docs for the mockIdpPlugin plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mockIdpPlugin'] --- import mockIdpPluginObj from './mock_idp_plugin.devdocs.json'; diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index 4bc6d153851b1..fcba5a7a72a94 100644 --- a/api_docs/monitoring.mdx +++ b/api_docs/monitoring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoring title: "monitoring" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoring plugin -date: 2024-07-04 +date: 2024-07-11 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 34d264e634bee..cb0a3d4ca3335 100644 --- a/api_docs/monitoring_collection.mdx +++ b/api_docs/monitoring_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoringCollection title: "monitoringCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoringCollection plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoringCollection'] --- import monitoringCollectionObj from './monitoring_collection.devdocs.json'; diff --git a/api_docs/navigation.mdx b/api_docs/navigation.mdx index 0f1e7a6bb27bc..ef2ba553deac4 100644 --- a/api_docs/navigation.mdx +++ b/api_docs/navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/navigation title: "navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the navigation plugin -date: 2024-07-04 +date: 2024-07-11 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 4c67fab6d9f3f..c0696a43adf04 100644 --- a/api_docs/newsfeed.mdx +++ b/api_docs/newsfeed.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/newsfeed title: "newsfeed" image: https://source.unsplash.com/400x175/?github description: API docs for the newsfeed plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'newsfeed'] --- import newsfeedObj from './newsfeed.devdocs.json'; diff --git a/api_docs/no_data_page.mdx b/api_docs/no_data_page.mdx index 924393777eaf6..2dd0b5b8da8e3 100644 --- a/api_docs/no_data_page.mdx +++ b/api_docs/no_data_page.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/noDataPage title: "noDataPage" image: https://source.unsplash.com/400x175/?github description: API docs for the noDataPage plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'noDataPage'] --- import noDataPageObj from './no_data_page.devdocs.json'; diff --git a/api_docs/notifications.mdx b/api_docs/notifications.mdx index 97b8a7c60b91a..c8b506954ee61 100644 --- a/api_docs/notifications.mdx +++ b/api_docs/notifications.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/notifications title: "notifications" image: https://source.unsplash.com/400x175/?github description: API docs for the notifications plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'notifications'] --- import notificationsObj from './notifications.devdocs.json'; diff --git a/api_docs/observability.devdocs.json b/api_docs/observability.devdocs.json index b3ed45a5dc0af..4b00709103738 100644 --- a/api_docs/observability.devdocs.json +++ b/api_docs/observability.devdocs.json @@ -4881,7 +4881,7 @@ "signature": [ "\"UPTIME_OVERVIEW_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "packages/deeplinks/observability/locators/uptime.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14633,7 +14633,7 @@ "signature": [ "\"UPTIME_OVERVIEW_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "packages/deeplinks/observability/locators/uptime.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index 83173879a2af4..18ae21442cfea 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observability title: "observability" image: https://source.unsplash.com/400x175/?github description: API docs for the observability plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] --- import observabilityObj from './observability.devdocs.json'; diff --git a/api_docs/observability_a_i_assistant.mdx b/api_docs/observability_a_i_assistant.mdx index ad9735161e5dd..94f0747e06a39 100644 --- a/api_docs/observability_a_i_assistant.mdx +++ b/api_docs/observability_a_i_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityAIAssistant title: "observabilityAIAssistant" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityAIAssistant plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityAIAssistant'] --- import observabilityAIAssistantObj from './observability_a_i_assistant.devdocs.json'; diff --git a/api_docs/observability_a_i_assistant_app.mdx b/api_docs/observability_a_i_assistant_app.mdx index 267f19dc38a03..a5734f975170e 100644 --- a/api_docs/observability_a_i_assistant_app.mdx +++ b/api_docs/observability_a_i_assistant_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityAIAssistantApp title: "observabilityAIAssistantApp" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityAIAssistantApp plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityAIAssistantApp'] --- import observabilityAIAssistantAppObj from './observability_a_i_assistant_app.devdocs.json'; diff --git a/api_docs/observability_ai_assistant_management.mdx b/api_docs/observability_ai_assistant_management.mdx index cf3f45bb07ec8..80f7c77827d38 100644 --- a/api_docs/observability_ai_assistant_management.mdx +++ b/api_docs/observability_ai_assistant_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityAiAssistantManagement title: "observabilityAiAssistantManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityAiAssistantManagement plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityAiAssistantManagement'] --- import observabilityAiAssistantManagementObj from './observability_ai_assistant_management.devdocs.json'; diff --git a/api_docs/observability_logs_explorer.mdx b/api_docs/observability_logs_explorer.mdx index 54c07b3d1221a..6c61de8b5b015 100644 --- a/api_docs/observability_logs_explorer.mdx +++ b/api_docs/observability_logs_explorer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityLogsExplorer title: "observabilityLogsExplorer" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityLogsExplorer plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityLogsExplorer'] --- import observabilityLogsExplorerObj from './observability_logs_explorer.devdocs.json'; diff --git a/api_docs/observability_onboarding.mdx b/api_docs/observability_onboarding.mdx index 70021f1b7a283..7492afaa416fd 100644 --- a/api_docs/observability_onboarding.mdx +++ b/api_docs/observability_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityOnboarding title: "observabilityOnboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityOnboarding plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityOnboarding'] --- import observabilityOnboardingObj from './observability_onboarding.devdocs.json'; diff --git a/api_docs/observability_shared.mdx b/api_docs/observability_shared.mdx index 4400441e6f619..6d3111a0ac489 100644 --- a/api_docs/observability_shared.mdx +++ b/api_docs/observability_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityShared title: "observabilityShared" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityShared plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityShared'] --- import observabilitySharedObj from './observability_shared.devdocs.json'; diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index 92462fdb2d85f..a566d206689c1 100644 --- a/api_docs/osquery.mdx +++ b/api_docs/osquery.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/osquery title: "osquery" image: https://source.unsplash.com/400x175/?github description: API docs for the osquery plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'osquery'] --- import osqueryObj from './osquery.devdocs.json'; diff --git a/api_docs/painless_lab.mdx b/api_docs/painless_lab.mdx index 40fd96e82ee66..1617fdc10a4c9 100644 --- a/api_docs/painless_lab.mdx +++ b/api_docs/painless_lab.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/painlessLab title: "painlessLab" image: https://source.unsplash.com/400x175/?github description: API docs for the painlessLab plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'painlessLab'] --- import painlessLabObj from './painless_lab.devdocs.json'; diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index fa1509d163ab0..37f80c7e739e9 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -7,7 +7,7 @@ id: kibDevDocsPluginDirectory slug: /kibana-dev-docs/api-meta/plugin-api-directory title: Directory description: Directory of public APIs available through plugins or packages. -date: 2024-07-04 +date: 2024-07-11 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 | |--------------|----------|------------------------| -| 810 | 694 | 42 | +| 812 | 696 | 42 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 49662 | 238 | 37887 | 1890 | +| 49923 | 239 | 38040 | 1897 | ## Plugin Directory @@ -57,7 +57,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 129 | 0 | 123 | 12 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 54 | 0 | 51 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3199 | 31 | 2590 | 24 | -| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 8 | 0 | 8 | 0 | +| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 5 | 0 | 5 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin provides the ability to create data views via a modal flyout inside Kibana apps | 35 | 0 | 25 | 5 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Reusable data view field editor across Kibana | 72 | 0 | 33 | 1 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Data view management app | 2 | 0 | 2 | 0 | @@ -74,20 +74,21 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Extends embeddable plugin with more functionality | 19 | 0 | 19 | 2 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides encryption and decryption utilities for saved objects containing sensitive information. | 53 | 0 | 46 | 1 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | Adds dashboards for discovering and managing Enterprise Search products. | 5 | 0 | 5 | 0 | -| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | Entity manager plugin for entity assets (inventory, topology, etc) | 8 | 0 | 8 | 1 | +| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | Entity manager plugin for entity assets (inventory, topology, etc) | 14 | 0 | 14 | 1 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 99 | 3 | 97 | 3 | +| | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 29 | 0 | 10 | 0 | | | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 2 | 0 | 2 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | The Event Annotation service contains expressions for event annotations | 201 | 0 | 201 | 6 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | The listing page for event annotations. | 15 | 0 | 15 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 112 | 0 | 112 | 11 | -| | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 126 | 0 | 126 | 12 | +| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 126 | 0 | 126 | 12 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'error' renderer to expressions | 17 | 0 | 15 | 2 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Expression Gauge plugin adds a `gauge` renderer and function to the expression plugin. The renderer will display the `gauge` chart. | 59 | 0 | 58 | 2 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Expression Heatmap plugin adds a `heatmap` renderer and function to the expression plugin. The renderer will display the `heatmap` chart. | 112 | 0 | 108 | 2 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'image' function and renderer to expressions | 26 | 0 | 26 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Adds a `metric` renderer and function to the expression plugin. The renderer will display the `legacy metric` chart. | 51 | 0 | 51 | 2 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'metric' function and renderer to expressions | 32 | 0 | 27 | 0 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Adds a `metric` renderer and function to the expression plugin. The renderer will display the `metric` chart. | 67 | 0 | 67 | 2 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Adds a `metric` renderer and function to the expression plugin. The renderer will display the `metric` chart. | 75 | 0 | 75 | 2 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Expression Partition Visualization plugin adds a `partitionVis` renderer and `pieVis`, `mosaicVis`, `treemapVis`, `waffleVis` functions to the expression plugin. The renderer will display the `pie`, `waffle`, `treemap` and `mosaic` charts. | 73 | 0 | 73 | 2 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'repeatImage' function and renderer to expressions | 32 | 0 | 32 | 0 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'revealImage' function and renderer to expressions | 14 | 0 | 14 | 3 | @@ -101,7 +102,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-gis](https://github.com/orgs/elastic/teams/kibana-gis) | The file upload plugin contains components and services for uploading a file, analyzing its data, and then importing the data into an Elasticsearch index. Supported file types include CSV, TSV, newline-delimited JSON and GeoJSON. | 84 | 0 | 84 | 8 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | File upload, download, sharing, and serving over HTTP implementation in Kibana. | 240 | 0 | 24 | 9 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Simple UI for managing files in Kibana | 3 | 0 | 3 | 0 | -| | [@elastic/fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1348 | 5 | 1226 | 72 | +| | [@elastic/fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1349 | 5 | 1227 | 72 | | ftrApis | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 72 | 0 | 14 | 5 | | globalSearchBar | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 0 | 0 | 0 | 0 | @@ -119,21 +120,21 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 127 | 2 | 100 | 4 | | | [@elastic/security-solution](https://github.com/orgs/elastic/teams/security-solution) | Plugin implementing the Integration Assistant API and UI | 47 | 0 | 40 | 3 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides UI and APIs for the interactive setup mode. | 28 | 0 | 18 | 0 | -| | [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai-assistant) | - | 95 | 0 | 95 | 4 | +| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 95 | 0 | 95 | 4 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 6 | 0 | 6 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 153 | 0 | 121 | 3 | | kibanaUsageCollection | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 610 | 3 | 417 | 9 | | | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 5 | 0 | 5 | 1 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 672 | 0 | 570 | 62 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 677 | 0 | 575 | 63 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 8 | 0 | 8 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 4 | 0 | 4 | 1 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 117 | 0 | 42 | 10 | -| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | A dashboard panel for creating links to dashboards or external links. | 58 | 0 | 58 | 6 | +| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | A dashboard panel for creating links to dashboards or external links. | 5 | 0 | 5 | 0 | | | [@elastic/security-detection-engine](https://github.com/orgs/elastic/teams/security-detection-engine) | - | 226 | 0 | 97 | 52 | -| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 7 | 0 | 7 | 2 | +| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 7 | 0 | 7 | 6 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | This plugin provides a LogsExplorer component using the Discover customization framework, offering several affordances specifically designed for log consumption. | 117 | 4 | 117 | 22 | -| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | Exposes the shared components and APIs to access and visualize logs. | 296 | 0 | 268 | 32 | +| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | Exposes the shared components and APIs to access and visualize logs. | 297 | 0 | 269 | 32 | | logstash | [@elastic/logstash](https://github.com/orgs/elastic/teams/logstash) | - | 0 | 0 | 0 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 44 | 0 | 44 | 7 | | | [@elastic/kibana-gis](https://github.com/orgs/elastic/teams/kibana-gis) | - | 209 | 0 | 205 | 28 | @@ -163,7 +164,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 23 | 0 | 23 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Reporting Services enables applications to feature reports that the user can automate with Watcher and download later. | 9 | 0 | 2 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 21 | 0 | 21 | 0 | -| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 276 | 0 | 247 | 14 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 286 | 0 | 249 | 14 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 24 | 0 | 19 | 2 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 132 | 2 | 121 | 5 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 25 | 0 | 25 | 0 | @@ -177,9 +178,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 18 | 0 | 10 | 0 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 10 | 0 | 6 | 1 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | Plugin to provide access to and rendering of python notebooks for use in the persistent developer console. | 8 | 0 | 8 | 1 | -| | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 18 | 0 | 10 | 1 | +| | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 15 | 0 | 9 | 1 | | searchprofiler | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 0 | 0 | 0 | 0 | -| | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides authentication and authorization features, and exposes functionality to understand the capabilities of the currently authenticated user. | 415 | 0 | 206 | 1 | +| | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides authentication and authorization features, and exposes functionality to understand the capabilities of the currently authenticated user. | 438 | 0 | 222 | 1 | | | [@elastic/security-solution](https://github.com/orgs/elastic/teams/security-solution) | - | 191 | 0 | 121 | 37 | | | [@elastic/security-solution](https://github.com/orgs/elastic/teams/security-solution) | ESS customizations for Security Solution. | 6 | 0 | 6 | 0 | | | [@elastic/security-solution](https://github.com/orgs/elastic/teams/security-solution) | Serverless customizations for security. | 7 | 0 | 7 | 0 | @@ -193,15 +194,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides the Spaces feature, which allows saved objects to be organized into meaningful categories. | 260 | 0 | 66 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 25 | 0 | 25 | 3 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 10 | 0 | 10 | 0 | -| synthetics | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | This plugin visualizes data from Synthetics and Heartbeat, and integrates with other Observability solutions. | 0 | 0 | 0 | 0 | +| synthetics | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | This plugin visualizes data from Synthetics and Heartbeat, and integrates with other Observability solutions. | 0 | 0 | 0 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 102 | 0 | 59 | 5 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 45 | 0 | 1 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 31 | 0 | 26 | 6 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 1 | 0 | 1 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 6 | 0 | 0 | 0 | -| | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 29 | 0 | 10 | 0 | | | [@elastic/security-threat-hunting-investigations](https://github.com/orgs/elastic/teams/security-threat-hunting-investigations) | Elastic threat intelligence helps you see if you are open to or have been subject to current or historical known threats | 30 | 0 | 14 | 4 | -| | [@elastic/security-threat-hunting-investigations](https://github.com/orgs/elastic/teams/security-threat-hunting-investigations) | - | 238 | 1 | 194 | 18 | +| | [@elastic/security-threat-hunting-investigations](https://github.com/orgs/elastic/teams/security-threat-hunting-investigations) | - | 228 | 1 | 184 | 18 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the transforms features provided by Elastic. Transforms enable you to convert existing Elasticsearch indices into summarized indices, which provide opportunities for new insights and analytics. | 4 | 0 | 4 | 1 | | translations | [@elastic/kibana-localization](https://github.com/orgs/elastic/teams/kibana-localization) | - | 0 | 0 | 0 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 588 | 1 | 562 | 52 | @@ -211,10 +211,10 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | The `unifiedHistogram` plugin provides UI components to create a layout including a resizable histogram and a main display. | 71 | 0 | 36 | 6 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains all the key functionality of Kibana's unified search experience.Contains all the key functionality of Kibana's unified search experience. | 152 | 2 | 113 | 23 | | upgradeAssistant | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 0 | 0 | 0 | 0 | -| | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | This plugin visualizes data from Heartbeat, and integrates with other Observability solutions. | 1 | 0 | 1 | 0 | +| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | This plugin visualizes data from Heartbeat, and integrates with other Observability solutions. | 1 | 0 | 1 | 0 | | urlDrilldown | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Adds drilldown implementations to Kibana | 0 | 0 | 0 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 12 | 0 | 12 | 0 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 55 | 0 | 16 | 2 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 56 | 0 | 16 | 2 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 2 | 0 | 2 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | The default editor used in most aggregation-based visualizations. | 56 | 0 | 49 | 4 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the gauge chart implementation using the elastic-charts library. The goal is to eventually deprecate the old implementation and keep only this. Until then, the library used is defined by the Legacy charts library advanced setting. | 7 | 0 | 7 | 2 | @@ -246,7 +246,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 23 | 0 | 22 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 194 | 0 | 191 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 33 | 0 | 33 | 0 | -| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 245 | 0 | 231 | 2 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 22 | 0 | 5 | 1 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 299 | 0 | 283 | 8 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 73 | 0 | 73 | 2 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 1 | 0 | 0 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 18 | 0 | 18 | 0 | @@ -277,7 +278,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 8 | 0 | 8 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 3 | 0 | 3 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 10 | 0 | 10 | 0 | -| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 48 | 0 | 32 | 3 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 49 | 0 | 33 | 3 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 30 | 0 | 30 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 195 | 1 | 128 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 101 | 0 | 0 | 0 | @@ -350,7 +351,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 54 | 7 | 54 | 6 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 13 | 0 | 13 | 1 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 495 | 2 | 193 | 0 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 92 | 0 | 79 | 10 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 95 | 0 | 82 | 10 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 44 | 0 | 43 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 4 | 0 | 2 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 3 | 0 | 3 | 0 | @@ -409,7 +410,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 4 | 0 | 4 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 128 | 0 | 94 | 44 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 12 | 0 | 12 | 0 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 561 | 1 | 133 | 4 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 562 | 1 | 134 | 4 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 71 | 0 | 70 | 5 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 14 | 0 | 14 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 36 | 0 | 6 | 0 | @@ -417,9 +418,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 8 | 0 | 8 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 8 | 0 | 8 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 20 | 0 | 6 | 0 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 52 | 0 | 16 | 0 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 146 | 1 | 63 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 16 | 0 | 16 | 0 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 13 | 0 | 13 | 2 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 15 | 0 | 15 | 2 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 12 | 0 | 2 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 21 | 0 | 20 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 20 | 0 | 3 | 0 | @@ -460,14 +461,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 51 | 0 | 51 | 1 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 14 | 0 | 9 | 0 | | | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 80 | 0 | 80 | 1 | -| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 5 | 0 | 4 | 0 | +| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 7 | 0 | 5 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 44 | 0 | 43 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 7 | 0 | 7 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 5 | 0 | 5 | 0 | | | [@elastic/fleet](https://github.com/orgs/elastic/teams/fleet) | - | 3 | 0 | 3 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 4 | 0 | 4 | 0 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 3 | 0 | 3 | 0 | -| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 45 | 0 | 33 | 0 | +| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 56 | 0 | 44 | 0 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 17 | 0 | 17 | 0 | | | [@elastic/security-solution](https://github.com/orgs/elastic/teams/security-solution) | - | 5 | 0 | 5 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 2 | 0 | 2 | 0 | @@ -489,14 +490,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 35 | 0 | 34 | 0 | | | [@elastic/security-generative-ai](https://github.com/orgs/elastic/teams/security-generative-ai) | - | 160 | 0 | 134 | 9 | | | [@elastic/security-generative-ai](https://github.com/orgs/elastic/teams/security-generative-ai) | - | 362 | 0 | 336 | 0 | -| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 18 | 0 | 18 | 0 | +| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 19 | 0 | 19 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 52 | 0 | 37 | 7 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 32 | 0 | 19 | 1 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 11 | 0 | 6 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 269 | 1 | 209 | 15 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 26 | 0 | 26 | 1 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 2 | 0 | 1 | 0 | -| | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 99 | 1 | 96 | 11 | +| | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 104 | 1 | 101 | 10 | | | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 53 | 0 | 51 | 0 | | | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 193 | 0 | 182 | 10 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 39 | 0 | 39 | 0 | @@ -511,7 +512,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 1 | 0 | 0 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 1 | 0 | 1 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 26 | 0 | 26 | 1 | -| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 17 | 0 | 12 | 8 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 17 | 0 | 12 | 10 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 49 | 0 | 47 | 0 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 33 | 3 | 24 | 6 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 3 | 0 | 3 | 0 | @@ -535,7 +536,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 7 | 0 | 5 | 0 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 193 | 0 | 190 | 6 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 172 | 0 | 172 | 1 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 27 | 0 | 1 | 2 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 28 | 0 | 2 | 2 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 8 | 0 | 8 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 2 | 0 | 2 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 6 | 0 | 1 | 1 | @@ -553,7 +554,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 2 | 0 | 0 | 0 | | | [@elastic/kibana-gis](https://github.com/orgs/elastic/teams/kibana-gis) | - | 592 | 1 | 1 | 0 | | | [@elastic/kibana-gis](https://github.com/orgs/elastic/teams/kibana-gis) | - | 2 | 0 | 2 | 0 | -| | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 102 | 2 | 0 | 0 | +| | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 90 | 1 | 0 | 0 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 207 | 3 | 1 | 0 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 8 | 0 | 8 | 0 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 37 | 0 | 0 | 0 | @@ -596,7 +597,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 1 | 0 | 1 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 1 | 0 | 1 | 0 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 82 | 0 | 71 | 0 | -| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 214 | 0 | 179 | 5 | +| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 216 | 0 | 181 | 5 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 168 | 0 | 55 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 13 | 0 | 7 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 22 | 0 | 9 | 0 | @@ -607,6 +608,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 18 | 0 | 3 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 11 | 0 | 2 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 11 | 0 | 8 | 0 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 14 | 0 | 7 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 18 | 0 | 18 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 40 | 0 | 38 | 5 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 13 | 0 | 9 | 0 | @@ -642,7 +644,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 7 | 0 | 7 | 0 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 118 | 0 | 59 | 0 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 51 | 0 | 25 | 0 | -| | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 216 | 0 | 121 | 0 | +| | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 275 | 1 | 154 | 0 | | | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 14 | 0 | 14 | 6 | | | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 54 | 0 | 49 | 0 | | | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 30 | 0 | 24 | 0 | @@ -672,7 +674,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/search-kibana @elastic/kibana-management](https://github.com/orgs/elastic/teams/search-kibana ) | - | 1 | 0 | 1 | 0 | | | [@elastic/security-solution @elastic/kibana-management](https://github.com/orgs/elastic/teams/security-solution ) | - | 1 | 0 | 1 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 2 | 0 | 0 | 0 | -| | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 4 | 0 | 4 | 0 | +| | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 5 | 0 | 5 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 3 | 0 | 2 | 2 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 8 | 0 | 2 | 1 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 30 | 0 | 8 | 0 | @@ -720,7 +722,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 41 | 2 | 21 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 7 | 0 | 5 | 1 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 315 | 4 | 267 | 13 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 25 | 0 | 13 | 0 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 36 | 0 | 18 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 131 | 3 | 98 | 2 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 2 | 0 | 1 | 0 | | | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 33 | 0 | 13 | 0 | @@ -731,7 +733,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 39 | 0 | 25 | 1 | | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 86 | 0 | 86 | 1 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 42 | 0 | 28 | 0 | -| | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 55 | 0 | 46 | 0 | +| | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 57 | 0 | 48 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 9 | 0 | 8 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Contains functionality for the unified data table which can be integrated into apps | 153 | 0 | 81 | 1 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 18 | 0 | 17 | 5 | @@ -743,8 +745,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 37 | 0 | 16 | 1 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 2 | 0 | 2 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 26 | 0 | 15 | 0 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 154 | 0 | 150 | 3 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 10 | 0 | 9 | 1 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 146 | 0 | 143 | 3 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 19 | 0 | 17 | 1 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 13 | 0 | 13 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 6 | 0 | 2 | 0 | | | [@elastic/security-detection-rule-management](https://github.com/orgs/elastic/teams/security-detection-rule-management) | - | 20 | 0 | 10 | 0 | diff --git a/api_docs/presentation_panel.mdx b/api_docs/presentation_panel.mdx index 5a7792bf3ac76..6020b7134ac6b 100644 --- a/api_docs/presentation_panel.mdx +++ b/api_docs/presentation_panel.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/presentationPanel title: "presentationPanel" image: https://source.unsplash.com/400x175/?github description: API docs for the presentationPanel plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationPanel'] --- import presentationPanelObj from './presentation_panel.devdocs.json'; diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index 6dc693ba98a6a..b44845d2bccf5 100644 --- a/api_docs/presentation_util.mdx +++ b/api_docs/presentation_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/presentationUtil title: "presentationUtil" image: https://source.unsplash.com/400x175/?github description: API docs for the presentationUtil plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationUtil'] --- import presentationUtilObj from './presentation_util.devdocs.json'; diff --git a/api_docs/profiling.mdx b/api_docs/profiling.mdx index 3ba6679b7c977..af1b22b1f5a80 100644 --- a/api_docs/profiling.mdx +++ b/api_docs/profiling.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/profiling title: "profiling" image: https://source.unsplash.com/400x175/?github description: API docs for the profiling plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'profiling'] --- import profilingObj from './profiling.devdocs.json'; diff --git a/api_docs/profiling_data_access.mdx b/api_docs/profiling_data_access.mdx index 352489dde1763..bc8b55f94b14b 100644 --- a/api_docs/profiling_data_access.mdx +++ b/api_docs/profiling_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/profilingDataAccess title: "profilingDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the profilingDataAccess plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'profilingDataAccess'] --- import profilingDataAccessObj from './profiling_data_access.devdocs.json'; diff --git a/api_docs/remote_clusters.mdx b/api_docs/remote_clusters.mdx index 32f26431579f2..4c345e18a0347 100644 --- a/api_docs/remote_clusters.mdx +++ b/api_docs/remote_clusters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/remoteClusters title: "remoteClusters" image: https://source.unsplash.com/400x175/?github description: API docs for the remoteClusters plugin -date: 2024-07-04 +date: 2024-07-11 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 d5c47f3f3ed21..fc5f161857818 100644 --- a/api_docs/reporting.mdx +++ b/api_docs/reporting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/reporting title: "reporting" image: https://source.unsplash.com/400x175/?github description: API docs for the reporting plugin -date: 2024-07-04 +date: 2024-07-11 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 840ca64f21b2d..a5cab8c2c7904 100644 --- a/api_docs/rollup.mdx +++ b/api_docs/rollup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/rollup title: "rollup" image: https://source.unsplash.com/400x175/?github description: API docs for the rollup plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] --- import rollupObj from './rollup.devdocs.json'; diff --git a/api_docs/rule_registry.devdocs.json b/api_docs/rule_registry.devdocs.json index fd79ee3f09e9a..a08293333c27a 100644 --- a/api_docs/rule_registry.devdocs.json +++ b/api_docs/rule_registry.devdocs.json @@ -399,9 +399,11 @@ "section": "def-common.RuleTypeParams", "text": "RuleTypeParams" }, - " = never>({ aggs, featureIds, index, query, search_after: searchAfter, size, sort, track_total_hits: trackTotalHits, _source, }: { aggs?: object | undefined; featureIds?: string[] | undefined; index?: string | undefined; query?: object | undefined; search_after?: (string | number)[] | undefined; size?: number | undefined; sort?: ", + " = never>({ aggs, featureIds, index, query, search_after: searchAfter, size, sort, track_total_hits: trackTotalHits, _source, runtimeMappings, }: { aggs?: object | undefined; featureIds?: string[] | undefined; index?: string | undefined; query?: object | undefined; search_after?: (string | number)[] | undefined; size?: number | undefined; sort?: ", "SortOptions", - "[] | undefined; track_total_hits?: number | boolean | undefined; _source?: string[] | undefined; }) => Promise<", + "[] | undefined; track_total_hits?: number | boolean | undefined; _source?: false | string[] | undefined; runtimeMappings?: ", + "MappingRuntimeFields", + " | undefined; }) => Promise<", "SearchResponse", " Promise<", + "SearchResponse", + ">, Record>>" + ], + "path": "x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "ruleRegistry", + "id": "def-server.AlertsClient.getGroupAggregations.$1", + "type": "Object", + "tags": [], + "label": "{\n featureIds,\n groupByField,\n aggregations,\n filters,\n pageIndex,\n pageSize,\n sort = [{ unitsCount: { order: 'desc' } }],\n }", + "description": [], + "path": "x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "ruleRegistry", + "id": "def-server.AlertsClient.getGroupAggregations.$1.featureIds", + "type": "Array", + "tags": [], + "label": "featureIds", + "description": [ + "\nThe feature ids the alerts belong to, used for authorization" + ], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.AlertsClient.getGroupAggregations.$1.groupByField", + "type": "string", + "tags": [], + "label": "groupByField", + "description": [ + "\nThe field to group by" + ], + "path": "x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.AlertsClient.getGroupAggregations.$1.aggregations", + "type": "Object", + "tags": [], + "label": "aggregations", + "description": [ + "\nThe aggregations to perform on the groupByField buckets" + ], + "signature": [ + "{ [x: string]: { avg?: { field?: string | undefined; missing?: string | number | boolean | undefined; } | undefined; cardinality?: { field?: string | undefined; precision_threshold?: number | undefined; rehash?: boolean | undefined; missing?: string | number | boolean | undefined; } | undefined; min?: { field?: string | undefined; missing?: string | number | boolean | undefined; format?: string | undefined; } | undefined; max?: { field?: string | undefined; missing?: string | number | boolean | undefined; format?: string | undefined; } | undefined; sum?: { field?: string | undefined; missing?: string | number | boolean | undefined; } | undefined; top_hits?: { explain?: boolean | undefined; docvalue_fields?: string | string[] | undefined; stored_fields?: string | string[] | undefined; from?: number | undefined; size?: number | undefined; sort?: string | { [x: string]: \"asc\" | \"desc\" | \"_doc\" | { missing?: string | number | boolean | undefined; mode?: \"min\" | \"max\" | \"sum\" | \"avg\" | \"median\" | undefined; order?: \"asc\" | \"desc\" | \"_doc\" | undefined; }; } | (string | { [x: string]: \"asc\" | \"desc\" | \"_doc\" | { missing?: string | number | boolean | undefined; mode?: \"min\" | \"max\" | \"sum\" | \"avg\" | \"median\" | undefined; order?: \"asc\" | \"desc\" | \"_doc\" | undefined; }; })[] | undefined; seq_no_primary_term?: boolean | undefined; version?: boolean | undefined; track_scores?: boolean | undefined; highlight?: any; _source?: string | boolean | string[] | undefined; } | undefined; weighted_avg?: { format?: string | undefined; value_type?: string | undefined; value?: { field?: string | undefined; missing?: number | undefined; } | undefined; weight?: { field?: string | undefined; missing?: number | undefined; } | undefined; } | undefined; } & BucketAggsSchemas & { aggs?: { [x: string]: BucketAggsSchemas & { avg?: { field?: string | undefined; missing?: string | number | boolean | undefined; } | undefined; cardinality?: { field?: string | undefined; precision_threshold?: number | undefined; rehash?: boolean | undefined; missing?: string | number | boolean | undefined; } | undefined; min?: { field?: string | undefined; missing?: string | number | boolean | undefined; format?: string | undefined; } | undefined; max?: { field?: string | undefined; missing?: string | number | boolean | undefined; format?: string | undefined; } | undefined; sum?: { field?: string | undefined; missing?: string | number | boolean | undefined; } | undefined; top_hits?: { explain?: boolean | undefined; docvalue_fields?: string | string[] | undefined; stored_fields?: string | string[] | undefined; from?: number | undefined; size?: number | undefined; sort?: string | { [x: string]: \"asc\" | \"desc\" | \"_doc\" | { missing?: string | number | boolean | undefined; mode?: \"min\" | \"max\" | \"sum\" | \"avg\" | \"median\" | undefined; order?: \"asc\" | \"desc\" | \"_doc\" | undefined; }; } | (string | { [x: string]: \"asc\" | \"desc\" | \"_doc\" | { missing?: string | number | boolean | undefined; mode?: \"min\" | \"max\" | \"sum\" | \"avg\" | \"median\" | undefined; order?: \"asc\" | \"desc\" | \"_doc\" | undefined; }; })[] | undefined; seq_no_primary_term?: boolean | undefined; version?: boolean | undefined; track_scores?: boolean | undefined; highlight?: any; _source?: string | boolean | string[] | undefined; } | undefined; weighted_avg?: { format?: string | undefined; value_type?: string | undefined; value?: { field?: string | undefined; missing?: number | undefined; } | undefined; weight?: { field?: string | undefined; missing?: number | undefined; } | undefined; } | undefined; }; } | undefined; aggregations?: { [x: string]: BucketAggsSchemas & { avg?: { field?: string | undefined; missing?: string | number | boolean | undefined; } | undefined; cardinality?: { field?: string | undefined; precision_threshold?: number | undefined; rehash?: boolean | undefined; missing?: string | number | boolean | undefined; } | undefined; min?: { field?: string | undefined; missing?: string | number | boolean | undefined; format?: string | undefined; } | undefined; max?: { field?: string | undefined; missing?: string | number | boolean | undefined; format?: string | undefined; } | undefined; sum?: { field?: string | undefined; missing?: string | number | boolean | undefined; } | undefined; top_hits?: { explain?: boolean | undefined; docvalue_fields?: string | string[] | undefined; stored_fields?: string | string[] | undefined; from?: number | undefined; size?: number | undefined; sort?: string | { [x: string]: \"asc\" | \"desc\" | \"_doc\" | { missing?: string | number | boolean | undefined; mode?: \"min\" | \"max\" | \"sum\" | \"avg\" | \"median\" | undefined; order?: \"asc\" | \"desc\" | \"_doc\" | undefined; }; } | (string | { [x: string]: \"asc\" | \"desc\" | \"_doc\" | { missing?: string | number | boolean | undefined; mode?: \"min\" | \"max\" | \"sum\" | \"avg\" | \"median\" | undefined; order?: \"asc\" | \"desc\" | \"_doc\" | undefined; }; })[] | undefined; seq_no_primary_term?: boolean | undefined; version?: boolean | undefined; track_scores?: boolean | undefined; highlight?: any; _source?: string | boolean | string[] | undefined; } | undefined; weighted_avg?: { format?: string | undefined; value_type?: string | undefined; value?: { field?: string | undefined; missing?: number | undefined; } | undefined; weight?: { field?: string | undefined; missing?: number | undefined; } | undefined; } | undefined; }; } | undefined; }; } | undefined" + ], + "path": "x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.AlertsClient.getGroupAggregations.$1.filters", + "type": "Array", + "tags": [], + "label": "filters", + "description": [ + "\nThe filters to apply to the query" + ], + "signature": [ + "QueryDslQueryContainer", + "[] | undefined" + ], + "path": "x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.AlertsClient.getGroupAggregations.$1.sort", + "type": "Array", + "tags": [], + "label": "sort", + "description": [ + "\nAny sort options to apply to the groupByField aggregations" + ], + "signature": [ + "SortCombinations", + "[] | undefined" + ], + "path": "x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.AlertsClient.getGroupAggregations.$1.pageIndex", + "type": "number", + "tags": [], + "label": "pageIndex", + "description": [ + "\nThe page index to start from" + ], + "path": "x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.AlertsClient.getGroupAggregations.$1.pageSize", + "type": "number", + "tags": [], + "label": "pageSize", + "description": [ + "\nThe page size" ], "path": "x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts", "deprecated": false, diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index d3415c598dfaf..d0778caa91448 100644 --- a/api_docs/rule_registry.mdx +++ b/api_docs/rule_registry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ruleRegistry title: "ruleRegistry" image: https://source.unsplash.com/400x175/?github description: API docs for the ruleRegistry plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ruleRegistry'] --- import ruleRegistryObj from './rule_registry.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-o | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 276 | 0 | 247 | 14 | +| 286 | 0 | 249 | 14 | ## Server diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index 463344a297adb..fc469b1bdf9f4 100644 --- a/api_docs/runtime_fields.mdx +++ b/api_docs/runtime_fields.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/runtimeFields title: "runtimeFields" image: https://source.unsplash.com/400x175/?github description: API docs for the runtimeFields plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'runtimeFields'] --- import runtimeFieldsObj from './runtime_fields.devdocs.json'; diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index 8dd068cfc5421..b4fcaecdbef71 100644 --- a/api_docs/saved_objects.mdx +++ b/api_docs/saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjects title: "savedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjects plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] --- import savedObjectsObj from './saved_objects.devdocs.json'; diff --git a/api_docs/saved_objects_finder.mdx b/api_docs/saved_objects_finder.mdx index 2761967fe271d..6ab7e6becdfb1 100644 --- a/api_docs/saved_objects_finder.mdx +++ b/api_docs/saved_objects_finder.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsFinder title: "savedObjectsFinder" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsFinder plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsFinder'] --- import savedObjectsFinderObj from './saved_objects_finder.devdocs.json'; diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index 137f7993547af..04f035cbea41b 100644 --- a/api_docs/saved_objects_management.mdx +++ b/api_docs/saved_objects_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsManagement title: "savedObjectsManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsManagement plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsManagement'] --- import savedObjectsManagementObj from './saved_objects_management.devdocs.json'; diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index 6b2a13c1dafdb..c4aba5bd77306 100644 --- a/api_docs/saved_objects_tagging.mdx +++ b/api_docs/saved_objects_tagging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTagging title: "savedObjectsTagging" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTagging plugin -date: 2024-07-04 +date: 2024-07-11 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 d6996d0e63804..492ce4fcb5e10 100644 --- a/api_docs/saved_objects_tagging_oss.mdx +++ b/api_docs/saved_objects_tagging_oss.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTaggingOss title: "savedObjectsTaggingOss" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTaggingOss plugin -date: 2024-07-04 +date: 2024-07-11 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 0c11fb18b62af..ee3b581ca164c 100644 --- a/api_docs/saved_search.mdx +++ b/api_docs/saved_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedSearch title: "savedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the savedSearch plugin -date: 2024-07-04 +date: 2024-07-11 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 fdcdd5fdee9ef..2b108c8375985 100644 --- a/api_docs/screenshot_mode.mdx +++ b/api_docs/screenshot_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotMode title: "screenshotMode" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotMode plugin -date: 2024-07-04 +date: 2024-07-11 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 e076dcbda5834..e5be4f65b96d0 100644 --- a/api_docs/screenshotting.mdx +++ b/api_docs/screenshotting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotting title: "screenshotting" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotting plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] --- import screenshottingObj from './screenshotting.devdocs.json'; diff --git a/api_docs/search_connectors.mdx b/api_docs/search_connectors.mdx index 976df014fa7e3..0f622d71afe27 100644 --- a/api_docs/search_connectors.mdx +++ b/api_docs/search_connectors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchConnectors title: "searchConnectors" image: https://source.unsplash.com/400x175/?github description: API docs for the searchConnectors plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchConnectors'] --- import searchConnectorsObj from './search_connectors.devdocs.json'; diff --git a/api_docs/search_homepage.mdx b/api_docs/search_homepage.mdx index 33c77dc2c2239..7fe0ca94d99a0 100644 --- a/api_docs/search_homepage.mdx +++ b/api_docs/search_homepage.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchHomepage title: "searchHomepage" image: https://source.unsplash.com/400x175/?github description: API docs for the searchHomepage plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchHomepage'] --- import searchHomepageObj from './search_homepage.devdocs.json'; diff --git a/api_docs/search_inference_endpoints.mdx b/api_docs/search_inference_endpoints.mdx index b44e1cc4185aa..80170001eb1ad 100644 --- a/api_docs/search_inference_endpoints.mdx +++ b/api_docs/search_inference_endpoints.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchInferenceEndpoints title: "searchInferenceEndpoints" image: https://source.unsplash.com/400x175/?github description: API docs for the searchInferenceEndpoints plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchInferenceEndpoints'] --- import searchInferenceEndpointsObj from './search_inference_endpoints.devdocs.json'; diff --git a/api_docs/search_notebooks.mdx b/api_docs/search_notebooks.mdx index 8098462573f37..67d86174c1e37 100644 --- a/api_docs/search_notebooks.mdx +++ b/api_docs/search_notebooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchNotebooks title: "searchNotebooks" image: https://source.unsplash.com/400x175/?github description: API docs for the searchNotebooks plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchNotebooks'] --- import searchNotebooksObj from './search_notebooks.devdocs.json'; diff --git a/api_docs/search_playground.devdocs.json b/api_docs/search_playground.devdocs.json index 0306aa3c5780a..9acc1abcd944f 100644 --- a/api_docs/search_playground.devdocs.json +++ b/api_docs/search_playground.devdocs.json @@ -40,9 +40,7 @@ "label": "PlaygroundProvider", "description": [], "signature": [ - "React.FunctionComponent<", - "PlaygroundProviderProps", - " & { children?: React.ReactNode; }>" + "React.FunctionComponent<{ children?: React.ReactNode; }>" ], "path": "x-pack/plugins/search_playground/public/types.ts", "deprecated": false, @@ -79,51 +77,6 @@ } ] }, - { - "parentPluginId": "searchPlayground", - "id": "def-public.SearchPlaygroundPluginStart.PlaygroundToolbar", - "type": "Function", - "tags": [], - "label": "PlaygroundToolbar", - "description": [], - "signature": [ - "React.FunctionComponent<{ children?: React.ReactNode; }>" - ], - "path": "x-pack/plugins/search_playground/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "searchPlayground", - "id": "def-public.SearchPlaygroundPluginStart.PlaygroundToolbar.$1", - "type": "CompoundType", - "tags": [], - "label": "props", - "description": [], - "signature": [ - "P & { children?: React.ReactNode; }" - ], - "path": "node_modules/@types/react/index.d.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "searchPlayground", - "id": "def-public.SearchPlaygroundPluginStart.PlaygroundToolbar.$2", - "type": "Any", - "tags": [], - "label": "context", - "description": [], - "signature": [ - "any" - ], - "path": "node_modules/@types/react/index.d.ts", - "deprecated": false, - "trackAdoption": false - } - ] - }, { "parentPluginId": "searchPlayground", "id": "def-public.SearchPlaygroundPluginStart.Playground", @@ -132,7 +85,9 @@ "label": "Playground", "description": [], "signature": [ - "React.FunctionComponent<{ children?: React.ReactNode; }>" + "React.FunctionComponent<", + "AppProps", + " & { children?: React.ReactNode; }>" ], "path": "x-pack/plugins/search_playground/public/types.ts", "deprecated": false, diff --git a/api_docs/search_playground.mdx b/api_docs/search_playground.mdx index e2128ff790770..193273e6d614e 100644 --- a/api_docs/search_playground.mdx +++ b/api_docs/search_playground.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchPlayground title: "searchPlayground" image: https://source.unsplash.com/400x175/?github description: API docs for the searchPlayground plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchPlayground'] --- import searchPlaygroundObj from './search_playground.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-ki | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 18 | 0 | 10 | 1 | +| 15 | 0 | 9 | 1 | ## Client diff --git a/api_docs/security.devdocs.json b/api_docs/security.devdocs.json index 65b7d3c7c4827..5d7daa39f0360 100644 --- a/api_docs/security.devdocs.json +++ b/api_docs/security.devdocs.json @@ -1829,8 +1829,10 @@ "type": "Interface", "tags": [], "label": "APIKeys", - "description": [], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "description": [ + "\nInterface for managing API keys in Elasticsearch, including creation,\nvalidation, and invalidation of API keys,\nas well as checking the status of API key features." + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1846,7 +1848,7 @@ "signature": [ "() => Promise" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1864,7 +1866,7 @@ "signature": [ "() => Promise" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1890,17 +1892,17 @@ }, ", createParams: ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CreateAPIKeyParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateAPIKeyParams", "text": "CreateAPIKeyParams" }, ") => Promise<", "SecurityCreateApiKeyResponse", " | null>" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1923,7 +1925,7 @@ }, "" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1939,14 +1941,98 @@ ], "signature": [ { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.CreateAPIKeyParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateAPIKeyParams", "text": "CreateAPIKeyParams" } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "security", + "id": "def-server.APIKeys.update", + "type": "Function", + "tags": [], + "label": "update", + "description": [ + "\nAttempts update an API key with the provided 'role_descriptors' and 'metadata'\n\nReturns `updated`, `true` if the update was successful, `false` if there was nothing to update\n\nUser needs `manage_api_key` privilege to update REST API keys and `manage_security` for cross-cluster API keys.\n" + ], + "signature": [ + "(request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + ", updateParams: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateAPIKeyParams", + "text": "UpdateAPIKeyParams" + }, + ") => Promise<", + "SecurityUpdateApiKeyResponse", + " | null>" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "security", + "id": "def-server.APIKeys.update.$1", + "type": "Object", + "tags": [], + "label": "request", + "description": [ + "Request instance." + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "common", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-common.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "security", + "id": "def-server.APIKeys.update.$2", + "type": "CompoundType", + "tags": [], + "label": "updateParams", + "description": [ + "The params to edit an API key" + ], + "signature": [ + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.UpdateAPIKeyParams", + "text": "UpdateAPIKeyParams" + } + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1972,17 +2058,33 @@ "section": "def-common.KibanaRequest", "text": "KibanaRequest" }, - ", createParams: Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { name: string; role_descriptors: Record>; }> | Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { name: string; kibana_role_descriptors: Record | undefined; } & { spaces: string[] | \"*\"[]; }>[]; elasticsearch: Readonly<{ cluster?: string[] | undefined; indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; }>[] | undefined; remote_cluster?: Readonly<{} & { privileges: string[]; clusters: string[]; }>[] | undefined; remote_indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; clusters: string[]; }>[] | undefined; run_as?: string[] | undefined; } & {}>; }>>; }>) => Promise<", + ", createParams: ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.GrantAPIKeyResult", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyParams", + "text": "CreateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams", + "text": "CreateRestAPIKeyWithKibanaPrivilegesParams" + }, + ") => Promise<", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.GrantAPIKeyResult", "text": "GrantAPIKeyResult" }, " | null>" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2005,7 +2107,7 @@ }, "" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2020,9 +2122,23 @@ "Create operation parameters." ], "signature": [ - "Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { name: string; role_descriptors: Record>; }> | Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { name: string; kibana_role_descriptors: Record | undefined; } & { spaces: string[] | \"*\"[]; }>[]; elasticsearch: Readonly<{ cluster?: string[] | undefined; indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; }>[] | undefined; remote_cluster?: Readonly<{} & { privileges: string[]; clusters: string[]; }>[] | undefined; remote_indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; clusters: string[]; }>[] | undefined; run_as?: string[] | undefined; } & {}>; }>>; }>" + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyParams", + "text": "CreateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams", + "text": "CreateRestAPIKeyWithKibanaPrivilegesParams" + } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2042,15 +2158,15 @@ "signature": [ "(apiKeyPrams: ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.ValidateAPIKeyParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.ValidateAPIKeyParams", "text": "ValidateAPIKeyParams" }, ") => Promise" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2065,14 +2181,14 @@ ], "signature": [ { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.ValidateAPIKeyParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.ValidateAPIKeyParams", "text": "ValidateAPIKeyParams" } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2100,23 +2216,23 @@ }, ", params: ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.InvalidateAPIKeysParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", "text": "InvalidateAPIKeysParams" }, ") => Promise<", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.InvalidateAPIKeyResult", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeyResult", "text": "InvalidateAPIKeyResult" }, " | null>" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2139,7 +2255,7 @@ }, "" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2155,14 +2271,14 @@ ], "signature": [ { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.InvalidateAPIKeysParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", "text": "InvalidateAPIKeysParams" } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2182,23 +2298,23 @@ "signature": [ "(params: ", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.InvalidateAPIKeysParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", "text": "InvalidateAPIKeysParams" }, ") => Promise<", { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.InvalidateAPIKeyResult", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeyResult", "text": "InvalidateAPIKeyResult" }, " | null>" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2213,14 +2329,14 @@ ], "signature": [ { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.InvalidateAPIKeysParams", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.InvalidateAPIKeysParams", "text": "InvalidateAPIKeysParams" } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2984,10 +3100,10 @@ "description": [], "signature": [ { - "pluginId": "@kbn/security-plugin-types-server", - "scope": "server", - "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.APIKeys", + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.APIKeys", "text": "APIKeys" } ], @@ -3985,51 +4101,79 @@ }, { "parentPluginId": "security", - "id": "def-server.GrantAPIKeyResult", + "id": "def-server.CreateCrossClusterAPIKeyParams", "type": "Interface", "tags": [], - "label": "GrantAPIKeyResult", + "label": "CreateCrossClusterAPIKeyParams", "description": [], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "security", - "id": "def-server.GrantAPIKeyResult.id", + "id": "def-server.CreateCrossClusterAPIKeyParams.type", "type": "string", "tags": [], - "label": "id", - "description": [ - "\nUnique id for this API key" + "label": "type", + "description": [], + "signature": [ + "\"cross_cluster\"" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "security", - "id": "def-server.GrantAPIKeyResult.name", + "id": "def-server.CreateCrossClusterAPIKeyParams.expiration", "type": "string", "tags": [], - "label": "name", - "description": [ - "\nName for this API key" + "label": "expiration", + "description": [], + "signature": [ + "string | undefined" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "security", - "id": "def-server.GrantAPIKeyResult.api_key", + "id": "def-server.CreateCrossClusterAPIKeyParams.name", "type": "string", "tags": [], - "label": "api_key", - "description": [ - "\nGenerated API key" + "label": "name", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.CreateCrossClusterAPIKeyParams.metadata", + "type": "Object", + "tags": [], + "label": "metadata", + "description": [], + "signature": [ + "{ [key: string]: any; } | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.CreateCrossClusterAPIKeyParams.access", + "type": "Object", + "tags": [], + "label": "access", + "description": [], + "signature": [ + "{ search?: { names: string[]; query?: unknown; field_security?: unknown; allow_restricted_indices?: boolean | undefined; }[] | undefined; replication?: { names: string[]; }[] | undefined; }" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -4038,78 +4182,395 @@ }, { "parentPluginId": "security", - "id": "def-server.InvalidateAPIKeyResult", + "id": "def-server.CreateRestAPIKeyParams", "type": "Interface", "tags": [], - "label": "InvalidateAPIKeyResult", - "description": [ - "\nThe return value when invalidating an API key in Elasticsearch." - ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "label": "CreateRestAPIKeyParams", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "security", - "id": "def-server.InvalidateAPIKeyResult.invalidated_api_keys", - "type": "Array", + "id": "def-server.CreateRestAPIKeyParams.type", + "type": "string", "tags": [], - "label": "invalidated_api_keys", - "description": [ - "\nThe IDs of the API keys that were invalidated as part of the request." - ], + "label": "type", + "description": [], "signature": [ - "string[]" + "\"rest\" | undefined" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "security", - "id": "def-server.InvalidateAPIKeyResult.previously_invalidated_api_keys", - "type": "Array", + "id": "def-server.CreateRestAPIKeyParams.expiration", + "type": "string", "tags": [], - "label": "previously_invalidated_api_keys", - "description": [ - "\nThe IDs of the API keys that were already invalidated." - ], + "label": "expiration", + "description": [], "signature": [ - "string[]" + "string | undefined" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "security", - "id": "def-server.InvalidateAPIKeyResult.error_count", - "type": "number", + "id": "def-server.CreateRestAPIKeyParams.name", + "type": "string", "tags": [], - "label": "error_count", - "description": [ - "\nThe number of errors that were encountered when invalidating the API keys." - ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "label": "name", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "security", - "id": "def-server.InvalidateAPIKeyResult.error_details", - "type": "Array", + "id": "def-server.CreateRestAPIKeyParams.role_descriptors", + "type": "Object", "tags": [], - "label": "error_details", - "description": [ - "\nDetails about these errors. This field is not present in the response when error_count is 0." - ], + "label": "role_descriptors", + "description": [], "signature": [ - "{ type?: string | undefined; reason?: string | undefined; caused_by?: { type?: string | undefined; reason?: string | undefined; } | undefined; }[] | undefined" + "{ [x: string]: { [key: string]: any; }; }" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false - } + }, + { + "parentPluginId": "security", + "id": "def-server.CreateRestAPIKeyParams.metadata", + "type": "Object", + "tags": [], + "label": "metadata", + "description": [], + "signature": [ + "{ [key: string]: any; } | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "security", + "id": "def-server.CreateRestAPIKeyWithKibanaPrivilegesParams", + "type": "Interface", + "tags": [], + "label": "CreateRestAPIKeyWithKibanaPrivilegesParams", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "security", + "id": "def-server.CreateRestAPIKeyWithKibanaPrivilegesParams.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"rest\" | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.CreateRestAPIKeyWithKibanaPrivilegesParams.expiration", + "type": "string", + "tags": [], + "label": "expiration", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.CreateRestAPIKeyWithKibanaPrivilegesParams.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.CreateRestAPIKeyWithKibanaPrivilegesParams.metadata", + "type": "Object", + "tags": [], + "label": "metadata", + "description": [], + "signature": [ + "{ [key: string]: any; } | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.CreateRestAPIKeyWithKibanaPrivilegesParams.kibana_role_descriptors", + "type": "Object", + "tags": [], + "label": "kibana_role_descriptors", + "description": [], + "signature": [ + "{ [x: string]: { elasticsearch: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.ElasticsearchPrivilegesType", + "text": "ElasticsearchPrivilegesType" + }, + " & { [key: string]: unknown; }; kibana: ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.KibanaPrivilegesType", + "text": "KibanaPrivilegesType" + }, + "; }; }" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "security", + "id": "def-server.ElasticsearchPrivilegesType", + "type": "Interface", + "tags": [], + "label": "ElasticsearchPrivilegesType", + "description": [ + "\nType representing Elasticsearch specific portion of the role definition." + ], + "path": "packages/core/security/core-security-server/src/roles/schema.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "security", + "id": "def-server.ElasticsearchPrivilegesType.cluster", + "type": "Array", + "tags": [], + "label": "cluster", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "packages/core/security/core-security-server/src/roles/schema.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.ElasticsearchPrivilegesType.remote_cluster", + "type": "Array", + "tags": [], + "label": "remote_cluster", + "description": [], + "signature": [ + "{ privileges: string[]; clusters: string[]; }[] | undefined" + ], + "path": "packages/core/security/core-security-server/src/roles/schema.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.ElasticsearchPrivilegesType.indices", + "type": "Array", + "tags": [], + "label": "indices", + "description": [], + "signature": [ + "{ names: string[]; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; privileges: string[]; query?: string | undefined; allow_restricted_indices?: boolean | undefined; }[] | undefined" + ], + "path": "packages/core/security/core-security-server/src/roles/schema.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.ElasticsearchPrivilegesType.remote_indices", + "type": "Array", + "tags": [], + "label": "remote_indices", + "description": [], + "signature": [ + "{ clusters: string[]; names: string[]; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; privileges: string[]; query?: string | undefined; allow_restricted_indices?: boolean | undefined; }[] | undefined" + ], + "path": "packages/core/security/core-security-server/src/roles/schema.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.ElasticsearchPrivilegesType.run_as", + "type": "Array", + "tags": [], + "label": "run_as", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "packages/core/security/core-security-server/src/roles/schema.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "security", + "id": "def-server.GrantAPIKeyResult", + "type": "Interface", + "tags": [], + "label": "GrantAPIKeyResult", + "description": [], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "security", + "id": "def-server.GrantAPIKeyResult.id", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "\nUnique id for this API key" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.GrantAPIKeyResult.name", + "type": "string", + "tags": [], + "label": "name", + "description": [ + "\nName for this API key" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.GrantAPIKeyResult.api_key", + "type": "string", + "tags": [], + "label": "api_key", + "description": [ + "\nGenerated API key" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "security", + "id": "def-server.InvalidateAPIKeyResult", + "type": "Interface", + "tags": [], + "label": "InvalidateAPIKeyResult", + "description": [ + "\nThe return value when invalidating an API key in Elasticsearch." + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "security", + "id": "def-server.InvalidateAPIKeyResult.invalidated_api_keys", + "type": "Array", + "tags": [], + "label": "invalidated_api_keys", + "description": [ + "\nThe IDs of the API keys that were invalidated as part of the request." + ], + "signature": [ + "string[]" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.InvalidateAPIKeyResult.previously_invalidated_api_keys", + "type": "Array", + "tags": [], + "label": "previously_invalidated_api_keys", + "description": [ + "\nThe IDs of the API keys that were already invalidated." + ], + "signature": [ + "string[]" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.InvalidateAPIKeyResult.error_count", + "type": "number", + "tags": [], + "label": "error_count", + "description": [ + "\nThe number of errors that were encountered when invalidating the API keys." + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.InvalidateAPIKeyResult.error_details", + "type": "Array", + "tags": [], + "label": "error_details", + "description": [ + "\nDetails about these errors. This field is not present in the response when error_count is 0." + ], + "signature": [ + "{ type?: string | undefined; reason?: string | undefined; caused_by?: { type?: string | undefined; reason?: string | undefined; } | undefined; }[] | undefined" + ], + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", + "deprecated": false, + "trackAdoption": false + } ], "initialIsOpen": false }, @@ -4122,7 +4583,7 @@ "description": [ "\nRepresents the params for invalidating multiple API keys" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4132,11 +4593,13 @@ "type": "Array", "tags": [], "label": "ids", - "description": [], + "description": [ + "\nList of unique API key IDs" + ], "signature": [ "string[]" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -4734,7 +5197,7 @@ "description": [ "\nRepresents the parameters for validating API Key credentials." ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4747,7 +5210,7 @@ "description": [ "\nUnique id for this API key" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false }, @@ -4760,7 +5223,7 @@ "description": [ "\nGenerated API Key (secret)" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false } @@ -5092,9 +5555,31 @@ "label": "CreateAPIKeyParams", "description": [], "signature": [ - "Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { name: string; role_descriptors: Record>; }> | Readonly<{ type?: \"rest\" | undefined; metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { name: string; kibana_role_descriptors: Record | undefined; } & { spaces: string[] | \"*\"[]; }>[]; elasticsearch: Readonly<{ cluster?: string[] | undefined; indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; }>[] | undefined; remote_cluster?: Readonly<{} & { privileges: string[]; clusters: string[]; }>[] | undefined; remote_indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; clusters: string[]; }>[] | undefined; run_as?: string[] | undefined; } & {}>; }>>; }> | Readonly<{ metadata?: Readonly<{} & {}> | undefined; expiration?: string | undefined; } & { type: \"cross_cluster\"; name: string; access: Readonly<{ search?: Readonly<{ query?: any; field_security?: any; allow_restricted_indices?: boolean | undefined; } & { names: string[]; }>[] | undefined; replication?: Readonly<{} & { names: string[]; }>[] | undefined; } & {}>; }>" + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyParams", + "text": "CreateRestAPIKeyParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateRestAPIKeyWithKibanaPrivilegesParams", + "text": "CreateRestAPIKeyWithKibanaPrivilegesParams" + }, + " | ", + { + "pluginId": "@kbn/core-security-server", + "scope": "common", + "docId": "kibKbnCoreSecurityServerPluginApi", + "section": "def-common.CreateCrossClusterAPIKeyParams", + "text": "CreateCrossClusterAPIKeyParams" + } ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5111,67 +5596,7 @@ "signature": [ "SecurityCreateApiKeyResponse" ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "security", - "id": "def-server.CreateCrossClusterAPIKeyParams", - "type": "Type", - "tags": [], - "label": "CreateCrossClusterAPIKeyParams", - "description": [], - "signature": [ - "{ readonly metadata?: Readonly<{} & {}> | undefined; readonly expiration?: string | undefined; readonly type: \"cross_cluster\"; readonly name: string; readonly access: Readonly<{ search?: Readonly<{ query?: any; field_security?: any; allow_restricted_indices?: boolean | undefined; } & { names: string[]; }>[] | undefined; replication?: Readonly<{} & { names: string[]; }>[] | undefined; } & {}>; }" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "security", - "id": "def-server.CreateRestAPIKeyParams", - "type": "Type", - "tags": [], - "label": "CreateRestAPIKeyParams", - "description": [], - "signature": [ - "{ readonly type?: \"rest\" | undefined; readonly metadata?: Readonly<{} & {}> | undefined; readonly expiration?: string | undefined; readonly name: string; readonly role_descriptors: Record>; }" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "security", - "id": "def-server.CreateRestAPIKeyWithKibanaPrivilegesParams", - "type": "Type", - "tags": [], - "label": "CreateRestAPIKeyWithKibanaPrivilegesParams", - "description": [], - "signature": [ - "{ readonly type?: \"rest\" | undefined; readonly metadata?: Readonly<{} & {}> | undefined; readonly expiration?: string | undefined; readonly name: string; readonly kibana_role_descriptors: Record | undefined; } & { spaces: string[] | \"*\"[]; }>[]; elasticsearch: Readonly<{ cluster?: string[] | undefined; indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; }>[] | undefined; remote_cluster?: Readonly<{} & { privileges: string[]; clusters: string[]; }>[] | undefined; remote_indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; clusters: string[]; }>[] | undefined; run_as?: string[] | undefined; } & {}>; }>>; }" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "security", - "id": "def-server.ElasticsearchPrivilegesType", - "type": "Type", - "tags": [], - "label": "ElasticsearchPrivilegesType", - "description": [], - "signature": [ - "{ readonly cluster?: string[] | undefined; readonly indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; }>[] | undefined; readonly remote_cluster?: Readonly<{} & { privileges: string[]; clusters: string[]; }>[] | undefined; readonly remote_indices?: Readonly<{ query?: string | undefined; field_security?: Record<\"except\" | \"grant\", string[]> | undefined; allow_restricted_indices?: boolean | undefined; } & { names: string[]; privileges: string[]; clusters: string[]; }>[] | undefined; readonly run_as?: string[] | undefined; }" - ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/role_schema.ts", + "path": "packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5182,11 +5607,13 @@ "type": "Type", "tags": [], "label": "KibanaPrivilegesType", - "description": [], + "description": [ + "\nType representing Kibana specific portion of the role definition." + ], "signature": [ - "Readonly<{ base?: string[] | undefined; feature?: Record | undefined; } & { spaces: string[] | \"*\"[]; }>[]" + "{ spaces: string[]; base?: string[] | undefined; feature?: Record | undefined; }[]" ], - "path": "x-pack/packages/security/plugin_types_server/src/authorization/role_schema.ts", + "path": "packages/core/security/core-security-server/src/roles/schema.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5312,41 +5739,13 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "encryptedSavedObjects", - "path": "x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.ts" - }, - { - "plugin": "encryptedSavedObjects", - "path": "x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.ts" - }, { "plugin": "ml", "path": "x-pack/plugins/ml/server/routes/annotations.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/request_context_factory.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts" } ] }, @@ -5499,30 +5898,6 @@ "plugin": "enterpriseSearch", "path": "x-pack/plugins/enterprise_search/server/routes/enterprise_search/api_keys.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" - }, { "plugin": "serverlessSearch", "path": "x-pack/plugins/serverless_search/server/routes/api_key_routes.ts" @@ -5622,30 +5997,6 @@ { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/routes/setup/handlers.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/list.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/state.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/suggestions/index.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts" } ] }, diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 43bd8e5f9cf77..ee72de420f716 100644 --- a/api_docs/security.mdx +++ b/api_docs/security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/security title: "security" image: https://source.unsplash.com/400x175/?github description: API docs for the security plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] --- import securityObj from './security.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 415 | 0 | 206 | 1 | +| 438 | 0 | 222 | 1 | ## Client diff --git a/api_docs/security_solution.devdocs.json b/api_docs/security_solution.devdocs.json index e07a045ba7722..b5d8334c5d5b0 100644 --- a/api_docs/security_solution.devdocs.json +++ b/api_docs/security_solution.devdocs.json @@ -485,7 +485,7 @@ "\nExperimental flag needed to enable the link" ], "signature": [ - "\"assistantKnowledgeBaseByDefault\" | \"assistantModelEvaluation\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionsEnabled\" | \"endpointResponseActionsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"responseActionScanEnabled\" | \"alertsPageChartsEnabled\" | \"alertTypeEnabled\" | \"expandableFlyoutDisabled\" | \"securitySolutionNotesEnabled\" | \"entityAlertPreviewEnabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"AIAssistantOnRuleCreationFormEnabled\" | \"disableTimelineSaveTour\" | \"alertSuppressionForEsqlRuleEnabled\" | \"riskEnginePrivilegesRouteEnabled\" | \"alertSuppressionForMachineLearningRuleEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"unifiedComponentsInTimelineEnabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"aiAssistantFlyoutMode\" | \"valueListItemsModalEnabled\" | \"bulkCustomHighlightedFieldsEnabled\" | \"manualRuleRunEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | undefined" + "\"assistantKnowledgeBaseByDefault\" | \"assistantModelEvaluation\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionsEnabled\" | \"endpointResponseActionsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"responseActionScanEnabled\" | \"alertsPageChartsEnabled\" | \"alertTypeEnabled\" | \"expandableFlyoutDisabled\" | \"securitySolutionNotesEnabled\" | \"entityAlertPreviewEnabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"AIAssistantOnRuleCreationFormEnabled\" | \"disableTimelineSaveTour\" | \"alertSuppressionForEsqlRuleEnabled\" | \"riskEnginePrivilegesRouteEnabled\" | \"alertSuppressionForMachineLearningRuleEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"unifiedComponentsInTimelineEnabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"bulkCustomHighlightedFieldsEnabled\" | \"manualRuleRunEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | undefined" ], "path": "x-pack/plugins/security_solution/public/common/links/types.ts", "deprecated": false, @@ -565,7 +565,7 @@ "\nExperimental flag needed to disable the link. Opposite of experimentalKey" ], "signature": [ - "\"assistantKnowledgeBaseByDefault\" | \"assistantModelEvaluation\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionsEnabled\" | \"endpointResponseActionsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"responseActionScanEnabled\" | \"alertsPageChartsEnabled\" | \"alertTypeEnabled\" | \"expandableFlyoutDisabled\" | \"securitySolutionNotesEnabled\" | \"entityAlertPreviewEnabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"AIAssistantOnRuleCreationFormEnabled\" | \"disableTimelineSaveTour\" | \"alertSuppressionForEsqlRuleEnabled\" | \"riskEnginePrivilegesRouteEnabled\" | \"alertSuppressionForMachineLearningRuleEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"unifiedComponentsInTimelineEnabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"aiAssistantFlyoutMode\" | \"valueListItemsModalEnabled\" | \"bulkCustomHighlightedFieldsEnabled\" | \"manualRuleRunEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | undefined" + "\"assistantKnowledgeBaseByDefault\" | \"assistantModelEvaluation\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionsEnabled\" | \"endpointResponseActionsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"responseActionScanEnabled\" | \"alertsPageChartsEnabled\" | \"alertTypeEnabled\" | \"expandableFlyoutDisabled\" | \"securitySolutionNotesEnabled\" | \"entityAlertPreviewEnabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"AIAssistantOnRuleCreationFormEnabled\" | \"disableTimelineSaveTour\" | \"alertSuppressionForEsqlRuleEnabled\" | \"riskEnginePrivilegesRouteEnabled\" | \"alertSuppressionForMachineLearningRuleEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"unifiedComponentsInTimelineEnabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"bulkCustomHighlightedFieldsEnabled\" | \"manualRuleRunEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | undefined" ], "path": "x-pack/plugins/security_solution/public/common/links/types.ts", "deprecated": false, @@ -1964,7 +1964,7 @@ "label": "experimentalFeatures", "description": [], "signature": [ - "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionsEnabled: boolean; readonly endpointResponseActionsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly responseActionScanEnabled: boolean; readonly alertsPageChartsEnabled: boolean; readonly alertTypeEnabled: boolean; readonly expandableFlyoutDisabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewEnabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly AIAssistantOnRuleCreationFormEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly alertSuppressionForEsqlRuleEnabled: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly alertSuppressionForMachineLearningRuleEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineEnabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly aiAssistantFlyoutMode: boolean; readonly valueListItemsModalEnabled: boolean; readonly bulkCustomHighlightedFieldsEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; }" + "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionsEnabled: boolean; readonly endpointResponseActionsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly responseActionScanEnabled: boolean; readonly alertsPageChartsEnabled: boolean; readonly alertTypeEnabled: boolean; readonly expandableFlyoutDisabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewEnabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly AIAssistantOnRuleCreationFormEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly alertSuppressionForEsqlRuleEnabled: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly alertSuppressionForMachineLearningRuleEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineEnabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly bulkCustomHighlightedFieldsEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/public/types.ts", "deprecated": false, @@ -3071,7 +3071,7 @@ "\nThe security solution generic experimental features" ], "signature": [ - "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionsEnabled: boolean; readonly endpointResponseActionsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly responseActionScanEnabled: boolean; readonly alertsPageChartsEnabled: boolean; readonly alertTypeEnabled: boolean; readonly expandableFlyoutDisabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewEnabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly AIAssistantOnRuleCreationFormEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly alertSuppressionForEsqlRuleEnabled: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly alertSuppressionForMachineLearningRuleEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineEnabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly aiAssistantFlyoutMode: boolean; readonly valueListItemsModalEnabled: boolean; readonly bulkCustomHighlightedFieldsEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; }" + "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionsEnabled: boolean; readonly endpointResponseActionsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly responseActionScanEnabled: boolean; readonly alertsPageChartsEnabled: boolean; readonly alertTypeEnabled: boolean; readonly expandableFlyoutDisabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewEnabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly AIAssistantOnRuleCreationFormEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly alertSuppressionForEsqlRuleEnabled: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly alertSuppressionForMachineLearningRuleEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineEnabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly bulkCustomHighlightedFieldsEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/server/plugin_contract.ts", "deprecated": false, @@ -3247,7 +3247,7 @@ "label": "ExperimentalFeatures", "description": [], "signature": [ - "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionsEnabled: boolean; readonly endpointResponseActionsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly responseActionScanEnabled: boolean; readonly alertsPageChartsEnabled: boolean; readonly alertTypeEnabled: boolean; readonly expandableFlyoutDisabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewEnabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly AIAssistantOnRuleCreationFormEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly alertSuppressionForEsqlRuleEnabled: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly alertSuppressionForMachineLearningRuleEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineEnabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly aiAssistantFlyoutMode: boolean; readonly valueListItemsModalEnabled: boolean; readonly bulkCustomHighlightedFieldsEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; }" + "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionsEnabled: boolean; readonly endpointResponseActionsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly responseActionScanEnabled: boolean; readonly alertsPageChartsEnabled: boolean; readonly alertTypeEnabled: boolean; readonly expandableFlyoutDisabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewEnabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly AIAssistantOnRuleCreationFormEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly alertSuppressionForEsqlRuleEnabled: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly alertSuppressionForMachineLearningRuleEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineEnabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly bulkCustomHighlightedFieldsEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/common/experimental_features.ts", "deprecated": false, @@ -3313,7 +3313,7 @@ "\nA list of allowed values that can be used in `xpack.securitySolution.enableExperimental`.\nThis object is then used to validate and parse the value entered." ], "signature": [ - "{ readonly excludePoliciesInFilterEnabled: false; readonly kubernetesEnabled: true; readonly donutChartEmbeddablesEnabled: false; readonly previewTelemetryUrlEnabled: false; readonly extendedRuleExecutionLoggingEnabled: false; readonly socTrendsEnabled: false; readonly responseActionsEnabled: true; readonly endpointResponseActionsEnabled: true; readonly responseActionUploadEnabled: true; readonly automatedProcessActionsEnabled: true; readonly responseActionsSentinelOneV1Enabled: true; readonly responseActionsSentinelOneV2Enabled: true; readonly responseActionsSentinelOneGetFileEnabled: true; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: true; readonly responseActionScanEnabled: false; readonly alertsPageChartsEnabled: true; readonly alertTypeEnabled: false; readonly expandableFlyoutDisabled: false; readonly securitySolutionNotesEnabled: false; readonly entityAlertPreviewEnabled: false; readonly assistantModelEvaluation: false; readonly assistantKnowledgeBaseByDefault: false; readonly newUserDetailsFlyoutManagedUser: false; readonly riskScoringPersistence: true; readonly riskScoringRoutesEnabled: true; readonly esqlRulesDisabled: false; readonly protectionUpdatesEnabled: true; readonly AIAssistantOnRuleCreationFormEnabled: false; readonly disableTimelineSaveTour: false; readonly alertSuppressionForEsqlRuleEnabled: false; readonly riskEnginePrivilegesRouteEnabled: true; readonly alertSuppressionForMachineLearningRuleEnabled: false; readonly sentinelOneDataInAnalyzerEnabled: true; readonly sentinelOneManualHostActionsEnabled: true; readonly crowdstrikeDataInAnalyzerEnabled: true; readonly jamfDataInAnalyzerEnabled: false; readonly timelineEsqlTabDisabled: false; readonly unifiedComponentsInTimelineEnabled: false; readonly analyzerDatePickersAndSourcererDisabled: false; readonly prebuiltRulesCustomizationEnabled: false; readonly malwareOnWriteScanOptionAvailable: true; readonly unifiedManifestEnabled: true; readonly aiAssistantFlyoutMode: true; readonly valueListItemsModalEnabled: true; readonly bulkCustomHighlightedFieldsEnabled: false; readonly manualRuleRunEnabled: false; readonly filterProcessDescendantsForEventFiltersEnabled: false; }" + "{ readonly excludePoliciesInFilterEnabled: false; readonly kubernetesEnabled: true; readonly donutChartEmbeddablesEnabled: false; readonly previewTelemetryUrlEnabled: false; readonly extendedRuleExecutionLoggingEnabled: false; readonly socTrendsEnabled: false; readonly responseActionsEnabled: true; readonly endpointResponseActionsEnabled: true; readonly responseActionUploadEnabled: true; readonly automatedProcessActionsEnabled: true; readonly responseActionsSentinelOneV1Enabled: true; readonly responseActionsSentinelOneV2Enabled: true; readonly responseActionsSentinelOneGetFileEnabled: true; readonly responseActionsSentinelOneKillProcessEnabled: false; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: true; readonly responseActionScanEnabled: false; readonly alertsPageChartsEnabled: true; readonly alertTypeEnabled: false; readonly expandableFlyoutDisabled: false; readonly securitySolutionNotesEnabled: false; readonly entityAlertPreviewEnabled: false; readonly assistantModelEvaluation: false; readonly assistantKnowledgeBaseByDefault: false; readonly newUserDetailsFlyoutManagedUser: false; readonly riskScoringPersistence: true; readonly riskScoringRoutesEnabled: true; readonly esqlRulesDisabled: false; readonly protectionUpdatesEnabled: true; readonly AIAssistantOnRuleCreationFormEnabled: false; readonly disableTimelineSaveTour: false; readonly alertSuppressionForEsqlRuleEnabled: false; readonly riskEnginePrivilegesRouteEnabled: true; readonly alertSuppressionForMachineLearningRuleEnabled: false; readonly sentinelOneDataInAnalyzerEnabled: true; readonly sentinelOneManualHostActionsEnabled: true; readonly crowdstrikeDataInAnalyzerEnabled: true; readonly jamfDataInAnalyzerEnabled: false; readonly timelineEsqlTabDisabled: false; readonly unifiedComponentsInTimelineEnabled: false; readonly analyzerDatePickersAndSourcererDisabled: false; readonly prebuiltRulesCustomizationEnabled: false; readonly malwareOnWriteScanOptionAvailable: true; readonly unifiedManifestEnabled: true; readonly valueListItemsModalEnabled: true; readonly bulkCustomHighlightedFieldsEnabled: false; readonly manualRuleRunEnabled: false; readonly filterProcessDescendantsForEventFiltersEnabled: false; }" ], "path": "x-pack/plugins/security_solution/common/experimental_features.ts", "deprecated": false, diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index fe91f2f4d81f4..b83ae20ff02b2 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolution title: "securitySolution" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolution plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolution'] --- import securitySolutionObj from './security_solution.devdocs.json'; diff --git a/api_docs/security_solution_ess.mdx b/api_docs/security_solution_ess.mdx index 62590f6edbb05..de3bb64f52ced 100644 --- a/api_docs/security_solution_ess.mdx +++ b/api_docs/security_solution_ess.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolutionEss title: "securitySolutionEss" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolutionEss plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolutionEss'] --- import securitySolutionEssObj from './security_solution_ess.devdocs.json'; diff --git a/api_docs/security_solution_serverless.mdx b/api_docs/security_solution_serverless.mdx index 92590b2dd088c..3242828d62e87 100644 --- a/api_docs/security_solution_serverless.mdx +++ b/api_docs/security_solution_serverless.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolutionServerless title: "securitySolutionServerless" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolutionServerless plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolutionServerless'] --- import securitySolutionServerlessObj from './security_solution_serverless.devdocs.json'; diff --git a/api_docs/serverless.mdx b/api_docs/serverless.mdx index dae6ab27d0f52..a0de5bcc4cf91 100644 --- a/api_docs/serverless.mdx +++ b/api_docs/serverless.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/serverless title: "serverless" image: https://source.unsplash.com/400x175/?github description: API docs for the serverless plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'serverless'] --- import serverlessObj from './serverless.devdocs.json'; diff --git a/api_docs/serverless_observability.mdx b/api_docs/serverless_observability.mdx index 7452b0349dca7..e64f97973a9dc 100644 --- a/api_docs/serverless_observability.mdx +++ b/api_docs/serverless_observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/serverlessObservability title: "serverlessObservability" image: https://source.unsplash.com/400x175/?github description: API docs for the serverlessObservability plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'serverlessObservability'] --- import serverlessObservabilityObj from './serverless_observability.devdocs.json'; diff --git a/api_docs/serverless_search.mdx b/api_docs/serverless_search.mdx index f65f7938a0ea9..09f2c7edcf5da 100644 --- a/api_docs/serverless_search.mdx +++ b/api_docs/serverless_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/serverlessSearch title: "serverlessSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the serverlessSearch plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'serverlessSearch'] --- import serverlessSearchObj from './serverless_search.devdocs.json'; diff --git a/api_docs/session_view.mdx b/api_docs/session_view.mdx index 886ce136a936e..f7b44f92491a4 100644 --- a/api_docs/session_view.mdx +++ b/api_docs/session_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/sessionView title: "sessionView" image: https://source.unsplash.com/400x175/?github description: API docs for the sessionView plugin -date: 2024-07-04 +date: 2024-07-11 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 99d016576c26a..264403c94db1f 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/share title: "share" image: https://source.unsplash.com/400x175/?github description: API docs for the share plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] --- import shareObj from './share.devdocs.json'; diff --git a/api_docs/slo.mdx b/api_docs/slo.mdx index bcdff116e9e0c..f2cb7a913790a 100644 --- a/api_docs/slo.mdx +++ b/api_docs/slo.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/slo title: "slo" image: https://source.unsplash.com/400x175/?github description: API docs for the slo plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'slo'] --- import sloObj from './slo.devdocs.json'; diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index 1e66ffb9619c9..530b22186bb50 100644 --- a/api_docs/snapshot_restore.mdx +++ b/api_docs/snapshot_restore.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/snapshotRestore title: "snapshotRestore" image: https://source.unsplash.com/400x175/?github description: API docs for the snapshotRestore plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'snapshotRestore'] --- import snapshotRestoreObj from './snapshot_restore.devdocs.json'; diff --git a/api_docs/spaces.mdx b/api_docs/spaces.mdx index 3a4797b07f393..a475fdea0ff3c 100644 --- a/api_docs/spaces.mdx +++ b/api_docs/spaces.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/spaces title: "spaces" image: https://source.unsplash.com/400x175/?github description: API docs for the spaces plugin -date: 2024-07-04 +date: 2024-07-11 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 8b24bcddc2ecb..49ee40840fb95 100644 --- a/api_docs/stack_alerts.mdx +++ b/api_docs/stack_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackAlerts title: "stackAlerts" image: https://source.unsplash.com/400x175/?github description: API docs for the stackAlerts plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackAlerts'] --- import stackAlertsObj from './stack_alerts.devdocs.json'; diff --git a/api_docs/stack_connectors.mdx b/api_docs/stack_connectors.mdx index fba2360abee83..9ef3fb6e5248e 100644 --- a/api_docs/stack_connectors.mdx +++ b/api_docs/stack_connectors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackConnectors title: "stackConnectors" image: https://source.unsplash.com/400x175/?github description: API docs for the stackConnectors plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackConnectors'] --- import stackConnectorsObj from './stack_connectors.devdocs.json'; diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index 4227742b695bf..bcf328cc6ca79 100644 --- a/api_docs/task_manager.mdx +++ b/api_docs/task_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/taskManager title: "taskManager" image: https://source.unsplash.com/400x175/?github description: API docs for the taskManager plugin -date: 2024-07-04 +date: 2024-07-11 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 89da3bb82a6f6..af4a57ecedc3b 100644 --- a/api_docs/telemetry.mdx +++ b/api_docs/telemetry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetry title: "telemetry" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetry plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] --- import telemetryObj from './telemetry.devdocs.json'; diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index d8103e454c54d..4b678c60a7a40 100644 --- a/api_docs/telemetry_collection_manager.mdx +++ b/api_docs/telemetry_collection_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionManager title: "telemetryCollectionManager" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionManager plugin -date: 2024-07-04 +date: 2024-07-11 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 04a3769d55164..38b3f69b9ca09 100644 --- a/api_docs/telemetry_collection_xpack.mdx +++ b/api_docs/telemetry_collection_xpack.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionXpack title: "telemetryCollectionXpack" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionXpack plugin -date: 2024-07-04 +date: 2024-07-11 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 8f1b0edcb7d74..cfbad9700d4d9 100644 --- a/api_docs/telemetry_management_section.mdx +++ b/api_docs/telemetry_management_section.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryManagementSection title: "telemetryManagementSection" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryManagementSection plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] --- import telemetryManagementSectionObj from './telemetry_management_section.devdocs.json'; diff --git a/api_docs/text_based_languages.mdx b/api_docs/text_based_languages.mdx index 6cbe9d47406aa..5813f0438d52a 100644 --- a/api_docs/text_based_languages.mdx +++ b/api_docs/text_based_languages.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/textBasedLanguages title: "textBasedLanguages" image: https://source.unsplash.com/400x175/?github description: API docs for the textBasedLanguages plugin -date: 2024-07-04 +date: 2024-07-09 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'textBasedLanguages'] --- import textBasedLanguagesObj from './text_based_languages.devdocs.json'; diff --git a/api_docs/threat_intelligence.mdx b/api_docs/threat_intelligence.mdx index deedae402bb38..5d3ce3746744c 100644 --- a/api_docs/threat_intelligence.mdx +++ b/api_docs/threat_intelligence.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/threatIntelligence title: "threatIntelligence" image: https://source.unsplash.com/400x175/?github description: API docs for the threatIntelligence plugin -date: 2024-07-04 +date: 2024-07-11 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 4758654017103..53bf4c3913ee6 100644 --- a/api_docs/timelines.devdocs.json +++ b/api_docs/timelines.devdocs.json @@ -1467,340 +1467,6 @@ "classes": [], "functions": [], "interfaces": [ - { - "parentPluginId": "timelines", - "id": "def-common.BrowserField", - "type": "Interface", - "tags": [ - "deprecated" - ], - "label": "BrowserField", - "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", - "deprecated": true, - "trackAdoption": false, - "references": [ - { - "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" - }, - { - "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" - }, - { - "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" - }, - { - "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" - }, - { - "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" - }, - { - "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/columns.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/columns.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/columns.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/use_data_view.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/use_data_view.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/use_data_view.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/use_data_view.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/types.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/types.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/types.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/table/field_value_cell.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/table/field_value_cell.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/table/use_action_cell_data_provider.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/table/use_action_cell_data_provider.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/utils.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/utils.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/utils.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_config.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_config.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_config.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.ts" - } - ], - "children": [ - { - "parentPluginId": "timelines", - "id": "def-common.BrowserField.aggregatable", - "type": "boolean", - "tags": [], - "label": "aggregatable", - "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "timelines", - "id": "def-common.BrowserField.format", - "type": "string", - "tags": [], - "label": "format", - "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "timelines", - "id": "def-common.BrowserField.indexes", - "type": "Array", - "tags": [], - "label": "indexes", - "description": [], - "signature": [ - "string[]" - ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "timelines", - "id": "def-common.BrowserField.name", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "timelines", - "id": "def-common.BrowserField.searchable", - "type": "boolean", - "tags": [], - "label": "searchable", - "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "timelines", - "id": "def-common.BrowserField.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "timelines", - "id": "def-common.BrowserField.esTypes", - "type": "Array", - "tags": [], - "label": "esTypes", - "description": [], - "signature": [ - "string[] | undefined" - ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "timelines", - "id": "def-common.BrowserField.subType", - "type": "CompoundType", - "tags": [], - "label": "subType", - "description": [], - "signature": [ - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.IFieldSubType", - "text": "IFieldSubType" - }, - " | undefined" - ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "timelines", - "id": "def-common.BrowserField.readFromDocValues", - "type": "boolean", - "tags": [], - "label": "readFromDocValues", - "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "timelines", - "id": "def-common.BrowserField.runtimeField", - "type": "Object", - "tags": [], - "label": "runtimeField", - "description": [], - "signature": [ - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" - }, - " | undefined" - ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, { "parentPluginId": "timelines", "id": "def-common.CursorType", @@ -3877,6 +3543,213 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "timelines", + "id": "def-common.BrowserField", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "BrowserField", + "description": [], + "signature": [ + "Omit<", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + ", \"format\"> & { format?: string | undefined; }" + ], + "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "deprecated": true, + "trackAdoption": false, + "references": [ + { + "plugin": "@kbn/securitysolution-data-table", + "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" + }, + { + "plugin": "@kbn/securitysolution-data-table", + "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" + }, + { + "plugin": "@kbn/securitysolution-data-table", + "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" + }, + { + "plugin": "@kbn/securitysolution-data-table", + "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" + }, + { + "plugin": "@kbn/securitysolution-data-table", + "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" + }, + { + "plugin": "@kbn/securitysolution-data-table", + "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/columns.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/columns.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/columns.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/use_data_view.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/use_data_view.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/use_data_view.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/use_data_view.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/table/field_value_cell.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/table/field_value_cell.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/table/use_action_cell_data_provider.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/table/use_action_cell_data_provider.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/utils.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/utils.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/utils.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_config.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_config.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_config.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.ts" + } + ], + "initialIsOpen": false + }, { "parentPluginId": "timelines", "id": "def-common.BrowserFields", diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index c825115a04469..638e5226e0a35 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/timelines title: "timelines" image: https://source.unsplash.com/400x175/?github description: API docs for the timelines plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'timelines'] --- import timelinesObj from './timelines.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/security-threat-hunting-investigations](https://github.com/org | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 238 | 1 | 194 | 18 | +| 228 | 1 | 184 | 18 | ## Client diff --git a/api_docs/transform.mdx b/api_docs/transform.mdx index ef145aff8fa51..16ce978528dd6 100644 --- a/api_docs/transform.mdx +++ b/api_docs/transform.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/transform title: "transform" image: https://source.unsplash.com/400x175/?github description: API docs for the transform plugin -date: 2024-07-04 +date: 2024-07-11 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 ad45f50762eb1..23ad7592bc323 100644 --- a/api_docs/triggers_actions_ui.devdocs.json +++ b/api_docs/triggers_actions_ui.devdocs.json @@ -177,7 +177,7 @@ "label": "start", "description": [], "signature": [ - "(_: ", + "(core: ", { "pluginId": "@kbn/core-lifecycle-browser", "scope": "common", @@ -203,7 +203,7 @@ "id": "def-public.Plugin.start.$1", "type": "Object", "tags": [], - "label": "_", + "label": "core", "description": [], "signature": [ { diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index d5d9c27ec210b..e041317a6070c 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/triggersActionsUi title: "triggersActionsUi" image: https://source.unsplash.com/400x175/?github description: API docs for the triggersActionsUi plugin -date: 2024-07-04 +date: 2024-07-11 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 49df36a5eb091..c090c5755ab42 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActions title: "uiActions" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActions plugin -date: 2024-07-04 +date: 2024-07-11 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 7f6ce8da09f7b..c68df9b322654 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActionsEnhanced title: "uiActionsEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActionsEnhanced plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActionsEnhanced'] --- import uiActionsEnhancedObj from './ui_actions_enhanced.devdocs.json'; diff --git a/api_docs/unified_doc_viewer.mdx b/api_docs/unified_doc_viewer.mdx index 055a63e701ac3..95c4364f43a22 100644 --- a/api_docs/unified_doc_viewer.mdx +++ b/api_docs/unified_doc_viewer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedDocViewer title: "unifiedDocViewer" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedDocViewer plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedDocViewer'] --- import unifiedDocViewerObj from './unified_doc_viewer.devdocs.json'; diff --git a/api_docs/unified_histogram.devdocs.json b/api_docs/unified_histogram.devdocs.json index 0518cdf17da56..17cc0d1a80cb9 100644 --- a/api_docs/unified_histogram.devdocs.json +++ b/api_docs/unified_histogram.devdocs.json @@ -614,7 +614,7 @@ }, ") => void) | undefined; } & Pick<", "UnifiedHistogramLayoutProps", - ", \"className\" | \"children\" | \"query\" | \"filters\" | \"columns\" | \"container\" | \"onBrushEnd\" | \"disabledActions\" | \"timeRange\" | \"dataView\" | \"table\" | \"services\" | \"relativeTimeRange\" | \"renderCustomChartToggleActions\" | \"onFilter\" | \"externalVisContext\" | \"withDefaultActions\" | \"abortController\"> & ", + ", \"className\" | \"children\" | \"query\" | \"filters\" | \"services\" | \"columns\" | \"container\" | \"onBrushEnd\" | \"disabledActions\" | \"timeRange\" | \"dataView\" | \"table\" | \"relativeTimeRange\" | \"renderCustomChartToggleActions\" | \"onFilter\" | \"externalVisContext\" | \"withDefaultActions\" | \"abortController\"> & ", { "pluginId": "@kbn/shared-ux-utility", "scope": "common", @@ -1615,7 +1615,7 @@ }, ") => void) | undefined; } & Pick<", "UnifiedHistogramLayoutProps", - ", \"className\" | \"children\" | \"query\" | \"filters\" | \"columns\" | \"container\" | \"onBrushEnd\" | \"disabledActions\" | \"timeRange\" | \"dataView\" | \"table\" | \"services\" | \"relativeTimeRange\" | \"renderCustomChartToggleActions\" | \"onFilter\" | \"externalVisContext\" | \"withDefaultActions\" | \"abortController\">" + ", \"className\" | \"children\" | \"query\" | \"filters\" | \"services\" | \"columns\" | \"container\" | \"onBrushEnd\" | \"disabledActions\" | \"timeRange\" | \"dataView\" | \"table\" | \"relativeTimeRange\" | \"renderCustomChartToggleActions\" | \"onFilter\" | \"externalVisContext\" | \"withDefaultActions\" | \"abortController\">" ], "path": "src/plugins/unified_histogram/public/container/container.tsx", "deprecated": false, diff --git a/api_docs/unified_histogram.mdx b/api_docs/unified_histogram.mdx index 49022db07ed33..4f4a60ac31a60 100644 --- a/api_docs/unified_histogram.mdx +++ b/api_docs/unified_histogram.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedHistogram title: "unifiedHistogram" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedHistogram plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedHistogram'] --- import unifiedHistogramObj from './unified_histogram.devdocs.json'; diff --git a/api_docs/unified_search.mdx b/api_docs/unified_search.mdx index 4b831a83772ee..47438fb7a9b30 100644 --- a/api_docs/unified_search.mdx +++ b/api_docs/unified_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch title: "unifiedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch plugin -date: 2024-07-04 +date: 2024-07-11 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 adb9e989ae7fd..c0d5599e462e5 100644 --- a/api_docs/unified_search_autocomplete.mdx +++ b/api_docs/unified_search_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch-autocomplete title: "unifiedSearch.autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch.autocomplete plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch.autocomplete'] --- import unifiedSearchAutocompleteObj from './unified_search_autocomplete.devdocs.json'; diff --git a/api_docs/uptime.mdx b/api_docs/uptime.mdx index 83988e94008c4..d7c9168a273e7 100644 --- a/api_docs/uptime.mdx +++ b/api_docs/uptime.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/uptime title: "uptime" image: https://source.unsplash.com/400x175/?github description: API docs for the uptime plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uptime'] --- import uptimeObj from './uptime.devdocs.json'; This plugin visualizes data from Heartbeat, and integrates with other Observability solutions. -Contact [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) for questions regarding this plugin. +Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index 3fd6abfac031a..e36131ead0d63 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/urlForwarding title: "urlForwarding" image: https://source.unsplash.com/400x175/?github description: API docs for the urlForwarding plugin -date: 2024-07-04 +date: 2024-07-11 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 609cbc0a5a633..aff0a34416810 100644 --- a/api_docs/usage_collection.devdocs.json +++ b/api_docs/usage_collection.devdocs.json @@ -1838,6 +1838,19 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "usageCollection", + "id": "def-server.UsageCountersSavedObjectAttributes.source", + "type": "string", + "tags": [], + "label": "source", + "description": [ + "The source of the event that is being counted: 'server' | 'ui'" + ], + "path": "src/plugins/usage_collection/server/usage_counters/saved_objects.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "usageCollection", "id": "def-server.UsageCountersSavedObjectAttributes.count", @@ -2006,7 +2019,7 @@ "The Saved Objects type for Usage Counters" ], "signature": [ - "\"usage-counters\"" + "\"usage-counter\"" ], "path": "src/plugins/usage_collection/server/usage_counters/saved_objects.ts", "deprecated": false, @@ -2152,10 +2165,10 @@ }, { "parentPluginId": "usageCollection", - "id": "def-server.UsageCollectionSetup.getUsageCounterByType", + "id": "def-server.UsageCollectionSetup.getUsageCounterByDomainId", "type": "Function", "tags": [], - "label": "getUsageCounterByType", + "label": "getUsageCounterByDomainId", "description": [ "\nReturns a usage counter by type" ], @@ -2176,7 +2189,7 @@ "children": [ { "parentPluginId": "usageCollection", - "id": "def-server.UsageCollectionSetup.getUsageCounterByType.$1", + "id": "def-server.UsageCollectionSetup.getUsageCounterByDomainId.$1", "type": "string", "tags": [], "label": "type", diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index 38be51dc80a42..5a83dde70882d 100644 --- a/api_docs/usage_collection.mdx +++ b/api_docs/usage_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/usageCollection title: "usageCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the usageCollection plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] --- import usageCollectionObj from './usage_collection.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 55 | 0 | 16 | 2 | +| 56 | 0 | 16 | 2 | ## Client diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index 8195e0e09fefc..c1a224812e6f9 100644 --- a/api_docs/ux.mdx +++ b/api_docs/ux.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ux title: "ux" image: https://source.unsplash.com/400x175/?github description: API docs for the ux plugin -date: 2024-07-04 +date: 2024-07-11 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 d62810e3d1ea1..e66d2e7f0cf1b 100644 --- a/api_docs/vis_default_editor.mdx +++ b/api_docs/vis_default_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visDefaultEditor title: "visDefaultEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the visDefaultEditor plugin -date: 2024-07-04 +date: 2024-07-11 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 fe5ece28da251..ba1bfdeb89f5e 100644 --- a/api_docs/vis_type_gauge.mdx +++ b/api_docs/vis_type_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeGauge title: "visTypeGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeGauge plugin -date: 2024-07-04 +date: 2024-07-11 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 eddbcbce54a59..cec157b72cc1d 100644 --- a/api_docs/vis_type_heatmap.mdx +++ b/api_docs/vis_type_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeHeatmap title: "visTypeHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeHeatmap plugin -date: 2024-07-04 +date: 2024-07-11 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 c99cbfa2402ad..9478bfc37db41 100644 --- a/api_docs/vis_type_pie.mdx +++ b/api_docs/vis_type_pie.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypePie title: "visTypePie" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypePie plugin -date: 2024-07-04 +date: 2024-07-11 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 49170451c94b7..8d3505f45293d 100644 --- a/api_docs/vis_type_table.mdx +++ b/api_docs/vis_type_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTable title: "visTypeTable" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTable plugin -date: 2024-07-04 +date: 2024-07-11 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 88d15e1669816..5fcdd9938c1be 100644 --- a/api_docs/vis_type_timelion.mdx +++ b/api_docs/vis_type_timelion.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimelion title: "visTypeTimelion" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimelion plugin -date: 2024-07-04 +date: 2024-07-11 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 4bd4a29b1bd80..bc6b238b14e3d 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimeseries title: "visTypeTimeseries" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimeseries plugin -date: 2024-07-04 +date: 2024-07-11 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 fbc1e6b50794c..617429675c83a 100644 --- a/api_docs/vis_type_vega.mdx +++ b/api_docs/vis_type_vega.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVega title: "visTypeVega" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVega plugin -date: 2024-07-04 +date: 2024-07-11 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 e7a413a6b90ab..aff385709f8b3 100644 --- a/api_docs/vis_type_vislib.mdx +++ b/api_docs/vis_type_vislib.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVislib title: "visTypeVislib" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVislib plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVislib'] --- import visTypeVislibObj from './vis_type_vislib.devdocs.json'; diff --git a/api_docs/vis_type_xy.mdx b/api_docs/vis_type_xy.mdx index 6217e915e8663..8165741192e1c 100644 --- a/api_docs/vis_type_xy.mdx +++ b/api_docs/vis_type_xy.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeXy title: "visTypeXy" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeXy plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeXy'] --- import visTypeXyObj from './vis_type_xy.devdocs.json'; diff --git a/api_docs/visualizations.devdocs.json b/api_docs/visualizations.devdocs.json index bfea478cf29ce..46fb8a61a8352 100644 --- a/api_docs/visualizations.devdocs.json +++ b/api_docs/visualizations.devdocs.json @@ -9691,7 +9691,7 @@ "label": "mode", "description": [], "signature": [ - "\"full\" | \"custom\" | \"dataBounds\"" + "\"custom\" | \"full\" | \"dataBounds\"" ], "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", "deprecated": false, @@ -14067,7 +14067,7 @@ "label": "yLeftScale", "description": [], "signature": [ - "\"log\" | \"time\" | \"linear\" | \"sqrt\" | undefined" + "\"log\" | \"sqrt\" | \"time\" | \"linear\" | undefined" ], "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", "deprecated": false, @@ -14081,7 +14081,7 @@ "label": "yRightScale", "description": [], "signature": [ - "\"log\" | \"time\" | \"linear\" | \"sqrt\" | undefined" + "\"log\" | \"sqrt\" | \"time\" | \"linear\" | undefined" ], "path": "src/plugins/visualizations/common/convert_to_lens/types/configurations.ts", "deprecated": false, diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index 81c0a563a3818..d7212a6bd8a8f 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visualizations title: "visualizations" image: https://source.unsplash.com/400x175/?github description: API docs for the visualizations plugin -date: 2024-07-04 +date: 2024-07-11 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] --- import visualizationsObj from './visualizations.devdocs.json'; diff --git a/catalog-info.yaml b/catalog-info.yaml index 95d625355d4db..4af2698ca6cca 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -39,41 +39,6 @@ spec: type: url target: https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/locations.yml ---- - -apiVersion: backstage.io/v1alpha1 -kind: Resource -metadata: - name: kibana-tests-pipeline - description: Definition of the kibana pipeline - links: - - title: Pipeline - url: https://buildkite.com/elastic/kibana-tests -spec: - type: buildkite-pipeline - owner: group:kibana-tech-leads - system: buildkite - implementation: - apiVersion: buildkite.elastic.dev/v1 - kind: Pipeline - metadata: - name: kibana-tests - description: Pipeline that tests the service integration in various environments - spec: - repository: elastic/kibana - pipeline_file: ./.buildkite/pipelines/quality-gates/pipeline.kibana-tests.yaml - provider_settings: - trigger_mode: none - teams: - kibana-operations: - access_level: MANAGE_BUILD_AND_READ - kibana-release-operators: - access_level: BUILD_AND_READ - cloud-tooling: - access_level: BUILD_AND_READ - everyone: - access_level: READ_ONLY - --- apiVersion: backstage.io/v1alpha1 kind: Component @@ -132,34 +97,6 @@ spec: # yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json apiVersion: backstage.io/v1alpha1 kind: Resource -metadata: - name: buildkite-pipeline-kibana-kme-test -spec: - implementation: - apiVersion: buildkite.elastic.dev/v1 - kind: Pipeline - metadata: - description: Temporary pipeline for testing Kibana KME work - name: kibana-kme-test - spec: - pipeline_file: .buildkite/scripts/pipelines/pull_request/pipeline.sh - provider_settings: - build_branches: false - build_pull_requests: true - publish_commit_status: false - trigger_mode: none - repository: elastic/kibana - teams: - kibana-operations: - access_level: MANAGE_BUILD_AND_READ - everyone: - access_level: READ_ONLY - owner: group:kibana-operations - type: buildkite-pipeline ---- -# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json -apiVersion: backstage.io/v1alpha1 -kind: Resource metadata: name: buildkite-pipeline-kibana-sonarqube description: Run a SonarQube scan @@ -189,37 +126,6 @@ spec: access_level: MANAGE_BUILD_AND_READ everyone: access_level: READ_ONLY ---- -# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json -apiVersion: backstage.io/v1alpha1 -kind: Resource -metadata: - name: buildkite-pipeline-kibana-emergency-release - description: Emergency release - links: - - title: Pipeline - url: https://buildkite.com/elastic/kibana-emergency-release -spec: - type: buildkite-pipeline - owner: group:kibana-operations - system: buildkite - implementation: - apiVersion: buildkite.elastic.dev/v1 - kind: Pipeline - metadata: - name: kibana / emergency release - spec: - repository: elastic/kibana - provider_settings: - trigger_mode: none - pipeline_file: ".buildkite/pipelines/emergency_release.yml" - teams: - kibana-operations: - access_level: MANAGE_BUILD_AND_READ - kibana-release-operators: - access_level: BUILD_AND_READ - everyone: - access_level: READ_ONLY # Please avoid creating new kibana pipelines in this file to avoid bloating. # Instead, create a new file in the pipeline-resource-definitions directory, and wire it in through the locations.yml file. diff --git a/dev_docs/tutorials/generating_oas_for_http_apis.mdx b/dev_docs/tutorials/generating_oas_for_http_apis.mdx new file mode 100644 index 0000000000000..f47031887db80 --- /dev/null +++ b/dev_docs/tutorials/generating_oas_for_http_apis.mdx @@ -0,0 +1,182 @@ +--- +id: kibDevTutorialGeneratingOASForHTTPAPIs +slug: /kibana-dev-docs/genereating-oas-for-http-apis +title: Generating OAS for HTTP APIs +description: This tutorial demonstrates how to generate OpenAPI specification for HTTP APIs. +date: 2024-07-04 +tags: ['kibana', 'onboarding', 'dev', 'architecture', 'http', 'rest', 'api'] +--- + + + If your route declares `access: 'public'` you **must** provide up-to-date OpenAPI specification for it. Docs for these routes get hosted on [on our docs site](https://www.elastic.co/docs/api/doc/serverless) and are used for client integrations. For example: our [Elastic stack terraform provider](https://github.com/elastic/terraform-provider-elasticstack). + + +### Important components + +To get OAS generated for HTTP APIs you must use the following components: + +1. Core's `router` or `router.versioned` for defining HTTP APIs provided via the `core.http` service to all plugins +2. `@kbn/config-schema` request and response schemas, skip to this FAQ for more information + + + Kibana's core platform supports `@kbn/config-schema` as a first-class citizen for various schema purposes: configuration, saved objects, and HTTP API request/response bodies. + + Developers can leverage `@kbn/config-schema` as a single-source of truth for runtime validation, TypeScript interfaces, and OpenAPI specification. + + +### How do I see my HTTP API's OAS? + +In `kibana.dev.yml` add the following configuration: + +```yaml +server.oas.enabled: true +``` + +Launch Kibana and send the following request: + +```bash +curl -s -uelastic:changeme http://localhost:5601/api/oas\?pathStartsWith\=/api/foo +``` + +The value returned should contain the OpenAPI specification for your route and any other path's start with `/api/foo`. + +Other useful query parameters for filtering are: + * `pluginId` - get the OAS for a specific plugin, for example: `@kbn/data-views-plugin` + * `access` - filter for specific access levels: `public` or `internal` are supported + + + For assistance with the writing docs or any other questions about the docs impact, check out https://docs.elastic.dev/content-architecture/oas or chat with writers on **#docs** or **#next-api-reference** + + +### Some good practices to consider + +#### 1. Runtime schema definitions + +```typescript +// In server/schemas/v1.ts +import { schema, TypeOf } from '@kbn/config-schema'; + +export const fooResource = schema.object({ + name: schema.string() + // ...and any other fields you may need +}); + +export type FooResource = TypeOf; + +// In common/foo/v1.ts +export type { FooResource } from '../server/schemas/v1'; + +// In common/index.ts expose this as the "latest" schema shape +export type { FooResource } from './latest'; + +export * as fooResourceV1 from '../foo/v1'; +``` + +This example demonstrates how you can organize runtime schemas to prepare for: + +1. Being versioned +2. Have TypeScript references available to client and server code in your plugin + +See for more information on this organizational pattern. + +#### 2. Route definitions + +```typescript +// Somewhere in your plugin's server/routes folder +import { schema, TypeOf } from '@kbn/config-schema'; +import type { FooResource } from '../../../common'; +import { fooResource } from '../../schemas/v1'; + +// Note: this response schema is instantiated lazily to avoid creating schemas that are not needed in most cases! +const fooResourceResponse = () => { + return schema.object({ + id: schema.string({ maxLength: 20 }), + name: schema.string(), + createdAt: schema.string(), + }) +} + +// Note: TypeOf can extract types for lazily instantiated schemas +type FooResourceResponse = TypeOf + +function registerFooRoute(router: IRouter, docLinks: DoclinksStart) { + router.versioned + .post({ + path: '/api/foo', + access: 'public', + summary: 'Create a foo resource' + description: `A foo resource enables baz. See the following [documentation](${docLinks.links.fooResource}).`, + }) + .addVersion({ + version: '2023-10-31', + validate: { + request: { + body: , + }, + response: { + 200: { + body: fooResourceResponse, + }, + }, + }, + }, + async (ctx, req, res) => { + const core = await ctx.core; + const savedObjectsClient = core.savedObjects.client; + const body = req.body; + const foo = await createFoo({ name: body.name }); + // This is our HTTP translation layer to ensure only the necessary fields included + const responseBody: FooResourceResponse = { + id: foo.id, + name: foo.name, + createdAt: foo.createdAt, + }; + return res.ok({ body: responseBody }); + } + ); +} +``` + +#### 3. Generating OAS + +See this section about viewing your HTTP APIs OAS. + +#### 4. Iterating on OAS + +From here, you can develop your route and schema definitions iteratively. After each change the Kibana server will +automatically reload and the latest OAS should reflect the current state of your code! + +For example, let's add a few descriptions to our schema members: + +```typescript +const fooResourceResponse = () => { + return schema.object({ + id: schema.string({ maxLength: 20, meta: { description: 'An unique ID for a foo resource.'} }), + name: schema.string({ meta: { description: 'A human friendly name for a foo resource.'} }), + createdAt: schema.string({ meta: { description: 'The ISO date a foo resource was created.'} }), + }) +} +``` + +This descriptions should now be reflected in the OAS generated for your route. + +#### 5. Publishing OAS + +OAS for public routes are written to the Kibana repo as a snapshot that will ultimately be published. + + + At the time of writing we only capture OAS for a subset of Kibana's HTTP APIs to give teams time to check and improve the quality of generated OAS. + + If you would like OAS for your endpoints to be included in the snapshot, **please reach out to #kibana-core**. + + + +### FAQs + +#### What about runtime validation libary X? +Teams have adopted different runtime validation libraries for their HTTP APIs. Kibana core does not intend to support all runtime validation libraries. + +Reach out to **#kibana-core** with questions, concerns or issues you may be facing with `@kbn/config-schema` and we will help you find a solution. + +#### What about internal HTTP APIs? +It's possible to generate OpenAPI specification for `access: 'internal'` routes but it is not required. The benefit will largely be for your team's internal reference and for other teams to discover your APIs. If you follow the practices outlined in this tutorial it should be simple to generate OAS for internal routes as well. diff --git a/dev_docs/tutorials/versioning_http_apis.mdx b/dev_docs/tutorials/versioning_http_apis.mdx index b0a4bf899158c..25361ba2ae792 100644 --- a/dev_docs/tutorials/versioning_http_apis.mdx +++ b/dev_docs/tutorials/versioning_http_apis.mdx @@ -3,7 +3,7 @@ id: kibDevTutorialVersioningHTTPAPIs slug: /kibana-dev-docs/versioning-http-apis title: Versioning HTTP APIs description: This tutorial demonstrates how to create or migrate to versionable HTTP APIs. -date: 2023-02-09 +date: 2024-07-04 tags: ['kibana', 'onboarding', 'dev', 'architecture'] --- diff --git a/docs/CHANGELOG.asciidoc b/docs/CHANGELOG.asciidoc index 6d42b25d4bce4..c5a1dd2798fbb 100644 --- a/docs/CHANGELOG.asciidoc +++ b/docs/CHANGELOG.asciidoc @@ -10,6 +10,7 @@ Review important information about the {kib} 8.x releases. +* <> * <> * <> * <> @@ -69,6 +70,21 @@ Review important information about the {kib} 8.x releases. -- +[[release-notes-8.14.3]] +== {kib} 8.14.3 + +The 8.14.3 release includes the following bug fixes. + +[float] +[[fixes-v8.14.3]] +=== Bug Fixes +Dashboard:: +* Fixes controls getting overwritten on navigation ({kibana-pull}187509[#187509]). +Elastic Security:: +For the Elastic Security 8.14.3 release information, refer to {security-guide}/release-notes.html[_Elastic Security Solution Release Notes_]. +Logs:: +* Fixes log entry fly-out when response is slow ({kibana-pull}187303[#187303]). + [[release-notes-8.14.2]] == {kib} 8.14.2 diff --git a/docs/api/data-views/create.asciidoc b/docs/api/data-views/create.asciidoc index 2164983db11ea..32372639d2dbf 100644 --- a/docs/api/data-views/create.asciidoc +++ b/docs/api/data-views/create.asciidoc @@ -231,10 +231,13 @@ The API returns the {data-source} object: .Properties of the fieldAttrs[fieldName] objects: [%collapsible%open] ===== -`customLabel`::: +`customLabel`:: (Optional, string) Custom label for the field. -`count`::: +`customDescription`:: +(Optional, string) Custom description for the field. Max length is 300 characters. + +`count`:: (Optional, number) Popularity count for the field. ===== diff --git a/docs/api/data-views/update-fields.asciidoc b/docs/api/data-views/update-fields.asciidoc index 9b0b044238f36..0feacccb81863 100644 --- a/docs/api/data-views/update-fields.asciidoc +++ b/docs/api/data-views/update-fields.asciidoc @@ -5,7 +5,7 @@ ++++ experimental[] Update fields presentation metadata, such as `count`, -`customLabel`, and `format`. You can update multiple fields in one request. Updates +`customLabel`, `customDescription`, and `format`. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify `null` as the value. @@ -119,7 +119,8 @@ $ curl -X POST api/data_views/data_view/my-view/fields "customLabel": "Foo" }, "bar": { - "customLabel": "Bar" + "customLabel": "Bar", + "customDescription": "Bar Custom description" } } } diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index e4f161ac8f4e5..0f20d331118cc 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -102,6 +102,10 @@ This API doesn't support angular, for registering angular dev tools, bootstrap a |Embeddables are React components that manage their own state, can be serialized and deserialized, and return an API that can be used to interact with them imperatively. +|{kib-repo}blob/{branch}/src/plugins/esql/README.md[esql] +|The editor accepts the following properties: + + |{kib-repo}blob/{branch}/src/plugins/esql_datagrid/README.md[esqlDataGrid] |Contains a Discover-like table specifically for ES|QL queries: @@ -328,10 +332,6 @@ generating deep links to other apps using locators, and creating short URLs. |This plugin adds the Advanced Settings section for the Usage and Security Data collection (aka Telemetry). -|{kib-repo}blob/{branch}/src/plugins/text_based_languages/README.md[textBasedLanguages] -|The editor accepts the following properties: - - |<> |UI Actions plugins provides API to manage *triggers* and *actions*. diff --git a/docs/discover/images/esql-full-query.png b/docs/discover/images/esql-full-query.png index 1d4a37af23a60..e4f5faeef3cf7 100644 Binary files a/docs/discover/images/esql-full-query.png and b/docs/discover/images/esql-full-query.png differ diff --git a/docs/discover/images/esql-limit.png b/docs/discover/images/esql-limit.png index dbc9edc3cdc13..b03ecdcc091e6 100644 Binary files a/docs/discover/images/esql-limit.png and b/docs/discover/images/esql-limit.png differ diff --git a/docs/discover/images/esql-machine-os-ram.png b/docs/discover/images/esql-machine-os-ram.png index 2c936cecb9498..ad46d88b219ff 100644 Binary files a/docs/discover/images/esql-machine-os-ram.png and b/docs/discover/images/esql-machine-os-ram.png differ diff --git a/docs/discover/try-esql.asciidoc b/docs/discover/try-esql.asciidoc index 32718d87c955a..53862be75f010 100644 --- a/docs/discover/try-esql.asciidoc +++ b/docs/discover/try-esql.asciidoc @@ -78,7 +78,7 @@ FROM kibana_sample_data_logs . Click **▶Run**. + [role="screenshot"] -image:images/esql-full-query.png[] +image:images/esql-full-query.png[An image of the full query result] + . Click **Save** to save the query and visualization to a dashboard. diff --git a/docs/management/advanced-options.asciidoc b/docs/management/advanced-options.asciidoc index 98886aedd5535..73789c750e015 100644 --- a/docs/management/advanced-options.asciidoc +++ b/docs/management/advanced-options.asciidoc @@ -43,8 +43,11 @@ Change the settings that apply only to {kib} spaces. [[auto-complete-use-time-tange]]`autocomplete:useTimeRange`:: When disabled, autocompletes the suggestions from your data set instead of the time range. +[[bfetch-disable]]`bfetch:disable`:: +deprecated:[8.15.0] When disabled, search requests from Kibana will be made in individual HTTP requests rather than bundled together. + [[bfetch-disable-compression]]`bfetch:disableCompression`:: -When disabled, allows you to debug individual requests, but increases the response size. +deprecated:[8.15.0] When disabled, allows you to debug individual requests, but increases the response size. [[csv-quotevalues]]`csv:quoteValues`:: Set this property to `true` to quote exported values. diff --git a/docs/management/connectors/action-types/gemini.asciidoc b/docs/management/connectors/action-types/gemini.asciidoc index 6ba03f247461a..3c835d981465c 100644 --- a/docs/management/connectors/action-types/gemini.asciidoc +++ b/docs/management/connectors/action-types/gemini.asciidoc @@ -29,7 +29,7 @@ image::management/connectors/images/gemini-connector.png[{gemini} connector] Name:: The name of the connector. API URL:: The {gemini} request URL. -PROJECT ID:: The project which has Vertex AI endpoint enabled. +Project ID:: The project which has Vertex AI endpoint enabled. Region:: The GCP region where the Vertex AI endpoint enabled. Default model:: The GAI model for {gemini} to use. Current support is for the Google Gemini models, defaulting to gemini-1.5-pro-001. The model can be set on a per request basis by including a "model" parameter alongside the request body. Credentials JSON:: The GCP service account JSON file for authentication. @@ -47,7 +47,7 @@ image::management/connectors/images/gemini-params.png[{gemini} params test] The {gemini} actions have the following configuration properties. -Body:: A stringified JSON payload sent to the {gemini} Invoke Model API URL. For example: +Body:: A stringified JSON payload sent to the {gemini} invoke model API. For example: + [source,text] -- @@ -65,7 +65,7 @@ Body:: A stringified JSON payload sent to the {gemini} Invoke Model API URL }) } -- -Model:: An optional string that will overwrite the connector's default model. For +Model:: An optional string that overwrites the connector's default model. [float] [[gemini-connector-networking-configuration]] diff --git a/docs/management/connectors/action-types/openai.asciidoc b/docs/management/connectors/action-types/openai.asciidoc index 49033b92cd740..968f5a1e30f3a 100644 --- a/docs/management/connectors/action-types/openai.asciidoc +++ b/docs/management/connectors/action-types/openai.asciidoc @@ -4,8 +4,8 @@ OpenAI ++++ :frontmatter-description: Add a connector that can send requests to an OpenAI provider. -:frontmatter-tags-products: [kibana] -:frontmatter-tags-content-type: [how-to] +:frontmatter-tags-products: [kibana] +:frontmatter-tags-content-type: [how-to] :frontmatter-tags-user-goals: [configure] @@ -21,6 +21,17 @@ You can create connectors in *{stack-manage-app} > {connectors-ui}*. For exampl image::management/connectors/images/gen-ai-connector.png[OpenAI connector] // NOTE: This is an autogenerated screenshot. Do not edit it directly. +[IMPORTANT] +==== +Elastic provides no official support for connecting to the Azure OpenAI service through a proxy. +However if you must use a proxy, +ensure that the proxy supports streaming and is SSE-compatible. +Elastic will only parse streamed responses. + +To validate that your connectivity problems are caused by using a proxy, +you can attempt to set up the connector and access the Azure OpenAI service without using a proxy. +==== + [float] [[openai-connector-configuration]] ==== Connector configuration @@ -46,7 +57,7 @@ image::management/connectors/images/gen-ai-params-test.png[OpenAI params test] The OpenAI actions have the following configuration properties. -Body:: A JSON payload sent to the OpenAI API URL. For example: +Body:: A JSON payload sent to the OpenAI API URL. For example: + [source,text] -- diff --git a/docs/setup/settings.asciidoc b/docs/setup/settings.asciidoc index cb096ec127154..6df6c8f3c95ee 100644 --- a/docs/setup/settings.asciidoc +++ b/docs/setup/settings.asciidoc @@ -85,6 +85,9 @@ enforce even rudimentary CSP rules, though {kib} is still accessible. This configuration is effectively ignored when <> is enabled. *Default: `true`* +`permissionsPolicy.report_to:`:: +Add sources for the https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissions-Policy[Permissions Policy `report-to` directive]. + [[elasticsearch-maxSockets]] `elasticsearch.maxSockets`:: The maximum number of sockets that can be used for communications with {es}. *Default: `Infinity`* @@ -424,6 +427,12 @@ Refer to the https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissio directives, values, and text format. To disable, set to `null`. *Default:* `camera=(), display-capture=(), fullscreen=(self), geolocation=(), microphone=(), web-share=()` +[[server-securityResponseHeaders-permissionsPolicyReportOnly]] `server.securityResponseHeaders.permissionsPolicyReportOnly`:: +experimental[] Controls whether the https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissions-Policy[`Permissions-Policy-Report-Only`] header +is used in all responses to the client from the {kib} server, and specifies what value is used. Allowed values are any text value or `null`. +Refer to the https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissions-Policy[`Permissions-Policy` documentation] for defined +directives, values, and text format. + [[server-securityResponseHeaders-disableEmbedding]]`server.securityResponseHeaders.disableEmbedding`:: Controls whether the https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy[`Content-Security-Policy`] and https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options[`X-Frame-Options`] headers are configured to disable embedding diff --git a/examples/controls_example/public/react_controls/control_group/serialization_utils.ts b/examples/controls_example/public/react_controls/control_group/serialization_utils.ts index 0488e3f46a572..4d0f2eb0f749a 100644 --- a/examples/controls_example/public/react_controls/control_group/serialization_utils.ts +++ b/examples/controls_example/public/react_controls/control_group/serialization_utils.ts @@ -10,7 +10,7 @@ import { Reference } from '@kbn/content-management-utils'; import { DEFAULT_CONTROL_GROW, DEFAULT_CONTROL_WIDTH } from '@kbn/controls-plugin/common'; import { SerializedPanelState } from '@kbn/presentation-containers'; import { omit } from 'lodash'; -import { DefaultControlApi, DefaultControlState } from '../types'; +import { DefaultControlApi } from '../types'; import { ControlGroupRuntimeState, ControlGroupSerializedState } from './types'; export const deserializeControlGroup = ( @@ -75,7 +75,7 @@ export const serializeControlGroup = ( const { rawState: { grow, width, ...rest }, references: childReferences, - } = (child.serializeState as () => SerializedPanelState)(); + } = child.serializeState(); if (childReferences && childReferences.length > 0) { references = [...references, ...childReferences]; diff --git a/examples/controls_example/public/react_controls/data_controls/range_slider/get_range_slider_control_factory.test.tsx b/examples/controls_example/public/react_controls/data_controls/range_slider/get_range_slider_control_factory.test.tsx index 98ce7619dda99..0dcaeece09873 100644 --- a/examples/controls_example/public/react_controls/data_controls/range_slider/get_range_slider_control_factory.test.tsx +++ b/examples/controls_example/public/react_controls/data_controls/range_slider/get_range_slider_control_factory.test.tsx @@ -19,6 +19,7 @@ import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { ControlApiRegistration } from '../../types'; import { RangesliderControlApi, RangesliderControlState } from './types'; import { StateComparators } from '@kbn/presentation-publishing'; +import { SerializedPanelState } from '@kbn/presentation-containers'; const DEFAULT_TOTAL_RESULTS = 20; const DEFAULT_MIN = 0; @@ -207,4 +208,35 @@ describe('RangesliderControlApi', () => { }); }); }); + + describe('step state', () => { + test('default value provided when state.step is undefined', () => { + const { api } = factory.buildControl( + { + dataViewId: 'myDataViewId', + fieldName: 'myFieldName', + }, + buildApiMock, + uuid, + controlGroupApi + ); + const serializedState = api.serializeState() as SerializedPanelState; + expect(serializedState.rawState.step).toBe(1); + }); + + test('retains value from initial state', () => { + const { api } = factory.buildControl( + { + dataViewId: 'myDataViewId', + fieldName: 'myFieldName', + step: 1024, + }, + buildApiMock, + uuid, + controlGroupApi + ); + const serializedState = api.serializeState() as SerializedPanelState; + expect(serializedState.rawState.step).toBe(1024); + }); + }); }); diff --git a/examples/controls_example/public/react_controls/data_controls/range_slider/get_range_slider_control_factory.tsx b/examples/controls_example/public/react_controls/data_controls/range_slider/get_range_slider_control_factory.tsx index 79670226c6666..6f477bbc4159a 100644 --- a/examples/controls_example/public/react_controls/data_controls/range_slider/get_range_slider_control_factory.tsx +++ b/examples/controls_example/public/react_controls/data_controls/range_slider/get_range_slider_control_factory.tsx @@ -64,7 +64,7 @@ export const getRangesliderControlFactory = ( const loadingMinMax$ = new BehaviorSubject(false); const loadingHasNoResults$ = new BehaviorSubject(false); const dataLoading$ = new BehaviorSubject(undefined); - const step$ = new BehaviorSubject(initialState.step); + const step$ = new BehaviorSubject(initialState.step ?? 1); const value$ = new BehaviorSubject(initialState.value); function setValue(nextValue: RangeValue | undefined) { value$.next(nextValue); diff --git a/examples/controls_example/public/react_controls/types.ts b/examples/controls_example/public/react_controls/types.ts index ec4299e717631..bbbd7584e2049 100644 --- a/examples/controls_example/public/react_controls/types.ts +++ b/examples/controls_example/public/react_controls/types.ts @@ -9,7 +9,7 @@ import { BehaviorSubject } from 'rxjs'; import { CanClearSelections, ControlWidth } from '@kbn/controls-plugin/public/types'; -import { HasSerializableState } from '@kbn/presentation-containers'; +import { SerializedPanelState } from '@kbn/presentation-containers'; import { PanelCompatibleComponent } from '@kbn/presentation-panel-plugin/public/panel_component/types'; import { HasParentApi, @@ -43,8 +43,11 @@ export type DefaultControlApi = PublishesDataLoading & CanClearSelections & HasType & HasUniqueId & - HasSerializableState & HasParentApi & { + // Can not use HasSerializableState interface + // HasSerializableState types serializeState as function returning 'MaybePromise' + // Controls serializeState is sync + serializeState: () => SerializedPanelState; /** TODO: Make these non-public as part of https://github.com/elastic/kibana/issues/174961 */ setDataLoading: (loading: boolean) => void; setBlockingError: (error: Error | undefined) => void; diff --git a/nav-kibana-dev.docnav.json b/nav-kibana-dev.docnav.json index 60dcb5d054393..60d0494de9c71 100644 --- a/nav-kibana-dev.docnav.json +++ b/nav-kibana-dev.docnav.json @@ -80,6 +80,10 @@ "id": "kibDevDocsSavedObjectsIntro", "label": "Saved objects" }, + { + "id": "kibDevDocsEncryptedSavedObjectsIntro", + "label": "Encrypted Saved objects" + }, { "id": "kibDevDocsPersistableStateIntro" }, @@ -135,6 +139,9 @@ "id": "kibDevTutorialVersioningInterfaces", "label": "Versioning interfaces" }, + { + "id": "kibDevTutorialGeneratingOASForHTTPAPIs" + }, { "id": "kibDevTutorialSubmitPullRequest" }, @@ -611,4 +618,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/package.json b/package.json index e4e89ddceb856..624c0820ce4e6 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "dashboarding" ], "private": true, - "version": "8.15.0", + "version": "8.16.0", "branch": "main", "types": "./kibana.d.ts", "tsdocMetadata": "./build/tsdoc-metadata.json", @@ -108,7 +108,7 @@ "@elastic/datemath": "5.0.3", "@elastic/ecs": "^8.11.1", "@elastic/elasticsearch": "^8.14.0", - "@elastic/ems-client": "8.5.1", + "@elastic/ems-client": "8.5.3", "@elastic/eui": "95.2.0", "@elastic/filesaver": "1.1.2", "@elastic/node-crypto": "1.2.1", @@ -163,6 +163,7 @@ "@kbn/alerting-state-types": "link:x-pack/packages/kbn-alerting-state-types", "@kbn/alerting-types": "link:packages/kbn-alerting-types", "@kbn/alerts-as-data-utils": "link:packages/kbn-alerts-as-data-utils", + "@kbn/alerts-grouping": "link:packages/kbn-alerts-grouping", "@kbn/alerts-restricted-fixtures-plugin": "link:x-pack/test/alerting_api_integration/common/plugins/alerts_restricted", "@kbn/alerts-ui-shared": "link:packages/kbn-alerts-ui-shared", "@kbn/analytics": "link:packages/kbn-analytics", @@ -453,6 +454,7 @@ "@kbn/es-ui-shared-plugin": "link:src/plugins/es_ui_shared", "@kbn/eso-model-version-example": "link:examples/eso_model_version_example", "@kbn/eso-plugin": "link:x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin", + "@kbn/esql": "link:src/plugins/esql", "@kbn/esql-ast": "link:packages/kbn-esql-ast", "@kbn/esql-ast-inspector-plugin": "link:examples/esql_ast_inspector", "@kbn/esql-datagrid": "link:src/plugins/esql_datagrid", @@ -673,6 +675,7 @@ "@kbn/react-kibana-context-styled": "link:packages/react/kibana_context/styled", "@kbn/react-kibana-context-theme": "link:packages/react/kibana_context/theme", "@kbn/react-kibana-mount": "link:packages/react/kibana_mount", + "@kbn/recently-accessed": "link:packages/kbn-recently-accessed", "@kbn/remote-clusters-plugin": "link:x-pack/plugins/remote_clusters", "@kbn/rendering-plugin": "link:test/plugin_functional/plugins/rendering_plugin", "@kbn/repo-info": "link:packages/kbn-repo-info", @@ -863,7 +866,6 @@ "@kbn/test-feature-usage-plugin": "link:x-pack/test/licensing_plugin/plugins/test_feature_usage", "@kbn/testing-embedded-lens-plugin": "link:x-pack/examples/testing_embedded_lens", "@kbn/text-based-editor": "link:packages/kbn-text-based-editor", - "@kbn/text-based-languages": "link:src/plugins/text_based_languages", "@kbn/third-party-lens-navigation-prompt-plugin": "link:x-pack/examples/third_party_lens_navigation_prompt", "@kbn/third-party-vis-lens-example-plugin": "link:x-pack/examples/third_party_vis_lens_example", "@kbn/threat-intelligence-plugin": "link:x-pack/plugins/threat_intelligence", @@ -937,7 +939,7 @@ "@langchain/langgraph": "^0.0.23", "@langchain/openai": "^0.0.34", "@langtrase/trace-attributes": "^3.0.8", - "@launchdarkly/node-server-sdk": "^9.4.6", + "@launchdarkly/node-server-sdk": "^9.4.7", "@loaders.gl/core": "^3.4.7", "@loaders.gl/json": "^3.4.7", "@loaders.gl/shapefile": "^3.4.7", @@ -946,6 +948,7 @@ "@mapbox/mapbox-gl-rtl-text": "0.2.3", "@mapbox/mapbox-gl-supported": "2.0.1", "@mapbox/vector-tile": "1.3.1", + "@mswjs/http-middleware": "^0.10.1", "@opentelemetry/api": "^1.1.0", "@opentelemetry/api-metrics": "^0.31.0", "@opentelemetry/exporter-metrics-otlp-grpc": "^0.34.0", @@ -1032,6 +1035,7 @@ "extract-zip": "^2.0.1", "fast-deep-equal": "^3.1.1", "fast-glob": "^3.3.2", + "fastest-levenshtein": "^1.0.12", "fflate": "^0.6.9", "file-saver": "^1.3.8", "flat": "5", @@ -1061,7 +1065,6 @@ "joi": "^17.13.3", "joi-to-json": "^4.3.0", "jquery": "^3.5.0", - "js-levenshtein": "^1.1.6", "js-search": "^1.4.3", "js-sha256": "^0.9.0", "js-yaml": "^3.14.1", @@ -1400,7 +1403,7 @@ "@mapbox/vector-tile": "1.3.1", "@octokit/rest": "^17.11.2", "@parcel/watcher": "^2.1.0", - "@redocly/cli": "^1.16.0", + "@redocly/cli": "^1.17.1", "@statoscope/webpack-plugin": "^5.28.2", "@storybook/addon-a11y": "^6.5.16", "@storybook/addon-actions": "^6.5.16", @@ -1481,7 +1484,6 @@ "@types/inquirer": "^7.3.1", "@types/jest": "^29.5.3", "@types/jquery": "^3.3.31", - "@types/js-levenshtein": "^1.1.0", "@types/js-search": "^1.4.0", "@types/js-yaml": "^3.11.1", "@types/jsdom": "^20.0.1", diff --git a/packages/analytics/ebt/shippers/fullstory/src/fullstory_shipper.ts b/packages/analytics/ebt/shippers/fullstory/src/fullstory_shipper.ts index a091076236a80..23ce46a560ca3 100644 --- a/packages/analytics/ebt/shippers/fullstory/src/fullstory_shipper.ts +++ b/packages/analytics/ebt/shippers/fullstory/src/fullstory_shipper.ts @@ -130,7 +130,7 @@ export class FullStoryShipper implements IShipper { ) .subscribe((pageVars) => { this.initContext.logger.debug( - `Calling FS.setVars with context ${JSON.stringify(pageVars)}` + () => `Calling FS.setVars with context ${JSON.stringify(pageVars)}` ); this.fullStoryApi.setVars('page', { ...formatPayload(pageVars), @@ -145,7 +145,7 @@ export class FullStoryShipper implements IShipper { * @param newContext The full new context to set {@link EventContext} */ public extendContext(newContext: EventContext): void { - this.initContext.logger.debug(`Received context ${JSON.stringify(newContext)}`); + this.initContext.logger.debug(() => `Received context ${JSON.stringify(newContext)}`); // FullStory requires different APIs for different type of contexts: // User-level context. @@ -226,7 +226,9 @@ export class FullStoryShipper implements IShipper { cloudIsElasticStaffOwned, cloudTrialEndDate, }; - this.initContext.logger.debug(`Calling FS.setUserVars with ${JSON.stringify(userVars)}`); + this.initContext.logger.debug( + () => `Calling FS.setUserVars with ${JSON.stringify(userVars)}` + ); this.fullStoryApi.setUserVars(formatPayload(userVars)); } } diff --git a/packages/content-management/table_list_view/src/table_list_view.tsx b/packages/content-management/table_list_view/src/table_list_view.tsx index a5150c959e4f5..06c2566936d5a 100644 --- a/packages/content-management/table_list_view/src/table_list_view.tsx +++ b/packages/content-management/table_list_view/src/table_list_view.tsx @@ -38,6 +38,7 @@ export type TableListViewProps & { title: string; description?: string; @@ -75,6 +76,7 @@ export const TableListView = ({ additionalRightSideActions, withoutPageTemplateWrapper, createdByEnabled, + recentlyAccessed, }: TableListViewProps) => { const PageTemplate = withoutPageTemplateWrapper ? (React.Fragment as unknown as typeof KibanaPageTemplate) @@ -124,6 +126,7 @@ export const TableListView = ({ onFetchSuccess={onFetchSuccess} setPageDataTestSubject={setPageDataTestSubject} createdByEnabled={createdByEnabled} + recentlyAccessed={recentlyAccessed} /> diff --git a/packages/content-management/table_list_view_table/src/components/table.tsx b/packages/content-management/table_list_view_table/src/components/table.tsx index dc3061e1e4802..058c12eba5bf3 100644 --- a/packages/content-management/table_list_view_table/src/components/table.tsx +++ b/packages/content-management/table_list_view_table/src/components/table.tsx @@ -13,7 +13,6 @@ import { EuiButton, EuiInMemoryTable, CriteriaWithPagination, - PropertySort, SearchFilterConfig, Direction, Query, @@ -59,6 +58,7 @@ interface Props extends State, TagManageme tableCaption: string; tableColumns: Array>; hasUpdatedAtMetadata: boolean; + hasRecentlyAccessedMetadata: boolean; deleteItems: TableListViewTableProps['deleteItems']; tableItemsRowActions: TableItemsRowActions; renderCreateButton: () => React.ReactElement | undefined; @@ -81,6 +81,7 @@ export function Table({ tableSort, tableFilter, hasUpdatedAtMetadata, + hasRecentlyAccessedMetadata, entityName, entityNamePlural, tagsToTableItemMap, @@ -174,12 +175,13 @@ export function Table({ ); }, }; - }, [hasUpdatedAtMetadata, onSortChange, tableSort]); + }, [hasUpdatedAtMetadata, onSortChange, tableSort, hasRecentlyAccessedMetadata]); const tagFilterPanel = useMemo(() => { if (!isTaggingEnabled()) return null; @@ -278,6 +280,11 @@ export function Table({ return { allUsers: Array.from(users), showNoUserOption: _showNoUserOption }; }, [createdByEnabled, items]); + const sorting = + tableSort.field === 'accessedAt' // "accessedAt" is a special case with a custom sorting + ? true // by passing "true" we disable the EuiInMemoryTable sorting and handle it ourselves, but sorting is still enabled + : { sort: tableSort }; + return ( ({ selection={selection} search={search} executeQueryOptions={{ enabled: false }} - sorting={tableSort ? { sort: tableSort as PropertySort } : undefined} + sorting={sorting} onChange={onTableChange} data-test-subj="itemsInMemTable" rowHeader="attributes.title" diff --git a/packages/content-management/table_list_view_table/src/components/table_sort_select.test.tsx b/packages/content-management/table_list_view_table/src/components/table_sort_select.test.tsx new file mode 100644 index 0000000000000..e2c62a46c0e71 --- /dev/null +++ b/packages/content-management/table_list_view_table/src/components/table_sort_select.test.tsx @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { sortByRecentlyAccessed } from './table_sort_select'; +import { UserContentCommonSchema } from '@kbn/content-management-table-list-view-common'; + +describe('sortByRecentlyAccessed', () => { + const items: UserContentCommonSchema[] = [ + { + id: 'item-1', + type: 'dashboard', + updatedAt: '2020-01-01T00:00:00Z', + attributes: { + title: 'Item 1', + }, + references: [], + }, + { + id: 'item-2', + type: 'dashboard', + updatedAt: '2020-01-02T00:00:00Z', + attributes: { + title: 'Item 2', + }, + createdBy: 'u_1', + references: [], + }, + { + id: 'item-3', + type: 'dashboard', + updatedAt: '2020-01-03T00:00:00Z', + attributes: { + title: 'Item 3', + }, + createdBy: 'u_2', + references: [], + }, + { + id: 'item-4', + type: 'dashboard', + updatedAt: '2020-01-04T00:00:00Z', + attributes: { + title: 'Item 4', + }, + references: [], + managed: true, + }, + ]; + + test('sort by last updated', () => { + const sortedItems = sortByRecentlyAccessed(items, []); + expect(sortedItems.map((item) => item.id)).toEqual(['item-4', 'item-3', 'item-2', 'item-1']); + }); + + test('pulls recently accessed to the top', () => { + const sortedItems = sortByRecentlyAccessed(items, [{ id: 'item-1' }, { id: 'item-2' }]); + expect(sortedItems.map((item) => item.id)).toEqual(['item-1', 'item-2', 'item-4', 'item-3']); + }); +}); diff --git a/packages/content-management/table_list_view_table/src/components/table_sort_select.tsx b/packages/content-management/table_list_view_table/src/components/table_sort_select.tsx index c9e06a29e9c8c..1b5d9080f8205 100644 --- a/packages/content-management/table_list_view_table/src/components/table_sort_select.tsx +++ b/packages/content-management/table_list_view_table/src/components/table_sort_select.tsx @@ -16,8 +16,10 @@ import { Direction, EuiText, useEuiTheme, + EuiIconTip, } from '@elastic/eui'; import { css } from '@emotion/react'; +import { UserContentCommonSchema } from '@kbn/content-management-table-list-view-common'; import { State } from '../table_list_view_table'; @@ -26,9 +28,15 @@ type SortItem = EuiSelectableOption & { direction: Direction; }; -export type SortColumnField = 'updatedAt' | 'attributes.title'; +export type SortColumnField = 'updatedAt' | 'attributes.title' | 'accessedAt'; const i18nText = { + accessedDescSort: i18n.translate( + 'contentManagement.tableList.listing.tableSortSelect.recentlyAccessedLabel', + { + defaultMessage: 'Recently viewed', + } + ), nameAscSort: i18n.translate('contentManagement.tableList.listing.tableSortSelect.nameAscLabel', { defaultMessage: 'Name A-Z', }), @@ -57,11 +65,17 @@ const i18nText = { interface Props { hasUpdatedAtMetadata: boolean; + hasRecentlyAccessedMetadata: boolean; tableSort: State['tableSort']; onChange?: (column: SortColumnField, direction: Direction) => void; } -export function TableSortSelect({ tableSort, hasUpdatedAtMetadata, onChange }: Props) { +export function TableSortSelect({ + tableSort, + hasUpdatedAtMetadata, + hasRecentlyAccessedMetadata, + onChange, +}: Props) { const { euiTheme } = useEuiTheme(); const [isPopoverOpen, setIsPopoverOpen] = useState(false); @@ -81,6 +95,40 @@ export function TableSortSelect({ tableSort, hasUpdatedAtMetadata, onChange }: P }, ]; + if (hasRecentlyAccessedMetadata) { + opts = [ + { + label: i18nText.accessedDescSort, + column: + 'accessedAt' /* nonexistent field, used to identify this custom type of sorting */, + direction: 'desc', + append: ( + + ), + }, + ...opts, + ]; + } + if (hasUpdatedAtMetadata) { opts = opts.concat([ { @@ -100,6 +148,7 @@ export function TableSortSelect({ tableSort, hasUpdatedAtMetadata, onChange }: P return opts; }); + const selectedOptionLabel = options.find(({ checked }) => checked === 'on')?.label ?? ''; const panelHeaderCSS = css` @@ -165,8 +214,11 @@ export function TableSortSelect({ tableSort, hasUpdatedAtMetadata, onChange }: P <> {i18nText.headerSort} - singleSelection - aria-label="some aria label" + singleSelection={'always'} + aria-label={i18n.translate( + 'contentManagement.tableList.listing.tableSortSelect.sortingOptionsAriaLabel', + { defaultMessage: 'Sorting options' } + )} options={options} onChange={onSelectChange} data-test-subj="sortSelect" @@ -214,3 +266,25 @@ export function saveSorting( /* empty */ } } + +/** + * Default custom sorting for the table when recently accessed info is available + * Sorts by recently accessed list first and the by lastUpdatedAt + */ +export function sortByRecentlyAccessed( + items: T[], + recentlyAccessed: Array<{ id: string }> +) { + const recentlyAccessedMap = new Map(recentlyAccessed.map((item, index) => [item.id, index])); + return [...items].sort((a, b) => { + if (recentlyAccessedMap.has(a.id) && recentlyAccessedMap.has(b.id)) { + return recentlyAccessedMap.get(a.id)! - recentlyAccessedMap.get(b.id)!; + } else if (recentlyAccessedMap.has(a.id)) { + return -1; + } else if (recentlyAccessedMap.has(b.id)) { + return 1; + } else { + return a.updatedAt > b.updatedAt ? -1 : 1; + } + }); +} diff --git a/packages/content-management/table_list_view_table/src/reducer.tsx b/packages/content-management/table_list_view_table/src/reducer.tsx index b4cf3691f9d75..d239fad38c724 100644 --- a/packages/content-management/table_list_view_table/src/reducer.tsx +++ b/packages/content-management/table_list_view_table/src/reducer.tsx @@ -33,11 +33,18 @@ export function getReducer() { // Only change the table sort if it hasn't been changed already. // For example if its state comes from the URL, we don't want to override it here. - if (hasUpdatedAtMetadata && !state.sortColumnChanged) { - tableSort = { - field: 'updatedAt' as const, - direction: 'desc' as const, - }; + if (!state.sortColumnChanged) { + if (state.hasRecentlyAccessedMetadata) { + tableSort = { + field: 'accessedAt' as const, + direction: 'desc' as const, + }; + } else if (hasUpdatedAtMetadata) { + tableSort = { + field: 'updatedAt' as const, + direction: 'desc' as const, + }; + } } } diff --git a/packages/content-management/table_list_view_table/src/table_list_view.test.tsx b/packages/content-management/table_list_view_table/src/table_list_view.test.tsx index c874747799480..e56322099d5ff 100644 --- a/packages/content-management/table_list_view_table/src/table_list_view.test.tsx +++ b/packages/content-management/table_list_view_table/src/table_list_view.test.tsx @@ -653,6 +653,91 @@ describe('TableListView', () => { }); }); + describe('column sorting with recently accessed', () => { + const setupColumnSorting = registerTestBed( + WithServices(TableListViewTable, { + TagList: getTagList({ references: [] }), + }), + { + defaultProps: { + ...requiredProps, + recentlyAccessed: { get: () => [{ id: '123', link: '', label: '' }] }, + }, + memoryRouter: { wrapComponent: true }, + } + ); + + const hits: UserContentCommonSchema[] = [ + { + id: '123', + updatedAt: twoDaysAgo.toISOString(), // first asc, last desc + type: 'dashboard', + attributes: { + title: 'z-foo', // first desc, last asc + }, + references: [{ id: 'id-tag-1', name: 'tag-1', type: 'tag' }], + }, + { + id: '456', + updatedAt: yesterday.toISOString(), // first desc, last asc + type: 'dashboard', + attributes: { + title: 'a-foo', // first asc, last desc + }, + references: [], + }, + ]; + + test('should initially sort by "Recently Accessed"', async () => { + let testBed: TestBed; + + await act(async () => { + testBed = await setupColumnSorting({ + findItems: jest.fn().mockResolvedValue({ total: hits.length, hits }), + }); + }); + + const { component, table } = testBed!; + component.update(); + + const { tableCellsValues } = table.getMetaData('itemsInMemTable'); + + expect(tableCellsValues).toEqual([ + ['z-foo', twoDaysAgoToString], + ['a-foo', yesterdayToString], + ]); + }); + + test('filter select should have 5 options', async () => { + let testBed: TestBed; + + await act(async () => { + testBed = await setupColumnSorting({ + findItems: jest.fn().mockResolvedValue({ total: hits.length, hits }), + }); + }); + const { openSortSelect } = getActions(testBed!); + const { component, find } = testBed!; + component.update(); + + act(() => { + openSortSelect(); + }); + component.update(); + + const filterOptions = find('sortSelect').find('li'); + + expect(filterOptions.length).toBe(5); + expect(filterOptions.map((wrapper) => wrapper.text())).toEqual([ + 'Recently viewed. Checked option.Additional information ', + 'Name A-Z ', + 'Name Z-A ', + 'Recently updated ', + 'Least recently updated ', + ]); + }); + }); + describe('content editor', () => { const setupInspector = registerTestBed( WithServices(TableListViewTable), diff --git a/packages/content-management/table_list_view_table/src/table_list_view_table.tsx b/packages/content-management/table_list_view_table/src/table_list_view_table.tsx index 9e69c4e0f4434..888e0a312d049 100644 --- a/packages/content-management/table_list_view_table/src/table_list_view_table.tsx +++ b/packages/content-management/table_list_view_table/src/table_list_view_table.tsx @@ -37,6 +37,7 @@ import type { SavedObjectsReference, } from '@kbn/content-management-content-editor'; import type { UserContentCommonSchema } from '@kbn/content-management-table-list-view-common'; +import type { RecentlyAccessed } from '@kbn/recently-accessed'; import { Table, @@ -52,6 +53,7 @@ import { type SortColumnField, getInitialSorting, saveSorting } from './componen import { useTags } from './use_tags'; import { useInRouterContext, useUrlState } from './use_url_state'; import { RowActions, TableItemsRowActions } from './types'; +import { sortByRecentlyAccessed } from './components/table_sort_select'; interface ContentEditorConfig extends Pick< @@ -116,6 +118,7 @@ export interface TableListViewTableProps< */ withoutPageTemplateWrapper?: boolean; contentEditor?: ContentEditorConfig; + recentlyAccessed?: Pick; tableCaption: string; /** Flag to force a new fetch of the table items. Whenever it changes, the `findItems()` will be called. */ @@ -145,6 +148,7 @@ export interface State { // in the query params. We might want to stop supporting both in a future release (v9.0?) stateFromURL.s = sanitizedParams.s ?? sanitizedParams.title; - if (sanitizedParams.sort === 'title' || sanitizedParams.sort === 'updatedAt') { - const field = sanitizedParams.sort === 'title' ? 'attributes.title' : 'updatedAt'; + if ( + sanitizedParams.sort === 'title' || + sanitizedParams.sort === 'updatedAt' || + sanitizedParams.sort === 'accessedAt' + ) { + const field = + sanitizedParams.sort === 'title' + ? 'attributes.title' + : sanitizedParams.sort === 'accessedAt' + ? 'accessedAt' + : 'updatedAt'; - stateFromURL.sort = { field, direction: 'asc' }; + stateFromURL.sort = { field, direction: field === 'attributes.title' ? 'asc' : 'desc' }; if (sanitizedParams.sortdir === 'desc' || sanitizedParams.sortdir === 'asc') { stateFromURL.sort.direction = sanitizedParams.sortdir; @@ -302,6 +315,7 @@ function TableListViewTableComp({ refreshListBouncer, setPageDataTestSubject, createdByEnabled = false, + recentlyAccessed, }: TableListViewTableProps) { useEffect(() => { setPageDataTestSubject(`${entityName}LandingPage`); @@ -373,6 +387,7 @@ function TableListViewTableComp({ showDeleteModal: false, hasUpdatedAtMetadata: false, hasCreatedByMetadata: false, + hasRecentlyAccessedMetadata: recentlyAccessed ? recentlyAccessed.get().length > 0 : false, selectedIds: [], searchQuery: { text: '', query: new Query(Ast.create([]), undefined, '') }, pagination: { @@ -387,7 +402,7 @@ function TableListViewTableComp({ createdBy: [], }, }; - }, [initialPageSize, entityName]); + }, [initialPageSize, entityName, recentlyAccessed]); const [state, dispatch] = useReducer(reducer, initialState); @@ -404,6 +419,7 @@ function TableListViewTableComp({ totalItems, hasUpdatedAtMetadata, hasCreatedByMetadata, + hasRecentlyAccessedMetadata, pagination, tableSort, tableFilter, @@ -433,6 +449,12 @@ function TableListViewTableComp({ } if (idx === fetchIdx.current) { + // when recentlyAccessed is available, we sort the items by the recently accessed items + // then this sort will be used as the default sort for the table + if (recentlyAccessed && recentlyAccessed.get().length > 0) { + response.hits = sortByRecentlyAccessed(response.hits, recentlyAccessed.get()); + } + dispatch({ type: 'onFetchItemsSuccess', data: { @@ -448,7 +470,7 @@ function TableListViewTableComp({ data: err, }); } - }, [searchQueryParser, searchQuery.text, findItems, onFetchSuccess]); + }, [searchQueryParser, searchQuery.text, findItems, onFetchSuccess, recentlyAccessed]); const updateQuery = useCallback( (query: Query) => { @@ -1109,6 +1131,7 @@ function TableListViewTableComp({ searchQuery={searchQuery} tableColumns={tableColumns} hasUpdatedAtMetadata={hasUpdatedAtMetadata} + hasRecentlyAccessedMetadata={hasRecentlyAccessedMetadata} tableSort={tableSort} tableFilter={tableFilter} tableItemsRowActions={tableItemsRowActions} diff --git a/packages/content-management/table_list_view_table/tsconfig.json b/packages/content-management/table_list_view_table/tsconfig.json index 09bf8256764d1..b8add47c2bfb9 100644 --- a/packages/content-management/table_list_view_table/tsconfig.json +++ b/packages/content-management/table_list_view_table/tsconfig.json @@ -34,7 +34,8 @@ "@kbn/user-profile-components", "@kbn/core-user-profile-browser", "@kbn/react-kibana-mount", - "@kbn/content-management-user-profiles" + "@kbn/content-management-user-profiles", + "@kbn/recently-accessed" ], "exclude": [ "target/**/*" diff --git a/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.tsx b/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.tsx index d2922b9a96611..380314554dedd 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.tsx +++ b/packages/core/chrome/core-chrome-browser-internal/src/chrome_service.tsx @@ -39,13 +39,13 @@ import type { SideNavComponent as ISideNavComponent, ChromeHelpMenuLink, } from '@kbn/core-chrome-browser'; +import { RecentlyAccessedService } from '@kbn/recently-accessed'; import { Logger } from '@kbn/logging'; import { DocTitleService } from './doc_title'; import { NavControlsService } from './nav_controls'; import { NavLinksService } from './nav_links'; import { ProjectNavigationService } from './project_navigation'; -import { RecentlyAccessedService } from './recently_accessed'; import { Header, LoadingIndicator, ProjectHeader } from './ui'; import { registerAnalyticsContextProvider } from './register_analytics_context_provider'; import type { InternalChromeStart } from './types'; @@ -252,7 +252,7 @@ export class ChromeService { chromeBreadcrumbs$: breadcrumbs$, logger: this.logger, }); - const recentlyAccessed = await this.recentlyAccessed.start({ http }); + const recentlyAccessed = this.recentlyAccessed.start({ http, key: 'recentlyAccessed' }); const docTitle = this.docTitle.start(); const { customBranding$ } = customBranding; const helpMenuLinks$ = navControls.getHelpMenuLinks$(); diff --git a/packages/core/chrome/core-chrome-browser-internal/tsconfig.json b/packages/core/chrome/core-chrome-browser-internal/tsconfig.json index 5d81526f2c970..d4512b515f640 100644 --- a/packages/core/chrome/core-chrome-browser-internal/tsconfig.json +++ b/packages/core/chrome/core-chrome-browser-internal/tsconfig.json @@ -16,7 +16,6 @@ "**/*.tsx", ], "kbn_references": [ - "@kbn/crypto-browser", "@kbn/i18n", "@kbn/i18n-react", "@kbn/core-injected-metadata-browser-internal", @@ -55,6 +54,7 @@ "@kbn/core-i18n-browser-mocks", "@kbn/core-theme-browser-mocks", "@kbn/react-kibana-context-render", + "@kbn/recently-accessed", ], "exclude": [ "target/**/*", diff --git a/packages/core/http/core-http-server-internal/index.ts b/packages/core/http/core-http-server-internal/index.ts index b9d4edd8a8628..cf9fe65afdb18 100644 --- a/packages/core/http/core-http-server-internal/index.ts +++ b/packages/core/http/core-http-server-internal/index.ts @@ -27,4 +27,8 @@ export { type ExternalUrlConfigType, } from './src/external_url'; +export type { PermissionsPolicyConfigType } from './src/permissions_policy'; + +export { permissionsPolicyConfig } from './src/permissions_policy'; + export { createCookieSessionStorageFactory } from './src/cookie_session_storage'; diff --git a/packages/core/http/core-http-server-internal/src/http_config.test.ts b/packages/core/http/core-http-server-internal/src/http_config.test.ts index 97da37fe703b0..45efca0b3376b 100644 --- a/packages/core/http/core-http-server-internal/src/http_config.test.ts +++ b/packages/core/http/core-http-server-internal/src/http_config.test.ts @@ -9,6 +9,7 @@ import { v4 as uuidv4 } from 'uuid'; import { config, HttpConfig } from './http_config'; import { cspConfig } from './csp'; +import { permissionsPolicyConfig } from './permissions_policy'; import { ExternalUrlConfig } from './external_url'; const validHostnames = ['www.example.com', '8.8.8.8', '::1', 'localhost', '0.0.0.0']; @@ -654,7 +655,13 @@ describe('HttpConfig', () => { }, }); const rawCspConfig = cspConfig.schema.validate({}); - const httpConfig = new HttpConfig(rawConfig, rawCspConfig, ExternalUrlConfig.DEFAULT); + const rawPermissionsPolicyConfig = permissionsPolicyConfig.schema.validate({}); + const httpConfig = new HttpConfig( + rawConfig, + rawCspConfig, + ExternalUrlConfig.DEFAULT, + rawPermissionsPolicyConfig + ); expect(httpConfig.customResponseHeaders).toEqual({ string: 'string', @@ -668,7 +675,13 @@ describe('HttpConfig', () => { it('defaults restrictInternalApis to false', () => { const rawConfig = config.schema.validate({}, {}); const rawCspConfig = cspConfig.schema.validate({}); - const httpConfig = new HttpConfig(rawConfig, rawCspConfig, ExternalUrlConfig.DEFAULT); + const rawPermissionsPolicyConfig = permissionsPolicyConfig.schema.validate({}); + const httpConfig = new HttpConfig( + rawConfig, + rawCspConfig, + ExternalUrlConfig.DEFAULT, + rawPermissionsPolicyConfig + ); expect(httpConfig.restrictInternalApis).toBe(false); }); }); diff --git a/packages/core/http/core-http-server-internal/src/http_config.ts b/packages/core/http/core-http-server-internal/src/http_config.ts index 746420fad810a..30fee577b9e1f 100644 --- a/packages/core/http/core-http-server-internal/src/http_config.ts +++ b/packages/core/http/core-http-server-internal/src/http_config.ts @@ -23,6 +23,7 @@ import { securityResponseHeadersSchema, } from './security_response_headers_config'; import { CdnConfig } from './cdn_config'; +import { PermissionsPolicyConfigType } from './permissions_policy'; const SECOND = 1000; @@ -343,14 +344,16 @@ export class HttpConfig implements IHttpConfig { constructor( rawHttpConfig: HttpConfigType, rawCspConfig: CspConfigType, - rawExternalUrlConfig: ExternalUrlConfig + rawExternalUrlConfig: ExternalUrlConfig, + rawPermissionsPolicyConfig: PermissionsPolicyConfigType ) { this.autoListen = rawHttpConfig.autoListen; this.host = rawHttpConfig.host; this.port = rawHttpConfig.port; this.cors = rawHttpConfig.cors; const { securityResponseHeaders, disableEmbedding } = parseRawSecurityResponseHeadersConfig( - rawHttpConfig.securityResponseHeaders + rawHttpConfig.securityResponseHeaders, + rawPermissionsPolicyConfig ); this.securityResponseHeaders = securityResponseHeaders; this.customResponseHeaders = Object.entries(rawHttpConfig.customResponseHeaders ?? {}).reduce( diff --git a/packages/core/http/core-http-server-internal/src/http_service.test.ts b/packages/core/http/core-http-server-internal/src/http_service.test.ts index e5ef15594b836..9867e97e0dfd5 100644 --- a/packages/core/http/core-http-server-internal/src/http_service.test.ts +++ b/packages/core/http/core-http-server-internal/src/http_service.test.ts @@ -23,6 +23,7 @@ import { HttpService } from './http_service'; import { HttpConfigType, config } from './http_config'; import { cspConfig } from './csp'; import { externalUrlConfig, ExternalUrlConfig } from './external_url'; +import { permissionsPolicyConfig } from './permissions_policy'; const logger = loggingSystemMock.create(); const env = Env.createDefault(REPO_ROOT, getEnvOptions()); @@ -42,6 +43,7 @@ const createConfigService = (value: Partial = {}) => { configService.setSchema(config.path, config.schema); configService.setSchema(cspConfig.path, cspConfig.schema); configService.setSchema(externalUrlConfig.path, externalUrlConfig.schema); + configService.setSchema(permissionsPolicyConfig.path, permissionsPolicyConfig.schema); return configService; }; const contextPreboot = contextServiceMock.createPrebootContract(); diff --git a/packages/core/http/core-http-server-internal/src/http_service.ts b/packages/core/http/core-http-server-internal/src/http_service.ts index 7e2168d397fee..05e5f48e5666d 100644 --- a/packages/core/http/core-http-server-internal/src/http_service.ts +++ b/packages/core/http/core-http-server-internal/src/http_service.ts @@ -29,6 +29,7 @@ import type { import { Router, RouterOptions } from '@kbn/core-http-router-server-internal'; import { CspConfigType, cspConfig } from './csp'; +import { PermissionsPolicyConfigType, permissionsPolicyConfig } from './permissions_policy'; import { HttpConfig, HttpConfigType, config as httpConfig } from './http_config'; import { HttpServer } from './http_server'; import { HttpsRedirectServer } from './https_redirect_server'; @@ -76,7 +77,13 @@ export class HttpService configService.atPath(httpConfig.path, { ignoreUnchanged: false }), configService.atPath(cspConfig.path), configService.atPath(externalUrlConfig.path), - ]).pipe(map(([http, csp, externalUrl]) => new HttpConfig(http, csp, externalUrl))); + configService.atPath(permissionsPolicyConfig.path), + ]).pipe( + map( + ([http, csp, externalUrl, permissionsPolicy]) => + new HttpConfig(http, csp, externalUrl, permissionsPolicy) + ) + ); const shutdownTimeout$ = this.config$.pipe(map(({ shutdownTimeout }) => shutdownTimeout)); this.prebootServer = new HttpServer(coreContext, 'Preboot', shutdownTimeout$); this.httpServer = new HttpServer(coreContext, 'Kibana', shutdownTimeout$); diff --git a/packages/core/http/core-http-server-internal/src/permissions_policy/config.ts b/packages/core/http/core-http-server-internal/src/permissions_policy/config.ts new file mode 100644 index 0000000000000..f9bfe44807be3 --- /dev/null +++ b/packages/core/http/core-http-server-internal/src/permissions_policy/config.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { TypeOf, schema } from '@kbn/config-schema'; +import type { ServiceConfigDescriptor } from '@kbn/core-base-server-internal'; + +const configSchema = schema.object({ + report_to: schema.arrayOf(schema.string(), { + defaultValue: [], + }), +}); + +/** + * @internal + */ +export type PermissionsPolicyConfigType = TypeOf; + +export const permissionsPolicyConfig: ServiceConfigDescriptor = { + path: 'permissionsPolicy', + schema: configSchema, +}; diff --git a/packages/core/http/core-http-server-internal/src/permissions_policy/index.ts b/packages/core/http/core-http-server-internal/src/permissions_policy/index.ts new file mode 100644 index 0000000000000..a7e4a0057c88c --- /dev/null +++ b/packages/core/http/core-http-server-internal/src/permissions_policy/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +export { permissionsPolicyConfig } from './config'; +export type { PermissionsPolicyConfigType } from './config'; diff --git a/packages/core/http/core-http-server-internal/src/security_response_headers_config.test.ts b/packages/core/http/core-http-server-internal/src/security_response_headers_config.test.ts index d4a0e1e384efc..4eea3469688cd 100644 --- a/packages/core/http/core-http-server-internal/src/security_response_headers_config.test.ts +++ b/packages/core/http/core-http-server-internal/src/security_response_headers_config.test.ts @@ -14,7 +14,7 @@ import { describe('parseRawSecurityResponseHeadersConfig', () => { it('returns default values', () => { const config = schema.validate({}); - const result = parse(config); + const result = parse(config, { report_to: [] }); expect(result.disableEmbedding).toBe(false); expect(result.securityResponseHeaders).toMatchInlineSnapshot(` Object { @@ -30,7 +30,7 @@ describe('parseRawSecurityResponseHeadersConfig', () => { it('a custom value results in the expected Strict-Transport-Security header', () => { const strictTransportSecurity = 'max-age=31536000; includeSubDomains'; const config = schema.validate({ strictTransportSecurity }); - const result = parse(config); + const result = parse(config, { report_to: [] }); expect(result.securityResponseHeaders['Strict-Transport-Security']).toEqual( strictTransportSecurity ); @@ -38,7 +38,7 @@ describe('parseRawSecurityResponseHeadersConfig', () => { it('a null value removes the Strict-Transport-Security header', () => { const config = schema.validate({ strictTransportSecurity: null }); - const result = parse(config); + const result = parse(config, { report_to: [] }); expect(result.securityResponseHeaders['Strict-Transport-Security']).toBeUndefined(); }); }); @@ -47,13 +47,13 @@ describe('parseRawSecurityResponseHeadersConfig', () => { it('a custom value results in the expected X-Content-Type-Options header', () => { const xContentTypeOptions = 'nosniff'; // there is no other valid value to test with const config = schema.validate({ xContentTypeOptions }); - const result = parse(config); + const result = parse(config, { report_to: [] }); expect(result.securityResponseHeaders['X-Content-Type-Options']).toEqual(xContentTypeOptions); }); it('a null value removes the X-Content-Type-Options header', () => { const config = schema.validate({ xContentTypeOptions: null }); - const result = parse(config); + const result = parse(config, { report_to: [] }); expect(result.securityResponseHeaders['X-Content-Type-Options']).toBeUndefined(); }); }); @@ -62,13 +62,13 @@ describe('parseRawSecurityResponseHeadersConfig', () => { it('a custom value results in the expected Referrer-Policy header', () => { const referrerPolicy = 'strict-origin-when-cross-origin'; const config = schema.validate({ referrerPolicy }); - const result = parse(config); + const result = parse(config, { report_to: [] }); expect(result.securityResponseHeaders['Referrer-Policy']).toEqual(referrerPolicy); }); it('a null value removes the Referrer-Policy header', () => { const config = schema.validate({ referrerPolicy: null }); - const result = parse(config); + const result = parse(config, { report_to: [] }); expect(result.securityResponseHeaders['Referrer-Policy']).toBeUndefined(); }); }); @@ -77,21 +77,45 @@ describe('parseRawSecurityResponseHeadersConfig', () => { it('a custom value results in the expected Permissions-Policy header', () => { const permissionsPolicy = 'display-capture=(self)'; const config = schema.validate({ permissionsPolicy }); - const result = parse(config); + const result = parse(config, { report_to: [] }); expect(result.securityResponseHeaders['Permissions-Policy']).toEqual(permissionsPolicy); }); it('a null value removes the Permissions-Policy header', () => { const config = schema.validate({ permissionsPolicy: null }); - const result = parse(config); + const result = parse(config, { report_to: [] }); expect(result.securityResponseHeaders['Permissions-Policy']).toBeUndefined(); }); + + it('includes report-to directive if it is provided', () => { + const config = schema.validate({ permissionsPolicy: 'display-capture=(self)' }); + const result = parse(config, { report_to: ['violations-endpoint'] }); + expect(result.securityResponseHeaders['Permissions-Policy']).toEqual( + 'display-capture=(self);report-to=violations-endpoint' + ); + }); + }); + + describe('permissionsPolicyReportOnly', () => { + it('a custom value results in the expected Permissions-Policy-Report-Only header', () => { + const config = schema.validate({ permissionsPolicyReportOnly: 'display-capture=(self)' }); + const result = parse(config, { report_to: ['violations-endpoint'] }); + expect(result.securityResponseHeaders['Permissions-Policy-Report-Only']).toEqual( + 'display-capture=(self);report-to=violations-endpoint' + ); + }); + + it('includes Permissions-Policy-Report-Only only if report-to directive is set', () => { + const config = schema.validate({ permissionsPolicy: 'display-capture=(self)' }); + const result = parse(config, { report_to: [] }); + expect(result.securityResponseHeaders['Permissions-Policy-Report-Only']).toBeUndefined(); + }); }); describe('disableEmbedding', () => { it('a true value results in the expected X-Frame-Options header and expected disableEmbedding result value', () => { const config = schema.validate({ disableEmbedding: true }); - const result = parse(config); + const result = parse(config, { report_to: [] }); expect(result.securityResponseHeaders['X-Frame-Options']).toMatchInlineSnapshot( `"SAMEORIGIN"` ); @@ -103,7 +127,7 @@ describe('parseRawSecurityResponseHeadersConfig', () => { it('a custom value results in the expected Cross-Origin-Opener-Policy header', () => { const crossOriginOpenerPolicy = 'same-origin-allow-popups'; const config = schema.validate({ crossOriginOpenerPolicy }); - const result = parse(config); + const result = parse(config, { report_to: [] }); expect(result.securityResponseHeaders['Cross-Origin-Opener-Policy']).toEqual( crossOriginOpenerPolicy ); @@ -111,7 +135,7 @@ describe('parseRawSecurityResponseHeadersConfig', () => { it('a null value removes the Cross-Origin-Opener-Policy header', () => { const config = schema.validate({ crossOriginOpenerPolicy: null }); - const result = parse(config); + const result = parse(config, { report_to: [] }); expect(result.securityResponseHeaders['Cross-Origin-Opener-Policy']).toBeUndefined(); }); }); diff --git a/packages/core/http/core-http-server-internal/src/security_response_headers_config.ts b/packages/core/http/core-http-server-internal/src/security_response_headers_config.ts index 7eb6f6e31d574..b62c8aa1ee5d1 100644 --- a/packages/core/http/core-http-server-internal/src/security_response_headers_config.ts +++ b/packages/core/http/core-http-server-internal/src/security_response_headers_config.ts @@ -7,6 +7,7 @@ */ import { schema, TypeOf } from '@kbn/config-schema'; +import { PermissionsPolicyConfigType } from './permissions_policy'; export const securityResponseHeadersSchema = schema.object({ strictTransportSecurity: schema.oneOf([schema.string(), schema.literal(null)], { @@ -38,6 +39,7 @@ export const securityResponseHeadersSchema = schema.object({ defaultValue: 'camera=(), display-capture=(), fullscreen=(self), geolocation=(), microphone=(), web-share=()', }), + permissionsPolicyReportOnly: schema.maybe(schema.oneOf([schema.string(), schema.literal(null)])), disableEmbedding: schema.boolean({ defaultValue: false }), // is used to control X-Frame-Options and CSP headers crossOriginOpenerPolicy: schema.oneOf( // See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy @@ -58,7 +60,8 @@ export const securityResponseHeadersSchema = schema.object({ * @internal */ export function parseRawSecurityResponseHeadersConfig( - raw: TypeOf + raw: TypeOf, + rawPermissionsPolicyConfig: PermissionsPolicyConfigType ) { const securityResponseHeaders: Record = {}; const { disableEmbedding } = raw; @@ -72,9 +75,21 @@ export function parseRawSecurityResponseHeadersConfig( if (raw.referrerPolicy) { securityResponseHeaders['Referrer-Policy'] = raw.referrerPolicy; } + + const reportTo = rawPermissionsPolicyConfig.report_to.length + ? `;report-to=${rawPermissionsPolicyConfig.report_to}` + : ''; + if (raw.permissionsPolicy) { - securityResponseHeaders['Permissions-Policy'] = raw.permissionsPolicy; + securityResponseHeaders['Permissions-Policy'] = `${raw.permissionsPolicy}${reportTo}`; } + + if (raw.permissionsPolicyReportOnly && reportTo) { + securityResponseHeaders[ + 'Permissions-Policy-Report-Only' + ] = `${raw.permissionsPolicyReportOnly}${reportTo}`; + } + if (raw.crossOriginOpenerPolicy) { securityResponseHeaders['Cross-Origin-Opener-Policy'] = raw.crossOriginOpenerPolicy; } diff --git a/packages/core/http/core-http-server-mocks/src/test_utils.ts b/packages/core/http/core-http-server-mocks/src/test_utils.ts index 552306cefbab3..e82fc41170999 100644 --- a/packages/core/http/core-http-server-mocks/src/test_utils.ts +++ b/packages/core/http/core-http-server-mocks/src/test_utils.ts @@ -91,6 +91,11 @@ export const createConfigService = ({ ...csp, }); } + if (path === 'permissionsPolicy') { + return new BehaviorSubject({ + report_to: [], + }); + } throw new Error(`Unexpected config path: ${path}`); }); return configService; diff --git a/packages/core/logging/core-logging-common-internal/src/logger.test.ts b/packages/core/logging/core-logging-common-internal/src/logger.test.ts index 613c0cbde93da..2f256c257d94d 100644 --- a/packages/core/logging/core-logging-common-internal/src/logger.test.ts +++ b/packages/core/logging/core-logging-common-internal/src/logger.test.ts @@ -186,7 +186,7 @@ describe('AbstractLogger', () => { }); describe('log level', () => { - it('does not calls appenders for records with unsupported levels', () => { + it('does not call appender for records with unsupported levels', () => { logger = new TestLogger(context, LogLevel.Warn, appenderMocks, factory); logger.trace('some trace message'); @@ -215,19 +215,49 @@ describe('AbstractLogger', () => { ); } }); + + it('does not call appender for records with unsupported levels for closure syntax', () => { + logger = new TestLogger(context, LogLevel.Warn, appenderMocks, factory); + + logger.trace(() => 'some trace message'); + logger.debug(() => 'some debug message'); + logger.info(() => 'some info message'); + logger.warn(() => 'some warn message'); + logger.error(() => 'some error message'); + logger.fatal(() => 'some fatal message'); + + for (const appenderMock of appenderMocks) { + expect(appenderMock.append).toHaveBeenCalledTimes(3); + expect(appenderMock.append).toHaveBeenCalledWith( + expect.objectContaining({ + level: LogLevel.Warn, + }) + ); + expect(appenderMock.append).toHaveBeenCalledWith( + expect.objectContaining({ + level: LogLevel.Error, + }) + ); + expect(appenderMock.append).toHaveBeenCalledWith( + expect.objectContaining({ + level: LogLevel.Fatal, + }) + ); + } + }); }); - describe('isLevelEnabled', () => { - const orderedLogLevels = [ - LogLevel.Fatal, - LogLevel.Error, - LogLevel.Warn, - LogLevel.Info, - LogLevel.Debug, - LogLevel.Trace, - LogLevel.All, - ]; + const orderedLogLevels = [ + LogLevel.Fatal, + LogLevel.Error, + LogLevel.Warn, + LogLevel.Info, + LogLevel.Debug, + LogLevel.Trace, + LogLevel.All, + ]; + describe('isLevelEnabled', () => { for (const logLevel of orderedLogLevels) { it(`returns the correct value for a '${logLevel.id}' level logger`, () => { const levelLogger = new TestLogger(context, logLevel, appenderMocks, factory); @@ -238,4 +268,22 @@ describe('AbstractLogger', () => { }); } }); + + describe('closure syntax', () => { + for (const logLevel of orderedLogLevels) { + it(`evaluates the log function for '${logLevel.id}' level if enabled`, () => { + logger = new TestLogger(context, LogLevel.All, appenderMocks, factory); + const logFn = jest.fn(() => 'some message'); + logger.trace(logFn); + expect(logFn).toHaveBeenCalledTimes(1); + }); + + it(`does not evaluate the log function for '${logLevel.id}' level if not enabled`, () => { + logger = new TestLogger(context, LogLevel.Off, appenderMocks, factory); + const logFn = jest.fn(() => 'some message'); + logger.trace(logFn); + expect(logFn).not.toHaveBeenCalled(); + }); + } + }); }); diff --git a/packages/core/logging/core-logging-common-internal/src/logger.ts b/packages/core/logging/core-logging-common-internal/src/logger.ts index 69d00ed57f39f..df1b991b44042 100644 --- a/packages/core/logging/core-logging-common-internal/src/logger.ts +++ b/packages/core/logging/core-logging-common-internal/src/logger.ts @@ -13,6 +13,7 @@ import { LoggerFactory, LogMeta, Logger, + LogMessageSource, LogLevelId, } from '@kbn/logging'; @@ -43,28 +44,73 @@ export abstract class AbstractLogger implements Logger { meta?: Meta ): LogRecord; - public trace(message: string, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Trace, message, meta)); + public trace(message: LogMessageSource, meta?: Meta): void { + if (!this.level.supports(LogLevel.Trace)) { + return; + } + if (typeof message === 'function') { + message = message(); + } + this.performLog(this.createLogRecord(LogLevel.Trace, message, meta)); } - public debug(message: string, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Debug, message, meta)); + public debug(message: LogMessageSource, meta?: Meta): void { + if (!this.level.supports(LogLevel.Debug)) { + return; + } + if (typeof message === 'function') { + message = message(); + } + this.performLog(this.createLogRecord(LogLevel.Debug, message, meta)); } - public info(message: string, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Info, message, meta)); + public info(message: LogMessageSource, meta?: Meta): void { + if (!this.level.supports(LogLevel.Info)) { + return; + } + if (typeof message === 'function') { + message = message(); + } + this.performLog(this.createLogRecord(LogLevel.Info, message, meta)); } - public warn(errorOrMessage: string | Error, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Warn, errorOrMessage, meta)); + public warn( + errorOrMessage: LogMessageSource | Error, + meta?: Meta + ): void { + if (!this.level.supports(LogLevel.Warn)) { + return; + } + if (typeof errorOrMessage === 'function') { + errorOrMessage = errorOrMessage(); + } + this.performLog(this.createLogRecord(LogLevel.Warn, errorOrMessage, meta)); } - public error(errorOrMessage: string | Error, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Error, errorOrMessage, meta)); + public error( + errorOrMessage: LogMessageSource | Error, + meta?: Meta + ): void { + if (!this.level.supports(LogLevel.Error)) { + return; + } + if (typeof errorOrMessage === 'function') { + errorOrMessage = errorOrMessage(); + } + this.performLog(this.createLogRecord(LogLevel.Error, errorOrMessage, meta)); } - public fatal(errorOrMessage: string | Error, meta?: Meta): void { - this.log(this.createLogRecord(LogLevel.Fatal, errorOrMessage, meta)); + public fatal( + errorOrMessage: LogMessageSource | Error, + meta?: Meta + ): void { + if (!this.level.supports(LogLevel.Fatal)) { + return; + } + if (typeof errorOrMessage === 'function') { + errorOrMessage = errorOrMessage(); + } + this.performLog(this.createLogRecord(LogLevel.Fatal, errorOrMessage, meta)); } public isLevelEnabled(levelId: LogLevelId): boolean { @@ -75,12 +121,16 @@ export abstract class AbstractLogger implements Logger { if (!this.level.supports(record.level)) { return; } - for (const appender of this.appenders) { - appender.append(record); - } + this.performLog(record); } public get(...childContextPaths: string[]): Logger { return this.factory.get(...[this.context, ...childContextPaths]); } + + private performLog(record: LogRecord) { + for (const appender of this.appenders) { + appender.append(record); + } + } } diff --git a/packages/core/metrics/core-metrics-collectors-server-internal/index.ts b/packages/core/metrics/core-metrics-collectors-server-internal/index.ts index 351129cdc8ba3..d726b0339a0bf 100644 --- a/packages/core/metrics/core-metrics-collectors-server-internal/index.ts +++ b/packages/core/metrics/core-metrics-collectors-server-internal/index.ts @@ -6,8 +6,7 @@ * Side Public License, v 1. */ -export { OsMetricsCollector } from './src/os'; -export type { OpsMetricsCollectorOptions } from './src/os'; +export { OsMetricsCollector, type OsMetricsCollectorOptions } from './src/os'; export { ProcessMetricsCollector } from './src/process'; export { ServerMetricsCollector } from './src/server'; export { EventLoopDelaysMonitor } from './src/event_loop_delays_monitor'; diff --git a/packages/core/metrics/core-metrics-collectors-server-internal/src/os.ts b/packages/core/metrics/core-metrics-collectors-server-internal/src/os.ts index 350b01a8100eb..049597cfa1f12 100644 --- a/packages/core/metrics/core-metrics-collectors-server-internal/src/os.ts +++ b/packages/core/metrics/core-metrics-collectors-server-internal/src/os.ts @@ -15,7 +15,7 @@ import { OsCgroupMetricsCollector } from './cgroup'; const getos = promisify(getosAsync); -export interface OpsMetricsCollectorOptions { +export interface OsMetricsCollectorOptions { logger: Logger; cpuPath?: string; cpuAcctPath?: string; @@ -24,7 +24,7 @@ export interface OpsMetricsCollectorOptions { export class OsMetricsCollector implements MetricsCollector { private readonly cgroupCollector: OsCgroupMetricsCollector; - constructor(options: OpsMetricsCollectorOptions) { + constructor(options: OsMetricsCollectorOptions) { this.cgroupCollector = new OsCgroupMetricsCollector({ ...options, logger: options.logger.get('cgroup'), diff --git a/packages/core/metrics/core-metrics-server-internal/src/ops_metrics_collector.ts b/packages/core/metrics/core-metrics-server-internal/src/ops_metrics_collector.ts index 2e358fc121bce..f35213a0e0480 100644 --- a/packages/core/metrics/core-metrics-server-internal/src/ops_metrics_collector.ts +++ b/packages/core/metrics/core-metrics-server-internal/src/ops_metrics_collector.ts @@ -7,16 +7,22 @@ */ import { Server as HapiServer } from '@hapi/hapi'; +import type { Logger } from '@kbn/logging'; import type { OpsMetrics, MetricsCollector } from '@kbn/core-metrics-server'; import type { AgentStatsProvider } from '@kbn/core-elasticsearch-client-server-internal'; import { ProcessMetricsCollector, OsMetricsCollector, - type OpsMetricsCollectorOptions, ServerMetricsCollector, ElasticsearchClientsMetricsCollector, } from '@kbn/core-metrics-collectors-server-internal'; +export interface OpsMetricsCollectorOptions { + logger: Logger; + cpuPath?: string; + cpuAcctPath?: string; +} + export class OpsMetricsCollector implements MetricsCollector { private readonly processCollector: ProcessMetricsCollector; private readonly osCollector: OsMetricsCollector; diff --git a/packages/core/rendering/core-rendering-server-internal/src/bootstrap/__snapshots__/render_template.test.ts.snap b/packages/core/rendering/core-rendering-server-internal/src/bootstrap/__snapshots__/render_template.test.ts.snap index af1808d9a2019..c1754bce247a9 100644 --- a/packages/core/rendering/core-rendering-server-internal/src/bootstrap/__snapshots__/render_template.test.ts.snap +++ b/packages/core/rendering/core-rendering-server-internal/src/bootstrap/__snapshots__/render_template.test.ts.snap @@ -64,10 +64,12 @@ if (window.__kbnStrictCsp__ && window.__kbnCspNotEnforced__) { var errorTitleEl = document.createElement('h1'); errorTitleEl.innerText = errorTitle; errorTitleEl.style.margin = '20px'; + errorTitleEl.style.color = '#1a1c21'; var errorTextEl = document.createElement('p'); errorTextEl.innerText = errorText; errorTextEl.style.margin = '20px'; + errorTextEl.style.color = '#343741'; var errorReloadEl = document.createElement('button'); errorReloadEl.innerText = errorReload; diff --git a/packages/core/rendering/core-rendering-server-internal/src/bootstrap/render_template.ts b/packages/core/rendering/core-rendering-server-internal/src/bootstrap/render_template.ts index fbb7a4290bf14..7644841ddead0 100644 --- a/packages/core/rendering/core-rendering-server-internal/src/bootstrap/render_template.ts +++ b/packages/core/rendering/core-rendering-server-internal/src/bootstrap/render_template.ts @@ -80,10 +80,12 @@ if (window.__kbnStrictCsp__ && window.__kbnCspNotEnforced__) { var errorTitleEl = document.createElement('h1'); errorTitleEl.innerText = errorTitle; errorTitleEl.style.margin = '20px'; + errorTitleEl.style.color = '#1a1c21'; var errorTextEl = document.createElement('p'); errorTextEl.innerText = errorText; errorTextEl.style.margin = '20px'; + errorTextEl.style.color = '#343741'; var errorReloadEl = document.createElement('button'); errorReloadEl.innerText = errorReload; diff --git a/packages/core/root/core-root-server-internal/src/register_service_config.ts b/packages/core/root/core-root-server-internal/src/register_service_config.ts index be67627720b34..3398c8e7b506e 100644 --- a/packages/core/root/core-root-server-internal/src/register_service_config.ts +++ b/packages/core/root/core-root-server-internal/src/register_service_config.ts @@ -14,7 +14,12 @@ import { coreDeprecationProvider } from '@kbn/core-config-server-internal'; import { nodeConfig } from '@kbn/core-node-server-internal'; import { pidConfig } from '@kbn/core-environment-server-internal'; import { executionContextConfig } from '@kbn/core-execution-context-server-internal'; -import { config as httpConfig, cspConfig, externalUrlConfig } from '@kbn/core-http-server-internal'; +import { + config as httpConfig, + cspConfig, + externalUrlConfig, + permissionsPolicyConfig, +} from '@kbn/core-http-server-internal'; import { config as elasticsearchConfig } from '@kbn/core-elasticsearch-server-internal'; import { config as coreAppConfig } from '@kbn/core-apps-server-internal'; import { opsConfig } from '@kbn/core-metrics-server-internal'; @@ -56,6 +61,7 @@ export function registerServiceConfig(configService: ConfigService) { serverlessConfig, statusConfig, uiSettingsConfig, + permissionsPolicyConfig, ]; configService.addDeprecationProvider(rootConfigPath, coreDeprecationProvider); diff --git a/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/update.test.ts b/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/update.test.ts index 117a36d3960cf..a812c1686b060 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/update.test.ts +++ b/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/update.test.ts @@ -149,7 +149,7 @@ describe('#update', () => { it(`should use the ES get action then index action when type is not multi-namespace for existing objects`, async () => { const type = 'index-pattern'; const id = 'logstash-*'; - migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc, migrated: true })); + migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc })); await updateSuccess(client, repository, registry, type, id, attributes, { namespace }); expect(client.get).toHaveBeenCalledTimes(1); expect(mockPreflightCheckForCreate).not.toHaveBeenCalled(); @@ -157,7 +157,7 @@ describe('#update', () => { }); it(`should use the ES get action then index action when type is multi-namespace for existing objects`, async () => { - migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc, migrated: true })); + migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc })); await updateSuccess( client, repository, @@ -172,7 +172,7 @@ describe('#update', () => { }); it(`should use the ES get action then index action when type is namespace agnostic for existing objects`, async () => { - migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc, migrated: true })); + migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc })); await updateSuccess(client, repository, registry, NAMESPACE_AGNOSTIC_TYPE, id, attributes); expect(client.get).toHaveBeenCalledTimes(1); expect(mockPreflightCheckForCreate).not.toHaveBeenCalled(); @@ -180,7 +180,7 @@ describe('#update', () => { }); it(`should use the ES index action with the merged attributes when mergeAttributes is not false`, async () => { - migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc, migrated: true })); + migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc })); await updateSuccess(client, repository, registry, NAMESPACE_AGNOSTIC_TYPE, id, { foo: 'bar', @@ -201,7 +201,7 @@ describe('#update', () => { }); it(`should use the ES index action only with the provided attributes when mergeAttributes is false`, async () => { - migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc, migrated: true })); + migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc })); await updateSuccess( client, @@ -229,7 +229,7 @@ describe('#update', () => { }); it(`should check for alias conflicts if a new multi-namespace object before create action would be created then create action to create the object`, async () => { - migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc, migrated: true })); + migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc })); await updateSuccess( client, repository, @@ -246,7 +246,7 @@ describe('#update', () => { }); it(`defaults to empty array with no input references`, async () => { - migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc, migrated: true })); + migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc })); await updateSuccess(client, repository, registry, type, id, attributes); expect( (client.index.mock.calls[0][0] as estypes.CreateRequest).body! @@ -256,7 +256,7 @@ describe('#update', () => { it(`accepts custom references array 1`, async () => { const test = async (references: SavedObjectReference[]) => { - migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc, migrated: true })); + migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc })); await updateSuccess(client, repository, registry, type, id, attributes, { references, }); @@ -271,7 +271,7 @@ describe('#update', () => { it(`accepts custom references array 2`, async () => { const test = async (references: SavedObjectReference[]) => { - migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc, migrated: true })); + migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc })); await updateSuccess(client, repository, registry, type, id, attributes, { references, }); @@ -286,7 +286,7 @@ describe('#update', () => { it(`accepts custom references array 3`, async () => { const test = async (references: SavedObjectReference[]) => { - migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc, migrated: true })); + migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc })); await updateSuccess(client, repository, registry, type, id, attributes, { references, }); @@ -300,7 +300,7 @@ describe('#update', () => { }); it(`uses the 'upsertAttributes' option when specified for a single-namespace type that does not exist`, async () => { - migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc, migrated: true })); + migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc })); await updateSuccess( client, repository, @@ -329,7 +329,7 @@ describe('#update', () => { it(`uses the 'upsertAttributes' option when specified for a multi-namespace type that does not exist`, async () => { const options = { upsert: { title: 'foo', description: 'bar' } }; - migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc, migrated: true })); + migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc })); await updateSuccess( client, repository, @@ -363,7 +363,7 @@ describe('#update', () => { it(`ignores the 'upsertAttributes' option when specified for a multi-namespace type that already exists`, async () => { // attributes don't change const options = { upsert: { title: 'foo', description: 'bar' } }; - migrator.migrateDocument.mockImplementation((doc) => ({ ...doc, migrated: true })); + migrator.migrateDocument.mockImplementation((doc) => ({ ...doc })); await updateSuccess( client, repository, @@ -700,7 +700,7 @@ describe('#update', () => { it('migrates the fetched document from get', async () => { const type = 'index-pattern'; const id = 'logstash-*'; - migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc, migrated: true })); + migrator.migrateDocument.mockImplementationOnce((doc) => ({ ...doc })); await updateSuccess(client, repository, registry, type, id, attributes); expect(migrator.migrateDocument).toHaveBeenCalledTimes(2); expectMigrationArgs({ diff --git a/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.encryption_extension.test.ts b/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.encryption_extension.test.ts index ecaefe05d65e0..1e2232de0a2e5 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.encryption_extension.test.ts +++ b/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.encryption_extension.test.ts @@ -116,6 +116,7 @@ describe('SavedObjectsRepository Encryption Extension', () => { // create a mock saved objects encryption extension mockEncryptionExt = savedObjectsExtensionsMock.createEncryptionExtension(); + mockEncryptionExt.encryptAttributes.mockImplementation((desc, attrs) => Promise.resolve(attrs)); mockGetCurrentTime.mockReturnValue(mockTimestamp); mockGetSearchDsl.mockClear(); @@ -247,7 +248,6 @@ describe('SavedObjectsRepository Encryption Extension', () => { expect.objectContaining({ ...encryptedSO, id: expect.objectContaining(/index-pattern:[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}/), - attributes: undefined, }), encryptedSO.attributes // original attributes ); diff --git a/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.spaces_extension.test.ts b/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.spaces_extension.test.ts index 9db7049e39c77..ed1f967d224a7 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.spaces_extension.test.ts +++ b/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.spaces_extension.test.ts @@ -1259,6 +1259,9 @@ describe('SavedObjectsRepository Spaces Extension', () => { serializer = createSpySerializer(registry); mockSpacesExt = savedObjectsExtensionsMock.createSpacesExtension(); mockEncryptionExt = savedObjectsExtensionsMock.createEncryptionExtension(); + mockEncryptionExt.encryptAttributes.mockImplementation((desc, attributes) => + Promise.resolve(attributes) + ); mockGetCurrentTime.mockReturnValue(mockTimestamp); mockGetSearchDsl.mockClear(); repository = instantiateRepository(); diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/schema.test.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/schema.test.ts index 42d33c67587ad..65169082c4f74 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/schema.test.ts +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/schema.test.ts @@ -42,6 +42,15 @@ describe('Saved Objects type validation schema', () => { ); }); + it('should fail if invalid id is provided', () => { + const objectSchema = createSavedObjectSanitizedDocSchema(validationMap['1.0.0']); + const data = createMockObject({ foo: 'bar' }); + data.id = ''; + expect(() => objectSchema.validate(data)).toThrowErrorMatchingInlineSnapshot( + `"[id]: value has length [0] but it must have a minimum length of [1]."` + ); + }); + it('should validate top-level properties', () => { const objectSchema = createSavedObjectSanitizedDocSchema(validationMap['1.0.0']); const data = createMockObject({ foo: 'heya' }); @@ -78,4 +87,31 @@ describe('Saved Objects type validation schema', () => { `"[id]: expected value of type [string] but got [boolean]"` ); }); + + describe('default schema', () => { + it('validates a record of attributes', () => { + const objectSchema = createSavedObjectSanitizedDocSchema(undefined); + const data = createMockObject({ foo: 'heya' }); + + expect(() => objectSchema.validate(data)).not.toThrowError(); + }); + + it('fails validation on undefined attributes', () => { + const objectSchema = createSavedObjectSanitizedDocSchema(undefined); + const data = createMockObject(undefined); + + expect(() => objectSchema.validate(data)).toThrowErrorMatchingInlineSnapshot( + `"[attributes]: expected value of type [object] but got [undefined]"` + ); + }); + + it('fails validation on primitive attributes', () => { + const objectSchema = createSavedObjectSanitizedDocSchema(undefined); + const data = createMockObject(42); + + expect(() => objectSchema.validate(data)).toThrowErrorMatchingInlineSnapshot( + `"[attributes]: expected value of type [object] but got [number]"` + ); + }); + }); }); diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/schema.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/schema.ts index 952aff1d221ce..9673267e510bc 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/schema.ts +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/schema.ts @@ -20,7 +20,7 @@ type SavedObjectSanitizedDocSchema = { }; const baseSchema = schema.object({ - id: schema.string(), + id: schema.string({ minLength: 1 }), type: schema.string(), references: schema.arrayOf( schema.object({ @@ -42,7 +42,7 @@ const baseSchema = schema.object({ version: schema.maybe(schema.string()), originId: schema.maybe(schema.string()), managed: schema.maybe(schema.boolean()), - attributes: schema.maybe(schema.any()), + attributes: schema.recordOf(schema.string(), schema.maybe(schema.any())), }); /** @@ -52,9 +52,13 @@ const baseSchema = schema.object({ * @internal */ export const createSavedObjectSanitizedDocSchema = ( - attributesSchema: SavedObjectsValidationSpec + attributesSchema: SavedObjectsValidationSpec | undefined ) => { - return baseSchema.extends({ - attributes: attributesSchema, - }); + if (attributesSchema) { + return baseSchema.extends({ + attributes: attributesSchema, + }); + } else { + return baseSchema; + } }; diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/validator.test.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/validator.test.ts index 37ced142364da..bccfc641e96d5 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/validator.test.ts +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/validator.test.ts @@ -88,6 +88,34 @@ describe('Saved Objects type validator', () => { const data = createMockObject({ attributes: { foo: 'hi' } }); expect(() => validator.validate(data)).not.toThrowError(); }); + + it('validates attributes for types without defined schemas', () => { + validator = new SavedObjectsTypeValidator({ + logger, + type, + validationMap: {}, + defaultVersion, + }); + const data = createMockObject({ attributes: undefined }); + expect(() => validator.validate(data)).toThrowErrorMatchingInlineSnapshot( + `"[attributes]: expected value of type [object] but got [undefined]"` + ); + }); + + it('validates top level properties for types without defined schemas', () => { + validator = new SavedObjectsTypeValidator({ + logger, + type, + validationMap: {}, + defaultVersion, + }); + const data = createMockObject({ attributes: { foo: 'bar' } }); + // @ts-expect-error Intentionally malformed object + data.updated_at = false; + expect(() => validator.validate(data)).toThrowErrorMatchingInlineSnapshot( + `"[updated_at]: expected value of type [string] but got [boolean]"` + ); + }); }); describe('schema selection', () => { diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/validator.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/validator.ts index e8344de7bc2f0..011c8240de030 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/validator.ts +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/validator.ts @@ -9,6 +9,7 @@ import Semver from 'semver'; import type { Logger } from '@kbn/logging'; import type { + SavedObjectsValidationSpec, SavedObjectsValidationMap, SavedObjectSanitizedDoc, } from '@kbn/core-saved-objects-server'; @@ -56,10 +57,10 @@ export class SavedObjectsTypeValidator { } const schemaVersion = previousVersionWithSchema(this.orderedVersions, usedVersion); - if (!schemaVersion || !this.validationMap[schemaVersion]) { - return; + let validationRule: SavedObjectsValidationSpec | undefined; + if (schemaVersion && this.validationMap[schemaVersion]) { + validationRule = this.validationMap[schemaVersion]; } - const validationRule = this.validationMap[schemaVersion]; try { const validationSchema = createSavedObjectSanitizedDocSchema(validationRule); diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_create.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_create.ts index 62b253e64f2e3..35c8fc305d062 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_create.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_create.ts @@ -34,8 +34,9 @@ export const registerBulkCreateRoute = ( { path: '/_bulk_create', options: { + summary: `Create saved objects`, + tags: ['oas-tag:saved objects'], access, - description: `Create saved objects`, }, validate: { query: schema.object({ diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_delete.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_delete.ts index ad8a087f5cfdd..0f7219386a07b 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_delete.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_delete.ts @@ -34,8 +34,9 @@ export const registerBulkDeleteRoute = ( { path: '/_bulk_delete', options: { + summary: `Delete saved objects`, + tags: ['oas-tag:saved objects'], access, - description: `Remove saved objects`, }, validate: { body: schema.arrayOf( diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_get.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_get.ts index 2e9798d56f3b1..c54069c0aae5c 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_get.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_get.ts @@ -34,8 +34,9 @@ export const registerBulkGetRoute = ( { path: '/_bulk_get', options: { + summary: `Get saved objects`, + tags: ['oas-tag:saved objects'], access, - description: `Get saved objects`, }, validate: { body: schema.arrayOf( diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_resolve.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_resolve.ts index 786af996dc628..d59c5e096aa2e 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_resolve.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_resolve.ts @@ -34,8 +34,9 @@ export const registerBulkResolveRoute = ( { path: '/_bulk_resolve', options: { + summary: `Resolve saved objects`, + tags: ['oas-tag:saved objects'], access, - description: `Resolve saved objects`, }, validate: { body: schema.arrayOf( diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_update.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_update.ts index ef6609358a782..cd401ba4f2061 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_update.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/bulk_update.ts @@ -34,8 +34,9 @@ export const registerBulkUpdateRoute = ( { path: '/_bulk_update', options: { + summary: `Update saved objects`, + tags: ['oas-tag:saved objects'], access, - description: `Update saved objects`, }, validate: { body: schema.arrayOf( diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/create.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/create.ts index 54db933dea814..5fb3a2964c701 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/create.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/create.ts @@ -34,8 +34,9 @@ export const registerCreateRoute = ( { path: '/{type}/{id?}', options: { + summary: `Create a saved object`, + tags: ['oas-tag:saved objects'], access, - description: `Create a saved object`, }, validate: { params: schema.object({ diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/delete.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/delete.ts index 5d18aa5763663..eb01f092ba585 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/delete.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/delete.ts @@ -34,8 +34,9 @@ export const registerDeleteRoute = ( { path: '/{type}/{id}', options: { + summary: `Delete a saved object`, + tags: ['oas-tag:saved objects'], access, - description: `Delete a saved object`, }, validate: { params: schema.object({ diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/export.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/export.ts index e6ec6f7caa5be..ea2adb976d07f 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/export.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/export.ts @@ -144,8 +144,9 @@ export const registerExportRoute = ( { path: '/_export', options: { + summary: `Export saved objects`, + tags: ['oas-tag:saved objects'], access: 'public', - description: `Export saved objects`, }, validate: { body: schema.object({ diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/find.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/find.ts index 8efc647573d69..525e80e7637b6 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/find.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/find.ts @@ -38,8 +38,9 @@ export const registerFindRoute = ( { path: '/_find', options: { + summary: `Search for saved objects`, + tags: ['oas-tag:saved objects'], access, - description: `Search for saved objects`, }, validate: { query: schema.object({ diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/get.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/get.ts index caaae77da9568..5d0ffb9a11964 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/get.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/get.ts @@ -34,8 +34,9 @@ export const registerGetRoute = ( { path: '/{type}/{id}', options: { + summary: `Get a saved object`, + tags: ['oas-tag:saved objects'], access, - description: `Get a saved object`, }, validate: { params: schema.object({ diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/import.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/import.ts index 7b4181a76507e..69042c7ce6a31 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/import.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/import.ts @@ -36,8 +36,9 @@ export const registerImportRoute = ( { path: '/_import', options: { + summary: `Import saved objects`, + tags: ['oas-tag:saved objects'], access: 'public', - description: `Import saved objects`, body: { maxBytes: maxImportPayloadBytes, output: 'stream', diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/resolve.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/resolve.ts index 866e6d47e8390..2139deda867dc 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/resolve.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/resolve.ts @@ -30,8 +30,9 @@ export const registerResolveRoute = ( { path: '/resolve/{type}/{id}', options: { + summary: `Resolve a saved object`, + tags: ['oas-tag:saved objects'], access, - description: `Resolve a saved object`, }, validate: { params: schema.object({ diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/resolve_import_errors.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/resolve_import_errors.ts index 770b3af978f1e..e9020b200b048 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/resolve_import_errors.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/resolve_import_errors.ts @@ -37,8 +37,9 @@ export const registerResolveImportErrorsRoute = ( { path: '/_resolve_import_errors', options: { + summary: `Resolve import errors`, + tags: ['oas-tag:saved objects'], access: 'public', - description: `Resolve import errors`, body: { maxBytes: maxImportPayloadBytes, output: 'stream', diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/update.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/update.ts index cda03f99c4ad1..c0b5b9ae26d3b 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/update.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/routes/update.ts @@ -35,8 +35,9 @@ export const registerUpdateRoute = ( { path: '/{type}/{id}', options: { + summary: `Update a saved object`, + tags: ['oas-tag:saved objects'], access, - description: `Update a saved object`, }, validate: { params: schema.object({ diff --git a/packages/core/saved-objects/core-saved-objects-server/index.ts b/packages/core/saved-objects/core-saved-objects-server/index.ts index 1ff74905b0b0f..189f28bf2c803 100644 --- a/packages/core/saved-objects/core-saved-objects-server/index.ts +++ b/packages/core/saved-objects/core-saved-objects-server/index.ts @@ -61,6 +61,7 @@ export { ALERTING_CASES_SAVED_OBJECT_INDEX, SECURITY_SOLUTION_SAVED_OBJECT_INDEX, ANALYTICS_SAVED_OBJECT_INDEX, + USAGE_COUNTERS_SAVED_OBJECT_INDEX, ALL_SAVED_OBJECT_INDICES, } from './src/saved_objects_index_pattern'; export type { diff --git a/packages/core/saved-objects/core-saved-objects-server/src/saved_objects_index_pattern.ts b/packages/core/saved-objects/core-saved-objects-server/src/saved_objects_index_pattern.ts index 93160c6b9bd45..e84403e29ca12 100644 --- a/packages/core/saved-objects/core-saved-objects-server/src/saved_objects_index_pattern.ts +++ b/packages/core/saved-objects/core-saved-objects-server/src/saved_objects_index_pattern.ts @@ -19,6 +19,8 @@ export const INGEST_SAVED_OBJECT_INDEX = `${MAIN_SAVED_OBJECT_INDEX}_ingest`; export const ALERTING_CASES_SAVED_OBJECT_INDEX = `${MAIN_SAVED_OBJECT_INDEX}_alerting_cases`; export const SECURITY_SOLUTION_SAVED_OBJECT_INDEX = `${MAIN_SAVED_OBJECT_INDEX}_security_solution`; export const ANALYTICS_SAVED_OBJECT_INDEX = `${MAIN_SAVED_OBJECT_INDEX}_analytics`; +export const USAGE_COUNTERS_SAVED_OBJECT_INDEX = `${MAIN_SAVED_OBJECT_INDEX}_usage_counters`; + export const ALL_SAVED_OBJECT_INDICES = [ MAIN_SAVED_OBJECT_INDEX, TASK_MANAGER_SAVED_OBJECT_INDEX, @@ -26,4 +28,5 @@ export const ALL_SAVED_OBJECT_INDICES = [ INGEST_SAVED_OBJECT_INDEX, SECURITY_SOLUTION_SAVED_OBJECT_INDEX, ANALYTICS_SAVED_OBJECT_INDEX, + USAGE_COUNTERS_SAVED_OBJECT_INDEX, ]; diff --git a/packages/core/security/core-security-server-internal/src/security_route_handler_context.ts b/packages/core/security/core-security-server-internal/src/security_route_handler_context.ts index 4fa328782dd0e..bae1c11d152a4 100644 --- a/packages/core/security/core-security-server-internal/src/security_route_handler_context.ts +++ b/packages/core/security/core-security-server-internal/src/security_route_handler_context.ts @@ -26,6 +26,16 @@ export class CoreSecurityRouteHandlerContext implements SecurityRequestHandlerCo if (this.#authc == null) { this.#authc = { getCurrentUser: () => this.securityStart.authc.getCurrentUser(this.request), + apiKeys: { + areAPIKeysEnabled: () => this.securityStart.authc.apiKeys.areAPIKeysEnabled(), + create: (createParams) => + this.securityStart.authc.apiKeys.create(this.request, createParams), + update: (updateParams) => + this.securityStart.authc.apiKeys.update(this.request, updateParams), + validate: (apiKeyParams) => this.securityStart.authc.apiKeys.validate(apiKeyParams), + invalidate: (apiKeyParams) => + this.securityStart.authc.apiKeys.invalidate(this.request, apiKeyParams), + }, }; } return this.#authc; diff --git a/packages/core/security/core-security-server-internal/src/utils/convert_security_api.test.ts b/packages/core/security/core-security-server-internal/src/utils/convert_security_api.test.ts index 7c2e49092f73e..40d9e788ea01b 100644 --- a/packages/core/security/core-security-server-internal/src/utils/convert_security_api.test.ts +++ b/packages/core/security/core-security-server-internal/src/utils/convert_security_api.test.ts @@ -15,6 +15,16 @@ describe('convertSecurityApi', () => { const source: CoreSecurityDelegateContract = { authc: { getCurrentUser: jest.fn(), + apiKeys: { + areAPIKeysEnabled: jest.fn(), + areCrossClusterAPIKeysEnabled: jest.fn(), + validate: jest.fn(), + invalidate: jest.fn(), + invalidateAsInternalUser: jest.fn(), + grantAsInternalUser: jest.fn(), + create: jest.fn(), + update: jest.fn(), + }, }, audit: { asScoped: jest.fn().mockReturnValue(createAuditLoggerMock.create()), @@ -23,6 +33,7 @@ describe('convertSecurityApi', () => { }; const output = convertSecurityApi(source); expect(output.authc.getCurrentUser).toBe(source.authc.getCurrentUser); + expect(output.authc.apiKeys).toBe(source.authc.apiKeys); expect(output.audit.asScoped).toBe(source.audit.asScoped); expect(output.audit.withoutRequest).toBe(source.audit.withoutRequest); }); diff --git a/packages/core/security/core-security-server-internal/src/utils/default_implementation.test.ts b/packages/core/security/core-security-server-internal/src/utils/default_implementation.test.ts index e4348404671b9..bc7fac96b7dd3 100644 --- a/packages/core/security/core-security-server-internal/src/utils/default_implementation.test.ts +++ b/packages/core/security/core-security-server-internal/src/utils/default_implementation.test.ts @@ -23,6 +23,15 @@ describe('getDefaultSecurityImplementation', () => { }); }); + describe('authc.apiKeys', () => { + it('returns stub object', async () => { + const { apiKeys } = implementation.authc; + const areAPIKeysEnabled = await apiKeys.areAPIKeysEnabled(); + + expect(areAPIKeysEnabled).toBe(false); + }); + }); + describe('audit.asScoped', () => { it('returns null', async () => { const logger = implementation.audit.asScoped({} as any); diff --git a/packages/core/security/core-security-server-internal/src/utils/default_implementation.ts b/packages/core/security/core-security-server-internal/src/utils/default_implementation.ts index 91819807f1064..8eaeb7b2577b5 100644 --- a/packages/core/security/core-security-server-internal/src/utils/default_implementation.ts +++ b/packages/core/security/core-security-server-internal/src/utils/default_implementation.ts @@ -8,10 +8,23 @@ import type { CoreSecurityDelegateContract } from '@kbn/core-security-server'; +const API_KEYS_DISABLED_ERROR = new Error('API keys are disabled'); +const REJECT_WHEN_API_KEYS_DISABLED = () => Promise.reject(API_KEYS_DISABLED_ERROR); + export const getDefaultSecurityImplementation = (): CoreSecurityDelegateContract => { return { authc: { getCurrentUser: () => null, + apiKeys: { + areAPIKeysEnabled: () => Promise.resolve(false), + areCrossClusterAPIKeysEnabled: () => Promise.resolve(false), + create: REJECT_WHEN_API_KEYS_DISABLED, + update: REJECT_WHEN_API_KEYS_DISABLED, + grantAsInternalUser: REJECT_WHEN_API_KEYS_DISABLED, + validate: REJECT_WHEN_API_KEYS_DISABLED, + invalidate: REJECT_WHEN_API_KEYS_DISABLED, + invalidateAsInternalUser: REJECT_WHEN_API_KEYS_DISABLED, + }, }, audit: { asScoped: () => { diff --git a/packages/core/security/core-security-server-mocks/index.ts b/packages/core/security/core-security-server-mocks/index.ts index 23c49282252f0..c834759973c1e 100644 --- a/packages/core/security/core-security-server-mocks/index.ts +++ b/packages/core/security/core-security-server-mocks/index.ts @@ -9,3 +9,4 @@ export { securityServiceMock } from './src/security_service.mock'; export type { InternalSecurityStartMock, SecurityStartMock } from './src/security_service.mock'; export { auditLoggerMock } from './src/audit.mock'; +export { apiKeysMock } from './src/api_keys.mock'; diff --git a/x-pack/plugins/security/server/authentication/api_keys/api_keys.mock.ts b/packages/core/security/core-security-server-mocks/src/api_keys.mock.ts similarity index 59% rename from x-pack/plugins/security/server/authentication/api_keys/api_keys.mock.ts rename to packages/core/security/core-security-server-mocks/src/api_keys.mock.ts index cfa857ca833a2..108f8380264e6 100644 --- a/x-pack/plugins/security/server/authentication/api_keys/api_keys.mock.ts +++ b/packages/core/security/core-security-server-mocks/src/api_keys.mock.ts @@ -1,16 +1,15 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import type { PublicMethodsOf } from '@kbn/utility-types'; - -import type { APIKeys } from './api_keys'; +import type { APIKeysService } from '@kbn/core-security-server'; export const apiKeysMock = { - create: (): jest.Mocked> => ({ + create: (): jest.MockedObjectDeep => ({ areAPIKeysEnabled: jest.fn(), areCrossClusterAPIKeysEnabled: jest.fn(), create: jest.fn(), diff --git a/packages/core/security/core-security-server-mocks/src/security_service.mock.ts b/packages/core/security/core-security-server-mocks/src/security_service.mock.ts index d833048990ff5..86a39af3b16d5 100644 --- a/packages/core/security/core-security-server-mocks/src/security_service.mock.ts +++ b/packages/core/security/core-security-server-mocks/src/security_service.mock.ts @@ -15,6 +15,7 @@ import type { InternalSecurityServiceSetup, InternalSecurityServiceStart, } from '@kbn/core-security-server-internal'; +import { apiKeysMock } from './api_keys.mock'; import { auditServiceMock, type MockedAuditService } from './audit.mock'; import { mockAuthenticatedUser, MockAuthenticatedUserProps } from '@kbn/core-security-common/mocks'; @@ -35,6 +36,7 @@ const createStartMock = (): SecurityStartMock => { const mock = { authc: { getCurrentUser: jest.fn(), + apiKeys: apiKeysMock.create(), }, audit: auditServiceMock.create(), }; @@ -61,6 +63,7 @@ const createInternalStartMock = (): InternalSecurityStartMock => { const mock = { authc: { getCurrentUser: jest.fn(), + apiKeys: apiKeysMock.create(), }, audit: auditServiceMock.create(), }; @@ -82,6 +85,13 @@ const createRequestHandlerContextMock = () => { const mock: jest.MockedObjectDeep = { authc: { getCurrentUser: jest.fn(), + apiKeys: { + areAPIKeysEnabled: jest.fn(), + create: jest.fn(), + update: jest.fn(), + validate: jest.fn(), + invalidate: jest.fn(), + }, }, audit: { logger: { diff --git a/packages/core/security/core-security-server/index.ts b/packages/core/security/core-security-server/index.ts index 6a111ab6e27ab..b5dd091c7b87a 100644 --- a/packages/core/security/core-security-server/index.ts +++ b/packages/core/security/core-security-server/index.ts @@ -26,4 +26,26 @@ export type { AuditRequest, } from './src/audit_logging/audit_events'; export type { AuditLogger } from './src/audit_logging/audit_logger'; + +export type { + APIKeysServiceWithContext, + APIKeysService, + CreateAPIKeyParams, + CreateAPIKeyResult, + InvalidateAPIKeyResult, + InvalidateAPIKeysParams, + ValidateAPIKeyParams, + CreateRestAPIKeyParams, + CreateRestAPIKeyWithKibanaPrivilegesParams, + CreateCrossClusterAPIKeyParams, + GrantAPIKeyResult, + UpdateAPIKeyParams, + UpdateAPIKeyResult, + UpdateCrossClusterAPIKeyParams, + UpdateRestAPIKeyParams, + UpdateRestAPIKeyWithKibanaPrivilegesParams, +} from './src/authentication/api_keys'; + +export type { KibanaPrivilegesType, ElasticsearchPrivilegesType } from './src/roles'; +export { isCreateRestAPIKeyParams } from './src/authentication/api_keys'; export type { CoreFipsService } from './src/fips'; diff --git a/packages/core/security/core-security-server/src/authc.ts b/packages/core/security/core-security-server/src/authc.ts index 97654104858ea..85ba4fc71542a 100644 --- a/packages/core/security/core-security-server/src/authc.ts +++ b/packages/core/security/core-security-server/src/authc.ts @@ -8,6 +8,7 @@ import type { KibanaRequest } from '@kbn/core-http-server'; import type { AuthenticatedUser } from '@kbn/core-security-common'; +import type { APIKeysService } from './authentication/api_keys'; /** * Core's authentication service @@ -22,4 +23,5 @@ export interface CoreAuthenticationService { * @param request The request to retrieve the authenticated user for. */ getCurrentUser(request: KibanaRequest): AuthenticatedUser | null; + apiKeys: APIKeysService; } diff --git a/packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts b/packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts new file mode 100644 index 0000000000000..e842c38d8674d --- /dev/null +++ b/packages/core/security/core-security-server/src/authentication/api_keys/api_keys.ts @@ -0,0 +1,268 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { estypes } from '@elastic/elasticsearch'; + +import type { KibanaRequest } from '@kbn/core-http-server'; + +import { ElasticsearchPrivilegesType, KibanaPrivilegesType } from '../../roles'; + +/** + * Interface for managing API keys in Elasticsearch, including creation, + * validation, and invalidation of API keys, + * as well as checking the status of API key features. + */ +export interface APIKeys { + /** + * Determines if API Keys are enabled in Elasticsearch. + */ + areAPIKeysEnabled(): Promise; + + /** + * Determines if Cross-Cluster API Keys are enabled in Elasticsearch. + */ + areCrossClusterAPIKeysEnabled(): Promise; + + /** + * Tries to create an API key for the current user. + * + * Returns newly created API key or `null` if API keys are disabled. + * + * User needs `manage_api_key` privilege to create REST API keys and `manage_security` for Cross-Cluster API keys. + * + * @param request Request instance. + * @param createParams The params to create an API key + */ + create( + request: KibanaRequest, + createParams: CreateAPIKeyParams + ): Promise; + + /** + * Attempts update an API key with the provided 'role_descriptors' and 'metadata' + * + * Returns `updated`, `true` if the update was successful, `false` if there was nothing to update + * + * User needs `manage_api_key` privilege to update REST API keys and `manage_security` for cross-cluster API keys. + * + * @param request Request instance. + * @param updateParams The params to edit an API key + */ + update( + request: KibanaRequest, + updateParams: UpdateAPIKeyParams + ): Promise; + + /** + * Tries to grant an API key for the current user. + * @param request Request instance. + * @param createParams Create operation parameters. + */ + grantAsInternalUser( + request: KibanaRequest, + createParams: CreateRestAPIKeyParams | CreateRestAPIKeyWithKibanaPrivilegesParams + ): Promise; + + /** + * Tries to validate an API key. + * @param apiKeyPrams ValidateAPIKeyParams. + */ + validate(apiKeyPrams: ValidateAPIKeyParams): Promise; + + /** + * Tries to invalidate an API keys. + * @param request Request instance. + * @param params The params to invalidate an API keys. + */ + invalidate( + request: KibanaRequest, + params: InvalidateAPIKeysParams + ): Promise; + + /** + * Tries to invalidate the API keys by using the internal user. + * @param params The params to invalidate the API keys. + */ + invalidateAsInternalUser(params: InvalidateAPIKeysParams): Promise; +} + +export type CreateAPIKeyParams = + | CreateRestAPIKeyParams + | CreateRestAPIKeyWithKibanaPrivilegesParams + | CreateCrossClusterAPIKeyParams; + +/** + * Response of Kibana Create API key endpoint. + */ +export type CreateAPIKeyResult = estypes.SecurityCreateApiKeyResponse; + +export interface CreateRestAPIKeyParams { + type?: 'rest'; + expiration?: string; + name: string; + role_descriptors: Record; + metadata?: { [key: string]: any }; +} + +export interface CreateRestAPIKeyWithKibanaPrivilegesParams { + type?: 'rest'; + expiration?: string; + name: string; + metadata?: { [key: string]: any }; + kibana_role_descriptors: Record< + string, + { + elasticsearch: ElasticsearchPrivilegesType & { [key: string]: unknown }; + kibana: KibanaPrivilegesType; + } + >; +} + +export interface CreateCrossClusterAPIKeyParams { + type: 'cross_cluster'; + expiration?: string; + name: string; + metadata?: { [key: string]: any }; + access: { + search?: Array<{ + names: string[]; + query?: unknown; + field_security?: unknown; + allow_restricted_indices?: boolean; + }>; + replication?: Array<{ + names: string[]; + }>; + }; +} + +export interface GrantAPIKeyResult { + /** + * Unique id for this API key + */ + id: string; + /** + * Name for this API key + */ + name: string; + /** + * Generated API key + */ + api_key: string; +} + +/** + * Represents the parameters for validating API Key credentials. + */ +export interface ValidateAPIKeyParams { + /** + * Unique id for this API key + */ + id: string; + + /** + * Generated API Key (secret) + */ + api_key: string; +} + +/** + * Represents the params for invalidating multiple API keys + */ +export interface InvalidateAPIKeysParams { + /** + * List of unique API key IDs + */ + ids: string[]; +} + +/** + * The return value when invalidating an API key in Elasticsearch. + */ +export interface InvalidateAPIKeyResult { + /** + * The IDs of the API keys that were invalidated as part of the request. + */ + invalidated_api_keys: string[]; + /** + * The IDs of the API keys that were already invalidated. + */ + previously_invalidated_api_keys: string[]; + /** + * The number of errors that were encountered when invalidating the API keys. + */ + error_count: number; + /** + * Details about these errors. This field is not present in the response when error_count is 0. + */ + error_details?: Array<{ + type?: string; + reason?: string; + caused_by?: { + type?: string; + reason?: string; + }; + }>; +} + +/** + * Response of Kibana Update API key endpoint. + */ +export type UpdateAPIKeyResult = estypes.SecurityUpdateApiKeyResponse; + +/** + * Request body of Kibana Update API key endpoint. + */ +export type UpdateAPIKeyParams = + | UpdateRestAPIKeyParams + | UpdateCrossClusterAPIKeyParams + | UpdateRestAPIKeyWithKibanaPrivilegesParams; + +export interface UpdateRestAPIKeyParams { + id: string; + type?: 'rest'; + expiration?: string; + role_descriptors: Record; + metadata?: { [key: string]: any }; +} + +export interface UpdateCrossClusterAPIKeyParams { + id: string; + type: 'cross_cluster'; + expiration?: string; + metadata?: { [key: string]: any }; + access: { + search?: Array<{ + names: string[]; + query?: unknown; + field_security?: unknown; + allow_restricted_indices?: boolean; + }>; + replication?: Array<{ + names: string[]; + }>; + }; +} + +export interface UpdateRestAPIKeyWithKibanaPrivilegesParams { + id: string; + type?: 'rest'; + expiration?: string; + metadata?: { [key: string]: any }; + kibana_role_descriptors: Record< + string, + { + elasticsearch: ElasticsearchPrivilegesType & { [key: string]: unknown }; + kibana: KibanaPrivilegesType; + } + >; +} + +export function isCreateRestAPIKeyParams(params: any): params is CreateRestAPIKeyParams { + return 'role_descriptors' in params; +} diff --git a/packages/core/security/core-security-server/src/authentication/api_keys/api_keys_context.ts b/packages/core/security/core-security-server/src/authentication/api_keys/api_keys_context.ts new file mode 100644 index 0000000000000..7090f7312774f --- /dev/null +++ b/packages/core/security/core-security-server/src/authentication/api_keys/api_keys_context.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 type { + CreateAPIKeyParams, + CreateAPIKeyResult, + UpdateAPIKeyParams, + UpdateAPIKeyResult, + ValidateAPIKeyParams, + InvalidateAPIKeyResult, + InvalidateAPIKeysParams, +} from './api_keys'; + +/** + * Public API Keys service exposed through core context to manage + * API keys in Elasticsearch, including creation, + * validation, and invalidation of API keys, + * as well as checking the status of API key features. + */ +export interface APIKeysServiceWithContext { + /** + * Determines if API Keys are enabled in Elasticsearch. + */ + areAPIKeysEnabled(): Promise; + + /** + * Tries to create an API key for the current user. + * + * Returns newly created API key or `null` if API keys are disabled. + * + * User needs `manage_api_key` privilege to create REST API keys and `manage_security` for Cross-Cluster API keys. + * + * @param createParams The params to create an API key + */ + create(createParams: CreateAPIKeyParams): Promise; + + /** + * Attempts update an API key with the provided 'role_descriptors' and 'metadata' + * + * Returns `updated`, `true` if the update was successful, `false` if there was nothing to update + * + * User needs `manage_api_key` privilege to update REST API keys and `manage_security` for cross-cluster API keys. + * + * @param updateParams The params to edit an API key + */ + update(updateParams: UpdateAPIKeyParams): Promise; + + /** + * Tries to validate an API key. + * @param apiKeyPrams ValidateAPIKeyParams. + */ + validate(apiKeyPrams: ValidateAPIKeyParams): Promise; + + /** + * Tries to invalidate an API keys. + * @param params The params to invalidate an API keys. + */ + invalidate(params: InvalidateAPIKeysParams): Promise; +} diff --git a/packages/core/security/core-security-server/src/authentication/api_keys/index.ts b/packages/core/security/core-security-server/src/authentication/api_keys/index.ts new file mode 100644 index 0000000000000..da7163bb50879 --- /dev/null +++ b/packages/core/security/core-security-server/src/authentication/api_keys/index.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export type { + APIKeys as APIKeysService, + CreateAPIKeyParams, + CreateAPIKeyResult, + InvalidateAPIKeyResult, + InvalidateAPIKeysParams, + ValidateAPIKeyParams, + CreateRestAPIKeyParams, + CreateRestAPIKeyWithKibanaPrivilegesParams, + CreateCrossClusterAPIKeyParams, + GrantAPIKeyResult, + UpdateAPIKeyParams, + UpdateAPIKeyResult, + UpdateCrossClusterAPIKeyParams, + UpdateRestAPIKeyParams, + UpdateRestAPIKeyWithKibanaPrivilegesParams, +} from './api_keys'; +export type { APIKeysServiceWithContext } from './api_keys_context'; +export { isCreateRestAPIKeyParams } from './api_keys'; diff --git a/packages/core/security/core-security-server/src/request_handler_context.ts b/packages/core/security/core-security-server/src/request_handler_context.ts index 37915c24ddaa1..6cb13b3afb9a8 100644 --- a/packages/core/security/core-security-server/src/request_handler_context.ts +++ b/packages/core/security/core-security-server/src/request_handler_context.ts @@ -7,7 +7,9 @@ */ import type { AuthenticatedUser } from '@kbn/core-security-common'; + import { AuditLogger } from './audit_logging/audit_logger'; +import type { APIKeysServiceWithContext } from './authentication/api_keys'; export interface SecurityRequestHandlerContext { authc: AuthcRequestHandlerContext; @@ -16,6 +18,7 @@ export interface SecurityRequestHandlerContext { export interface AuthcRequestHandlerContext { getCurrentUser(): AuthenticatedUser | null; + apiKeys: APIKeysServiceWithContext; } export interface AuditRequestHandlerContext { diff --git a/packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/index.ts b/packages/core/security/core-security-server/src/roles/index.ts similarity index 81% rename from packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/index.ts rename to packages/core/security/core-security-server/src/roles/index.ts index 057b8ad60b999..420f6780fdd85 100644 --- a/packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/index.ts +++ b/packages/core/security/core-security-server/src/roles/index.ts @@ -6,5 +6,4 @@ * Side Public License, v 1. */ -export * from './use_alert_data_view'; -export * from './use_rule_aad_fields'; +export type { ElasticsearchPrivilegesType, KibanaPrivilegesType } from './schema'; diff --git a/packages/core/security/core-security-server/src/roles/schema.ts b/packages/core/security/core-security-server/src/roles/schema.ts new file mode 100644 index 0000000000000..693916ef3d9b3 --- /dev/null +++ b/packages/core/security/core-security-server/src/roles/schema.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. + */ + +/** + * Type representing Elasticsearch specific portion of the role definition. + */ +export interface ElasticsearchPrivilegesType { + cluster?: string[]; + remote_cluster?: Array<{ + privileges: string[]; + clusters: string[]; + }>; + indices?: Array<{ + names: string[]; + field_security?: Record<'grant' | 'except', string[]>; + privileges: string[]; + query?: string; + allow_restricted_indices?: boolean; + }>; + remote_indices?: Array<{ + clusters: string[]; + names: string[]; + field_security?: Record<'grant' | 'except', string[]>; + privileges: string[]; + query?: string; + allow_restricted_indices?: boolean; + }>; + run_as?: string[]; +} +/** + * Type representing Kibana specific portion of the role definition. + */ +export type KibanaPrivilegesType = Array<{ + spaces: string[]; + base?: string[]; + feature?: Record; +}>; diff --git a/packages/deeplinks/observability/locators/dataset_quality.ts b/packages/deeplinks/observability/locators/dataset_quality.ts index bfa760bf62c06..e30648e3f129c 100644 --- a/packages/deeplinks/observability/locators/dataset_quality.ts +++ b/packages/deeplinks/observability/locators/dataset_quality.ts @@ -8,7 +8,7 @@ import { SerializableRecord } from '@kbn/utility-types'; -export const DATASET_QUALITY_LOCATOR_ID = 'DATASET_QUALITY_LOCATOR'; +export const DATA_QUALITY_LOCATOR_ID = 'DATA_QUALITY_LOCATOR'; // eslint-disable-next-line @typescript-eslint/consistent-type-definitions type RefreshInterval = { @@ -23,11 +23,22 @@ type TimeRangeConfig = { refresh: RefreshInterval; }; +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions +type DatasetConfig = { + rawName: string; + type: string; + name: string; + namespace: string; +}; + // eslint-disable-next-line @typescript-eslint/consistent-type-definitions type Filters = { timeRange: TimeRangeConfig; }; -export interface DatasetQualityLocatorParams extends SerializableRecord { +export interface DataQualityLocatorParams extends SerializableRecord { filters?: Filters; + flyout?: { + dataset: DatasetConfig; + }; } diff --git a/packages/deeplinks/observability/locators/index.ts b/packages/deeplinks/observability/locators/index.ts index 73fe4b64bce9f..67e79ecb577ea 100644 --- a/packages/deeplinks/observability/locators/index.ts +++ b/packages/deeplinks/observability/locators/index.ts @@ -6,7 +6,8 @@ * Side Public License, v 1. */ +export * from './dataset_quality'; export * from './logs_explorer'; export * from './observability_logs_explorer'; export * from './observability_onboarding'; -export * from './dataset_quality'; +export * from './uptime'; diff --git a/packages/deeplinks/observability/locators/uptime.ts b/packages/deeplinks/observability/locators/uptime.ts new file mode 100644 index 0000000000000..a0f42801b6610 --- /dev/null +++ b/packages/deeplinks/observability/locators/uptime.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { SerializableRecord } from '@kbn/utility-types'; + +export const uptimeOverviewLocatorID = 'UPTIME_OVERVIEW_LOCATOR'; + +export interface UptimeOverviewLocatorInfraParams extends SerializableRecord { + ip?: string; + host?: string; + container?: string; + pod?: string; +} + +export interface UptimeOverviewLocatorParams extends SerializableRecord { + dateRangeStart?: string; + dateRangeEnd?: string; + search?: string; +} diff --git a/packages/deeplinks/search/constants.ts b/packages/deeplinks/search/constants.ts index 3fdcc78bb68a1..8aa53658320f5 100644 --- a/packages/deeplinks/search/constants.ts +++ b/packages/deeplinks/search/constants.ts @@ -8,7 +8,7 @@ export const ENTERPRISE_SEARCH_APP_ID = 'enterpriseSearch'; export const ENTERPRISE_SEARCH_CONTENT_APP_ID = 'enterpriseSearchContent'; -export const ENTERPRISE_SEARCH_INFERENCE_ENDPOINTS_APP_ID = 'enterpriseSearchInferenceEndpoints'; +export const ENTERPRISE_SEARCH_RELEVANCE_APP_ID = 'enterpriseSearchRelevance'; export const ENTERPRISE_SEARCH_APPLICATIONS_APP_ID = 'enterpriseSearchApplications'; export const ENTERPRISE_SEARCH_ANALYTICS_APP_ID = 'enterpriseSearchAnalytics'; export const ENTERPRISE_SEARCH_APPSEARCH_APP_ID = 'appSearch'; diff --git a/packages/deeplinks/search/deep_links.ts b/packages/deeplinks/search/deep_links.ts index f004d1b2c9dd6..4b32ec9757bde 100644 --- a/packages/deeplinks/search/deep_links.ts +++ b/packages/deeplinks/search/deep_links.ts @@ -12,6 +12,7 @@ import { ENTERPRISE_SEARCH_APP_ID, ENTERPRISE_SEARCH_CONTENT_APP_ID, ENTERPRISE_SEARCH_APPLICATIONS_APP_ID, + ENTERPRISE_SEARCH_RELEVANCE_APP_ID, ENTERPRISE_SEARCH_ANALYTICS_APP_ID, ENTERPRISE_SEARCH_APPSEARCH_APP_ID, ENTERPRISE_SEARCH_WORKPLACESEARCH_APP_ID, @@ -23,6 +24,7 @@ import { export type EnterpriseSearchApp = typeof ENTERPRISE_SEARCH_APP_ID; export type EnterpriseSearchContentApp = typeof ENTERPRISE_SEARCH_CONTENT_APP_ID; export type EnterpriseSearchApplicationsApp = typeof ENTERPRISE_SEARCH_APPLICATIONS_APP_ID; +export type EnterpriseSearchRelevanceApp = typeof ENTERPRISE_SEARCH_RELEVANCE_APP_ID; export type EnterpriseSearchAnalyticsApp = typeof ENTERPRISE_SEARCH_ANALYTICS_APP_ID; export type EnterpriseSearchAppsearchApp = typeof ENTERPRISE_SEARCH_APPSEARCH_APP_ID; export type EnterpriseSearchWorkplaceSearchApp = typeof ENTERPRISE_SEARCH_WORKPLACESEARCH_APP_ID; @@ -38,10 +40,13 @@ export type ApplicationsLinkId = 'searchApplications' | 'playground'; export type AppsearchLinkId = 'engines'; +export type RelevanceLinkId = 'inferenceEndpoints'; + export type DeepLinkId = | EnterpriseSearchApp | EnterpriseSearchContentApp | EnterpriseSearchApplicationsApp + | EnterpriseSearchRelevanceApp | EnterpriseSearchAnalyticsApp | EnterpriseSearchAppsearchApp | EnterpriseSearchWorkplaceSearchApp @@ -52,4 +57,5 @@ export type DeepLinkId = | SearchHomepage | `${EnterpriseSearchContentApp}:${ContentLinkId}` | `${EnterpriseSearchApplicationsApp}:${ApplicationsLinkId}` - | `${EnterpriseSearchAppsearchApp}:${AppsearchLinkId}`; + | `${EnterpriseSearchAppsearchApp}:${AppsearchLinkId}` + | `${EnterpriseSearchRelevanceApp}:${RelevanceLinkId}`; diff --git a/packages/deeplinks/search/index.ts b/packages/deeplinks/search/index.ts index 663d625e9fd72..a18f0cb31426f 100644 --- a/packages/deeplinks/search/index.ts +++ b/packages/deeplinks/search/index.ts @@ -9,7 +9,7 @@ export { ENTERPRISE_SEARCH_APP_ID, ENTERPRISE_SEARCH_CONTENT_APP_ID, - ENTERPRISE_SEARCH_INFERENCE_ENDPOINTS_APP_ID, + ENTERPRISE_SEARCH_RELEVANCE_APP_ID, ENTERPRISE_SEARCH_APPLICATIONS_APP_ID, ENTERPRISE_SEARCH_ANALYTICS_APP_ID, ENTERPRISE_SEARCH_APPSEARCH_APP_ID, diff --git a/packages/kbn-alerts-grouping/README.md b/packages/kbn-alerts-grouping/README.md new file mode 100644 index 0000000000000..65629e708fc99 --- /dev/null +++ b/packages/kbn-alerts-grouping/README.md @@ -0,0 +1,3 @@ +# @kbn/alerts-grouping + +Platform components to create hierarchical alerts grouping UIs diff --git a/packages/kbn-alerts-grouping/index.ts b/packages/kbn-alerts-grouping/index.ts new file mode 100644 index 0000000000000..e9e2476dde7a7 --- /dev/null +++ b/packages/kbn-alerts-grouping/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { AlertsGrouping } from './src/components/alerts_grouping'; +export { type AlertsGroupingProps } from './src/types'; +export { useAlertsGroupingState } from './src/contexts/alerts_grouping_context'; diff --git a/packages/kbn-alerts-grouping/jest.config.js b/packages/kbn-alerts-grouping/jest.config.js new file mode 100644 index 0000000000000..540837079010f --- /dev/null +++ b/packages/kbn-alerts-grouping/jest.config.js @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../..', + roots: ['/packages/kbn-alerts-grouping'], + setupFilesAfterEnv: ['/packages/kbn-alerts-grouping/setup_tests.ts'], +}; diff --git a/packages/kbn-alerts-grouping/kibana.jsonc b/packages/kbn-alerts-grouping/kibana.jsonc new file mode 100644 index 0000000000000..b98a1f0779eb3 --- /dev/null +++ b/packages/kbn-alerts-grouping/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-browser", + "id": "@kbn/alerts-grouping", + "owner": "@elastic/response-ops" +} diff --git a/packages/kbn-alerts-grouping/package.json b/packages/kbn-alerts-grouping/package.json new file mode 100644 index 0000000000000..9f490fbb2ec10 --- /dev/null +++ b/packages/kbn-alerts-grouping/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/alerts-grouping", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-grouping/setup_test.ts b/packages/kbn-alerts-grouping/setup_tests.ts similarity index 100% rename from packages/kbn-grouping/setup_test.ts rename to packages/kbn-alerts-grouping/setup_tests.ts diff --git a/packages/kbn-alerts-grouping/src/components/alerts_grouping.test.tsx b/packages/kbn-alerts-grouping/src/components/alerts_grouping.test.tsx new file mode 100644 index 0000000000000..c60ef03ca35e5 --- /dev/null +++ b/packages/kbn-alerts-grouping/src/components/alerts_grouping.test.tsx @@ -0,0 +1,495 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/** + * Adapted from x-pack/plugins/security_solution/public/detections/components/alerts_table/alerts_grouping.test.tsx + */ +import React from 'react'; +import { render, within, screen, waitFor } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import type { Filter } from '@kbn/es-query'; + +import { AlertsGrouping } from './alerts_grouping'; + +import { useGetAlertsGroupAggregationsQuery } from '@kbn/alerts-ui-shared'; +import useResizeObserver from 'use-resize-observer/polyfilled'; +import { groupingSearchResponse } from '../mocks/grouping_query.mock'; +import { useAlertsGroupingState } from '../contexts/alerts_grouping_context'; +import { I18nProvider } from '@kbn/i18n-react'; +import { + mockFeatureIds, + mockDate, + mockGroupingProps, + mockGroupingId, + mockOptions, +} from '../mocks/grouping_props.mock'; + +jest.mock('@kbn/alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query', () => ({ + useGetAlertsGroupAggregationsQuery: jest.fn(), +})); + +jest.mock('@kbn/alerts-ui-shared/src/common/hooks/use_alert_data_view', () => ({ + useAlertDataView: jest.fn().mockReturnValue({ dataViews: [{ fields: [] }] }), +})); + +jest.mock('../contexts/alerts_grouping_context', () => { + const original = jest.requireActual('../contexts/alerts_grouping_context'); + return { + ...original, + useAlertsGroupingState: jest.fn(), + }; +}); + +const mockUseAlertsGroupingState = useAlertsGroupingState as jest.Mock; + +jest.mock('uuid', () => ({ + v4: jest.fn().mockReturnValue('test-uuid'), +})); + +const mockUseGetAlertsGroupAggregationsQuery = useGetAlertsGroupAggregationsQuery as jest.Mock; + +const mockUseResizeObserver: jest.Mock = useResizeObserver as jest.Mock; +jest.mock('use-resize-observer/polyfilled'); +mockUseResizeObserver.mockImplementation(() => ({})); + +const renderChildComponent = (_groupingFilters: Filter[]) =>

; + +const getMockStorageState = (groups: string[] = ['none']) => + JSON.stringify({ + [mockGroupingId]: { + activeGroups: groups, + options: mockOptions, + }, + }); + +const mockQueryResponse = { + loading: false, + data: { + aggregations: { + groupsCount: { + value: 0, + }, + }, + }, +}; + +const TestProviders = ({ children }: { children: React.ReactNode }) => ( + {children} +); + +const mockAlertsGroupingState = { + grouping: { + options: mockOptions, + activeGroups: ['kibana.alert.rule.name'], + }, + updateGrouping: jest.fn(), +}; + +describe('AlertsGrouping', () => { + beforeEach(() => { + window.localStorage.clear(); + mockUseGetAlertsGroupAggregationsQuery.mockImplementation(() => ({ + loading: false, + data: groupingSearchResponse, + })); + mockUseAlertsGroupingState.mockReturnValue(mockAlertsGroupingState); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + it('renders empty grouping table when group is selected without data', () => { + mockUseGetAlertsGroupAggregationsQuery.mockReturnValue(mockQueryResponse); + window.localStorage.setItem( + `grouping-table-${mockGroupingId}`, + getMockStorageState(['kibana.alert.rule.name']) + ); + + render( + + {renderChildComponent} + + ); + expect(screen.queryByTestId('alerts-table')).not.toBeInTheDocument(); + expect(screen.getByTestId('empty-results-panel')).toBeInTheDocument(); + }); + + it('renders grouping table in first accordion level when single group is selected', () => { + render( + + {renderChildComponent} + + ); + + userEvent.click( + within(screen.getByTestId('level-0-group-0')).getByTestId('group-panel-toggle') + ); + expect( + within(screen.getByTestId('level-0-group-0')).getByTestId('alerts-table') + ).toBeInTheDocument(); + }); + + it('Query gets passed correctly', () => { + render( + + {renderChildComponent} + + ); + expect(mockUseGetAlertsGroupAggregationsQuery).toHaveBeenLastCalledWith( + expect.objectContaining({ + params: { + aggregations: {}, + featureIds: mockFeatureIds, + groupByField: 'kibana.alert.rule.name', + filters: [ + { + bool: { + filter: [], + must: [], + must_not: [], + should: [], + }, + }, + { + range: { + '@timestamp': { + gte: mockDate.from, + lte: mockDate.to, + }, + }, + }, + ], + pageIndex: 0, + pageSize: 25, + }, + }) + ); + }); + + it('renders grouping table in second accordion level when 2 groups are selected', () => { + mockUseAlertsGroupingState.mockReturnValue({ + ...mockAlertsGroupingState, + grouping: { + ...mockAlertsGroupingState.grouping, + activeGroups: ['kibana.alert.rule.name', 'user.name'], + }, + }); + render( + + {renderChildComponent} + + ); + userEvent.click( + within(screen.getByTestId('level-0-group-0')).getByTestId('group-panel-toggle') + ); + expect( + within(screen.getByTestId('level-0-group-0')).queryByTestId('alerts-table') + ).not.toBeInTheDocument(); + userEvent.click( + within(screen.getByTestId('level-1-group-0')).getByTestId('group-panel-toggle') + ); + expect( + within(screen.getByTestId('level-1-group-0')).getByTestId('alerts-table') + ).toBeInTheDocument(); + }); + + it('resets all levels pagination when selected group changes', async () => { + mockUseAlertsGroupingState.mockReturnValue({ + ...mockAlertsGroupingState, + grouping: { + ...mockAlertsGroupingState.grouping, + activeGroups: ['kibana.alert.rule.name', 'host.name', 'user.name'], + }, + }); + render( + + {renderChildComponent} + + ); + + userEvent.click(screen.getByTestId('pagination-button-1')); + userEvent.click( + within(screen.getByTestId('level-0-group-0')).getByTestId('group-panel-toggle') + ); + + userEvent.click( + within(screen.getByTestId('level-0-group-0')).getByTestId('pagination-button-1') + ); + userEvent.click( + within(screen.getByTestId('level-1-group-0')).getByTestId('group-panel-toggle') + ); + + userEvent.click( + within(screen.getByTestId('level-1-group-0')).getByTestId('pagination-button-1') + ); + + [ + screen.getByTestId('grouping-level-0-pagination'), + screen.getByTestId('grouping-level-1-pagination'), + screen.getByTestId('grouping-level-2-pagination'), + ].forEach((pagination) => { + expect( + within(pagination).getByTestId('pagination-button-0').getAttribute('aria-current') + ).toEqual(null); + expect( + within(pagination).getByTestId('pagination-button-1').getAttribute('aria-current') + ).toEqual('true'); + }); + + userEvent.click(screen.getAllByTestId('group-selector-dropdown')[0]); + // Wait for element to have pointer events enabled + await waitFor(() => userEvent.click(screen.getAllByTestId('panel-user.name')[0])); + + [ + screen.getByTestId('grouping-level-0-pagination'), + screen.getByTestId('grouping-level-1-pagination'), + // level 2 has been removed with the group selection change + ].forEach((pagination) => { + expect( + within(pagination).getByTestId('pagination-button-0').getAttribute('aria-current') + ).toEqual('true'); + expect( + within(pagination).getByTestId('pagination-button-1').getAttribute('aria-current') + ).toEqual(null); + }); + }); + + it('resets all levels pagination when global query updates', () => { + mockUseAlertsGroupingState.mockReturnValue({ + ...mockAlertsGroupingState, + grouping: { + ...mockAlertsGroupingState.grouping, + activeGroups: ['kibana.alert.rule.name', 'host.name', 'user.name'], + }, + }); + + const { rerender } = render( + + {renderChildComponent} + + ); + + userEvent.click(screen.getByTestId('pagination-button-1')); + userEvent.click( + within(screen.getByTestId('level-0-group-0')).getByTestId('group-panel-toggle') + ); + userEvent.click( + within(screen.getByTestId('level-0-group-0')).getByTestId('pagination-button-1') + ); + userEvent.click( + within(screen.getByTestId('level-1-group-0')).getByTestId('group-panel-toggle') + ); + userEvent.click( + within(screen.getByTestId('level-1-group-0')).getByTestId('pagination-button-1') + ); + + rerender( + + + {renderChildComponent} + + + ); + + [ + screen.getByTestId('grouping-level-0-pagination'), + screen.getByTestId('grouping-level-1-pagination'), + screen.getByTestId('grouping-level-2-pagination'), + ].forEach((pagination) => { + expect( + within(pagination).getByTestId('pagination-button-0').getAttribute('aria-current') + ).toEqual('true'); + expect( + within(pagination).getByTestId('pagination-button-1').getAttribute('aria-current') + ).toEqual(null); + }); + }); + + it('resets only most inner group pagination when its parent groups open/close', () => { + mockUseAlertsGroupingState.mockReturnValue({ + ...mockAlertsGroupingState, + grouping: { + ...mockAlertsGroupingState.grouping, + activeGroups: ['kibana.alert.rule.name', 'host.name', 'user.name'], + }, + }); + + render( + + {renderChildComponent} + + ); + + // set level 0 page to 2 + userEvent.click(screen.getByTestId('pagination-button-1')); + userEvent.click( + within(screen.getByTestId('level-0-group-0')).getByTestId('group-panel-toggle') + ); + + // set level 1 page to 2 + userEvent.click( + within(screen.getByTestId('level-0-group-0')).getByTestId('pagination-button-1') + ); + userEvent.click( + within(screen.getByTestId('level-1-group-0')).getByTestId('group-panel-toggle') + ); + + // set level 2 page to 2 + userEvent.click( + within(screen.getByTestId('level-1-group-0')).getByTestId('pagination-button-1') + ); + userEvent.click( + within(screen.getByTestId('level-2-group-0')).getByTestId('group-panel-toggle') + ); + + // open different level 1 group + + // level 0, 1 pagination is the same + userEvent.click( + within(screen.getByTestId('level-1-group-1')).getByTestId('group-panel-toggle') + ); + [ + screen.getByTestId('grouping-level-0-pagination'), + screen.getByTestId('grouping-level-1-pagination'), + ].forEach((pagination) => { + expect( + within(pagination).getByTestId('pagination-button-0').getAttribute('aria-current') + ).toEqual(null); + expect( + within(pagination).getByTestId('pagination-button-1').getAttribute('aria-current') + ).toEqual('true'); + }); + + // level 2 pagination is reset + expect( + within(screen.getByTestId('grouping-level-2-pagination')) + .getByTestId('pagination-button-0') + .getAttribute('aria-current') + ).toEqual('true'); + expect( + within(screen.getByTestId('grouping-level-2-pagination')) + .getByTestId('pagination-button-1') + .getAttribute('aria-current') + ).toEqual(null); + }); + + it(`resets innermost level's current page when that level's page size updates`, async () => { + mockUseAlertsGroupingState.mockReturnValue({ + ...mockAlertsGroupingState, + grouping: { + ...mockAlertsGroupingState.grouping, + activeGroups: ['kibana.alert.rule.name', 'host.name', 'user.name'], + }, + }); + + render( + + {renderChildComponent} + + ); + + userEvent.click(await screen.findByTestId('pagination-button-1')); + userEvent.click( + within(await screen.findByTestId('level-0-group-0')).getByTestId('group-panel-toggle') + ); + userEvent.click( + within(await screen.findByTestId('level-0-group-0')).getByTestId('pagination-button-1') + ); + userEvent.click( + within(await screen.findByTestId('level-1-group-0')).getByTestId('group-panel-toggle') + ); + + userEvent.click( + within(await screen.findByTestId('level-1-group-0')).getByTestId('pagination-button-1') + ); + userEvent.click( + within(await screen.findByTestId('grouping-level-2')).getByTestId( + 'tablePaginationPopoverButton' + ) + ); + userEvent.click(await screen.findByTestId('tablePagination-100-rows')); + + [ + await screen.findByTestId('grouping-level-0-pagination'), + await screen.findByTestId('grouping-level-1-pagination'), + await screen.findByTestId('grouping-level-2-pagination'), + ].forEach((pagination, i) => { + if (i !== 2) { + expect( + within(pagination).getByTestId('pagination-button-0').getAttribute('aria-current') + ).toEqual(null); + expect( + within(pagination).getByTestId('pagination-button-1').getAttribute('aria-current') + ).toEqual('true'); + } else { + expect( + within(pagination).getByTestId('pagination-button-0').getAttribute('aria-current') + ).toEqual('true'); + expect(within(pagination).queryByTestId('pagination-button-1')).not.toBeInTheDocument(); + } + }); + }); + + it(`resets outermost level's current page when that level's page size updates`, async () => { + mockUseAlertsGroupingState.mockReturnValue({ + ...mockAlertsGroupingState, + grouping: { + ...mockAlertsGroupingState.grouping, + activeGroups: ['kibana.alert.rule.name', 'host.name', 'user.name'], + }, + }); + + render( + + {renderChildComponent} + + ); + + userEvent.click(screen.getByTestId('pagination-button-1')); + userEvent.click( + within(await screen.findByTestId('level-0-group-0')).getByTestId('group-panel-toggle') + ); + + userEvent.click( + within(await screen.findByTestId('level-0-group-0')).getByTestId('pagination-button-1') + ); + userEvent.click( + within(await screen.findByTestId('level-1-group-0')).getByTestId('group-panel-toggle') + ); + + userEvent.click( + within(await screen.findByTestId('level-1-group-0')).getByTestId('pagination-button-1') + ); + const tablePaginations = await screen.findAllByTestId('tablePaginationPopoverButton'); + userEvent.click(tablePaginations[tablePaginations.length - 1]); + await waitFor(() => userEvent.click(screen.getByTestId('tablePagination-100-rows'))); + + [ + screen.getByTestId('grouping-level-0-pagination'), + screen.getByTestId('grouping-level-1-pagination'), + screen.getByTestId('grouping-level-2-pagination'), + ].forEach((pagination, i) => { + if (i !== 0) { + expect( + within(pagination).getByTestId('pagination-button-0').getAttribute('aria-current') + ).toEqual(null); + expect( + within(pagination).getByTestId('pagination-button-1').getAttribute('aria-current') + ).toEqual('true'); + } else { + expect( + within(pagination).getByTestId('pagination-button-0').getAttribute('aria-current') + ).toEqual('true'); + expect(within(pagination).queryByTestId('pagination-button-1')).not.toBeInTheDocument(); + } + }); + }); +}); diff --git a/packages/kbn-alerts-grouping/src/components/alerts_grouping.tsx b/packages/kbn-alerts-grouping/src/components/alerts_grouping.tsx new file mode 100644 index 0000000000000..130997dd393ce --- /dev/null +++ b/packages/kbn-alerts-grouping/src/components/alerts_grouping.tsx @@ -0,0 +1,285 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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, { + Dispatch, + memo, + SetStateAction, + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from 'react'; +import type { Filter } from '@kbn/es-query'; +import { isNoneGroup, useGrouping } from '@kbn/grouping'; +import { isEqual } from 'lodash/fp'; +import { i18n } from '@kbn/i18n'; +import { useAlertDataView } from '@kbn/alerts-ui-shared'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; +import { AlertsGroupingLevel, AlertsGroupingLevelProps } from './alerts_grouping_level'; +import { AlertsGroupingProps } from '../types'; +import { + AlertsGroupingContextProvider, + useAlertsGroupingState, +} from '../contexts/alerts_grouping_context'; +import { DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE, MAX_GROUPING_LEVELS } from '../constants'; + +/** + * Handles recursive rendering of grouping levels + */ +const NextLevel = ({ + level, + selectedGroups, + children, + parentGroupingFilter, + groupingFilters, + getLevel, +}: Pick & { + level: number; + selectedGroups: string[]; + groupingFilters: Filter[]; + getLevel: (level: number, selectedGroup: string, parentGroupingFilter?: Filter[]) => JSX.Element; +}): JSX.Element => { + const nextGroupingFilters = useMemo( + () => [...groupingFilters, ...(parentGroupingFilter ?? [])], + [groupingFilters, parentGroupingFilter] + ); + if (level < selectedGroups.length - 1) { + return getLevel(level + 1, selectedGroups[level + 1], nextGroupingFilters)!; + } + return children(nextGroupingFilters)!; +}; + +const AlertsGroupingInternal = (props: AlertsGroupingProps) => { + const { + groupingId, + services, + featureIds, + defaultGroupingOptions, + defaultFilters, + globalFilters, + globalQuery, + renderGroupPanel, + getGroupStats, + children, + } = props; + const { dataViews, notifications, http } = services; + const { grouping, updateGrouping } = useAlertsGroupingState(groupingId); + + const { dataViews: alertDataViews } = useAlertDataView({ + featureIds, + dataViewsService: dataViews, + http, + toasts: notifications.toasts, + }); + const dataView = useMemo(() => alertDataViews?.[0], [alertDataViews]); + const [pageSize, setPageSize] = useLocalStorage( + `grouping-table-${groupingId}`, + Array(MAX_GROUPING_LEVELS).fill(DEFAULT_PAGE_SIZE) + ) as [number[], Dispatch>, () => void]; + + const onOptionsChange = useCallback( + (options) => { + // useGrouping > useAlertsGroupingState options sync + // the available grouping options change when the user selects + // a new field not in the default ones + updateGrouping({ + options, + }); + }, + [updateGrouping] + ); + + const { getGrouping, selectedGroups, setSelectedGroups } = useGrouping({ + componentProps: { + groupPanelRenderer: renderGroupPanel, + getGroupStats, + unit: (totalCount) => + i18n.translate('alertsGrouping.unit', { + values: { totalCount }, + defaultMessage: `{totalCount, plural, =1 {alert} other {alerts}}`, + }), + }, + defaultGroupingOptions, + fields: dataView?.fields ?? [], + groupingId, + maxGroupingLevels: MAX_GROUPING_LEVELS, + onOptionsChange, + }); + + useEffect(() => { + // The `none` grouping is managed from the internal selector state + if (isNoneGroup(selectedGroups)) { + // Set active groups from selected groups + updateGrouping({ + activeGroups: selectedGroups, + }); + } + }, [selectedGroups, updateGrouping]); + + useEffect(() => { + if (!isNoneGroup(grouping.activeGroups)) { + // Set selected groups from active groups + setSelectedGroups(grouping.activeGroups); + } + }, [grouping.activeGroups, setSelectedGroups]); + + const [pageIndex, setPageIndex] = useState( + Array(MAX_GROUPING_LEVELS).fill(DEFAULT_PAGE_INDEX) + ); + + const resetAllPagination = useCallback(() => { + setPageIndex((curr) => curr.map(() => DEFAULT_PAGE_INDEX)); + }, []); + + const setPageVar = useCallback( + (newNumber: number, groupingLevel: number, pageType: 'index' | 'size') => { + if (pageType === 'index') { + setPageIndex((currentIndex) => { + const newArr = [...currentIndex]; + newArr[groupingLevel] = newNumber; + return newArr; + }); + } + + if (pageType === 'size') { + setPageSize((currentIndex) => { + const newArr = [...currentIndex]; + newArr[groupingLevel] = newNumber; + return newArr; + }); + // set page index to 0 when page size is changed + setPageIndex((currentIndex) => { + const newArr = [...currentIndex]; + newArr[groupingLevel] = 0; + return newArr; + }); + } + }, + [setPageSize] + ); + + const paginationResetTriggers = useRef({ + defaultFilters, + globalFilters, + globalQuery, + selectedGroups, + }); + + useEffect(() => { + const triggers = { + defaultFilters, + globalFilters, + globalQuery, + selectedGroups, + }; + if (!isEqual(paginationResetTriggers.current, triggers)) { + resetAllPagination(); + paginationResetTriggers.current = triggers; + } + }, [defaultFilters, globalFilters, globalQuery, resetAllPagination, selectedGroups]); + + const getLevel = useCallback( + (level: number, selectedGroup: string, parentGroupingFilter?: Filter[]) => { + const resetGroupChildrenPagination = (parentLevel: number) => { + setPageIndex((allPages) => { + const resetPages = allPages.splice(parentLevel + 1, allPages.length); + return [...allPages, ...resetPages.map(() => DEFAULT_PAGE_INDEX)]; + }); + }; + + return ( + resetGroupChildrenPagination(level)} + pageIndex={pageIndex[level] ?? DEFAULT_PAGE_INDEX} + pageSize={pageSize[level] ?? DEFAULT_PAGE_SIZE} + parentGroupingFilter={parentGroupingFilter} + selectedGroup={selectedGroup} + setPageIndex={(newIndex: number) => setPageVar(newIndex, level, 'index')} + setPageSize={(newSize: number) => setPageVar(newSize, level, 'size')} + > + {(groupingFilters) => ( + + {children} + + )} + + ); + }, + [children, getGrouping, pageIndex, pageSize, props, selectedGroups, setPageVar] + ); + + if (!dataView) { + return null; + } + + return getLevel(0, selectedGroups[0]); +}; + +/** + * A coordinator component to show multiple alert tables grouped by one or more fields + * + * @example Basic grouping + * ```ts + * const { + * notifications, + * dataViews, + * http, + * } = useKibana().services; + * + * + * return ( + * + * {(groupingFilters) => { + * const query = buildEsQuery({ + * filters: groupingFilters, + * }); + * return ( + * + * ); + * }} + * + * ); + * ``` + */ +export const AlertsGrouping = memo((props: AlertsGroupingProps) => { + return ( + + + + ); +}); diff --git a/packages/kbn-alerts-grouping/src/components/alerts_grouping_level.test.tsx b/packages/kbn-alerts-grouping/src/components/alerts_grouping_level.test.tsx new file mode 100644 index 0000000000000..45424f34d9cb4 --- /dev/null +++ b/packages/kbn-alerts-grouping/src/components/alerts_grouping_level.test.tsx @@ -0,0 +1,121 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { render, waitFor } from '@testing-library/react'; +import { AlertsGroupingLevel, type AlertsGroupingLevelProps } from './alerts_grouping_level'; +import { useGetAlertsGroupAggregationsQuery } from '@kbn/alerts-ui-shared'; +import * as buildEsQueryModule from '@kbn/es-query/src/es_query/build_es_query'; +import { mockGroupingProps } from '../mocks/grouping_props.mock'; +import { groupingSearchResponse } from '../mocks/grouping_query.mock'; + +jest.mock('@kbn/alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query', () => ({ + useGetAlertsGroupAggregationsQuery: jest.fn(), +})); + +const mockUseGetAlertsGroupAggregationsQuery = useGetAlertsGroupAggregationsQuery as jest.Mock; +mockUseGetAlertsGroupAggregationsQuery.mockReturnValue({ + loading: false, + data: groupingSearchResponse, +}); + +jest.mock('@kbn/alerts-ui-shared/src/common/hooks/use_alert_data_view', () => ({ + useAlertDataView: jest.fn().mockReturnValue({ dataViews: [{ fields: [] }] }), +})); + +jest.mock('../contexts/alerts_grouping_context', () => { + const original = jest.requireActual('../contexts/alerts_grouping_context'); + return { + ...original, + useAlertsGroupingState: jest.fn(), + }; +}); + +const getGrouping = jest + .fn() + .mockImplementation(({ renderChildComponent }) => {renderChildComponent()}); + +const mockGroupingLevelProps: Omit = { + ...mockGroupingProps, + getGrouping, + onGroupClose: jest.fn(), + pageIndex: 0, + pageSize: 10, + selectedGroup: 'selectedGroup', + setPageIndex: jest.fn(), + setPageSize: jest.fn(), +}; + +describe('AlertsGroupingLevel', () => { + let buildEsQuerySpy: jest.SpyInstance; + + beforeAll(() => { + buildEsQuerySpy = jest.spyOn(buildEsQueryModule, 'buildEsQuery'); + }); + + it('should render', () => { + const { getByTestId } = render( + + {() => } + + ); + expect(getByTestId('grouping-level')).toBeInTheDocument(); + }); + + it('should account for global, default and parent filters', async () => { + const globalFilter = { meta: { value: 'global', disabled: false } }; + const defaultFilter = { meta: { value: 'default' } }; + const parentFilter = { meta: { value: 'parent' } }; + render( + + {() => } + + ); + await waitFor(() => + expect(buildEsQuerySpy).toHaveBeenLastCalledWith(undefined, expect.anything(), [ + globalFilter, + defaultFilter, + parentFilter, + ]) + ); + }); + + it('should discard disabled global filters', async () => { + const globalFilters = [ + { meta: { value: 'global1', disabled: false } }, + { meta: { value: 'global2', disabled: true } }, + ]; + render( + + {() => } + + ); + await waitFor(() => + expect(buildEsQuerySpy).toHaveBeenLastCalledWith(undefined, expect.anything(), [ + globalFilters[0], + ]) + ); + }); + + it('should call getGrouping with the right aggregations', () => { + render( + + {() => } + + ); + + expect(Object.keys(getGrouping.mock.calls[0][0].data)).toMatchObject( + Object.keys(groupingSearchResponse.aggregations) + ); + }); +}); diff --git a/packages/kbn-alerts-grouping/src/components/alerts_grouping_level.tsx b/packages/kbn-alerts-grouping/src/components/alerts_grouping_level.tsx new file mode 100644 index 0000000000000..e4511e8dea774 --- /dev/null +++ b/packages/kbn-alerts-grouping/src/components/alerts_grouping_level.tsx @@ -0,0 +1,173 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { memo, ReactElement, useMemo } from 'react'; +import { v4 as uuidv4 } from 'uuid'; +import type { Filter } from '@kbn/es-query'; +import { buildEsQuery } from '@kbn/es-query'; +import { type GroupingAggregation } from '@kbn/grouping'; +import { isNoneGroup } from '@kbn/grouping'; +import type { DynamicGroupingProps } from '@kbn/grouping/src'; +import { parseGroupingQuery } from '@kbn/grouping/src'; +import { + useGetAlertsGroupAggregationsQuery, + UseGetAlertsGroupAggregationsQueryProps, +} from '@kbn/alerts-ui-shared'; +import { AlertsGroupingProps } from '../types'; + +export interface AlertsGroupingLevelProps = {}> + extends AlertsGroupingProps { + getGrouping: ( + props: Omit, 'groupSelector' | 'pagination'> + ) => ReactElement; + groupingLevel?: number; + onGroupClose: () => void; + pageIndex: number; + pageSize: number; + parentGroupingFilter?: Filter[]; + selectedGroup: string; + setPageIndex: (newIndex: number) => void; + setPageSize: (newSize: number) => void; +} + +const DEFAULT_FILTERS: Filter[] = []; + +/** + * Renders an alerts grouping level + */ +export const AlertsGroupingLevel = memo( + = {}>({ + featureIds, + defaultFilters = DEFAULT_FILTERS, + from, + getGrouping, + globalFilters, + globalQuery, + groupingLevel, + loading = false, + onGroupClose, + pageIndex, + pageSize, + parentGroupingFilter, + children, + selectedGroup, + setPageIndex, + setPageSize, + to, + takeActionItems, + getAggregationsByGroupingField, + services: { http, notifications }, + }: AlertsGroupingLevelProps) => { + const filters = useMemo(() => { + try { + return [ + buildEsQuery(undefined, globalQuery != null ? [globalQuery] : [], [ + ...(globalFilters?.filter((f) => f.meta.disabled === false) ?? []), + ...(defaultFilters ?? []), + ...(parentGroupingFilter ?? []), + ]), + ]; + } catch (e) { + return []; + } + }, [defaultFilters, globalFilters, globalQuery, parentGroupingFilter]); + + // Create a unique, but stable (across re-renders) value + const uniqueValue = useMemo(() => `alerts-grouping-level-${uuidv4()}`, []); + + const aggregationsQuery = useMemo(() => { + return { + featureIds, + groupByField: selectedGroup, + aggregations: getAggregationsByGroupingField(selectedGroup)?.reduce( + (acc, val) => Object.assign(acc, val), + {} + ), + filters: [ + ...filters, + { + range: { + '@timestamp': { + gte: from, + lte: to, + }, + }, + }, + ], + pageIndex, + pageSize, + }; + }, [ + featureIds, + filters, + from, + getAggregationsByGroupingField, + pageIndex, + pageSize, + selectedGroup, + to, + ]); + + const { data: alertGroupsData, isLoading: isLoadingGroups } = + useGetAlertsGroupAggregationsQuery>({ + http, + toasts: notifications.toasts, + enabled: aggregationsQuery && !isNoneGroup([selectedGroup]), + params: aggregationsQuery, + }); + + const queriedGroup = useMemo( + () => (!isNoneGroup([selectedGroup]) ? selectedGroup : null), + [selectedGroup] + ); + + const aggs = useMemo( + // queriedGroup because `selectedGroup` updates before the query response + () => + parseGroupingQuery( + // fallback to selectedGroup if queriedGroup.current is null, this happens in tests + queriedGroup === null ? selectedGroup : queriedGroup, + uniqueValue, + alertGroupsData?.aggregations + ), + [alertGroupsData?.aggregations, queriedGroup, selectedGroup, uniqueValue] + ); + + return useMemo( + () => + getGrouping({ + activePage: pageIndex, + data: aggs, + groupingLevel, + isLoading: loading || isLoadingGroups, + itemsPerPage: pageSize, + onChangeGroupsItemsPerPage: (size: number) => setPageSize(size), + onChangeGroupsPage: (index) => setPageIndex(index), + onGroupClose, + renderChildComponent: children, + selectedGroup, + takeActionItems, + }), + [ + getGrouping, + pageIndex, + aggs, + groupingLevel, + loading, + isLoadingGroups, + pageSize, + onGroupClose, + children, + selectedGroup, + takeActionItems, + setPageSize, + setPageIndex, + ] + ); + } +); diff --git a/packages/kbn-alerts-grouping/src/constants.ts b/packages/kbn-alerts-grouping/src/constants.ts new file mode 100644 index 0000000000000..d42678e64520c --- /dev/null +++ b/packages/kbn-alerts-grouping/src/constants.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export const DEFAULT_PAGE_SIZE = 25; +export const DEFAULT_PAGE_INDEX = 0; +export const MAX_GROUPING_LEVELS = 3; diff --git a/packages/kbn-alerts-grouping/src/contexts/alerts_grouping_context.tsx b/packages/kbn-alerts-grouping/src/contexts/alerts_grouping_context.tsx new file mode 100644 index 0000000000000..cc5e06e652cd4 --- /dev/null +++ b/packages/kbn-alerts-grouping/src/contexts/alerts_grouping_context.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { + createContext, + Dispatch, + PropsWithChildren, + SetStateAction, + useCallback, + useContext, + useMemo, + useState, +} from 'react'; +import { AlertsGroupingState, GroupModel } from '../types'; + +const initialActiveGroups = ['none']; + +export const AlertsGroupingContext = createContext({ + groupingState: {} as AlertsGroupingState, + setGroupingState: (() => {}) as Dispatch>, +}); + +export const AlertsGroupingContextProvider = ({ children }: PropsWithChildren<{}>) => { + const [groupingState, setGroupingState] = useState({}); + return ( + ({ groupingState, setGroupingState }), + [groupingState, setGroupingState] + )} + > + {children} + + ); +}; + +export const useAlertsGroupingState = (groupingId: string) => { + const { groupingState, setGroupingState } = useContext(AlertsGroupingContext); + const updateGrouping = useCallback( + (groupModel: Partial | null) => { + if (groupModel === null) { + setGroupingState((prevState) => { + const newState = { ...prevState }; + delete newState[groupingId]; + return newState; + }); + return; + } + setGroupingState((prevState) => ({ + ...prevState, + [groupingId]: { + // @ts-expect-error options might not be defined + options: [], + // @ts-expect-error activeGroups might not be defined + activeGroups: initialActiveGroups, + ...prevState[groupingId], + ...groupModel, + }, + })); + }, + [setGroupingState, groupingId] + ); + const grouping = useMemo( + () => groupingState[groupingId] ?? { activeGroups: ['none'] }, + [groupingState, groupingId] + ); + return { + grouping, + updateGrouping, + }; +}; diff --git a/packages/kbn-alerts-grouping/src/index.ts b/packages/kbn-alerts-grouping/src/index.ts new file mode 100644 index 0000000000000..db8b9dc84f8f6 --- /dev/null +++ b/packages/kbn-alerts-grouping/src/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './components/alerts_grouping'; +export * from './contexts/alerts_grouping_context'; +export * from './types'; diff --git a/packages/kbn-alerts-grouping/src/mocks/grouping_props.mock.tsx b/packages/kbn-alerts-grouping/src/mocks/grouping_props.mock.tsx new file mode 100644 index 0000000000000..ac8e55bfb0222 --- /dev/null +++ b/packages/kbn-alerts-grouping/src/mocks/grouping_props.mock.tsx @@ -0,0 +1,59 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { AlertConsumers } from '@kbn/rule-data-utils'; +import { AlertsGroupingProps } from '../types'; + +export const mockGroupingId = 'test'; + +export const mockFeatureIds = [AlertConsumers.STACK_ALERTS]; + +export const mockDate = { + from: '2020-07-07T08:20:18.966Z', + to: '2020-07-08T08:20:18.966Z', +}; + +export const mockOptions = [ + { label: 'ruleName', key: 'kibana.alert.rule.name' }, + { label: 'userName', key: 'user.name' }, + { label: 'hostName', key: 'host.name' }, + { label: 'sourceIP', key: 'source.ip' }, +]; + +export const mockGroupingProps: Omit = { + ...mockDate, + groupingId: mockGroupingId, + featureIds: mockFeatureIds, + defaultGroupingOptions: mockOptions, + getAggregationsByGroupingField: () => [], + getGroupStats: () => [{ title: 'Stat', component: }], + renderGroupPanel: () => , + takeActionItems: undefined, + defaultFilters: [], + globalFilters: [], + globalQuery: { + query: 'query', + language: 'language', + }, + loading: false, + services: { + dataViews: { + clearInstanceCache: jest.fn(), + create: jest.fn(), + } as unknown as AlertsGroupingProps['services']['dataViews'], + http: { + get: jest.fn(), + } as unknown as AlertsGroupingProps['services']['http'], + notifications: { + toasts: { + addDanger: jest.fn(), + }, + } as unknown as AlertsGroupingProps['services']['notifications'], + }, +}; diff --git a/packages/kbn-alerts-grouping/src/mocks/grouping_query.mock.ts b/packages/kbn-alerts-grouping/src/mocks/grouping_query.mock.ts new file mode 100644 index 0000000000000..3cdf07ec8c31f --- /dev/null +++ b/packages/kbn-alerts-grouping/src/mocks/grouping_query.mock.ts @@ -0,0 +1,1382 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may 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 getQuery = ({ + selectedGroup, + uniqueValue, + timeRange, + featureIds, +}: { + selectedGroup: string; + uniqueValue: string; + timeRange: { from: string; to: string }; + featureIds: string[]; +}) => ({ + _source: false, + aggs: { + unitsCount: { + value_count: { + field: 'groupByField', + }, + }, + groupsCount: { + cardinality: { + field: 'groupByField', + }, + }, + groupByFields: { + aggs: { + bucket_truncate: { + bucket_sort: { + from: 0, + size: 25, + sort: [ + { + unitsCount: { + order: 'desc', + }, + }, + ], + }, + }, + }, + terms: { + field: 'groupByField', + size: 10000, + }, + }, + }, + feature_ids: featureIds, + query: { + bool: { + filter: [ + { bool: { filter: [], must: [], must_not: [], should: [] } }, + { + range: { + '@timestamp': { + gte: timeRange.from, + lte: timeRange.to, + }, + }, + }, + ], + }, + }, + runtime_mappings: { + groupByField: { + type: 'keyword', + script: { + source: + "if (doc[params['selectedGroup']].size()==0) { emit(params['uniqueValue']) } else { emit(doc[params['selectedGroup']].join(params['uniqueValue']))}", + params: { + selectedGroup, + uniqueValue, + }, + }, + }, + }, + size: 0, +}); + +export const groupingSearchResponse = { + hits: { + total: { + value: 6048, + relation: 'eq', + }, + max_score: null, + hits: [], + }, + aggregations: { + groupsCount: { + value: 32, + }, + groupByFields: { + buckets: [ + { + key: ['critical hosts [Duplicate]'], + key_as_string: 'critical hosts [Duplicate]', + doc_count: 300, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 300, + }, + { + key: 'rule', + doc_count: 300, + }, + ], + }, + unitsCount: { + value: 300, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'critical', + doc_count: 300, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['critical hosts [Duplicate] [Duplicate]'], + key_as_string: 'critical hosts [Duplicate] [Duplicate]', + doc_count: 300, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 300, + }, + { + key: 'rule', + doc_count: 300, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 300, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'critical', + doc_count: 300, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['high hosts [Duplicate]'], + key_as_string: 'high hosts [Duplicate]', + doc_count: 300, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 300, + }, + { + key: 'rule', + doc_count: 300, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 300, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'high', + doc_count: 300, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['high hosts [Duplicate] [Duplicate]'], + key_as_string: 'high hosts [Duplicate] [Duplicate]', + doc_count: 300, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 300, + }, + { + key: 'rule', + doc_count: 300, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 300, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'high', + doc_count: 300, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['low hosts [Duplicate]'], + key_as_string: 'low hosts [Duplicate]', + doc_count: 300, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 300, + }, + { + key: 'rule', + doc_count: 300, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 300, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'low', + doc_count: 300, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['low hosts [Duplicate] [Duplicate]'], + key_as_string: 'low hosts [Duplicate] [Duplicate]', + doc_count: 300, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 300, + }, + { + key: 'rule', + doc_count: 300, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 300, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'low', + doc_count: 300, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['medium hosts [Duplicate]'], + key_as_string: 'medium hosts [Duplicate]', + doc_count: 300, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 300, + }, + { + key: 'rule', + doc_count: 300, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 300, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'medium', + doc_count: 300, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['medium hosts [Duplicate] [Duplicate]'], + key_as_string: 'medium hosts [Duplicate] [Duplicate]', + doc_count: 300, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 300, + }, + { + key: 'rule', + doc_count: 300, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 300, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'medium', + doc_count: 300, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['critical users [Duplicate]'], + key_as_string: 'critical users [Duplicate]', + doc_count: 273, + hostsCountAggregation: { + value: 10, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 273, + }, + { + key: 'rule', + doc_count: 273, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 273, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'critical', + doc_count: 273, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 91, + }, + }, + { + key: ['critical users [Duplicate] [Duplicate]'], + key_as_string: 'critical users [Duplicate] [Duplicate]', + doc_count: 273, + hostsCountAggregation: { + value: 10, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 273, + }, + { + key: 'rule', + doc_count: 273, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 273, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'critical', + doc_count: 273, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 91, + }, + }, + { + key: ['high users [Duplicate]'], + key_as_string: 'high users [Duplicate]', + doc_count: 273, + hostsCountAggregation: { + value: 10, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 273, + }, + { + key: 'rule', + doc_count: 273, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 273, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'high', + doc_count: 273, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 91, + }, + }, + { + key: ['high users [Duplicate] [Duplicate]'], + key_as_string: 'high users [Duplicate] [Duplicate]', + doc_count: 273, + hostsCountAggregation: { + value: 10, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 273, + }, + { + key: 'rule', + doc_count: 273, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 273, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'high', + doc_count: 273, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 91, + }, + }, + { + key: ['low users [Duplicate]'], + key_as_string: 'low users [Duplicate]', + doc_count: 273, + hostsCountAggregation: { + value: 10, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 273, + }, + { + key: 'rule', + doc_count: 273, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 273, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'low', + doc_count: 273, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 91, + }, + }, + { + key: ['low users [Duplicate] [Duplicate]'], + key_as_string: 'low users [Duplicate] [Duplicate]', + doc_count: 273, + hostsCountAggregation: { + value: 10, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 273, + }, + { + key: 'rule', + doc_count: 273, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 273, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'low', + doc_count: 273, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 91, + }, + }, + { + key: ['medium users [Duplicate]'], + key_as_string: 'medium users [Duplicate]', + doc_count: 273, + hostsCountAggregation: { + value: 10, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 273, + }, + { + key: 'rule', + doc_count: 273, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 273, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'medium', + doc_count: 273, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 91, + }, + }, + { + key: ['medium users [Duplicate] [Duplicate]'], + key_as_string: 'medium users [Duplicate] [Duplicate]', + doc_count: 273, + hostsCountAggregation: { + value: 10, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 273, + }, + { + key: 'rule', + doc_count: 273, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 273, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'medium', + doc_count: 273, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 91, + }, + }, + { + key: ['critical hosts'], + key_as_string: 'critical hosts', + doc_count: 100, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 100, + }, + { + key: 'rule', + doc_count: 100, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 100, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'critical', + doc_count: 100, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['critical hosts [Duplicate] [Duplicate] [Duplicate]'], + key_as_string: 'critical hosts [Duplicate] [Duplicate] [Duplicate]', + doc_count: 100, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 100, + }, + { + key: 'rule', + doc_count: 100, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 100, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'critical', + doc_count: 100, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['high hosts'], + key_as_string: 'high hosts', + doc_count: 100, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 100, + }, + { + key: 'rule', + doc_count: 100, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 100, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'high', + doc_count: 100, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['high hosts [Duplicate] [Duplicate] [Duplicate]'], + key_as_string: 'high hosts [Duplicate] [Duplicate] [Duplicate]', + doc_count: 100, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 100, + }, + { + key: 'rule', + doc_count: 100, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 100, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'high', + doc_count: 100, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['low hosts '], + key_as_string: 'low hosts ', + doc_count: 100, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 100, + }, + { + key: 'rule', + doc_count: 100, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 100, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'low', + doc_count: 100, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['low hosts [Duplicate] [Duplicate] [Duplicate]'], + key_as_string: 'low hosts [Duplicate] [Duplicate] [Duplicate]', + doc_count: 100, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 100, + }, + { + key: 'rule', + doc_count: 100, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 100, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'low', + doc_count: 100, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['medium hosts'], + key_as_string: 'medium hosts', + doc_count: 100, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 100, + }, + { + key: 'rule', + doc_count: 100, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 100, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'medium', + doc_count: 100, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['medium hosts [Duplicate] [Duplicate] [Duplicate]'], + key_as_string: 'medium hosts [Duplicate] [Duplicate] [Duplicate]', + doc_count: 100, + hostsCountAggregation: { + value: 30, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 100, + }, + { + key: 'rule', + doc_count: 100, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 100, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'medium', + doc_count: 100, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 0, + }, + }, + { + key: ['critical users [Duplicate] [Duplicate] [Duplicate]'], + key_as_string: 'critical users [Duplicate] [Duplicate] [Duplicate]', + doc_count: 91, + hostsCountAggregation: { + value: 10, + }, + ruleTags: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'cool', + doc_count: 91, + }, + { + key: 'rule', + doc_count: 91, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 91, + }, + severitiesSubAggregation: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'critical', + doc_count: 91, + }, + ], + }, + countSeveritySubAggregation: { + value: 1, + }, + usersCountAggregation: { + value: 91, + }, + }, + ], + }, + description: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'f', + doc_count: 1, + }, + ], + }, + unitsCount: { + value: 6048, + }, + }, +}; diff --git a/packages/kbn-alerts-grouping/src/types.ts b/packages/kbn-alerts-grouping/src/types.ts new file mode 100644 index 0000000000000..8d226bb74e71f --- /dev/null +++ b/packages/kbn-alerts-grouping/src/types.ts @@ -0,0 +1,98 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { Filter, Query } from '@kbn/es-query'; +import { ValidFeatureId } from '@kbn/rule-data-utils'; +import type { NotificationsStart } from '@kbn/core-notifications-browser'; +import type { DataViewsServicePublic } from '@kbn/data-views-plugin/public/types'; +import type { HttpSetup } from '@kbn/core-http-browser'; +import { + GroupingProps, + GroupOption, + GroupPanelRenderer, + GetGroupStats, + NamedAggregation, +} from '@kbn/grouping/src'; +import { ReactElement } from 'react'; + +export interface GroupModel { + activeGroups: string[]; + options: Array<{ key: string; label: string }>; +} + +export interface AlertsGroupingState { + [groupingId: string]: GroupModel; +} + +export interface AlertsGroupingProps = {}> { + /** + * The leaf component that will be rendered in the grouping panels + */ + children: (groupingFilters: Filter[]) => ReactElement; + /** + * Render function for the group panel header + */ + renderGroupPanel?: GroupPanelRenderer; + /** + * A function that given the current grouping field and aggregation results, returns an array of + * stat items to be rendered in the group panel + */ + getGroupStats?: GetGroupStats; + /** + * Default search filters + */ + defaultFilters?: Filter[]; + /** + * Global search filters + */ + globalFilters: Filter[]; + /** + * Items that will be rendered in the `Take Actions` menu + */ + takeActionItems?: GroupingProps['takeActionItems']; + /** + * The default fields available for grouping + */ + defaultGroupingOptions: GroupOption[]; + /** + * The alerting feature ids this grouping covers + */ + featureIds: ValidFeatureId[]; + /** + * Time filter start + */ + from: string; + /** + * Time filter end + */ + to: string; + /** + * Global search query (i.e. from the KQL bar) + */ + globalQuery: Query; + /** + * External loading state + */ + loading?: boolean; + /** + * ID used to retrieve the current grouping configuration from the state + */ + groupingId: string; + /** + * Resolves an array of aggregations for a given grouping field + */ + getAggregationsByGroupingField: (field: string) => NamedAggregation[]; + /** + * Services required for the grouping component + */ + services: { + notifications: NotificationsStart; + dataViews: DataViewsServicePublic; + http: HttpSetup; + }; +} diff --git a/packages/kbn-alerts-grouping/tsconfig.json b/packages/kbn-alerts-grouping/tsconfig.json new file mode 100644 index 0000000000000..04b795b97c890 --- /dev/null +++ b/packages/kbn-alerts-grouping/tsconfig.json @@ -0,0 +1,28 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/es-query", + "@kbn/grouping", + "@kbn/i18n", + "@kbn/alerts-ui-shared", + "@kbn/rule-data-utils", + "@kbn/core-notifications-browser", + "@kbn/data-views-plugin", + "@kbn/core-http-browser", + "@kbn/i18n-react", + ] +} diff --git a/packages/kbn-alerts-ui-shared/index.ts b/packages/kbn-alerts-ui-shared/index.ts index a93fbd476165b..8fbffe5926ad8 100644 --- a/packages/kbn-alerts-ui-shared/index.ts +++ b/packages/kbn-alerts-ui-shared/index.ts @@ -11,8 +11,7 @@ export type { AlertLifecycleStatusBadgeProps } from './src/alert_lifecycle_statu export { MaintenanceWindowCallout } from './src/maintenance_window_callout'; export { AddMessageVariables } from './src/add_message_variables'; -export * from './src/alerts_search_bar/hooks'; -export * from './src/alerts_search_bar/apis'; +export * from './src/common/hooks'; export { AlertsSearchBar } from './src/alerts_search_bar'; export type { AlertsSearchBarProps } from './src/alerts_search_bar/types'; diff --git a/packages/kbn-alerts-ui-shared/src/alerts_search_bar/constants.ts b/packages/kbn-alerts-ui-shared/src/alerts_search_bar/constants.ts index c81588af58bf9..1d8e3b72708b5 100644 --- a/packages/kbn-alerts-ui-shared/src/alerts_search_bar/constants.ts +++ b/packages/kbn-alerts-ui-shared/src/alerts_search_bar/constants.ts @@ -6,8 +6,7 @@ * Side Public License, v 1. */ -import type { DataView, DataViewField } from '@kbn/data-views-plugin/common'; +import type { DataView } from '@kbn/data-views-plugin/common'; export const NO_INDEX_PATTERNS: DataView[] = []; -export const EMPTY_AAD_FIELDS: DataViewField[] = []; export * from '../common/constants'; diff --git a/packages/kbn-alerts-ui-shared/src/alerts_search_bar/index.tsx b/packages/kbn-alerts-ui-shared/src/alerts_search_bar/index.tsx index 13bca396cb401..9a095200a8506 100644 --- a/packages/kbn-alerts-ui-shared/src/alerts_search_bar/index.tsx +++ b/packages/kbn-alerts-ui-shared/src/alerts_search_bar/index.tsx @@ -13,9 +13,7 @@ import { AlertConsumers } from '@kbn/rule-data-utils'; import { NO_INDEX_PATTERNS } from './constants'; import { SEARCH_BAR_PLACEHOLDER } from './translations'; import type { AlertsSearchBarProps, QueryLanguageType } from './types'; -import { useLoadRuleTypesQuery } from '../common/hooks/use_load_rule_types_query'; -import { useAlertDataView } from './hooks/use_alert_data_view'; -import { useRuleAADFields } from './hooks/use_rule_aad_fields'; +import { useLoadRuleTypesQuery, useAlertDataView, useRuleAADFields } from '../common/hooks'; const SA_ALERTS = { type: 'alerts', fields: {} } as SuggestionsAbstraction; diff --git a/packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_aad_fields.ts b/packages/kbn-alerts-ui-shared/src/common/apis/fetch_aad_fields.ts similarity index 100% rename from packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_aad_fields.ts rename to packages/kbn-alerts-ui-shared/src/common/apis/fetch_aad_fields.ts diff --git a/packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_alert_fields.ts b/packages/kbn-alerts-ui-shared/src/common/apis/fetch_alert_fields.ts similarity index 100% rename from packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_alert_fields.ts rename to packages/kbn-alerts-ui-shared/src/common/apis/fetch_alert_fields.ts diff --git a/packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_alert_index_names.ts b/packages/kbn-alerts-ui-shared/src/common/apis/fetch_alert_index_names.ts similarity index 100% rename from packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/fetch_alert_index_names.ts rename to packages/kbn-alerts-ui-shared/src/common/apis/fetch_alert_index_names.ts diff --git a/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.test.ts b/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.test.ts index 28a0c39c998df..7cb64b51427e0 100644 --- a/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.test.ts +++ b/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.test.ts @@ -114,13 +114,9 @@ describe('updateRule', () => { }, ], }); - expect(http.put.mock.calls[0]).toMatchInlineSnapshot(` - Array [ - "/api/alerting/rule/12%2F3", - Object { - "body": "{\\"name\\":\\"test\\",\\"tags\\":[\\"foo\\"],\\"schedule\\":{\\"interval\\":\\"1m\\"},\\"params\\":{},\\"actions\\":[],\\"alert_delay\\":{\\"active\\":10}}", - }, - ] - `); + + expect(http.put).toHaveBeenCalledWith('/api/alerting/rule/12%2F3', { + body: '{"name":"test","tags":["foo"],"schedule":{"interval":"1m"},"params":{},"actions":[{"group":"default","id":"2","params":{},"frequency":{"notify_when":"onActionGroupChange","throttle":null,"summary":false},"use_alert_data_for_template":false},{"id":".test-system-action","params":{}}],"alert_delay":{"active":10}}', + }); }); }); diff --git a/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.ts b/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.ts index 7d9dbf71211ee..841778eaa52ee 100644 --- a/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.ts +++ b/packages/kbn-alerts-ui-shared/src/common/apis/update_rule/update_rule.ts @@ -44,7 +44,7 @@ export async function updateRule({ const res = await http.put>( `${BASE_ALERTING_API_PATH}/rule/${encodeURIComponent(id)}`, { - body: JSON.stringify(transformUpdateRuleBody(pick(rule, UPDATE_FIELDS))), + body: JSON.stringify(transformUpdateRuleBody(pick(rule, UPDATE_FIELDS_WITH_ACTIONS))), } ); return transformRule(res); diff --git a/packages/kbn-alerts-ui-shared/src/common/constants.ts b/packages/kbn-alerts-ui-shared/src/common/constants.ts index fcbf498988a66..ccc59f18d299c 100644 --- a/packages/kbn-alerts-ui-shared/src/common/constants.ts +++ b/packages/kbn-alerts-ui-shared/src/common/constants.ts @@ -6,8 +6,11 @@ * Side Public License, v 1. */ +import type { DataViewField } from '@kbn/data-views-plugin/common'; + export const ALERTS_FEATURE_ID = 'alerts'; export const BASE_ALERTING_API_PATH = '/api/alerting'; export const INTERNAL_BASE_ALERTING_API_PATH = '/internal/alerting'; export const BASE_RAC_ALERTS_API_PATH = '/internal/rac/alerts'; +export const EMPTY_AAD_FIELDS: DataViewField[] = []; export const BASE_TRIGGERS_ACTIONS_UI_API_PATH = '/internal/triggers_actions_ui'; diff --git a/packages/kbn-alerts-ui-shared/src/common/hooks/index.ts b/packages/kbn-alerts-ui-shared/src/common/hooks/index.ts index dc59bf57610b3..614b14515f511 100644 --- a/packages/kbn-alerts-ui-shared/src/common/hooks/index.ts +++ b/packages/kbn-alerts-ui-shared/src/common/hooks/index.ts @@ -6,7 +6,10 @@ * Side Public License, v 1. */ +export * from './use_alert_data_view'; +export * from './use_find_alerts_query'; export * from './use_load_rule_types_query'; +export * from './use_rule_aad_fields'; export * from './use_load_ui_config'; export * from './use_health_check'; export * from './use_load_ui_health'; @@ -14,3 +17,4 @@ export * from './use_load_alerting_framework_health'; export * from './use_create_rule'; export * from './use_update_rule'; export * from './use_resolve_rule'; +export * from './use_get_alerts_group_aggregations_query'; diff --git a/packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_alert_data_view.ts b/packages/kbn-alerts-ui-shared/src/common/hooks/use_alert_data_view.ts similarity index 98% rename from packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_alert_data_view.ts rename to packages/kbn-alerts-ui-shared/src/common/hooks/use_alert_data_view.ts index 47e1456158826..8c76671819b25 100644 --- a/packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_alert_data_view.ts +++ b/packages/kbn-alerts-ui-shared/src/common/hooks/use_alert_data_view.ts @@ -67,6 +67,7 @@ export function useAlertDataView(props: UseAlertDataViewProps): UseAlertDataView queryFn: queryIndexNameFn, onError: onErrorFn, refetchOnWindowFocus: false, + staleTime: 60 * 1000, // To prevent duplicated requests enabled: featureIds.length > 0 && !hasSecurityAndO11yFeatureIds, }); @@ -80,6 +81,7 @@ export function useAlertDataView(props: UseAlertDataViewProps): UseAlertDataView queryFn: queryAlertFieldsFn, onError: onErrorFn, refetchOnWindowFocus: false, + staleTime: 60 * 1000, enabled: hasNoSecuritySolution, }); diff --git a/packages/kbn-alerts-ui-shared/src/common/hooks/use_find_alerts_query.ts b/packages/kbn-alerts-ui-shared/src/common/hooks/use_find_alerts_query.ts new file mode 100644 index 0000000000000..a0d1b68458e04 --- /dev/null +++ b/packages/kbn-alerts-ui-shared/src/common/hooks/use_find_alerts_query.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 { i18n } from '@kbn/i18n'; +import { useQuery } from '@tanstack/react-query'; +import type { HttpStart } from '@kbn/core-http-browser'; +import type { ToastsStart } from '@kbn/core-notifications-browser'; +import { ISearchRequestParams } from '@kbn/search-types'; +import { SearchResponseBody } from '@elastic/elasticsearch/lib/api/types'; +import { BASE_RAC_ALERTS_API_PATH } from '../constants'; + +export interface UseFindAlertsQueryProps { + http: HttpStart; + toasts: ToastsStart; + enabled?: boolean; + params: ISearchRequestParams & { feature_ids?: string[] }; +} + +/** + * A generic hook to find alerts + * + * Still applies alerts authorization rules but, unlike triggers_actions_ui's `useFetchAlerts` hook, + * allows to perform arbitrary queries + */ +export const useFindAlertsQuery = ({ + http, + toasts, + enabled = true, + params, +}: UseFindAlertsQueryProps) => { + const onErrorFn = (error: Error) => { + if (error) { + toasts.addDanger( + i18n.translate('alertsUIShared.hooks.useFindAlertsQuery.unableToFindAlertsQueryMessage', { + defaultMessage: 'Unable to find alerts', + }) + ); + } + }; + + return useQuery({ + queryKey: ['findAlerts', JSON.stringify(params)], + queryFn: () => + http.post>(`${BASE_RAC_ALERTS_API_PATH}/find`, { + body: JSON.stringify(params), + }), + onError: onErrorFn, + refetchOnWindowFocus: false, + enabled, + }); +}; diff --git a/packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.test.tsx b/packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.test.tsx new file mode 100644 index 0000000000000..f4566ffed2e45 --- /dev/null +++ b/packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.test.tsx @@ -0,0 +1,89 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { renderHook } from '@testing-library/react-hooks/dom'; +import type { HttpStart } from '@kbn/core-http-browser'; +import { ToastsStart } from '@kbn/core-notifications-browser'; +import { AlertConsumers } from '@kbn/rule-data-utils'; + +import { useGetAlertsGroupAggregationsQuery } from './use_get_alerts_group_aggregations_query'; +import { waitFor } from '@testing-library/react'; +import { BASE_RAC_ALERTS_API_PATH } from '../constants'; + +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: false, + }, + }, +}); + +const wrapper = ({ children }: { children: Node }) => ( + {children} +); + +const mockHttp = { + post: jest.fn(), +}; +const http = mockHttp as unknown as HttpStart; + +const mockToasts = { + addDanger: jest.fn(), +}; +const toasts = mockToasts as unknown as ToastsStart; + +const params = { + featureIds: [AlertConsumers.STACK_ALERTS], + groupByField: 'kibana.alert.rule.name', +}; + +describe('useAlertsGroupAggregationsQuery', () => { + afterEach(() => { + jest.clearAllMocks(); + }); + + test('displays toast on errors', async () => { + mockHttp.post.mockRejectedValue(new Error('An error occurred')); + renderHook( + () => + useGetAlertsGroupAggregationsQuery({ + params, + enabled: true, + toasts, + http, + }), + { wrapper } + ); + + await waitFor(() => expect(mockToasts.addDanger).toHaveBeenCalled()); + }); + + test('calls API endpoint with the correct body', async () => { + renderHook( + () => + useGetAlertsGroupAggregationsQuery({ + params, + enabled: true, + toasts, + http, + }), + { wrapper } + ); + + await waitFor(() => + expect(mockHttp.post).toHaveBeenLastCalledWith( + `${BASE_RAC_ALERTS_API_PATH}/_group_aggregations`, + { + body: JSON.stringify(params), + } + ) + ); + }); +}); diff --git a/packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.ts b/packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.ts new file mode 100644 index 0000000000000..eab5b9ac510fa --- /dev/null +++ b/packages/kbn-alerts-ui-shared/src/common/hooks/use_get_alerts_group_aggregations_query.ts @@ -0,0 +1,80 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import { useQuery } from '@tanstack/react-query'; +import type { HttpStart } from '@kbn/core-http-browser'; +import type { ToastsStart } from '@kbn/core-notifications-browser'; +import { SearchResponseBody } from '@elastic/elasticsearch/lib/api/types'; +import { AlertConsumers } from '@kbn/rule-data-utils'; +import type { + AggregationsAggregationContainer, + QueryDslQueryContainer, + SortCombinations, +} from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { BASE_RAC_ALERTS_API_PATH } from '../constants'; + +export interface UseGetAlertsGroupAggregationsQueryProps { + http: HttpStart; + toasts: ToastsStart; + enabled?: boolean; + params: { + featureIds: AlertConsumers[]; + groupByField: string; + aggregations?: Record; + filters?: QueryDslQueryContainer[]; + sort?: SortCombinations[]; + pageIndex?: number; + pageSize?: number; + }; +} + +/** + * Fetches alerts aggregations for a given groupByField. + * + * Some default aggregations are applied: + * - `groupByFields`, to get the buckets based on the provided grouping field, + * - `unitsCount`, to count the number of alerts in each bucket, + * - `unitsCount`, to count the total number of alerts targeted by the query, + * - `groupsCount`, to count the total number of groups. + * + * The provided `aggregations` are applied within `groupByFields`. Here the `groupByField` runtime + * field can be used to perform grouping-based aggregations. + * + * Applies alerting RBAC through featureIds. + */ +export const useGetAlertsGroupAggregationsQuery = ({ + http, + toasts, + enabled = true, + params, +}: UseGetAlertsGroupAggregationsQueryProps) => { + const onErrorFn = (error: Error) => { + if (error) { + toasts.addDanger( + i18n.translate( + 'alertsUIShared.hooks.useFindAlertsQuery.unableToFetchAlertsGroupingAggregations', + { + defaultMessage: 'Unable to fetch alerts grouping aggregations', + } + ) + ); + } + }; + + return useQuery({ + queryKey: ['getAlertsGroupAggregations', JSON.stringify(params)], + queryFn: () => + http.post>(`${BASE_RAC_ALERTS_API_PATH}/_group_aggregations`, { + body: JSON.stringify(params), + }), + onError: onErrorFn, + refetchOnWindowFocus: false, + enabled, + }); +}; diff --git a/packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_rule_aad_fields.ts b/packages/kbn-alerts-ui-shared/src/common/hooks/use_rule_aad_fields.ts similarity index 100% rename from packages/kbn-alerts-ui-shared/src/alerts_search_bar/hooks/use_rule_aad_fields.ts rename to packages/kbn-alerts-ui-shared/src/common/hooks/use_rule_aad_fields.ts diff --git a/packages/kbn-alerts-ui-shared/tsconfig.json b/packages/kbn-alerts-ui-shared/tsconfig.json index 8edc3ff6eda78..7fe9d16ad314e 100644 --- a/packages/kbn-alerts-ui-shared/tsconfig.json +++ b/packages/kbn-alerts-ui-shared/tsconfig.json @@ -37,6 +37,7 @@ "@kbn/core-doc-links-browser", "@kbn/charts-plugin", "@kbn/data-plugin", + "@kbn/search-types", "@kbn/utility-types", "@kbn/core-application-browser", "@kbn/react-kibana-mount", diff --git a/packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts b/packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts index 489221eea3d7a..4e7ab744d8ecd 100644 --- a/packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts +++ b/packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts @@ -14,6 +14,7 @@ export type LogDocument = Fields & 'input.type': string; 'log.file.path'?: string; 'service.name'?: string; + 'service.environment'?: string; 'data_stream.namespace': string; 'data_stream.type': string; 'data_stream.dataset': string; diff --git a/packages/kbn-check-mappings-update-cli/current_fields.json b/packages/kbn-check-mappings-update-cli/current_fields.json index e0f2ae0f4f4ba..59cd87288e8ec 100644 --- a/packages/kbn-check-mappings-update-cli/current_fields.json +++ b/packages/kbn-check-mappings-update-cli/current_fields.json @@ -301,7 +301,8 @@ "metrics", "name", "staticFields", - "type" + "type", + "version" ], "entity-discovery-api-key": [ "apiKey" @@ -1029,6 +1030,13 @@ "createDate", "slug" ], + "usage-counter": [ + "count", + "counterName", + "counterType", + "domainId", + "source" + ], "usage-counters": [ "domainId" ], diff --git a/packages/kbn-check-mappings-update-cli/current_mappings.json b/packages/kbn-check-mappings-update-cli/current_mappings.json index 778ed3c37992c..47602ca181b5e 100644 --- a/packages/kbn-check-mappings-update-cli/current_mappings.json +++ b/packages/kbn-check-mappings-update-cli/current_mappings.json @@ -1028,6 +1028,9 @@ }, "type": { "type": "keyword" + }, + "version": { + "type": "keyword" } } }, @@ -3407,6 +3410,26 @@ } } }, + "usage-counter": { + "dynamic": false, + "properties": { + "count": { + "type": "integer" + }, + "counterName": { + "type": "keyword" + }, + "counterType": { + "type": "keyword" + }, + "domainId": { + "type": "keyword" + }, + "source": { + "type": "keyword" + } + } + }, "usage-counters": { "dynamic": false, "properties": { diff --git a/packages/kbn-cli-dev-mode/src/log_adapter.ts b/packages/kbn-cli-dev-mode/src/log_adapter.ts index 58260939a6dae..eb76594036fca 100644 --- a/packages/kbn-cli-dev-mode/src/log_adapter.ts +++ b/packages/kbn-cli-dev-mode/src/log_adapter.ts @@ -10,8 +10,12 @@ import { Logger } from '@kbn/logging'; import { Log } from './log'; export const convertToLogger = (cliLog: Log): Logger => { - const getErrorMessage = (msgOrError: string | Error): string => { - return typeof msgOrError === 'string' ? msgOrError : msgOrError.message; + const getErrorMessage = (msgOrError: string | (() => string) | Error): string => { + return typeof msgOrError === 'function' + ? msgOrError() + : typeof msgOrError === 'string' + ? msgOrError + : msgOrError.message; }; const adapter: Logger = { diff --git a/packages/kbn-config-schema/README.md b/packages/kbn-config-schema/README.md index 10d96578d4689..2074ab7698e63 100644 --- a/packages/kbn-config-schema/README.md +++ b/packages/kbn-config-schema/README.md @@ -138,6 +138,7 @@ __Options:__ * `validate: (value: number) => string | void` - defines a custom validator function, see [Custom validation](#custom-validation) section for more details. * `min: number` - defines a minimum value the number should have. * `max: number` - defines a maximum value the number should have. + * `unsafe: boolean` - if true, will accept unsafe numbers (integers > 2^53). __Usage:__ ```typescript @@ -460,8 +461,12 @@ const valueSchema = schema.duration({ defaultValue: '70ms' }); ``` __Notes:__ -* The string value for `schema.duration()` supports the following optional suffixes: `ms`, `s`, `m`, `h`, `d`, `w`, `M` and `Y`. The default suffix is `ms`. +* The string value for `schema.duration()` supports the following optional suffixes: `ms`, `s`, `m`, `h`, `d`, `w`, `M` and `y`. The default suffix is `ms`. * The number value is treated as a number of milliseconds and hence should be a positive integer, e.g. `100` is equal to `'100ms'`. +* Multi-unit duration strings are supported (`1m30s`). + * Spaces are not allowed. + * It allows any order in the units (`1m30s1d`). + * It allows the same unit to be specified multiple times (`1m30s50m` is the same as `51m30s`). #### `schema.conditional()` diff --git a/packages/kbn-config-schema/src/duration/index.ts b/packages/kbn-config-schema/src/duration/index.ts index 1b1d47a24abd3..5111a603bfbdc 100644 --- a/packages/kbn-config-schema/src/duration/index.ts +++ b/packages/kbn-config-schema/src/duration/index.ts @@ -6,29 +6,36 @@ * Side Public License, v 1. */ -import { Duration, duration as momentDuration, DurationInputArg2, isDuration } from 'moment'; +import { Duration, duration as momentDuration, isDuration } from 'moment'; export type { Duration }; export { isDuration }; -const timeFormatRegex = /^(0|[1-9][0-9]*)(ms|s|m|h|d|w|M|Y)$/; +const timeFormatRegex = /^(0|[1-9][0-9]*)(ms|s|m|h|d|w|M|y|Y)(.*)$/; +type TimeUnitString = 'ms' | 's' | 'm' | 'h' | 'd' | 'w' | 'M' | 'y' | 'Y'; // Moment officially supports lowercased 'y', but keeping 'Y' for BWC -function stringToDuration(text: string) { +function stringToDuration(text: string): Duration { const result = timeFormatRegex.exec(text); if (!result) { const number = Number(text); if (typeof number !== 'number' || isNaN(number)) { throw new Error( `Failed to parse value as time value. Value must be a duration in milliseconds, or follow the format ` + - `[ms|s|m|h|d|w|M|Y] (e.g. '70ms', '5s', '3d', '1Y'), where the duration is a safe positive integer.` + `[ms|s|m|h|d|w|M|y] (e.g. '70ms', '5s', '3d', '1y', '1m30s'), where the duration is a safe positive integer.` ); } return numberToDuration(number); } const count = parseInt(result[1], 10); - const unit = result[2] as DurationInputArg2; + const unit = result[2] as TimeUnitString; + const rest = result[3]; - return momentDuration(count, unit); + const duration = momentDuration(count, unit as Exclude); // Moment still supports capital 'Y', but officially (and type-wise), it doesn't. + + if (rest) { + return duration.add(stringToDuration(rest)); + } + return duration; } function numberToDuration(numberMs: number) { diff --git a/packages/kbn-config-schema/src/types/duration_type.test.ts b/packages/kbn-config-schema/src/types/duration_type.test.ts index 18327b65cd1f6..779962b6354b8 100644 --- a/packages/kbn-config-schema/src/types/duration_type.test.ts +++ b/packages/kbn-config-schema/src/types/duration_type.test.ts @@ -24,6 +24,22 @@ test('handles number', () => { expect(duration().validate(123000)).toEqual(momentDuration(123000)); }); +test('handles multi-unit', () => { + expect(duration().validate('1m30s')).toEqual(momentDuration(90000)); + expect(duration().validate('1m30s70ms')).toEqual(momentDuration(90070)); +}); + +test.each([60000, '60000', '60000ms', '60s', '1m', '1m0s'])( + 'multiple ways of introducing 1 minute: %p', + (d) => { + expect(duration().validate(d)).toEqual(momentDuration(60000)); + } +); + +test('it supports years as Y and y', () => { + expect(duration().validate('1y')).toEqual(duration().validate('1Y')); +}); + test('is required by default', () => { expect(() => duration().validate(undefined)).toThrowErrorMatchingInlineSnapshot( `"expected value of type [moment.Duration] but got [undefined]"` @@ -184,10 +200,10 @@ test('returns error when not valid string or non-safe positive integer', () => { ); expect(() => duration().validate('123foo')).toThrowErrorMatchingInlineSnapshot( - `"Failed to parse value as time value. Value must be a duration in milliseconds, or follow the format [ms|s|m|h|d|w|M|Y] (e.g. '70ms', '5s', '3d', '1Y'), where the duration is a safe positive integer."` + `"Failed to parse value as time value. Value must be a duration in milliseconds, or follow the format [ms|s|m|h|d|w|M|y] (e.g. '70ms', '5s', '3d', '1y', '1m30s'), where the duration is a safe positive integer."` ); expect(() => duration().validate('123 456')).toThrowErrorMatchingInlineSnapshot( - `"Failed to parse value as time value. Value must be a duration in milliseconds, or follow the format [ms|s|m|h|d|w|M|Y] (e.g. '70ms', '5s', '3d', '1Y'), where the duration is a safe positive integer."` + `"Failed to parse value as time value. Value must be a duration in milliseconds, or follow the format [ms|s|m|h|d|w|M|y] (e.g. '70ms', '5s', '3d', '1y', '1m30s'), where the duration is a safe positive integer."` ); }); diff --git a/packages/kbn-config-schema/src/types/number_type.test.ts b/packages/kbn-config-schema/src/types/number_type.test.ts index 3077d41d29cc5..0e1fcdd1dc028 100644 --- a/packages/kbn-config-schema/src/types/number_type.test.ts +++ b/packages/kbn-config-schema/src/types/number_type.test.ts @@ -64,6 +64,26 @@ describe('#max', () => { }); }); +describe('#unsafe', () => { + it('rejects unsafe numbers when undefined', () => { + expect(() => schema.number().validate(9007199254740992)).toThrowErrorMatchingInlineSnapshot( + `"\\"value\\" must be a safe number"` + ); + }); + + it('rejects unsafe numbers when false', () => { + expect(() => + schema.number({ unsafe: false }).validate(9007199254740992) + ).toThrowErrorMatchingInlineSnapshot(`"\\"value\\" must be a safe number"`); + }); + + it('accepts unsafe numbers when true', () => { + expect(schema.number({ unsafe: true }).validate(9007199254740992)).toBeGreaterThan( + 9007199254740991 + ); + }); +}); + describe('#defaultValue', () => { test('returns default when number is undefined', () => { expect(schema.number({ defaultValue: 2 }).validate(undefined)).toBe(2); diff --git a/packages/kbn-config-schema/src/types/number_type.ts b/packages/kbn-config-schema/src/types/number_type.ts index 6b86fe7e7fc71..195e3916feb96 100644 --- a/packages/kbn-config-schema/src/types/number_type.ts +++ b/packages/kbn-config-schema/src/types/number_type.ts @@ -13,6 +13,12 @@ import { Type, TypeOptions } from './type'; export type NumberOptions = TypeOptions & { min?: number; max?: number; + /** + * When set to true, will accept unsafe numbers (integers > 2^53). + * Otherwise, unsafe numbers will fail validation. + * Default: `false` + */ + unsafe?: boolean; }; export class NumberType extends Type { @@ -21,10 +27,12 @@ export class NumberType extends Type { if (options.min !== undefined) { schema = schema.min(options.min); } - if (options.max !== undefined) { schema = schema.max(options.max); } + if (options.unsafe === true) { + schema = schema.unsafe(true); + } super(schema, options); } diff --git a/packages/kbn-crypto-browser/BUILD.bazel b/packages/kbn-crypto-browser/BUILD.bazel new file mode 100644 index 0000000000000..c959d62ffde68 --- /dev/null +++ b/packages/kbn-crypto-browser/BUILD.bazel @@ -0,0 +1,32 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") + +SRCS = glob( + [ + "**/*.ts", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +BUNDLER_DEPS = [ + "@npm//tslib", +] + +js_library( + name = "kbn-crypto-browser", + package_name = "@kbn/crypto-browser", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-data-view-utils/index.ts b/packages/kbn-data-view-utils/index.ts index 1c881dbdacf79..ad783bc163c59 100644 --- a/packages/kbn-data-view-utils/index.ts +++ b/packages/kbn-data-view-utils/index.ts @@ -7,6 +7,6 @@ */ export * from './src/constants'; - +export { convertDatatableColumnToDataViewFieldSpec } from './src/utils/convert_to_data_view_field_spec'; export { createRegExpPatternFrom } from './src/utils/create_regexp_pattern_from'; export { testPatternAgainstAllowedList } from './src/utils/test_pattern_against_allowed_list'; diff --git a/packages/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.test.ts b/packages/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.test.ts new file mode 100644 index 0000000000000..94dce4a6a60da --- /dev/null +++ b/packages/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.test.ts @@ -0,0 +1,60 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { DatatableColumnType } from '@kbn/expressions-plugin/common'; +import { convertDatatableColumnToDataViewFieldSpec } from './convert_to_data_view_field_spec'; + +describe('convertDatatableColumnToDataViewFieldSpec', () => { + it('should return a DataViewField object for a counter column', () => { + const column = { + id: 'bytes_counter', + name: 'bytes_counter', + meta: { + esType: 'counter_long', + type: 'number' as DatatableColumnType, + }, + isNull: false, + }; + const result = convertDatatableColumnToDataViewFieldSpec(column); + expect(result).toEqual( + expect.objectContaining({ + name: 'bytes_counter', + type: 'number', + esTypes: ['long'], + searchable: true, + aggregatable: false, + isNull: false, + timeSeriesMetric: 'counter', + }) + ); + }); + + it('should return a DataViewField object with timeSeriesMetric undefined if esType does not start with counter_', () => { + const column = { + id: 'test', + name: 'test', + meta: { + esType: 'keyword', + type: 'string' as DatatableColumnType, + }, + isNull: false, + }; + const result = convertDatatableColumnToDataViewFieldSpec(column); + expect(result.timeSeriesMetric).toBeUndefined(); + expect(result).toEqual( + expect.objectContaining({ + name: 'test', + type: 'string', + esTypes: ['keyword'], + searchable: true, + aggregatable: false, + isNull: false, + }) + ); + }); +}); diff --git a/packages/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.ts b/packages/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.ts new file mode 100644 index 0000000000000..7cc408a414ade --- /dev/null +++ b/packages/kbn-data-view-utils/src/utils/convert_to_data_view_field_spec.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { DatatableColumn } from '@kbn/expressions-plugin/common'; +import type { MappingTimeSeriesMetricType } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type { FieldSpec } from '@kbn/data-views-plugin/common'; + +/** + * Convert a datatable column to a DataViewFieldSpec + */ +export function convertDatatableColumnToDataViewFieldSpec(column: DatatableColumn): FieldSpec { + let esType = column.meta?.esType; + let timeSeriesMetric: MappingTimeSeriesMetricType | undefined; + + // 'counter_integer', 'counter_long', 'counter_double'... + if (esType?.startsWith('counter_')) { + esType = esType?.replace('counter_', ''); + timeSeriesMetric = 'counter'; + } + + // `DataViewField` class is defined in "data-views" plugin, so we can't create an instance of it from a package. + // We will return a data view field spec here instead then. + return { + name: column.name, + type: column.meta?.type ?? 'unknown', + esTypes: esType ? [esType] : undefined, + searchable: true, + aggregatable: false, + isNull: Boolean(column?.isNull), + ...(timeSeriesMetric ? { timeSeriesMetric } : {}), + }; +} diff --git a/packages/kbn-data-view-utils/tsconfig.json b/packages/kbn-data-view-utils/tsconfig.json index a41af0b7c5017..05400030e1001 100644 --- a/packages/kbn-data-view-utils/tsconfig.json +++ b/packages/kbn-data-view-utils/tsconfig.json @@ -14,5 +14,9 @@ ], "exclude": [ "target/**/*" + ], + "kbn_references": [ + "@kbn/data-views-plugin", + "@kbn/expressions-plugin", ] } diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/packages/kbn-doc-links/src/get_doc_links.ts index 951bdbb531d60..9b38a716a714c 100644 --- a/packages/kbn-doc-links/src/get_doc_links.ts +++ b/packages/kbn-doc-links/src/get_doc_links.ts @@ -462,6 +462,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D }, securitySolution: { artifactControl: `${SECURITY_SOLUTION_DOCS}artifact-control.html`, + avcResults: `${ELASTIC_WEBSITE_URL}blog/elastic-security-malware-protection-test-av-comparatives`, trustedApps: `${SECURITY_SOLUTION_DOCS}trusted-apps-ov.html`, eventFilters: `${SECURITY_SOLUTION_DOCS}event-filters.html`, blocklist: `${SECURITY_SOLUTION_DOCS}blocklist.html`, @@ -487,8 +488,6 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D ruleUiAdvancedParams: `${SECURITY_SOLUTION_DOCS}rules-ui-create.html#rule-ui-advanced-params`, entityAnalytics: { riskScorePrerequisites: `${SECURITY_SOLUTION_DOCS}ers-requirements.html`, - hostRiskScore: `${SECURITY_SOLUTION_DOCS}host-risk-score.html`, - userRiskScore: `${SECURITY_SOLUTION_DOCS}user-risk-score.html`, entityRiskScoring: `${SECURITY_SOLUTION_DOCS}entity-risk-scoring.html`, assetCriticality: `${SECURITY_SOLUTION_DOCS}asset-criticality.html`, }, @@ -521,6 +520,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D rollupSettings: `${KIBANA_DOCS}advanced-options.html#kibana-rollups-settings`, visualizationSettings: `${KIBANA_DOCS}advanced-options.html#kibana-visualization-settings`, timelionSettings: `${KIBANA_DOCS}advanced-options.html#kibana-timelion-settings`, + generalSettings: `${KIBANA_DOCS}advanced-options.html#kibana-general-settings`, savedObjectsApiList: `${KIBANA_DOCS}saved-objects-api.html#saved-objects-api`, }, ml: { diff --git a/packages/kbn-doc-links/src/types.ts b/packages/kbn-doc-links/src/types.ts index 7a296aac6d8ba..c6b1b753ce883 100644 --- a/packages/kbn-doc-links/src/types.ts +++ b/packages/kbn-doc-links/src/types.ts @@ -334,6 +334,7 @@ export interface DocLinks { }; readonly securitySolution: { readonly artifactControl: string; + readonly avcResults: string; readonly trustedApps: string; readonly eventFilters: string; readonly blocklist: string; @@ -359,8 +360,6 @@ export interface DocLinks { readonly ruleUiAdvancedParams: string; readonly entityAnalytics: { readonly riskScorePrerequisites: string; - readonly hostRiskScore: string; - readonly userRiskScore: string; readonly entityRiskScoring: string; readonly assetCriticality: string; }; diff --git a/packages/kbn-esql-ast/index.ts b/packages/kbn-esql-ast/index.ts index fc129c5c6fac3..6c8cd3c23e50b 100644 --- a/packages/kbn-esql-ast/index.ts +++ b/packages/kbn-esql-ast/index.ts @@ -22,6 +22,7 @@ export type { ESQLSource, ESQLColumn, ESQLLiteral, + ESQLParamLiteral, AstProviderFn, EditorError, ESQLAstNode, diff --git a/packages/kbn-esql-ast/src/__tests__/ast_parser.from.test.ts b/packages/kbn-esql-ast/src/__tests__/ast_parser.from.test.ts index 00559da4fff9c..a88b51f63ea16 100644 --- a/packages/kbn-esql-ast/src/__tests__/ast_parser.from.test.ts +++ b/packages/kbn-esql-ast/src/__tests__/ast_parser.from.test.ts @@ -60,6 +60,36 @@ describe('FROM', () => { ]); }); + it('can parse FROM query with single quote or triple quote', () => { + const text = '\tFROM "foo%" \t\t, """bar{{00-00}}""", \n baz'; + const { ast, errors } = parse(text); + + expect(errors.length).toBe(0); + expect(ast).toMatchObject([ + { + type: 'command', + name: 'from', + args: [ + { + type: 'source', + name: 'foo%', + sourceType: 'index', + }, + { + type: 'source', + name: 'bar{{00-00}}', + sourceType: 'index', + }, + { + type: 'source', + name: 'baz', + sourceType: 'index', + }, + ], + }, + ]); + }); + it('can parse FROM query with a single metadata column', () => { const text = 'from foo METADATA bar'; const { ast, errors } = parse(text); diff --git a/packages/kbn-esql-ast/src/antlr/esql_lexer.g4 b/packages/kbn-esql-ast/src/antlr/esql_lexer.g4 index d7a4b88e6d5c5..12a47a195dfda 100644 --- a/packages/kbn-esql-ast/src/antlr/esql_lexer.g4 +++ b/packages/kbn-esql-ast/src/antlr/esql_lexer.g4 @@ -44,13 +44,15 @@ WS : [ \r\n\t]+ -> channel(HIDDEN) ; -fragment INDEX_UNQUOTED_IDENTIFIER_PART - : ~[=`|,[\]/ \t\r\n] - | '/' ~[*/] // allow single / but not followed by another / or * which would start a comment +// in 8.14 ` were not allowed +// this has been relaxed in 8.15 since " is used for quoting +fragment UNQUOTED_SOURCE_PART + : ~[:"=|,[\]/ \t\r\n] + | '/' ~[*/] // allow single / but not followed by another / or * which would start a comment -- used in index pattern date spec ; -INDEX_UNQUOTED_IDENTIFIER - : INDEX_UNQUOTED_IDENTIFIER_PART+ +UNQUOTED_SOURCE + : UNQUOTED_SOURCE_PART+ ; // @@ -212,15 +214,13 @@ mode FROM_MODE; FROM_PIPE : PIPE -> type(PIPE), popMode; FROM_OPENING_BRACKET : OPENING_BRACKET -> type(OPENING_BRACKET); FROM_CLOSING_BRACKET : CLOSING_BRACKET -> type(CLOSING_BRACKET); +FROM_COLON : COLON -> type(COLON); FROM_COMMA : COMMA -> type(COMMA); FROM_ASSIGN : ASSIGN -> type(ASSIGN); -FROM_QUOTED_STRING : QUOTED_STRING -> type(QUOTED_STRING); - METADATA : 'metadata'; -FROM_INDEX_UNQUOTED_IDENTIFIER - : INDEX_UNQUOTED_IDENTIFIER -> type(INDEX_UNQUOTED_IDENTIFIER) - ; +FROM_UNQUOTED_SOURCE : UNQUOTED_SOURCE -> type(UNQUOTED_SOURCE); +FROM_QUOTED_SOURCE : QUOTED_STRING -> type(QUOTED_STRING); FROM_LINE_COMMENT : LINE_COMMENT -> channel(HIDDEN) @@ -311,10 +311,6 @@ ENRICH_POLICY_NAME : (ENRICH_POLICY_NAME_BODY+ COLON)? ENRICH_POLICY_NAME_BODY+ ; -ENRICH_QUOTED_IDENTIFIER - : QUOTED_IDENTIFIER -> type(QUOTED_IDENTIFIER) - ; - ENRICH_MODE_UNQUOTED_VALUE : ENRICH_POLICY_NAME -> type(ENRICH_POLICY_NAME) ; @@ -331,7 +327,7 @@ ENRICH_WS : WS -> channel(HIDDEN) ; -// submode for Enrich to allow different lexing between policy identifier (loose) and field identifiers +// submode for Enrich to allow different lexing between policy source (loose) and field identifiers mode ENRICH_FIELD_MODE; ENRICH_FIELD_PIPE : PIPE -> type(PIPE), popMode, popMode; ENRICH_FIELD_ASSIGN : ASSIGN -> type(ASSIGN); @@ -363,13 +359,13 @@ ENRICH_FIELD_WS // LOOKUP ON key mode LOOKUP_MODE; LOOKUP_PIPE : PIPE -> type(PIPE), popMode; +LOOKUP_COLON : COLON -> type(COLON); LOOKUP_COMMA : COMMA -> type(COMMA); LOOKUP_DOT: DOT -> type(DOT); LOOKUP_ON : ON -> type(ON), pushMode(LOOKUP_FIELD_MODE); -LOOKUP_INDEX_UNQUOTED_IDENTIFIER - : INDEX_UNQUOTED_IDENTIFIER -> type(INDEX_UNQUOTED_IDENTIFIER) - ; +LOOKUP_UNQUOTED_SOURCE: UNQUOTED_SOURCE -> type(UNQUOTED_SOURCE); +LOOKUP_QUOTED_SOURCE : QUOTED_STRING -> type(QUOTED_STRING); LOOKUP_LINE_COMMENT : LINE_COMMENT -> channel(HIDDEN) @@ -496,9 +492,8 @@ SETTING_WS mode METRICS_MODE; METRICS_PIPE : PIPE -> type(PIPE), popMode; -METRICS_INDEX_UNQUOTED_IDENTIFIER - : INDEX_UNQUOTED_IDENTIFIER -> type(INDEX_UNQUOTED_IDENTIFIER), popMode, pushMode(CLOSING_METRICS_MODE) - ; +METRICS_UNQUOTED_SOURCE: UNQUOTED_SOURCE -> type(UNQUOTED_SOURCE), popMode, pushMode(CLOSING_METRICS_MODE); +METRICS_QUOTED_SOURCE : QUOTED_STRING -> type(QUOTED_STRING), popMode, pushMode(CLOSING_METRICS_MODE); METRICS_LINE_COMMENT : LINE_COMMENT -> channel(HIDDEN) @@ -515,6 +510,10 @@ METRICS_WS // TODO: remove this workaround mode - see https://github.com/elastic/elasticsearch/issues/108528 mode CLOSING_METRICS_MODE; +CLOSING_METRICS_COLON + : COLON -> type(COLON), popMode, pushMode(METRICS_MODE) + ; + CLOSING_METRICS_COMMA : COMMA -> type(COMMA), popMode, pushMode(METRICS_MODE) ; diff --git a/packages/kbn-esql-ast/src/antlr/esql_lexer.interp b/packages/kbn-esql-ast/src/antlr/esql_lexer.interp index 911e1371fd129..f0826dc49df6e 100644 --- a/packages/kbn-esql-ast/src/antlr/esql_lexer.interp +++ b/packages/kbn-esql-ast/src/antlr/esql_lexer.interp @@ -151,7 +151,7 @@ UNKNOWN_CMD LINE_COMMENT MULTILINE_COMMENT WS -INDEX_UNQUOTED_IDENTIFIER +UNQUOTED_SOURCE EXPLAIN_WS EXPLAIN_LINE_COMMENT EXPLAIN_MULTILINE_COMMENT @@ -277,8 +277,8 @@ UNKNOWN_CMD LINE_COMMENT MULTILINE_COMMENT WS -INDEX_UNQUOTED_IDENTIFIER_PART -INDEX_UNQUOTED_IDENTIFIER +UNQUOTED_SOURCE_PART +UNQUOTED_SOURCE EXPLAIN_OPENING_BRACKET EXPLAIN_PIPE EXPLAIN_WS @@ -345,11 +345,12 @@ EXPR_WS FROM_PIPE FROM_OPENING_BRACKET FROM_CLOSING_BRACKET +FROM_COLON FROM_COMMA FROM_ASSIGN -FROM_QUOTED_STRING METADATA -FROM_INDEX_UNQUOTED_IDENTIFIER +FROM_UNQUOTED_SOURCE +FROM_QUOTED_SOURCE FROM_LINE_COMMENT FROM_MULTILINE_COMMENT FROM_WS @@ -377,7 +378,6 @@ ON WITH ENRICH_POLICY_NAME_BODY ENRICH_POLICY_NAME -ENRICH_QUOTED_IDENTIFIER ENRICH_MODE_UNQUOTED_VALUE ENRICH_LINE_COMMENT ENRICH_MULTILINE_COMMENT @@ -393,10 +393,12 @@ ENRICH_FIELD_LINE_COMMENT ENRICH_FIELD_MULTILINE_COMMENT ENRICH_FIELD_WS LOOKUP_PIPE +LOOKUP_COLON LOOKUP_COMMA LOOKUP_DOT LOOKUP_ON -LOOKUP_INDEX_UNQUOTED_IDENTIFIER +LOOKUP_UNQUOTED_SOURCE +LOOKUP_QUOTED_SOURCE LOOKUP_LINE_COMMENT LOOKUP_MULTILINE_COMMENT LOOKUP_WS @@ -431,10 +433,12 @@ SETTING_LINE_COMMENT SETTTING_MULTILINE_COMMENT SETTING_WS METRICS_PIPE -METRICS_INDEX_UNQUOTED_IDENTIFIER +METRICS_UNQUOTED_SOURCE +METRICS_QUOTED_SOURCE METRICS_LINE_COMMENT METRICS_MULTILINE_COMMENT METRICS_WS +CLOSING_METRICS_COLON CLOSING_METRICS_COMMA CLOSING_METRICS_LINE_COMMENT CLOSING_METRICS_MULTILINE_COMMENT @@ -467,4 +471,4 @@ METRICS_MODE CLOSING_METRICS_MODE atn: -[4, 0, 124, 1422, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, 7, 121, 2, 122, 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, 2, 126, 7, 126, 2, 127, 7, 127, 2, 128, 7, 128, 2, 129, 7, 129, 2, 130, 7, 130, 2, 131, 7, 131, 2, 132, 7, 132, 2, 133, 7, 133, 2, 134, 7, 134, 2, 135, 7, 135, 2, 136, 7, 136, 2, 137, 7, 137, 2, 138, 7, 138, 2, 139, 7, 139, 2, 140, 7, 140, 2, 141, 7, 141, 2, 142, 7, 142, 2, 143, 7, 143, 2, 144, 7, 144, 2, 145, 7, 145, 2, 146, 7, 146, 2, 147, 7, 147, 2, 148, 7, 148, 2, 149, 7, 149, 2, 150, 7, 150, 2, 151, 7, 151, 2, 152, 7, 152, 2, 153, 7, 153, 2, 154, 7, 154, 2, 155, 7, 155, 2, 156, 7, 156, 2, 157, 7, 157, 2, 158, 7, 158, 2, 159, 7, 159, 2, 160, 7, 160, 2, 161, 7, 161, 2, 162, 7, 162, 2, 163, 7, 163, 2, 164, 7, 164, 2, 165, 7, 165, 2, 166, 7, 166, 2, 167, 7, 167, 2, 168, 7, 168, 2, 169, 7, 169, 2, 170, 7, 170, 2, 171, 7, 171, 2, 172, 7, 172, 2, 173, 7, 173, 2, 174, 7, 174, 2, 175, 7, 175, 2, 176, 7, 176, 2, 177, 7, 177, 2, 178, 7, 178, 2, 179, 7, 179, 2, 180, 7, 180, 2, 181, 7, 181, 2, 182, 7, 182, 2, 183, 7, 183, 2, 184, 7, 184, 2, 185, 7, 185, 2, 186, 7, 186, 2, 187, 7, 187, 2, 188, 7, 188, 2, 189, 7, 189, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 4, 20, 567, 8, 20, 11, 20, 12, 20, 568, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 577, 8, 21, 10, 21, 12, 21, 580, 9, 21, 1, 21, 3, 21, 583, 8, 21, 1, 21, 3, 21, 586, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 5, 22, 595, 8, 22, 10, 22, 12, 22, 598, 9, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 4, 23, 606, 8, 23, 11, 23, 12, 23, 607, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 3, 24, 615, 8, 24, 1, 25, 4, 25, 618, 8, 25, 11, 25, 12, 25, 619, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 3, 36, 659, 8, 36, 1, 36, 4, 36, 662, 8, 36, 11, 36, 12, 36, 663, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 3, 39, 673, 8, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 3, 41, 680, 8, 41, 1, 42, 1, 42, 1, 42, 5, 42, 685, 8, 42, 10, 42, 12, 42, 688, 9, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 696, 8, 42, 10, 42, 12, 42, 699, 9, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 3, 42, 706, 8, 42, 1, 42, 3, 42, 709, 8, 42, 3, 42, 711, 8, 42, 1, 43, 4, 43, 714, 8, 43, 11, 43, 12, 43, 715, 1, 44, 4, 44, 719, 8, 44, 11, 44, 12, 44, 720, 1, 44, 1, 44, 5, 44, 725, 8, 44, 10, 44, 12, 44, 728, 9, 44, 1, 44, 1, 44, 4, 44, 732, 8, 44, 11, 44, 12, 44, 733, 1, 44, 4, 44, 737, 8, 44, 11, 44, 12, 44, 738, 1, 44, 1, 44, 5, 44, 743, 8, 44, 10, 44, 12, 44, 746, 9, 44, 3, 44, 748, 8, 44, 1, 44, 1, 44, 1, 44, 1, 44, 4, 44, 754, 8, 44, 11, 44, 12, 44, 755, 1, 44, 1, 44, 3, 44, 760, 8, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 76, 1, 76, 1, 77, 1, 77, 1, 78, 1, 78, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 5, 80, 882, 8, 80, 10, 80, 12, 80, 885, 9, 80, 1, 80, 1, 80, 4, 80, 889, 8, 80, 11, 80, 12, 80, 890, 3, 80, 893, 8, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 5, 83, 907, 8, 83, 10, 83, 12, 83, 910, 9, 83, 1, 83, 1, 83, 3, 83, 914, 8, 83, 1, 83, 4, 83, 917, 8, 83, 11, 83, 12, 83, 918, 3, 83, 921, 8, 83, 1, 84, 1, 84, 4, 84, 925, 8, 84, 11, 84, 12, 84, 926, 1, 84, 1, 84, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 3, 103, 1012, 8, 103, 1, 104, 1, 104, 3, 104, 1016, 8, 104, 1, 104, 5, 104, 1019, 8, 104, 10, 104, 12, 104, 1022, 9, 104, 1, 104, 1, 104, 3, 104, 1026, 8, 104, 1, 104, 4, 104, 1029, 8, 104, 11, 104, 12, 104, 1030, 3, 104, 1033, 8, 104, 1, 105, 1, 105, 4, 105, 1037, 8, 105, 11, 105, 12, 105, 1038, 1, 106, 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 123, 4, 123, 1114, 8, 123, 11, 123, 12, 123, 1115, 1, 123, 1, 123, 3, 123, 1120, 8, 123, 1, 123, 4, 123, 1123, 8, 123, 11, 123, 12, 123, 1124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 125, 1, 125, 1, 125, 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 128, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, 130, 1, 130, 1, 130, 1, 130, 1, 131, 1, 131, 1, 131, 1, 131, 1, 132, 1, 132, 1, 132, 1, 132, 1, 133, 1, 133, 1, 133, 1, 133, 1, 134, 1, 134, 1, 134, 1, 134, 1, 135, 1, 135, 1, 135, 1, 135, 1, 136, 1, 136, 1, 136, 1, 136, 1, 137, 1, 137, 1, 137, 1, 137, 1, 138, 1, 138, 1, 138, 1, 138, 1, 139, 1, 139, 1, 139, 1, 139, 1, 139, 1, 140, 1, 140, 1, 140, 1, 140, 1, 141, 1, 141, 1, 141, 1, 141, 1, 142, 1, 142, 1, 142, 1, 142, 1, 142, 1, 143, 1, 143, 1, 143, 1, 143, 1, 144, 1, 144, 1, 144, 1, 144, 1, 145, 1, 145, 1, 145, 1, 145, 1, 146, 1, 146, 1, 146, 1, 146, 1, 147, 1, 147, 1, 147, 1, 147, 1, 147, 1, 147, 1, 148, 1, 148, 1, 148, 1, 148, 1, 149, 1, 149, 1, 149, 1, 149, 1, 150, 1, 150, 1, 150, 1, 150, 1, 151, 1, 151, 1, 151, 1, 151, 1, 152, 1, 152, 1, 152, 1, 152, 1, 153, 1, 153, 1, 153, 1, 153, 1, 154, 1, 154, 1, 154, 1, 154, 1, 154, 1, 155, 1, 155, 1, 155, 1, 155, 1, 156, 1, 156, 1, 156, 1, 156, 1, 157, 1, 157, 1, 157, 1, 157, 1, 158, 1, 158, 1, 158, 1, 158, 1, 159, 1, 159, 1, 159, 1, 159, 1, 160, 1, 160, 1, 160, 1, 160, 1, 161, 1, 161, 1, 161, 1, 161, 1, 161, 1, 162, 1, 162, 1, 162, 1, 162, 1, 162, 1, 163, 1, 163, 1, 163, 1, 163, 1, 164, 1, 164, 1, 164, 1, 164, 1, 165, 1, 165, 1, 165, 1, 165, 1, 166, 1, 166, 1, 166, 1, 166, 1, 166, 1, 167, 1, 167, 1, 167, 1, 167, 1, 167, 1, 167, 1, 167, 1, 167, 1, 167, 1, 167, 1, 168, 1, 168, 1, 168, 1, 168, 1, 169, 1, 169, 1, 169, 1, 169, 1, 170, 1, 170, 1, 170, 1, 170, 1, 171, 1, 171, 1, 171, 1, 171, 1, 171, 1, 172, 1, 172, 1, 173, 1, 173, 1, 173, 1, 173, 1, 173, 4, 173, 1343, 8, 173, 11, 173, 12, 173, 1344, 1, 174, 1, 174, 1, 174, 1, 174, 1, 175, 1, 175, 1, 175, 1, 175, 1, 176, 1, 176, 1, 176, 1, 176, 1, 177, 1, 177, 1, 177, 1, 177, 1, 177, 1, 178, 1, 178, 1, 178, 1, 178, 1, 178, 1, 178, 1, 179, 1, 179, 1, 179, 1, 179, 1, 180, 1, 180, 1, 180, 1, 180, 1, 181, 1, 181, 1, 181, 1, 181, 1, 182, 1, 182, 1, 182, 1, 182, 1, 182, 1, 182, 1, 183, 1, 183, 1, 183, 1, 183, 1, 184, 1, 184, 1, 184, 1, 184, 1, 185, 1, 185, 1, 185, 1, 185, 1, 186, 1, 186, 1, 186, 1, 186, 1, 186, 1, 186, 1, 187, 1, 187, 1, 187, 1, 187, 1, 187, 1, 187, 1, 188, 1, 188, 1, 188, 1, 188, 1, 188, 1, 188, 1, 189, 1, 189, 1, 189, 1, 189, 1, 189, 2, 596, 697, 0, 190, 16, 1, 18, 2, 20, 3, 22, 4, 24, 5, 26, 6, 28, 7, 30, 8, 32, 9, 34, 10, 36, 11, 38, 12, 40, 13, 42, 14, 44, 15, 46, 16, 48, 17, 50, 18, 52, 19, 54, 20, 56, 21, 58, 22, 60, 23, 62, 24, 64, 0, 66, 25, 68, 0, 70, 0, 72, 26, 74, 27, 76, 28, 78, 29, 80, 0, 82, 0, 84, 0, 86, 0, 88, 0, 90, 0, 92, 0, 94, 0, 96, 0, 98, 0, 100, 30, 102, 31, 104, 32, 106, 33, 108, 34, 110, 35, 112, 36, 114, 37, 116, 38, 118, 39, 120, 40, 122, 41, 124, 42, 126, 43, 128, 44, 130, 45, 132, 46, 134, 47, 136, 48, 138, 49, 140, 50, 142, 51, 144, 52, 146, 53, 148, 54, 150, 55, 152, 56, 154, 57, 156, 58, 158, 59, 160, 60, 162, 61, 164, 62, 166, 63, 168, 64, 170, 65, 172, 66, 174, 67, 176, 68, 178, 69, 180, 70, 182, 71, 184, 0, 186, 72, 188, 73, 190, 74, 192, 75, 194, 0, 196, 0, 198, 0, 200, 0, 202, 0, 204, 0, 206, 76, 208, 0, 210, 77, 212, 78, 214, 79, 216, 0, 218, 0, 220, 0, 222, 0, 224, 0, 226, 80, 228, 81, 230, 82, 232, 83, 234, 0, 236, 0, 238, 0, 240, 0, 242, 84, 244, 0, 246, 85, 248, 86, 250, 87, 252, 0, 254, 0, 256, 88, 258, 89, 260, 0, 262, 90, 264, 0, 266, 0, 268, 91, 270, 92, 272, 93, 274, 0, 276, 0, 278, 0, 280, 0, 282, 0, 284, 0, 286, 0, 288, 94, 290, 95, 292, 96, 294, 0, 296, 0, 298, 0, 300, 0, 302, 0, 304, 97, 306, 98, 308, 99, 310, 0, 312, 0, 314, 0, 316, 0, 318, 100, 320, 101, 322, 102, 324, 0, 326, 0, 328, 0, 330, 0, 332, 103, 334, 104, 336, 105, 338, 0, 340, 106, 342, 107, 344, 108, 346, 109, 348, 0, 350, 110, 352, 111, 354, 112, 356, 113, 358, 0, 360, 114, 362, 115, 364, 116, 366, 117, 368, 118, 370, 0, 372, 0, 374, 119, 376, 120, 378, 121, 380, 0, 382, 122, 384, 123, 386, 124, 388, 0, 390, 0, 392, 0, 394, 0, 16, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 35, 2, 0, 68, 68, 100, 100, 2, 0, 73, 73, 105, 105, 2, 0, 83, 83, 115, 115, 2, 0, 69, 69, 101, 101, 2, 0, 67, 67, 99, 99, 2, 0, 84, 84, 116, 116, 2, 0, 82, 82, 114, 114, 2, 0, 79, 79, 111, 111, 2, 0, 80, 80, 112, 112, 2, 0, 78, 78, 110, 110, 2, 0, 72, 72, 104, 104, 2, 0, 86, 86, 118, 118, 2, 0, 65, 65, 97, 97, 2, 0, 76, 76, 108, 108, 2, 0, 88, 88, 120, 120, 2, 0, 70, 70, 102, 102, 2, 0, 77, 77, 109, 109, 2, 0, 71, 71, 103, 103, 2, 0, 75, 75, 107, 107, 2, 0, 85, 85, 117, 117, 2, 0, 87, 87, 119, 119, 6, 0, 9, 10, 13, 13, 32, 32, 47, 47, 91, 91, 93, 93, 2, 0, 10, 10, 13, 13, 3, 0, 9, 10, 13, 13, 32, 32, 10, 0, 9, 10, 13, 13, 32, 32, 44, 44, 47, 47, 61, 61, 91, 91, 93, 93, 96, 96, 124, 124, 2, 0, 42, 42, 47, 47, 1, 0, 48, 57, 2, 0, 65, 90, 97, 122, 8, 0, 34, 34, 78, 78, 82, 82, 84, 84, 92, 92, 110, 110, 114, 114, 116, 116, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 2, 0, 43, 43, 45, 45, 1, 0, 96, 96, 2, 0, 66, 66, 98, 98, 2, 0, 89, 89, 121, 121, 11, 0, 9, 10, 13, 13, 32, 32, 34, 35, 44, 44, 47, 47, 58, 58, 60, 60, 62, 63, 92, 92, 124, 124, 1448, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 1, 68, 1, 0, 0, 0, 1, 70, 1, 0, 0, 0, 1, 72, 1, 0, 0, 0, 1, 74, 1, 0, 0, 0, 1, 76, 1, 0, 0, 0, 2, 78, 1, 0, 0, 0, 2, 100, 1, 0, 0, 0, 2, 102, 1, 0, 0, 0, 2, 104, 1, 0, 0, 0, 2, 106, 1, 0, 0, 0, 2, 108, 1, 0, 0, 0, 2, 110, 1, 0, 0, 0, 2, 112, 1, 0, 0, 0, 2, 114, 1, 0, 0, 0, 2, 116, 1, 0, 0, 0, 2, 118, 1, 0, 0, 0, 2, 120, 1, 0, 0, 0, 2, 122, 1, 0, 0, 0, 2, 124, 1, 0, 0, 0, 2, 126, 1, 0, 0, 0, 2, 128, 1, 0, 0, 0, 2, 130, 1, 0, 0, 0, 2, 132, 1, 0, 0, 0, 2, 134, 1, 0, 0, 0, 2, 136, 1, 0, 0, 0, 2, 138, 1, 0, 0, 0, 2, 140, 1, 0, 0, 0, 2, 142, 1, 0, 0, 0, 2, 144, 1, 0, 0, 0, 2, 146, 1, 0, 0, 0, 2, 148, 1, 0, 0, 0, 2, 150, 1, 0, 0, 0, 2, 152, 1, 0, 0, 0, 2, 154, 1, 0, 0, 0, 2, 156, 1, 0, 0, 0, 2, 158, 1, 0, 0, 0, 2, 160, 1, 0, 0, 0, 2, 162, 1, 0, 0, 0, 2, 164, 1, 0, 0, 0, 2, 166, 1, 0, 0, 0, 2, 168, 1, 0, 0, 0, 2, 170, 1, 0, 0, 0, 2, 172, 1, 0, 0, 0, 2, 174, 1, 0, 0, 0, 2, 176, 1, 0, 0, 0, 2, 178, 1, 0, 0, 0, 2, 180, 1, 0, 0, 0, 2, 182, 1, 0, 0, 0, 2, 186, 1, 0, 0, 0, 2, 188, 1, 0, 0, 0, 2, 190, 1, 0, 0, 0, 2, 192, 1, 0, 0, 0, 3, 194, 1, 0, 0, 0, 3, 196, 1, 0, 0, 0, 3, 198, 1, 0, 0, 0, 3, 200, 1, 0, 0, 0, 3, 202, 1, 0, 0, 0, 3, 204, 1, 0, 0, 0, 3, 206, 1, 0, 0, 0, 3, 208, 1, 0, 0, 0, 3, 210, 1, 0, 0, 0, 3, 212, 1, 0, 0, 0, 3, 214, 1, 0, 0, 0, 4, 216, 1, 0, 0, 0, 4, 218, 1, 0, 0, 0, 4, 220, 1, 0, 0, 0, 4, 226, 1, 0, 0, 0, 4, 228, 1, 0, 0, 0, 4, 230, 1, 0, 0, 0, 4, 232, 1, 0, 0, 0, 5, 234, 1, 0, 0, 0, 5, 236, 1, 0, 0, 0, 5, 238, 1, 0, 0, 0, 5, 240, 1, 0, 0, 0, 5, 242, 1, 0, 0, 0, 5, 244, 1, 0, 0, 0, 5, 246, 1, 0, 0, 0, 5, 248, 1, 0, 0, 0, 5, 250, 1, 0, 0, 0, 6, 252, 1, 0, 0, 0, 6, 254, 1, 0, 0, 0, 6, 256, 1, 0, 0, 0, 6, 258, 1, 0, 0, 0, 6, 262, 1, 0, 0, 0, 6, 264, 1, 0, 0, 0, 6, 266, 1, 0, 0, 0, 6, 268, 1, 0, 0, 0, 6, 270, 1, 0, 0, 0, 6, 272, 1, 0, 0, 0, 7, 274, 1, 0, 0, 0, 7, 276, 1, 0, 0, 0, 7, 278, 1, 0, 0, 0, 7, 280, 1, 0, 0, 0, 7, 282, 1, 0, 0, 0, 7, 284, 1, 0, 0, 0, 7, 286, 1, 0, 0, 0, 7, 288, 1, 0, 0, 0, 7, 290, 1, 0, 0, 0, 7, 292, 1, 0, 0, 0, 8, 294, 1, 0, 0, 0, 8, 296, 1, 0, 0, 0, 8, 298, 1, 0, 0, 0, 8, 300, 1, 0, 0, 0, 8, 302, 1, 0, 0, 0, 8, 304, 1, 0, 0, 0, 8, 306, 1, 0, 0, 0, 8, 308, 1, 0, 0, 0, 9, 310, 1, 0, 0, 0, 9, 312, 1, 0, 0, 0, 9, 314, 1, 0, 0, 0, 9, 316, 1, 0, 0, 0, 9, 318, 1, 0, 0, 0, 9, 320, 1, 0, 0, 0, 9, 322, 1, 0, 0, 0, 10, 324, 1, 0, 0, 0, 10, 326, 1, 0, 0, 0, 10, 328, 1, 0, 0, 0, 10, 330, 1, 0, 0, 0, 10, 332, 1, 0, 0, 0, 10, 334, 1, 0, 0, 0, 10, 336, 1, 0, 0, 0, 11, 338, 1, 0, 0, 0, 11, 340, 1, 0, 0, 0, 11, 342, 1, 0, 0, 0, 11, 344, 1, 0, 0, 0, 11, 346, 1, 0, 0, 0, 12, 348, 1, 0, 0, 0, 12, 350, 1, 0, 0, 0, 12, 352, 1, 0, 0, 0, 12, 354, 1, 0, 0, 0, 12, 356, 1, 0, 0, 0, 13, 358, 1, 0, 0, 0, 13, 360, 1, 0, 0, 0, 13, 362, 1, 0, 0, 0, 13, 364, 1, 0, 0, 0, 13, 366, 1, 0, 0, 0, 13, 368, 1, 0, 0, 0, 14, 370, 1, 0, 0, 0, 14, 372, 1, 0, 0, 0, 14, 374, 1, 0, 0, 0, 14, 376, 1, 0, 0, 0, 14, 378, 1, 0, 0, 0, 15, 380, 1, 0, 0, 0, 15, 382, 1, 0, 0, 0, 15, 384, 1, 0, 0, 0, 15, 386, 1, 0, 0, 0, 15, 388, 1, 0, 0, 0, 15, 390, 1, 0, 0, 0, 15, 392, 1, 0, 0, 0, 15, 394, 1, 0, 0, 0, 16, 396, 1, 0, 0, 0, 18, 406, 1, 0, 0, 0, 20, 413, 1, 0, 0, 0, 22, 422, 1, 0, 0, 0, 24, 429, 1, 0, 0, 0, 26, 439, 1, 0, 0, 0, 28, 446, 1, 0, 0, 0, 30, 453, 1, 0, 0, 0, 32, 467, 1, 0, 0, 0, 34, 474, 1, 0, 0, 0, 36, 482, 1, 0, 0, 0, 38, 491, 1, 0, 0, 0, 40, 498, 1, 0, 0, 0, 42, 508, 1, 0, 0, 0, 44, 520, 1, 0, 0, 0, 46, 529, 1, 0, 0, 0, 48, 535, 1, 0, 0, 0, 50, 542, 1, 0, 0, 0, 52, 549, 1, 0, 0, 0, 54, 557, 1, 0, 0, 0, 56, 566, 1, 0, 0, 0, 58, 572, 1, 0, 0, 0, 60, 589, 1, 0, 0, 0, 62, 605, 1, 0, 0, 0, 64, 614, 1, 0, 0, 0, 66, 617, 1, 0, 0, 0, 68, 621, 1, 0, 0, 0, 70, 626, 1, 0, 0, 0, 72, 631, 1, 0, 0, 0, 74, 635, 1, 0, 0, 0, 76, 639, 1, 0, 0, 0, 78, 643, 1, 0, 0, 0, 80, 647, 1, 0, 0, 0, 82, 649, 1, 0, 0, 0, 84, 651, 1, 0, 0, 0, 86, 654, 1, 0, 0, 0, 88, 656, 1, 0, 0, 0, 90, 665, 1, 0, 0, 0, 92, 667, 1, 0, 0, 0, 94, 672, 1, 0, 0, 0, 96, 674, 1, 0, 0, 0, 98, 679, 1, 0, 0, 0, 100, 710, 1, 0, 0, 0, 102, 713, 1, 0, 0, 0, 104, 759, 1, 0, 0, 0, 106, 761, 1, 0, 0, 0, 108, 764, 1, 0, 0, 0, 110, 768, 1, 0, 0, 0, 112, 772, 1, 0, 0, 0, 114, 774, 1, 0, 0, 0, 116, 777, 1, 0, 0, 0, 118, 779, 1, 0, 0, 0, 120, 784, 1, 0, 0, 0, 122, 786, 1, 0, 0, 0, 124, 792, 1, 0, 0, 0, 126, 798, 1, 0, 0, 0, 128, 803, 1, 0, 0, 0, 130, 805, 1, 0, 0, 0, 132, 808, 1, 0, 0, 0, 134, 811, 1, 0, 0, 0, 136, 816, 1, 0, 0, 0, 138, 820, 1, 0, 0, 0, 140, 825, 1, 0, 0, 0, 142, 831, 1, 0, 0, 0, 144, 834, 1, 0, 0, 0, 146, 836, 1, 0, 0, 0, 148, 842, 1, 0, 0, 0, 150, 844, 1, 0, 0, 0, 152, 849, 1, 0, 0, 0, 154, 852, 1, 0, 0, 0, 156, 855, 1, 0, 0, 0, 158, 858, 1, 0, 0, 0, 160, 860, 1, 0, 0, 0, 162, 863, 1, 0, 0, 0, 164, 865, 1, 0, 0, 0, 166, 868, 1, 0, 0, 0, 168, 870, 1, 0, 0, 0, 170, 872, 1, 0, 0, 0, 172, 874, 1, 0, 0, 0, 174, 876, 1, 0, 0, 0, 176, 892, 1, 0, 0, 0, 178, 894, 1, 0, 0, 0, 180, 899, 1, 0, 0, 0, 182, 920, 1, 0, 0, 0, 184, 922, 1, 0, 0, 0, 186, 930, 1, 0, 0, 0, 188, 932, 1, 0, 0, 0, 190, 936, 1, 0, 0, 0, 192, 940, 1, 0, 0, 0, 194, 944, 1, 0, 0, 0, 196, 949, 1, 0, 0, 0, 198, 953, 1, 0, 0, 0, 200, 957, 1, 0, 0, 0, 202, 961, 1, 0, 0, 0, 204, 965, 1, 0, 0, 0, 206, 969, 1, 0, 0, 0, 208, 978, 1, 0, 0, 0, 210, 982, 1, 0, 0, 0, 212, 986, 1, 0, 0, 0, 214, 990, 1, 0, 0, 0, 216, 994, 1, 0, 0, 0, 218, 999, 1, 0, 0, 0, 220, 1003, 1, 0, 0, 0, 222, 1011, 1, 0, 0, 0, 224, 1032, 1, 0, 0, 0, 226, 1036, 1, 0, 0, 0, 228, 1040, 1, 0, 0, 0, 230, 1044, 1, 0, 0, 0, 232, 1048, 1, 0, 0, 0, 234, 1052, 1, 0, 0, 0, 236, 1057, 1, 0, 0, 0, 238, 1061, 1, 0, 0, 0, 240, 1065, 1, 0, 0, 0, 242, 1069, 1, 0, 0, 0, 244, 1072, 1, 0, 0, 0, 246, 1076, 1, 0, 0, 0, 248, 1080, 1, 0, 0, 0, 250, 1084, 1, 0, 0, 0, 252, 1088, 1, 0, 0, 0, 254, 1093, 1, 0, 0, 0, 256, 1098, 1, 0, 0, 0, 258, 1103, 1, 0, 0, 0, 260, 1110, 1, 0, 0, 0, 262, 1119, 1, 0, 0, 0, 264, 1126, 1, 0, 0, 0, 266, 1130, 1, 0, 0, 0, 268, 1134, 1, 0, 0, 0, 270, 1138, 1, 0, 0, 0, 272, 1142, 1, 0, 0, 0, 274, 1146, 1, 0, 0, 0, 276, 1152, 1, 0, 0, 0, 278, 1156, 1, 0, 0, 0, 280, 1160, 1, 0, 0, 0, 282, 1164, 1, 0, 0, 0, 284, 1168, 1, 0, 0, 0, 286, 1172, 1, 0, 0, 0, 288, 1176, 1, 0, 0, 0, 290, 1180, 1, 0, 0, 0, 292, 1184, 1, 0, 0, 0, 294, 1188, 1, 0, 0, 0, 296, 1193, 1, 0, 0, 0, 298, 1197, 1, 0, 0, 0, 300, 1201, 1, 0, 0, 0, 302, 1206, 1, 0, 0, 0, 304, 1210, 1, 0, 0, 0, 306, 1214, 1, 0, 0, 0, 308, 1218, 1, 0, 0, 0, 310, 1222, 1, 0, 0, 0, 312, 1228, 1, 0, 0, 0, 314, 1232, 1, 0, 0, 0, 316, 1236, 1, 0, 0, 0, 318, 1240, 1, 0, 0, 0, 320, 1244, 1, 0, 0, 0, 322, 1248, 1, 0, 0, 0, 324, 1252, 1, 0, 0, 0, 326, 1257, 1, 0, 0, 0, 328, 1261, 1, 0, 0, 0, 330, 1265, 1, 0, 0, 0, 332, 1269, 1, 0, 0, 0, 334, 1273, 1, 0, 0, 0, 336, 1277, 1, 0, 0, 0, 338, 1281, 1, 0, 0, 0, 340, 1286, 1, 0, 0, 0, 342, 1291, 1, 0, 0, 0, 344, 1295, 1, 0, 0, 0, 346, 1299, 1, 0, 0, 0, 348, 1303, 1, 0, 0, 0, 350, 1308, 1, 0, 0, 0, 352, 1318, 1, 0, 0, 0, 354, 1322, 1, 0, 0, 0, 356, 1326, 1, 0, 0, 0, 358, 1330, 1, 0, 0, 0, 360, 1335, 1, 0, 0, 0, 362, 1342, 1, 0, 0, 0, 364, 1346, 1, 0, 0, 0, 366, 1350, 1, 0, 0, 0, 368, 1354, 1, 0, 0, 0, 370, 1358, 1, 0, 0, 0, 372, 1363, 1, 0, 0, 0, 374, 1369, 1, 0, 0, 0, 376, 1373, 1, 0, 0, 0, 378, 1377, 1, 0, 0, 0, 380, 1381, 1, 0, 0, 0, 382, 1387, 1, 0, 0, 0, 384, 1391, 1, 0, 0, 0, 386, 1395, 1, 0, 0, 0, 388, 1399, 1, 0, 0, 0, 390, 1405, 1, 0, 0, 0, 392, 1411, 1, 0, 0, 0, 394, 1417, 1, 0, 0, 0, 396, 397, 7, 0, 0, 0, 397, 398, 7, 1, 0, 0, 398, 399, 7, 2, 0, 0, 399, 400, 7, 2, 0, 0, 400, 401, 7, 3, 0, 0, 401, 402, 7, 4, 0, 0, 402, 403, 7, 5, 0, 0, 403, 404, 1, 0, 0, 0, 404, 405, 6, 0, 0, 0, 405, 17, 1, 0, 0, 0, 406, 407, 7, 0, 0, 0, 407, 408, 7, 6, 0, 0, 408, 409, 7, 7, 0, 0, 409, 410, 7, 8, 0, 0, 410, 411, 1, 0, 0, 0, 411, 412, 6, 1, 1, 0, 412, 19, 1, 0, 0, 0, 413, 414, 7, 3, 0, 0, 414, 415, 7, 9, 0, 0, 415, 416, 7, 6, 0, 0, 416, 417, 7, 1, 0, 0, 417, 418, 7, 4, 0, 0, 418, 419, 7, 10, 0, 0, 419, 420, 1, 0, 0, 0, 420, 421, 6, 2, 2, 0, 421, 21, 1, 0, 0, 0, 422, 423, 7, 3, 0, 0, 423, 424, 7, 11, 0, 0, 424, 425, 7, 12, 0, 0, 425, 426, 7, 13, 0, 0, 426, 427, 1, 0, 0, 0, 427, 428, 6, 3, 0, 0, 428, 23, 1, 0, 0, 0, 429, 430, 7, 3, 0, 0, 430, 431, 7, 14, 0, 0, 431, 432, 7, 8, 0, 0, 432, 433, 7, 13, 0, 0, 433, 434, 7, 12, 0, 0, 434, 435, 7, 1, 0, 0, 435, 436, 7, 9, 0, 0, 436, 437, 1, 0, 0, 0, 437, 438, 6, 4, 3, 0, 438, 25, 1, 0, 0, 0, 439, 440, 7, 15, 0, 0, 440, 441, 7, 6, 0, 0, 441, 442, 7, 7, 0, 0, 442, 443, 7, 16, 0, 0, 443, 444, 1, 0, 0, 0, 444, 445, 6, 5, 4, 0, 445, 27, 1, 0, 0, 0, 446, 447, 7, 17, 0, 0, 447, 448, 7, 6, 0, 0, 448, 449, 7, 7, 0, 0, 449, 450, 7, 18, 0, 0, 450, 451, 1, 0, 0, 0, 451, 452, 6, 6, 0, 0, 452, 29, 1, 0, 0, 0, 453, 454, 7, 1, 0, 0, 454, 455, 7, 9, 0, 0, 455, 456, 7, 13, 0, 0, 456, 457, 7, 1, 0, 0, 457, 458, 7, 9, 0, 0, 458, 459, 7, 3, 0, 0, 459, 460, 7, 2, 0, 0, 460, 461, 7, 5, 0, 0, 461, 462, 7, 12, 0, 0, 462, 463, 7, 5, 0, 0, 463, 464, 7, 2, 0, 0, 464, 465, 1, 0, 0, 0, 465, 466, 6, 7, 0, 0, 466, 31, 1, 0, 0, 0, 467, 468, 7, 18, 0, 0, 468, 469, 7, 3, 0, 0, 469, 470, 7, 3, 0, 0, 470, 471, 7, 8, 0, 0, 471, 472, 1, 0, 0, 0, 472, 473, 6, 8, 1, 0, 473, 33, 1, 0, 0, 0, 474, 475, 7, 13, 0, 0, 475, 476, 7, 1, 0, 0, 476, 477, 7, 16, 0, 0, 477, 478, 7, 1, 0, 0, 478, 479, 7, 5, 0, 0, 479, 480, 1, 0, 0, 0, 480, 481, 6, 9, 0, 0, 481, 35, 1, 0, 0, 0, 482, 483, 7, 13, 0, 0, 483, 484, 7, 7, 0, 0, 484, 485, 7, 7, 0, 0, 485, 486, 7, 18, 0, 0, 486, 487, 7, 19, 0, 0, 487, 488, 7, 8, 0, 0, 488, 489, 1, 0, 0, 0, 489, 490, 6, 10, 5, 0, 490, 37, 1, 0, 0, 0, 491, 492, 7, 16, 0, 0, 492, 493, 7, 3, 0, 0, 493, 494, 7, 5, 0, 0, 494, 495, 7, 12, 0, 0, 495, 496, 1, 0, 0, 0, 496, 497, 6, 11, 6, 0, 497, 39, 1, 0, 0, 0, 498, 499, 7, 16, 0, 0, 499, 500, 7, 3, 0, 0, 500, 501, 7, 5, 0, 0, 501, 502, 7, 6, 0, 0, 502, 503, 7, 1, 0, 0, 503, 504, 7, 4, 0, 0, 504, 505, 7, 2, 0, 0, 505, 506, 1, 0, 0, 0, 506, 507, 6, 12, 7, 0, 507, 41, 1, 0, 0, 0, 508, 509, 7, 16, 0, 0, 509, 510, 7, 11, 0, 0, 510, 511, 5, 95, 0, 0, 511, 512, 7, 3, 0, 0, 512, 513, 7, 14, 0, 0, 513, 514, 7, 8, 0, 0, 514, 515, 7, 12, 0, 0, 515, 516, 7, 9, 0, 0, 516, 517, 7, 0, 0, 0, 517, 518, 1, 0, 0, 0, 518, 519, 6, 13, 8, 0, 519, 43, 1, 0, 0, 0, 520, 521, 7, 6, 0, 0, 521, 522, 7, 3, 0, 0, 522, 523, 7, 9, 0, 0, 523, 524, 7, 12, 0, 0, 524, 525, 7, 16, 0, 0, 525, 526, 7, 3, 0, 0, 526, 527, 1, 0, 0, 0, 527, 528, 6, 14, 9, 0, 528, 45, 1, 0, 0, 0, 529, 530, 7, 6, 0, 0, 530, 531, 7, 7, 0, 0, 531, 532, 7, 20, 0, 0, 532, 533, 1, 0, 0, 0, 533, 534, 6, 15, 0, 0, 534, 47, 1, 0, 0, 0, 535, 536, 7, 2, 0, 0, 536, 537, 7, 10, 0, 0, 537, 538, 7, 7, 0, 0, 538, 539, 7, 20, 0, 0, 539, 540, 1, 0, 0, 0, 540, 541, 6, 16, 10, 0, 541, 49, 1, 0, 0, 0, 542, 543, 7, 2, 0, 0, 543, 544, 7, 7, 0, 0, 544, 545, 7, 6, 0, 0, 545, 546, 7, 5, 0, 0, 546, 547, 1, 0, 0, 0, 547, 548, 6, 17, 0, 0, 548, 51, 1, 0, 0, 0, 549, 550, 7, 2, 0, 0, 550, 551, 7, 5, 0, 0, 551, 552, 7, 12, 0, 0, 552, 553, 7, 5, 0, 0, 553, 554, 7, 2, 0, 0, 554, 555, 1, 0, 0, 0, 555, 556, 6, 18, 0, 0, 556, 53, 1, 0, 0, 0, 557, 558, 7, 20, 0, 0, 558, 559, 7, 10, 0, 0, 559, 560, 7, 3, 0, 0, 560, 561, 7, 6, 0, 0, 561, 562, 7, 3, 0, 0, 562, 563, 1, 0, 0, 0, 563, 564, 6, 19, 0, 0, 564, 55, 1, 0, 0, 0, 565, 567, 8, 21, 0, 0, 566, 565, 1, 0, 0, 0, 567, 568, 1, 0, 0, 0, 568, 566, 1, 0, 0, 0, 568, 569, 1, 0, 0, 0, 569, 570, 1, 0, 0, 0, 570, 571, 6, 20, 0, 0, 571, 57, 1, 0, 0, 0, 572, 573, 5, 47, 0, 0, 573, 574, 5, 47, 0, 0, 574, 578, 1, 0, 0, 0, 575, 577, 8, 22, 0, 0, 576, 575, 1, 0, 0, 0, 577, 580, 1, 0, 0, 0, 578, 576, 1, 0, 0, 0, 578, 579, 1, 0, 0, 0, 579, 582, 1, 0, 0, 0, 580, 578, 1, 0, 0, 0, 581, 583, 5, 13, 0, 0, 582, 581, 1, 0, 0, 0, 582, 583, 1, 0, 0, 0, 583, 585, 1, 0, 0, 0, 584, 586, 5, 10, 0, 0, 585, 584, 1, 0, 0, 0, 585, 586, 1, 0, 0, 0, 586, 587, 1, 0, 0, 0, 587, 588, 6, 21, 11, 0, 588, 59, 1, 0, 0, 0, 589, 590, 5, 47, 0, 0, 590, 591, 5, 42, 0, 0, 591, 596, 1, 0, 0, 0, 592, 595, 3, 60, 22, 0, 593, 595, 9, 0, 0, 0, 594, 592, 1, 0, 0, 0, 594, 593, 1, 0, 0, 0, 595, 598, 1, 0, 0, 0, 596, 597, 1, 0, 0, 0, 596, 594, 1, 0, 0, 0, 597, 599, 1, 0, 0, 0, 598, 596, 1, 0, 0, 0, 599, 600, 5, 42, 0, 0, 600, 601, 5, 47, 0, 0, 601, 602, 1, 0, 0, 0, 602, 603, 6, 22, 11, 0, 603, 61, 1, 0, 0, 0, 604, 606, 7, 23, 0, 0, 605, 604, 1, 0, 0, 0, 606, 607, 1, 0, 0, 0, 607, 605, 1, 0, 0, 0, 607, 608, 1, 0, 0, 0, 608, 609, 1, 0, 0, 0, 609, 610, 6, 23, 11, 0, 610, 63, 1, 0, 0, 0, 611, 615, 8, 24, 0, 0, 612, 613, 5, 47, 0, 0, 613, 615, 8, 25, 0, 0, 614, 611, 1, 0, 0, 0, 614, 612, 1, 0, 0, 0, 615, 65, 1, 0, 0, 0, 616, 618, 3, 64, 24, 0, 617, 616, 1, 0, 0, 0, 618, 619, 1, 0, 0, 0, 619, 617, 1, 0, 0, 0, 619, 620, 1, 0, 0, 0, 620, 67, 1, 0, 0, 0, 621, 622, 3, 178, 81, 0, 622, 623, 1, 0, 0, 0, 623, 624, 6, 26, 12, 0, 624, 625, 6, 26, 13, 0, 625, 69, 1, 0, 0, 0, 626, 627, 3, 78, 31, 0, 627, 628, 1, 0, 0, 0, 628, 629, 6, 27, 14, 0, 629, 630, 6, 27, 15, 0, 630, 71, 1, 0, 0, 0, 631, 632, 3, 62, 23, 0, 632, 633, 1, 0, 0, 0, 633, 634, 6, 28, 11, 0, 634, 73, 1, 0, 0, 0, 635, 636, 3, 58, 21, 0, 636, 637, 1, 0, 0, 0, 637, 638, 6, 29, 11, 0, 638, 75, 1, 0, 0, 0, 639, 640, 3, 60, 22, 0, 640, 641, 1, 0, 0, 0, 641, 642, 6, 30, 11, 0, 642, 77, 1, 0, 0, 0, 643, 644, 5, 124, 0, 0, 644, 645, 1, 0, 0, 0, 645, 646, 6, 31, 15, 0, 646, 79, 1, 0, 0, 0, 647, 648, 7, 26, 0, 0, 648, 81, 1, 0, 0, 0, 649, 650, 7, 27, 0, 0, 650, 83, 1, 0, 0, 0, 651, 652, 5, 92, 0, 0, 652, 653, 7, 28, 0, 0, 653, 85, 1, 0, 0, 0, 654, 655, 8, 29, 0, 0, 655, 87, 1, 0, 0, 0, 656, 658, 7, 3, 0, 0, 657, 659, 7, 30, 0, 0, 658, 657, 1, 0, 0, 0, 658, 659, 1, 0, 0, 0, 659, 661, 1, 0, 0, 0, 660, 662, 3, 80, 32, 0, 661, 660, 1, 0, 0, 0, 662, 663, 1, 0, 0, 0, 663, 661, 1, 0, 0, 0, 663, 664, 1, 0, 0, 0, 664, 89, 1, 0, 0, 0, 665, 666, 5, 64, 0, 0, 666, 91, 1, 0, 0, 0, 667, 668, 5, 96, 0, 0, 668, 93, 1, 0, 0, 0, 669, 673, 8, 31, 0, 0, 670, 671, 5, 96, 0, 0, 671, 673, 5, 96, 0, 0, 672, 669, 1, 0, 0, 0, 672, 670, 1, 0, 0, 0, 673, 95, 1, 0, 0, 0, 674, 675, 5, 95, 0, 0, 675, 97, 1, 0, 0, 0, 676, 680, 3, 82, 33, 0, 677, 680, 3, 80, 32, 0, 678, 680, 3, 96, 40, 0, 679, 676, 1, 0, 0, 0, 679, 677, 1, 0, 0, 0, 679, 678, 1, 0, 0, 0, 680, 99, 1, 0, 0, 0, 681, 686, 5, 34, 0, 0, 682, 685, 3, 84, 34, 0, 683, 685, 3, 86, 35, 0, 684, 682, 1, 0, 0, 0, 684, 683, 1, 0, 0, 0, 685, 688, 1, 0, 0, 0, 686, 684, 1, 0, 0, 0, 686, 687, 1, 0, 0, 0, 687, 689, 1, 0, 0, 0, 688, 686, 1, 0, 0, 0, 689, 711, 5, 34, 0, 0, 690, 691, 5, 34, 0, 0, 691, 692, 5, 34, 0, 0, 692, 693, 5, 34, 0, 0, 693, 697, 1, 0, 0, 0, 694, 696, 8, 22, 0, 0, 695, 694, 1, 0, 0, 0, 696, 699, 1, 0, 0, 0, 697, 698, 1, 0, 0, 0, 697, 695, 1, 0, 0, 0, 698, 700, 1, 0, 0, 0, 699, 697, 1, 0, 0, 0, 700, 701, 5, 34, 0, 0, 701, 702, 5, 34, 0, 0, 702, 703, 5, 34, 0, 0, 703, 705, 1, 0, 0, 0, 704, 706, 5, 34, 0, 0, 705, 704, 1, 0, 0, 0, 705, 706, 1, 0, 0, 0, 706, 708, 1, 0, 0, 0, 707, 709, 5, 34, 0, 0, 708, 707, 1, 0, 0, 0, 708, 709, 1, 0, 0, 0, 709, 711, 1, 0, 0, 0, 710, 681, 1, 0, 0, 0, 710, 690, 1, 0, 0, 0, 711, 101, 1, 0, 0, 0, 712, 714, 3, 80, 32, 0, 713, 712, 1, 0, 0, 0, 714, 715, 1, 0, 0, 0, 715, 713, 1, 0, 0, 0, 715, 716, 1, 0, 0, 0, 716, 103, 1, 0, 0, 0, 717, 719, 3, 80, 32, 0, 718, 717, 1, 0, 0, 0, 719, 720, 1, 0, 0, 0, 720, 718, 1, 0, 0, 0, 720, 721, 1, 0, 0, 0, 721, 722, 1, 0, 0, 0, 722, 726, 3, 120, 52, 0, 723, 725, 3, 80, 32, 0, 724, 723, 1, 0, 0, 0, 725, 728, 1, 0, 0, 0, 726, 724, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 760, 1, 0, 0, 0, 728, 726, 1, 0, 0, 0, 729, 731, 3, 120, 52, 0, 730, 732, 3, 80, 32, 0, 731, 730, 1, 0, 0, 0, 732, 733, 1, 0, 0, 0, 733, 731, 1, 0, 0, 0, 733, 734, 1, 0, 0, 0, 734, 760, 1, 0, 0, 0, 735, 737, 3, 80, 32, 0, 736, 735, 1, 0, 0, 0, 737, 738, 1, 0, 0, 0, 738, 736, 1, 0, 0, 0, 738, 739, 1, 0, 0, 0, 739, 747, 1, 0, 0, 0, 740, 744, 3, 120, 52, 0, 741, 743, 3, 80, 32, 0, 742, 741, 1, 0, 0, 0, 743, 746, 1, 0, 0, 0, 744, 742, 1, 0, 0, 0, 744, 745, 1, 0, 0, 0, 745, 748, 1, 0, 0, 0, 746, 744, 1, 0, 0, 0, 747, 740, 1, 0, 0, 0, 747, 748, 1, 0, 0, 0, 748, 749, 1, 0, 0, 0, 749, 750, 3, 88, 36, 0, 750, 760, 1, 0, 0, 0, 751, 753, 3, 120, 52, 0, 752, 754, 3, 80, 32, 0, 753, 752, 1, 0, 0, 0, 754, 755, 1, 0, 0, 0, 755, 753, 1, 0, 0, 0, 755, 756, 1, 0, 0, 0, 756, 757, 1, 0, 0, 0, 757, 758, 3, 88, 36, 0, 758, 760, 1, 0, 0, 0, 759, 718, 1, 0, 0, 0, 759, 729, 1, 0, 0, 0, 759, 736, 1, 0, 0, 0, 759, 751, 1, 0, 0, 0, 760, 105, 1, 0, 0, 0, 761, 762, 7, 32, 0, 0, 762, 763, 7, 33, 0, 0, 763, 107, 1, 0, 0, 0, 764, 765, 7, 12, 0, 0, 765, 766, 7, 9, 0, 0, 766, 767, 7, 0, 0, 0, 767, 109, 1, 0, 0, 0, 768, 769, 7, 12, 0, 0, 769, 770, 7, 2, 0, 0, 770, 771, 7, 4, 0, 0, 771, 111, 1, 0, 0, 0, 772, 773, 5, 61, 0, 0, 773, 113, 1, 0, 0, 0, 774, 775, 5, 58, 0, 0, 775, 776, 5, 58, 0, 0, 776, 115, 1, 0, 0, 0, 777, 778, 5, 44, 0, 0, 778, 117, 1, 0, 0, 0, 779, 780, 7, 0, 0, 0, 780, 781, 7, 3, 0, 0, 781, 782, 7, 2, 0, 0, 782, 783, 7, 4, 0, 0, 783, 119, 1, 0, 0, 0, 784, 785, 5, 46, 0, 0, 785, 121, 1, 0, 0, 0, 786, 787, 7, 15, 0, 0, 787, 788, 7, 12, 0, 0, 788, 789, 7, 13, 0, 0, 789, 790, 7, 2, 0, 0, 790, 791, 7, 3, 0, 0, 791, 123, 1, 0, 0, 0, 792, 793, 7, 15, 0, 0, 793, 794, 7, 1, 0, 0, 794, 795, 7, 6, 0, 0, 795, 796, 7, 2, 0, 0, 796, 797, 7, 5, 0, 0, 797, 125, 1, 0, 0, 0, 798, 799, 7, 13, 0, 0, 799, 800, 7, 12, 0, 0, 800, 801, 7, 2, 0, 0, 801, 802, 7, 5, 0, 0, 802, 127, 1, 0, 0, 0, 803, 804, 5, 40, 0, 0, 804, 129, 1, 0, 0, 0, 805, 806, 7, 1, 0, 0, 806, 807, 7, 9, 0, 0, 807, 131, 1, 0, 0, 0, 808, 809, 7, 1, 0, 0, 809, 810, 7, 2, 0, 0, 810, 133, 1, 0, 0, 0, 811, 812, 7, 13, 0, 0, 812, 813, 7, 1, 0, 0, 813, 814, 7, 18, 0, 0, 814, 815, 7, 3, 0, 0, 815, 135, 1, 0, 0, 0, 816, 817, 7, 9, 0, 0, 817, 818, 7, 7, 0, 0, 818, 819, 7, 5, 0, 0, 819, 137, 1, 0, 0, 0, 820, 821, 7, 9, 0, 0, 821, 822, 7, 19, 0, 0, 822, 823, 7, 13, 0, 0, 823, 824, 7, 13, 0, 0, 824, 139, 1, 0, 0, 0, 825, 826, 7, 9, 0, 0, 826, 827, 7, 19, 0, 0, 827, 828, 7, 13, 0, 0, 828, 829, 7, 13, 0, 0, 829, 830, 7, 2, 0, 0, 830, 141, 1, 0, 0, 0, 831, 832, 7, 7, 0, 0, 832, 833, 7, 6, 0, 0, 833, 143, 1, 0, 0, 0, 834, 835, 5, 63, 0, 0, 835, 145, 1, 0, 0, 0, 836, 837, 7, 6, 0, 0, 837, 838, 7, 13, 0, 0, 838, 839, 7, 1, 0, 0, 839, 840, 7, 18, 0, 0, 840, 841, 7, 3, 0, 0, 841, 147, 1, 0, 0, 0, 842, 843, 5, 41, 0, 0, 843, 149, 1, 0, 0, 0, 844, 845, 7, 5, 0, 0, 845, 846, 7, 6, 0, 0, 846, 847, 7, 19, 0, 0, 847, 848, 7, 3, 0, 0, 848, 151, 1, 0, 0, 0, 849, 850, 5, 61, 0, 0, 850, 851, 5, 61, 0, 0, 851, 153, 1, 0, 0, 0, 852, 853, 5, 61, 0, 0, 853, 854, 5, 126, 0, 0, 854, 155, 1, 0, 0, 0, 855, 856, 5, 33, 0, 0, 856, 857, 5, 61, 0, 0, 857, 157, 1, 0, 0, 0, 858, 859, 5, 60, 0, 0, 859, 159, 1, 0, 0, 0, 860, 861, 5, 60, 0, 0, 861, 862, 5, 61, 0, 0, 862, 161, 1, 0, 0, 0, 863, 864, 5, 62, 0, 0, 864, 163, 1, 0, 0, 0, 865, 866, 5, 62, 0, 0, 866, 867, 5, 61, 0, 0, 867, 165, 1, 0, 0, 0, 868, 869, 5, 43, 0, 0, 869, 167, 1, 0, 0, 0, 870, 871, 5, 45, 0, 0, 871, 169, 1, 0, 0, 0, 872, 873, 5, 42, 0, 0, 873, 171, 1, 0, 0, 0, 874, 875, 5, 47, 0, 0, 875, 173, 1, 0, 0, 0, 876, 877, 5, 37, 0, 0, 877, 175, 1, 0, 0, 0, 878, 879, 3, 144, 64, 0, 879, 883, 3, 82, 33, 0, 880, 882, 3, 98, 41, 0, 881, 880, 1, 0, 0, 0, 882, 885, 1, 0, 0, 0, 883, 881, 1, 0, 0, 0, 883, 884, 1, 0, 0, 0, 884, 893, 1, 0, 0, 0, 885, 883, 1, 0, 0, 0, 886, 888, 3, 144, 64, 0, 887, 889, 3, 80, 32, 0, 888, 887, 1, 0, 0, 0, 889, 890, 1, 0, 0, 0, 890, 888, 1, 0, 0, 0, 890, 891, 1, 0, 0, 0, 891, 893, 1, 0, 0, 0, 892, 878, 1, 0, 0, 0, 892, 886, 1, 0, 0, 0, 893, 177, 1, 0, 0, 0, 894, 895, 5, 91, 0, 0, 895, 896, 1, 0, 0, 0, 896, 897, 6, 81, 0, 0, 897, 898, 6, 81, 0, 0, 898, 179, 1, 0, 0, 0, 899, 900, 5, 93, 0, 0, 900, 901, 1, 0, 0, 0, 901, 902, 6, 82, 15, 0, 902, 903, 6, 82, 15, 0, 903, 181, 1, 0, 0, 0, 904, 908, 3, 82, 33, 0, 905, 907, 3, 98, 41, 0, 906, 905, 1, 0, 0, 0, 907, 910, 1, 0, 0, 0, 908, 906, 1, 0, 0, 0, 908, 909, 1, 0, 0, 0, 909, 921, 1, 0, 0, 0, 910, 908, 1, 0, 0, 0, 911, 914, 3, 96, 40, 0, 912, 914, 3, 90, 37, 0, 913, 911, 1, 0, 0, 0, 913, 912, 1, 0, 0, 0, 914, 916, 1, 0, 0, 0, 915, 917, 3, 98, 41, 0, 916, 915, 1, 0, 0, 0, 917, 918, 1, 0, 0, 0, 918, 916, 1, 0, 0, 0, 918, 919, 1, 0, 0, 0, 919, 921, 1, 0, 0, 0, 920, 904, 1, 0, 0, 0, 920, 913, 1, 0, 0, 0, 921, 183, 1, 0, 0, 0, 922, 924, 3, 92, 38, 0, 923, 925, 3, 94, 39, 0, 924, 923, 1, 0, 0, 0, 925, 926, 1, 0, 0, 0, 926, 924, 1, 0, 0, 0, 926, 927, 1, 0, 0, 0, 927, 928, 1, 0, 0, 0, 928, 929, 3, 92, 38, 0, 929, 185, 1, 0, 0, 0, 930, 931, 3, 184, 84, 0, 931, 187, 1, 0, 0, 0, 932, 933, 3, 58, 21, 0, 933, 934, 1, 0, 0, 0, 934, 935, 6, 86, 11, 0, 935, 189, 1, 0, 0, 0, 936, 937, 3, 60, 22, 0, 937, 938, 1, 0, 0, 0, 938, 939, 6, 87, 11, 0, 939, 191, 1, 0, 0, 0, 940, 941, 3, 62, 23, 0, 941, 942, 1, 0, 0, 0, 942, 943, 6, 88, 11, 0, 943, 193, 1, 0, 0, 0, 944, 945, 3, 78, 31, 0, 945, 946, 1, 0, 0, 0, 946, 947, 6, 89, 14, 0, 947, 948, 6, 89, 15, 0, 948, 195, 1, 0, 0, 0, 949, 950, 3, 178, 81, 0, 950, 951, 1, 0, 0, 0, 951, 952, 6, 90, 12, 0, 952, 197, 1, 0, 0, 0, 953, 954, 3, 180, 82, 0, 954, 955, 1, 0, 0, 0, 955, 956, 6, 91, 16, 0, 956, 199, 1, 0, 0, 0, 957, 958, 3, 116, 50, 0, 958, 959, 1, 0, 0, 0, 959, 960, 6, 92, 17, 0, 960, 201, 1, 0, 0, 0, 961, 962, 3, 112, 48, 0, 962, 963, 1, 0, 0, 0, 963, 964, 6, 93, 18, 0, 964, 203, 1, 0, 0, 0, 965, 966, 3, 100, 42, 0, 966, 967, 1, 0, 0, 0, 967, 968, 6, 94, 19, 0, 968, 205, 1, 0, 0, 0, 969, 970, 7, 16, 0, 0, 970, 971, 7, 3, 0, 0, 971, 972, 7, 5, 0, 0, 972, 973, 7, 12, 0, 0, 973, 974, 7, 0, 0, 0, 974, 975, 7, 12, 0, 0, 975, 976, 7, 5, 0, 0, 976, 977, 7, 12, 0, 0, 977, 207, 1, 0, 0, 0, 978, 979, 3, 66, 25, 0, 979, 980, 1, 0, 0, 0, 980, 981, 6, 96, 20, 0, 981, 209, 1, 0, 0, 0, 982, 983, 3, 58, 21, 0, 983, 984, 1, 0, 0, 0, 984, 985, 6, 97, 11, 0, 985, 211, 1, 0, 0, 0, 986, 987, 3, 60, 22, 0, 987, 988, 1, 0, 0, 0, 988, 989, 6, 98, 11, 0, 989, 213, 1, 0, 0, 0, 990, 991, 3, 62, 23, 0, 991, 992, 1, 0, 0, 0, 992, 993, 6, 99, 11, 0, 993, 215, 1, 0, 0, 0, 994, 995, 3, 78, 31, 0, 995, 996, 1, 0, 0, 0, 996, 997, 6, 100, 14, 0, 997, 998, 6, 100, 15, 0, 998, 217, 1, 0, 0, 0, 999, 1000, 3, 120, 52, 0, 1000, 1001, 1, 0, 0, 0, 1001, 1002, 6, 101, 21, 0, 1002, 219, 1, 0, 0, 0, 1003, 1004, 3, 116, 50, 0, 1004, 1005, 1, 0, 0, 0, 1005, 1006, 6, 102, 17, 0, 1006, 221, 1, 0, 0, 0, 1007, 1012, 3, 82, 33, 0, 1008, 1012, 3, 80, 32, 0, 1009, 1012, 3, 96, 40, 0, 1010, 1012, 3, 170, 77, 0, 1011, 1007, 1, 0, 0, 0, 1011, 1008, 1, 0, 0, 0, 1011, 1009, 1, 0, 0, 0, 1011, 1010, 1, 0, 0, 0, 1012, 223, 1, 0, 0, 0, 1013, 1016, 3, 82, 33, 0, 1014, 1016, 3, 170, 77, 0, 1015, 1013, 1, 0, 0, 0, 1015, 1014, 1, 0, 0, 0, 1016, 1020, 1, 0, 0, 0, 1017, 1019, 3, 222, 103, 0, 1018, 1017, 1, 0, 0, 0, 1019, 1022, 1, 0, 0, 0, 1020, 1018, 1, 0, 0, 0, 1020, 1021, 1, 0, 0, 0, 1021, 1033, 1, 0, 0, 0, 1022, 1020, 1, 0, 0, 0, 1023, 1026, 3, 96, 40, 0, 1024, 1026, 3, 90, 37, 0, 1025, 1023, 1, 0, 0, 0, 1025, 1024, 1, 0, 0, 0, 1026, 1028, 1, 0, 0, 0, 1027, 1029, 3, 222, 103, 0, 1028, 1027, 1, 0, 0, 0, 1029, 1030, 1, 0, 0, 0, 1030, 1028, 1, 0, 0, 0, 1030, 1031, 1, 0, 0, 0, 1031, 1033, 1, 0, 0, 0, 1032, 1015, 1, 0, 0, 0, 1032, 1025, 1, 0, 0, 0, 1033, 225, 1, 0, 0, 0, 1034, 1037, 3, 224, 104, 0, 1035, 1037, 3, 184, 84, 0, 1036, 1034, 1, 0, 0, 0, 1036, 1035, 1, 0, 0, 0, 1037, 1038, 1, 0, 0, 0, 1038, 1036, 1, 0, 0, 0, 1038, 1039, 1, 0, 0, 0, 1039, 227, 1, 0, 0, 0, 1040, 1041, 3, 58, 21, 0, 1041, 1042, 1, 0, 0, 0, 1042, 1043, 6, 106, 11, 0, 1043, 229, 1, 0, 0, 0, 1044, 1045, 3, 60, 22, 0, 1045, 1046, 1, 0, 0, 0, 1046, 1047, 6, 107, 11, 0, 1047, 231, 1, 0, 0, 0, 1048, 1049, 3, 62, 23, 0, 1049, 1050, 1, 0, 0, 0, 1050, 1051, 6, 108, 11, 0, 1051, 233, 1, 0, 0, 0, 1052, 1053, 3, 78, 31, 0, 1053, 1054, 1, 0, 0, 0, 1054, 1055, 6, 109, 14, 0, 1055, 1056, 6, 109, 15, 0, 1056, 235, 1, 0, 0, 0, 1057, 1058, 3, 112, 48, 0, 1058, 1059, 1, 0, 0, 0, 1059, 1060, 6, 110, 18, 0, 1060, 237, 1, 0, 0, 0, 1061, 1062, 3, 116, 50, 0, 1062, 1063, 1, 0, 0, 0, 1063, 1064, 6, 111, 17, 0, 1064, 239, 1, 0, 0, 0, 1065, 1066, 3, 120, 52, 0, 1066, 1067, 1, 0, 0, 0, 1067, 1068, 6, 112, 21, 0, 1068, 241, 1, 0, 0, 0, 1069, 1070, 7, 12, 0, 0, 1070, 1071, 7, 2, 0, 0, 1071, 243, 1, 0, 0, 0, 1072, 1073, 3, 226, 105, 0, 1073, 1074, 1, 0, 0, 0, 1074, 1075, 6, 114, 22, 0, 1075, 245, 1, 0, 0, 0, 1076, 1077, 3, 58, 21, 0, 1077, 1078, 1, 0, 0, 0, 1078, 1079, 6, 115, 11, 0, 1079, 247, 1, 0, 0, 0, 1080, 1081, 3, 60, 22, 0, 1081, 1082, 1, 0, 0, 0, 1082, 1083, 6, 116, 11, 0, 1083, 249, 1, 0, 0, 0, 1084, 1085, 3, 62, 23, 0, 1085, 1086, 1, 0, 0, 0, 1086, 1087, 6, 117, 11, 0, 1087, 251, 1, 0, 0, 0, 1088, 1089, 3, 78, 31, 0, 1089, 1090, 1, 0, 0, 0, 1090, 1091, 6, 118, 14, 0, 1091, 1092, 6, 118, 15, 0, 1092, 253, 1, 0, 0, 0, 1093, 1094, 3, 178, 81, 0, 1094, 1095, 1, 0, 0, 0, 1095, 1096, 6, 119, 12, 0, 1096, 1097, 6, 119, 23, 0, 1097, 255, 1, 0, 0, 0, 1098, 1099, 7, 7, 0, 0, 1099, 1100, 7, 9, 0, 0, 1100, 1101, 1, 0, 0, 0, 1101, 1102, 6, 120, 24, 0, 1102, 257, 1, 0, 0, 0, 1103, 1104, 7, 20, 0, 0, 1104, 1105, 7, 1, 0, 0, 1105, 1106, 7, 5, 0, 0, 1106, 1107, 7, 10, 0, 0, 1107, 1108, 1, 0, 0, 0, 1108, 1109, 6, 121, 24, 0, 1109, 259, 1, 0, 0, 0, 1110, 1111, 8, 34, 0, 0, 1111, 261, 1, 0, 0, 0, 1112, 1114, 3, 260, 122, 0, 1113, 1112, 1, 0, 0, 0, 1114, 1115, 1, 0, 0, 0, 1115, 1113, 1, 0, 0, 0, 1115, 1116, 1, 0, 0, 0, 1116, 1117, 1, 0, 0, 0, 1117, 1118, 3, 360, 172, 0, 1118, 1120, 1, 0, 0, 0, 1119, 1113, 1, 0, 0, 0, 1119, 1120, 1, 0, 0, 0, 1120, 1122, 1, 0, 0, 0, 1121, 1123, 3, 260, 122, 0, 1122, 1121, 1, 0, 0, 0, 1123, 1124, 1, 0, 0, 0, 1124, 1122, 1, 0, 0, 0, 1124, 1125, 1, 0, 0, 0, 1125, 263, 1, 0, 0, 0, 1126, 1127, 3, 186, 85, 0, 1127, 1128, 1, 0, 0, 0, 1128, 1129, 6, 124, 25, 0, 1129, 265, 1, 0, 0, 0, 1130, 1131, 3, 262, 123, 0, 1131, 1132, 1, 0, 0, 0, 1132, 1133, 6, 125, 26, 0, 1133, 267, 1, 0, 0, 0, 1134, 1135, 3, 58, 21, 0, 1135, 1136, 1, 0, 0, 0, 1136, 1137, 6, 126, 11, 0, 1137, 269, 1, 0, 0, 0, 1138, 1139, 3, 60, 22, 0, 1139, 1140, 1, 0, 0, 0, 1140, 1141, 6, 127, 11, 0, 1141, 271, 1, 0, 0, 0, 1142, 1143, 3, 62, 23, 0, 1143, 1144, 1, 0, 0, 0, 1144, 1145, 6, 128, 11, 0, 1145, 273, 1, 0, 0, 0, 1146, 1147, 3, 78, 31, 0, 1147, 1148, 1, 0, 0, 0, 1148, 1149, 6, 129, 14, 0, 1149, 1150, 6, 129, 15, 0, 1150, 1151, 6, 129, 15, 0, 1151, 275, 1, 0, 0, 0, 1152, 1153, 3, 112, 48, 0, 1153, 1154, 1, 0, 0, 0, 1154, 1155, 6, 130, 18, 0, 1155, 277, 1, 0, 0, 0, 1156, 1157, 3, 116, 50, 0, 1157, 1158, 1, 0, 0, 0, 1158, 1159, 6, 131, 17, 0, 1159, 279, 1, 0, 0, 0, 1160, 1161, 3, 120, 52, 0, 1161, 1162, 1, 0, 0, 0, 1162, 1163, 6, 132, 21, 0, 1163, 281, 1, 0, 0, 0, 1164, 1165, 3, 258, 121, 0, 1165, 1166, 1, 0, 0, 0, 1166, 1167, 6, 133, 27, 0, 1167, 283, 1, 0, 0, 0, 1168, 1169, 3, 226, 105, 0, 1169, 1170, 1, 0, 0, 0, 1170, 1171, 6, 134, 22, 0, 1171, 285, 1, 0, 0, 0, 1172, 1173, 3, 186, 85, 0, 1173, 1174, 1, 0, 0, 0, 1174, 1175, 6, 135, 25, 0, 1175, 287, 1, 0, 0, 0, 1176, 1177, 3, 58, 21, 0, 1177, 1178, 1, 0, 0, 0, 1178, 1179, 6, 136, 11, 0, 1179, 289, 1, 0, 0, 0, 1180, 1181, 3, 60, 22, 0, 1181, 1182, 1, 0, 0, 0, 1182, 1183, 6, 137, 11, 0, 1183, 291, 1, 0, 0, 0, 1184, 1185, 3, 62, 23, 0, 1185, 1186, 1, 0, 0, 0, 1186, 1187, 6, 138, 11, 0, 1187, 293, 1, 0, 0, 0, 1188, 1189, 3, 78, 31, 0, 1189, 1190, 1, 0, 0, 0, 1190, 1191, 6, 139, 14, 0, 1191, 1192, 6, 139, 15, 0, 1192, 295, 1, 0, 0, 0, 1193, 1194, 3, 116, 50, 0, 1194, 1195, 1, 0, 0, 0, 1195, 1196, 6, 140, 17, 0, 1196, 297, 1, 0, 0, 0, 1197, 1198, 3, 120, 52, 0, 1198, 1199, 1, 0, 0, 0, 1199, 1200, 6, 141, 21, 0, 1200, 299, 1, 0, 0, 0, 1201, 1202, 3, 256, 120, 0, 1202, 1203, 1, 0, 0, 0, 1203, 1204, 6, 142, 28, 0, 1204, 1205, 6, 142, 29, 0, 1205, 301, 1, 0, 0, 0, 1206, 1207, 3, 66, 25, 0, 1207, 1208, 1, 0, 0, 0, 1208, 1209, 6, 143, 20, 0, 1209, 303, 1, 0, 0, 0, 1210, 1211, 3, 58, 21, 0, 1211, 1212, 1, 0, 0, 0, 1212, 1213, 6, 144, 11, 0, 1213, 305, 1, 0, 0, 0, 1214, 1215, 3, 60, 22, 0, 1215, 1216, 1, 0, 0, 0, 1216, 1217, 6, 145, 11, 0, 1217, 307, 1, 0, 0, 0, 1218, 1219, 3, 62, 23, 0, 1219, 1220, 1, 0, 0, 0, 1220, 1221, 6, 146, 11, 0, 1221, 309, 1, 0, 0, 0, 1222, 1223, 3, 78, 31, 0, 1223, 1224, 1, 0, 0, 0, 1224, 1225, 6, 147, 14, 0, 1225, 1226, 6, 147, 15, 0, 1226, 1227, 6, 147, 15, 0, 1227, 311, 1, 0, 0, 0, 1228, 1229, 3, 116, 50, 0, 1229, 1230, 1, 0, 0, 0, 1230, 1231, 6, 148, 17, 0, 1231, 313, 1, 0, 0, 0, 1232, 1233, 3, 120, 52, 0, 1233, 1234, 1, 0, 0, 0, 1234, 1235, 6, 149, 21, 0, 1235, 315, 1, 0, 0, 0, 1236, 1237, 3, 226, 105, 0, 1237, 1238, 1, 0, 0, 0, 1238, 1239, 6, 150, 22, 0, 1239, 317, 1, 0, 0, 0, 1240, 1241, 3, 58, 21, 0, 1241, 1242, 1, 0, 0, 0, 1242, 1243, 6, 151, 11, 0, 1243, 319, 1, 0, 0, 0, 1244, 1245, 3, 60, 22, 0, 1245, 1246, 1, 0, 0, 0, 1246, 1247, 6, 152, 11, 0, 1247, 321, 1, 0, 0, 0, 1248, 1249, 3, 62, 23, 0, 1249, 1250, 1, 0, 0, 0, 1250, 1251, 6, 153, 11, 0, 1251, 323, 1, 0, 0, 0, 1252, 1253, 3, 78, 31, 0, 1253, 1254, 1, 0, 0, 0, 1254, 1255, 6, 154, 14, 0, 1255, 1256, 6, 154, 15, 0, 1256, 325, 1, 0, 0, 0, 1257, 1258, 3, 120, 52, 0, 1258, 1259, 1, 0, 0, 0, 1259, 1260, 6, 155, 21, 0, 1260, 327, 1, 0, 0, 0, 1261, 1262, 3, 186, 85, 0, 1262, 1263, 1, 0, 0, 0, 1263, 1264, 6, 156, 25, 0, 1264, 329, 1, 0, 0, 0, 1265, 1266, 3, 182, 83, 0, 1266, 1267, 1, 0, 0, 0, 1267, 1268, 6, 157, 30, 0, 1268, 331, 1, 0, 0, 0, 1269, 1270, 3, 58, 21, 0, 1270, 1271, 1, 0, 0, 0, 1271, 1272, 6, 158, 11, 0, 1272, 333, 1, 0, 0, 0, 1273, 1274, 3, 60, 22, 0, 1274, 1275, 1, 0, 0, 0, 1275, 1276, 6, 159, 11, 0, 1276, 335, 1, 0, 0, 0, 1277, 1278, 3, 62, 23, 0, 1278, 1279, 1, 0, 0, 0, 1279, 1280, 6, 160, 11, 0, 1280, 337, 1, 0, 0, 0, 1281, 1282, 3, 78, 31, 0, 1282, 1283, 1, 0, 0, 0, 1283, 1284, 6, 161, 14, 0, 1284, 1285, 6, 161, 15, 0, 1285, 339, 1, 0, 0, 0, 1286, 1287, 7, 1, 0, 0, 1287, 1288, 7, 9, 0, 0, 1288, 1289, 7, 15, 0, 0, 1289, 1290, 7, 7, 0, 0, 1290, 341, 1, 0, 0, 0, 1291, 1292, 3, 58, 21, 0, 1292, 1293, 1, 0, 0, 0, 1293, 1294, 6, 163, 11, 0, 1294, 343, 1, 0, 0, 0, 1295, 1296, 3, 60, 22, 0, 1296, 1297, 1, 0, 0, 0, 1297, 1298, 6, 164, 11, 0, 1298, 345, 1, 0, 0, 0, 1299, 1300, 3, 62, 23, 0, 1300, 1301, 1, 0, 0, 0, 1301, 1302, 6, 165, 11, 0, 1302, 347, 1, 0, 0, 0, 1303, 1304, 3, 78, 31, 0, 1304, 1305, 1, 0, 0, 0, 1305, 1306, 6, 166, 14, 0, 1306, 1307, 6, 166, 15, 0, 1307, 349, 1, 0, 0, 0, 1308, 1309, 7, 15, 0, 0, 1309, 1310, 7, 19, 0, 0, 1310, 1311, 7, 9, 0, 0, 1311, 1312, 7, 4, 0, 0, 1312, 1313, 7, 5, 0, 0, 1313, 1314, 7, 1, 0, 0, 1314, 1315, 7, 7, 0, 0, 1315, 1316, 7, 9, 0, 0, 1316, 1317, 7, 2, 0, 0, 1317, 351, 1, 0, 0, 0, 1318, 1319, 3, 58, 21, 0, 1319, 1320, 1, 0, 0, 0, 1320, 1321, 6, 168, 11, 0, 1321, 353, 1, 0, 0, 0, 1322, 1323, 3, 60, 22, 0, 1323, 1324, 1, 0, 0, 0, 1324, 1325, 6, 169, 11, 0, 1325, 355, 1, 0, 0, 0, 1326, 1327, 3, 62, 23, 0, 1327, 1328, 1, 0, 0, 0, 1328, 1329, 6, 170, 11, 0, 1329, 357, 1, 0, 0, 0, 1330, 1331, 3, 180, 82, 0, 1331, 1332, 1, 0, 0, 0, 1332, 1333, 6, 171, 16, 0, 1333, 1334, 6, 171, 15, 0, 1334, 359, 1, 0, 0, 0, 1335, 1336, 5, 58, 0, 0, 1336, 361, 1, 0, 0, 0, 1337, 1343, 3, 90, 37, 0, 1338, 1343, 3, 80, 32, 0, 1339, 1343, 3, 120, 52, 0, 1340, 1343, 3, 82, 33, 0, 1341, 1343, 3, 96, 40, 0, 1342, 1337, 1, 0, 0, 0, 1342, 1338, 1, 0, 0, 0, 1342, 1339, 1, 0, 0, 0, 1342, 1340, 1, 0, 0, 0, 1342, 1341, 1, 0, 0, 0, 1343, 1344, 1, 0, 0, 0, 1344, 1342, 1, 0, 0, 0, 1344, 1345, 1, 0, 0, 0, 1345, 363, 1, 0, 0, 0, 1346, 1347, 3, 58, 21, 0, 1347, 1348, 1, 0, 0, 0, 1348, 1349, 6, 174, 11, 0, 1349, 365, 1, 0, 0, 0, 1350, 1351, 3, 60, 22, 0, 1351, 1352, 1, 0, 0, 0, 1352, 1353, 6, 175, 11, 0, 1353, 367, 1, 0, 0, 0, 1354, 1355, 3, 62, 23, 0, 1355, 1356, 1, 0, 0, 0, 1356, 1357, 6, 176, 11, 0, 1357, 369, 1, 0, 0, 0, 1358, 1359, 3, 78, 31, 0, 1359, 1360, 1, 0, 0, 0, 1360, 1361, 6, 177, 14, 0, 1361, 1362, 6, 177, 15, 0, 1362, 371, 1, 0, 0, 0, 1363, 1364, 3, 66, 25, 0, 1364, 1365, 1, 0, 0, 0, 1365, 1366, 6, 178, 20, 0, 1366, 1367, 6, 178, 15, 0, 1367, 1368, 6, 178, 31, 0, 1368, 373, 1, 0, 0, 0, 1369, 1370, 3, 58, 21, 0, 1370, 1371, 1, 0, 0, 0, 1371, 1372, 6, 179, 11, 0, 1372, 375, 1, 0, 0, 0, 1373, 1374, 3, 60, 22, 0, 1374, 1375, 1, 0, 0, 0, 1375, 1376, 6, 180, 11, 0, 1376, 377, 1, 0, 0, 0, 1377, 1378, 3, 62, 23, 0, 1378, 1379, 1, 0, 0, 0, 1379, 1380, 6, 181, 11, 0, 1380, 379, 1, 0, 0, 0, 1381, 1382, 3, 116, 50, 0, 1382, 1383, 1, 0, 0, 0, 1383, 1384, 6, 182, 17, 0, 1384, 1385, 6, 182, 15, 0, 1385, 1386, 6, 182, 7, 0, 1386, 381, 1, 0, 0, 0, 1387, 1388, 3, 58, 21, 0, 1388, 1389, 1, 0, 0, 0, 1389, 1390, 6, 183, 11, 0, 1390, 383, 1, 0, 0, 0, 1391, 1392, 3, 60, 22, 0, 1392, 1393, 1, 0, 0, 0, 1393, 1394, 6, 184, 11, 0, 1394, 385, 1, 0, 0, 0, 1395, 1396, 3, 62, 23, 0, 1396, 1397, 1, 0, 0, 0, 1397, 1398, 6, 185, 11, 0, 1398, 387, 1, 0, 0, 0, 1399, 1400, 3, 186, 85, 0, 1400, 1401, 1, 0, 0, 0, 1401, 1402, 6, 186, 15, 0, 1402, 1403, 6, 186, 0, 0, 1403, 1404, 6, 186, 25, 0, 1404, 389, 1, 0, 0, 0, 1405, 1406, 3, 182, 83, 0, 1406, 1407, 1, 0, 0, 0, 1407, 1408, 6, 187, 15, 0, 1408, 1409, 6, 187, 0, 0, 1409, 1410, 6, 187, 30, 0, 1410, 391, 1, 0, 0, 0, 1411, 1412, 3, 106, 45, 0, 1412, 1413, 1, 0, 0, 0, 1413, 1414, 6, 188, 15, 0, 1414, 1415, 6, 188, 0, 0, 1415, 1416, 6, 188, 32, 0, 1416, 393, 1, 0, 0, 0, 1417, 1418, 3, 78, 31, 0, 1418, 1419, 1, 0, 0, 0, 1419, 1420, 6, 189, 14, 0, 1420, 1421, 6, 189, 15, 0, 1421, 395, 1, 0, 0, 0, 65, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 568, 578, 582, 585, 594, 596, 607, 614, 619, 658, 663, 672, 679, 684, 686, 697, 705, 708, 710, 715, 720, 726, 733, 738, 744, 747, 755, 759, 883, 890, 892, 908, 913, 918, 920, 926, 1011, 1015, 1020, 1025, 1030, 1032, 1036, 1038, 1115, 1119, 1124, 1342, 1344, 33, 5, 2, 0, 5, 4, 0, 5, 6, 0, 5, 1, 0, 5, 3, 0, 5, 8, 0, 5, 12, 0, 5, 14, 0, 5, 10, 0, 5, 5, 0, 5, 11, 0, 0, 1, 0, 7, 69, 0, 5, 0, 0, 7, 29, 0, 4, 0, 0, 7, 70, 0, 7, 38, 0, 7, 36, 0, 7, 30, 0, 7, 25, 0, 7, 40, 0, 7, 80, 0, 5, 13, 0, 5, 7, 0, 7, 72, 0, 7, 90, 0, 7, 89, 0, 7, 88, 0, 5, 9, 0, 7, 71, 0, 5, 15, 0, 7, 33, 0] \ No newline at end of file +[4, 0, 124, 1450, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 2, 111, 7, 111, 2, 112, 7, 112, 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, 7, 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, 7, 121, 2, 122, 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, 2, 126, 7, 126, 2, 127, 7, 127, 2, 128, 7, 128, 2, 129, 7, 129, 2, 130, 7, 130, 2, 131, 7, 131, 2, 132, 7, 132, 2, 133, 7, 133, 2, 134, 7, 134, 2, 135, 7, 135, 2, 136, 7, 136, 2, 137, 7, 137, 2, 138, 7, 138, 2, 139, 7, 139, 2, 140, 7, 140, 2, 141, 7, 141, 2, 142, 7, 142, 2, 143, 7, 143, 2, 144, 7, 144, 2, 145, 7, 145, 2, 146, 7, 146, 2, 147, 7, 147, 2, 148, 7, 148, 2, 149, 7, 149, 2, 150, 7, 150, 2, 151, 7, 151, 2, 152, 7, 152, 2, 153, 7, 153, 2, 154, 7, 154, 2, 155, 7, 155, 2, 156, 7, 156, 2, 157, 7, 157, 2, 158, 7, 158, 2, 159, 7, 159, 2, 160, 7, 160, 2, 161, 7, 161, 2, 162, 7, 162, 2, 163, 7, 163, 2, 164, 7, 164, 2, 165, 7, 165, 2, 166, 7, 166, 2, 167, 7, 167, 2, 168, 7, 168, 2, 169, 7, 169, 2, 170, 7, 170, 2, 171, 7, 171, 2, 172, 7, 172, 2, 173, 7, 173, 2, 174, 7, 174, 2, 175, 7, 175, 2, 176, 7, 176, 2, 177, 7, 177, 2, 178, 7, 178, 2, 179, 7, 179, 2, 180, 7, 180, 2, 181, 7, 181, 2, 182, 7, 182, 2, 183, 7, 183, 2, 184, 7, 184, 2, 185, 7, 185, 2, 186, 7, 186, 2, 187, 7, 187, 2, 188, 7, 188, 2, 189, 7, 189, 2, 190, 7, 190, 2, 191, 7, 191, 2, 192, 7, 192, 2, 193, 7, 193, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 4, 20, 575, 8, 20, 11, 20, 12, 20, 576, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 5, 21, 585, 8, 21, 10, 21, 12, 21, 588, 9, 21, 1, 21, 3, 21, 591, 8, 21, 1, 21, 3, 21, 594, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 5, 22, 603, 8, 22, 10, 22, 12, 22, 606, 9, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 4, 23, 614, 8, 23, 11, 23, 12, 23, 615, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 3, 24, 623, 8, 24, 1, 25, 4, 25, 626, 8, 25, 11, 25, 12, 25, 627, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 3, 36, 667, 8, 36, 1, 36, 4, 36, 670, 8, 36, 11, 36, 12, 36, 671, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 3, 39, 681, 8, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 3, 41, 688, 8, 41, 1, 42, 1, 42, 1, 42, 5, 42, 693, 8, 42, 10, 42, 12, 42, 696, 9, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 5, 42, 704, 8, 42, 10, 42, 12, 42, 707, 9, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 3, 42, 714, 8, 42, 1, 42, 3, 42, 717, 8, 42, 3, 42, 719, 8, 42, 1, 43, 4, 43, 722, 8, 43, 11, 43, 12, 43, 723, 1, 44, 4, 44, 727, 8, 44, 11, 44, 12, 44, 728, 1, 44, 1, 44, 5, 44, 733, 8, 44, 10, 44, 12, 44, 736, 9, 44, 1, 44, 1, 44, 4, 44, 740, 8, 44, 11, 44, 12, 44, 741, 1, 44, 4, 44, 745, 8, 44, 11, 44, 12, 44, 746, 1, 44, 1, 44, 5, 44, 751, 8, 44, 10, 44, 12, 44, 754, 9, 44, 3, 44, 756, 8, 44, 1, 44, 1, 44, 1, 44, 1, 44, 4, 44, 762, 8, 44, 11, 44, 12, 44, 763, 1, 44, 1, 44, 3, 44, 768, 8, 44, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 76, 1, 76, 1, 77, 1, 77, 1, 78, 1, 78, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 5, 80, 890, 8, 80, 10, 80, 12, 80, 893, 9, 80, 1, 80, 1, 80, 4, 80, 897, 8, 80, 11, 80, 12, 80, 898, 3, 80, 901, 8, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 5, 83, 915, 8, 83, 10, 83, 12, 83, 918, 9, 83, 1, 83, 1, 83, 3, 83, 922, 8, 83, 1, 83, 4, 83, 925, 8, 83, 11, 83, 12, 83, 926, 3, 83, 929, 8, 83, 1, 84, 1, 84, 4, 84, 933, 8, 84, 11, 84, 12, 84, 934, 1, 84, 1, 84, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 3, 104, 1024, 8, 104, 1, 105, 1, 105, 3, 105, 1028, 8, 105, 1, 105, 5, 105, 1031, 8, 105, 10, 105, 12, 105, 1034, 9, 105, 1, 105, 1, 105, 3, 105, 1038, 8, 105, 1, 105, 4, 105, 1041, 8, 105, 11, 105, 12, 105, 1042, 3, 105, 1045, 8, 105, 1, 106, 1, 106, 4, 106, 1049, 8, 106, 11, 106, 12, 106, 1050, 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 120, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, 1, 121, 1, 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 123, 1, 123, 1, 124, 4, 124, 1126, 8, 124, 11, 124, 12, 124, 1127, 1, 124, 1, 124, 3, 124, 1132, 8, 124, 1, 124, 4, 124, 1135, 8, 124, 11, 124, 12, 124, 1136, 1, 125, 1, 125, 1, 125, 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 128, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, 129, 1, 130, 1, 130, 1, 130, 1, 130, 1, 131, 1, 131, 1, 131, 1, 131, 1, 132, 1, 132, 1, 132, 1, 132, 1, 133, 1, 133, 1, 133, 1, 133, 1, 134, 1, 134, 1, 134, 1, 134, 1, 135, 1, 135, 1, 135, 1, 135, 1, 136, 1, 136, 1, 136, 1, 136, 1, 137, 1, 137, 1, 137, 1, 137, 1, 138, 1, 138, 1, 138, 1, 138, 1, 139, 1, 139, 1, 139, 1, 139, 1, 139, 1, 140, 1, 140, 1, 140, 1, 140, 1, 141, 1, 141, 1, 141, 1, 141, 1, 142, 1, 142, 1, 142, 1, 142, 1, 143, 1, 143, 1, 143, 1, 143, 1, 143, 1, 144, 1, 144, 1, 144, 1, 144, 1, 145, 1, 145, 1, 145, 1, 145, 1, 146, 1, 146, 1, 146, 1, 146, 1, 147, 1, 147, 1, 147, 1, 147, 1, 148, 1, 148, 1, 148, 1, 148, 1, 149, 1, 149, 1, 149, 1, 149, 1, 149, 1, 149, 1, 150, 1, 150, 1, 150, 1, 150, 1, 151, 1, 151, 1, 151, 1, 151, 1, 152, 1, 152, 1, 152, 1, 152, 1, 153, 1, 153, 1, 153, 1, 153, 1, 154, 1, 154, 1, 154, 1, 154, 1, 155, 1, 155, 1, 155, 1, 155, 1, 156, 1, 156, 1, 156, 1, 156, 1, 156, 1, 157, 1, 157, 1, 157, 1, 157, 1, 158, 1, 158, 1, 158, 1, 158, 1, 159, 1, 159, 1, 159, 1, 159, 1, 160, 1, 160, 1, 160, 1, 160, 1, 161, 1, 161, 1, 161, 1, 161, 1, 162, 1, 162, 1, 162, 1, 162, 1, 163, 1, 163, 1, 163, 1, 163, 1, 163, 1, 164, 1, 164, 1, 164, 1, 164, 1, 164, 1, 165, 1, 165, 1, 165, 1, 165, 1, 166, 1, 166, 1, 166, 1, 166, 1, 167, 1, 167, 1, 167, 1, 167, 1, 168, 1, 168, 1, 168, 1, 168, 1, 168, 1, 169, 1, 169, 1, 169, 1, 169, 1, 169, 1, 169, 1, 169, 1, 169, 1, 169, 1, 169, 1, 170, 1, 170, 1, 170, 1, 170, 1, 171, 1, 171, 1, 171, 1, 171, 1, 172, 1, 172, 1, 172, 1, 172, 1, 173, 1, 173, 1, 173, 1, 173, 1, 173, 1, 174, 1, 174, 1, 175, 1, 175, 1, 175, 1, 175, 1, 175, 4, 175, 1359, 8, 175, 11, 175, 12, 175, 1360, 1, 176, 1, 176, 1, 176, 1, 176, 1, 177, 1, 177, 1, 177, 1, 177, 1, 178, 1, 178, 1, 178, 1, 178, 1, 179, 1, 179, 1, 179, 1, 179, 1, 179, 1, 180, 1, 180, 1, 180, 1, 180, 1, 180, 1, 180, 1, 181, 1, 181, 1, 181, 1, 181, 1, 181, 1, 181, 1, 182, 1, 182, 1, 182, 1, 182, 1, 183, 1, 183, 1, 183, 1, 183, 1, 184, 1, 184, 1, 184, 1, 184, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 185, 1, 186, 1, 186, 1, 186, 1, 186, 1, 186, 1, 186, 1, 187, 1, 187, 1, 187, 1, 187, 1, 188, 1, 188, 1, 188, 1, 188, 1, 189, 1, 189, 1, 189, 1, 189, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 190, 1, 191, 1, 191, 1, 191, 1, 191, 1, 191, 1, 191, 1, 192, 1, 192, 1, 192, 1, 192, 1, 192, 1, 192, 1, 193, 1, 193, 1, 193, 1, 193, 1, 193, 2, 604, 705, 0, 194, 16, 1, 18, 2, 20, 3, 22, 4, 24, 5, 26, 6, 28, 7, 30, 8, 32, 9, 34, 10, 36, 11, 38, 12, 40, 13, 42, 14, 44, 15, 46, 16, 48, 17, 50, 18, 52, 19, 54, 20, 56, 21, 58, 22, 60, 23, 62, 24, 64, 0, 66, 25, 68, 0, 70, 0, 72, 26, 74, 27, 76, 28, 78, 29, 80, 0, 82, 0, 84, 0, 86, 0, 88, 0, 90, 0, 92, 0, 94, 0, 96, 0, 98, 0, 100, 30, 102, 31, 104, 32, 106, 33, 108, 34, 110, 35, 112, 36, 114, 37, 116, 38, 118, 39, 120, 40, 122, 41, 124, 42, 126, 43, 128, 44, 130, 45, 132, 46, 134, 47, 136, 48, 138, 49, 140, 50, 142, 51, 144, 52, 146, 53, 148, 54, 150, 55, 152, 56, 154, 57, 156, 58, 158, 59, 160, 60, 162, 61, 164, 62, 166, 63, 168, 64, 170, 65, 172, 66, 174, 67, 176, 68, 178, 69, 180, 70, 182, 71, 184, 0, 186, 72, 188, 73, 190, 74, 192, 75, 194, 0, 196, 0, 198, 0, 200, 0, 202, 0, 204, 0, 206, 76, 208, 0, 210, 0, 212, 77, 214, 78, 216, 79, 218, 0, 220, 0, 222, 0, 224, 0, 226, 0, 228, 80, 230, 81, 232, 82, 234, 83, 236, 0, 238, 0, 240, 0, 242, 0, 244, 84, 246, 0, 248, 85, 250, 86, 252, 87, 254, 0, 256, 0, 258, 88, 260, 89, 262, 0, 264, 90, 266, 0, 268, 91, 270, 92, 272, 93, 274, 0, 276, 0, 278, 0, 280, 0, 282, 0, 284, 0, 286, 0, 288, 94, 290, 95, 292, 96, 294, 0, 296, 0, 298, 0, 300, 0, 302, 0, 304, 0, 306, 0, 308, 97, 310, 98, 312, 99, 314, 0, 316, 0, 318, 0, 320, 0, 322, 100, 324, 101, 326, 102, 328, 0, 330, 0, 332, 0, 334, 0, 336, 103, 338, 104, 340, 105, 342, 0, 344, 106, 346, 107, 348, 108, 350, 109, 352, 0, 354, 110, 356, 111, 358, 112, 360, 113, 362, 0, 364, 114, 366, 115, 368, 116, 370, 117, 372, 118, 374, 0, 376, 0, 378, 0, 380, 119, 382, 120, 384, 121, 386, 0, 388, 0, 390, 122, 392, 123, 394, 124, 396, 0, 398, 0, 400, 0, 402, 0, 16, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 35, 2, 0, 68, 68, 100, 100, 2, 0, 73, 73, 105, 105, 2, 0, 83, 83, 115, 115, 2, 0, 69, 69, 101, 101, 2, 0, 67, 67, 99, 99, 2, 0, 84, 84, 116, 116, 2, 0, 82, 82, 114, 114, 2, 0, 79, 79, 111, 111, 2, 0, 80, 80, 112, 112, 2, 0, 78, 78, 110, 110, 2, 0, 72, 72, 104, 104, 2, 0, 86, 86, 118, 118, 2, 0, 65, 65, 97, 97, 2, 0, 76, 76, 108, 108, 2, 0, 88, 88, 120, 120, 2, 0, 70, 70, 102, 102, 2, 0, 77, 77, 109, 109, 2, 0, 71, 71, 103, 103, 2, 0, 75, 75, 107, 107, 2, 0, 85, 85, 117, 117, 2, 0, 87, 87, 119, 119, 6, 0, 9, 10, 13, 13, 32, 32, 47, 47, 91, 91, 93, 93, 2, 0, 10, 10, 13, 13, 3, 0, 9, 10, 13, 13, 32, 32, 11, 0, 9, 10, 13, 13, 32, 32, 34, 34, 44, 44, 47, 47, 58, 58, 61, 61, 91, 91, 93, 93, 124, 124, 2, 0, 42, 42, 47, 47, 1, 0, 48, 57, 2, 0, 65, 90, 97, 122, 8, 0, 34, 34, 78, 78, 82, 82, 84, 84, 92, 92, 110, 110, 114, 114, 116, 116, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 2, 0, 43, 43, 45, 45, 1, 0, 96, 96, 2, 0, 66, 66, 98, 98, 2, 0, 89, 89, 121, 121, 11, 0, 9, 10, 13, 13, 32, 32, 34, 35, 44, 44, 47, 47, 58, 58, 60, 60, 62, 63, 92, 92, 124, 124, 1476, 0, 16, 1, 0, 0, 0, 0, 18, 1, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 24, 1, 0, 0, 0, 0, 26, 1, 0, 0, 0, 0, 28, 1, 0, 0, 0, 0, 30, 1, 0, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 1, 0, 0, 0, 0, 36, 1, 0, 0, 0, 0, 38, 1, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 46, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 50, 1, 0, 0, 0, 0, 52, 1, 0, 0, 0, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 66, 1, 0, 0, 0, 1, 68, 1, 0, 0, 0, 1, 70, 1, 0, 0, 0, 1, 72, 1, 0, 0, 0, 1, 74, 1, 0, 0, 0, 1, 76, 1, 0, 0, 0, 2, 78, 1, 0, 0, 0, 2, 100, 1, 0, 0, 0, 2, 102, 1, 0, 0, 0, 2, 104, 1, 0, 0, 0, 2, 106, 1, 0, 0, 0, 2, 108, 1, 0, 0, 0, 2, 110, 1, 0, 0, 0, 2, 112, 1, 0, 0, 0, 2, 114, 1, 0, 0, 0, 2, 116, 1, 0, 0, 0, 2, 118, 1, 0, 0, 0, 2, 120, 1, 0, 0, 0, 2, 122, 1, 0, 0, 0, 2, 124, 1, 0, 0, 0, 2, 126, 1, 0, 0, 0, 2, 128, 1, 0, 0, 0, 2, 130, 1, 0, 0, 0, 2, 132, 1, 0, 0, 0, 2, 134, 1, 0, 0, 0, 2, 136, 1, 0, 0, 0, 2, 138, 1, 0, 0, 0, 2, 140, 1, 0, 0, 0, 2, 142, 1, 0, 0, 0, 2, 144, 1, 0, 0, 0, 2, 146, 1, 0, 0, 0, 2, 148, 1, 0, 0, 0, 2, 150, 1, 0, 0, 0, 2, 152, 1, 0, 0, 0, 2, 154, 1, 0, 0, 0, 2, 156, 1, 0, 0, 0, 2, 158, 1, 0, 0, 0, 2, 160, 1, 0, 0, 0, 2, 162, 1, 0, 0, 0, 2, 164, 1, 0, 0, 0, 2, 166, 1, 0, 0, 0, 2, 168, 1, 0, 0, 0, 2, 170, 1, 0, 0, 0, 2, 172, 1, 0, 0, 0, 2, 174, 1, 0, 0, 0, 2, 176, 1, 0, 0, 0, 2, 178, 1, 0, 0, 0, 2, 180, 1, 0, 0, 0, 2, 182, 1, 0, 0, 0, 2, 186, 1, 0, 0, 0, 2, 188, 1, 0, 0, 0, 2, 190, 1, 0, 0, 0, 2, 192, 1, 0, 0, 0, 3, 194, 1, 0, 0, 0, 3, 196, 1, 0, 0, 0, 3, 198, 1, 0, 0, 0, 3, 200, 1, 0, 0, 0, 3, 202, 1, 0, 0, 0, 3, 204, 1, 0, 0, 0, 3, 206, 1, 0, 0, 0, 3, 208, 1, 0, 0, 0, 3, 210, 1, 0, 0, 0, 3, 212, 1, 0, 0, 0, 3, 214, 1, 0, 0, 0, 3, 216, 1, 0, 0, 0, 4, 218, 1, 0, 0, 0, 4, 220, 1, 0, 0, 0, 4, 222, 1, 0, 0, 0, 4, 228, 1, 0, 0, 0, 4, 230, 1, 0, 0, 0, 4, 232, 1, 0, 0, 0, 4, 234, 1, 0, 0, 0, 5, 236, 1, 0, 0, 0, 5, 238, 1, 0, 0, 0, 5, 240, 1, 0, 0, 0, 5, 242, 1, 0, 0, 0, 5, 244, 1, 0, 0, 0, 5, 246, 1, 0, 0, 0, 5, 248, 1, 0, 0, 0, 5, 250, 1, 0, 0, 0, 5, 252, 1, 0, 0, 0, 6, 254, 1, 0, 0, 0, 6, 256, 1, 0, 0, 0, 6, 258, 1, 0, 0, 0, 6, 260, 1, 0, 0, 0, 6, 264, 1, 0, 0, 0, 6, 266, 1, 0, 0, 0, 6, 268, 1, 0, 0, 0, 6, 270, 1, 0, 0, 0, 6, 272, 1, 0, 0, 0, 7, 274, 1, 0, 0, 0, 7, 276, 1, 0, 0, 0, 7, 278, 1, 0, 0, 0, 7, 280, 1, 0, 0, 0, 7, 282, 1, 0, 0, 0, 7, 284, 1, 0, 0, 0, 7, 286, 1, 0, 0, 0, 7, 288, 1, 0, 0, 0, 7, 290, 1, 0, 0, 0, 7, 292, 1, 0, 0, 0, 8, 294, 1, 0, 0, 0, 8, 296, 1, 0, 0, 0, 8, 298, 1, 0, 0, 0, 8, 300, 1, 0, 0, 0, 8, 302, 1, 0, 0, 0, 8, 304, 1, 0, 0, 0, 8, 306, 1, 0, 0, 0, 8, 308, 1, 0, 0, 0, 8, 310, 1, 0, 0, 0, 8, 312, 1, 0, 0, 0, 9, 314, 1, 0, 0, 0, 9, 316, 1, 0, 0, 0, 9, 318, 1, 0, 0, 0, 9, 320, 1, 0, 0, 0, 9, 322, 1, 0, 0, 0, 9, 324, 1, 0, 0, 0, 9, 326, 1, 0, 0, 0, 10, 328, 1, 0, 0, 0, 10, 330, 1, 0, 0, 0, 10, 332, 1, 0, 0, 0, 10, 334, 1, 0, 0, 0, 10, 336, 1, 0, 0, 0, 10, 338, 1, 0, 0, 0, 10, 340, 1, 0, 0, 0, 11, 342, 1, 0, 0, 0, 11, 344, 1, 0, 0, 0, 11, 346, 1, 0, 0, 0, 11, 348, 1, 0, 0, 0, 11, 350, 1, 0, 0, 0, 12, 352, 1, 0, 0, 0, 12, 354, 1, 0, 0, 0, 12, 356, 1, 0, 0, 0, 12, 358, 1, 0, 0, 0, 12, 360, 1, 0, 0, 0, 13, 362, 1, 0, 0, 0, 13, 364, 1, 0, 0, 0, 13, 366, 1, 0, 0, 0, 13, 368, 1, 0, 0, 0, 13, 370, 1, 0, 0, 0, 13, 372, 1, 0, 0, 0, 14, 374, 1, 0, 0, 0, 14, 376, 1, 0, 0, 0, 14, 378, 1, 0, 0, 0, 14, 380, 1, 0, 0, 0, 14, 382, 1, 0, 0, 0, 14, 384, 1, 0, 0, 0, 15, 386, 1, 0, 0, 0, 15, 388, 1, 0, 0, 0, 15, 390, 1, 0, 0, 0, 15, 392, 1, 0, 0, 0, 15, 394, 1, 0, 0, 0, 15, 396, 1, 0, 0, 0, 15, 398, 1, 0, 0, 0, 15, 400, 1, 0, 0, 0, 15, 402, 1, 0, 0, 0, 16, 404, 1, 0, 0, 0, 18, 414, 1, 0, 0, 0, 20, 421, 1, 0, 0, 0, 22, 430, 1, 0, 0, 0, 24, 437, 1, 0, 0, 0, 26, 447, 1, 0, 0, 0, 28, 454, 1, 0, 0, 0, 30, 461, 1, 0, 0, 0, 32, 475, 1, 0, 0, 0, 34, 482, 1, 0, 0, 0, 36, 490, 1, 0, 0, 0, 38, 499, 1, 0, 0, 0, 40, 506, 1, 0, 0, 0, 42, 516, 1, 0, 0, 0, 44, 528, 1, 0, 0, 0, 46, 537, 1, 0, 0, 0, 48, 543, 1, 0, 0, 0, 50, 550, 1, 0, 0, 0, 52, 557, 1, 0, 0, 0, 54, 565, 1, 0, 0, 0, 56, 574, 1, 0, 0, 0, 58, 580, 1, 0, 0, 0, 60, 597, 1, 0, 0, 0, 62, 613, 1, 0, 0, 0, 64, 622, 1, 0, 0, 0, 66, 625, 1, 0, 0, 0, 68, 629, 1, 0, 0, 0, 70, 634, 1, 0, 0, 0, 72, 639, 1, 0, 0, 0, 74, 643, 1, 0, 0, 0, 76, 647, 1, 0, 0, 0, 78, 651, 1, 0, 0, 0, 80, 655, 1, 0, 0, 0, 82, 657, 1, 0, 0, 0, 84, 659, 1, 0, 0, 0, 86, 662, 1, 0, 0, 0, 88, 664, 1, 0, 0, 0, 90, 673, 1, 0, 0, 0, 92, 675, 1, 0, 0, 0, 94, 680, 1, 0, 0, 0, 96, 682, 1, 0, 0, 0, 98, 687, 1, 0, 0, 0, 100, 718, 1, 0, 0, 0, 102, 721, 1, 0, 0, 0, 104, 767, 1, 0, 0, 0, 106, 769, 1, 0, 0, 0, 108, 772, 1, 0, 0, 0, 110, 776, 1, 0, 0, 0, 112, 780, 1, 0, 0, 0, 114, 782, 1, 0, 0, 0, 116, 785, 1, 0, 0, 0, 118, 787, 1, 0, 0, 0, 120, 792, 1, 0, 0, 0, 122, 794, 1, 0, 0, 0, 124, 800, 1, 0, 0, 0, 126, 806, 1, 0, 0, 0, 128, 811, 1, 0, 0, 0, 130, 813, 1, 0, 0, 0, 132, 816, 1, 0, 0, 0, 134, 819, 1, 0, 0, 0, 136, 824, 1, 0, 0, 0, 138, 828, 1, 0, 0, 0, 140, 833, 1, 0, 0, 0, 142, 839, 1, 0, 0, 0, 144, 842, 1, 0, 0, 0, 146, 844, 1, 0, 0, 0, 148, 850, 1, 0, 0, 0, 150, 852, 1, 0, 0, 0, 152, 857, 1, 0, 0, 0, 154, 860, 1, 0, 0, 0, 156, 863, 1, 0, 0, 0, 158, 866, 1, 0, 0, 0, 160, 868, 1, 0, 0, 0, 162, 871, 1, 0, 0, 0, 164, 873, 1, 0, 0, 0, 166, 876, 1, 0, 0, 0, 168, 878, 1, 0, 0, 0, 170, 880, 1, 0, 0, 0, 172, 882, 1, 0, 0, 0, 174, 884, 1, 0, 0, 0, 176, 900, 1, 0, 0, 0, 178, 902, 1, 0, 0, 0, 180, 907, 1, 0, 0, 0, 182, 928, 1, 0, 0, 0, 184, 930, 1, 0, 0, 0, 186, 938, 1, 0, 0, 0, 188, 940, 1, 0, 0, 0, 190, 944, 1, 0, 0, 0, 192, 948, 1, 0, 0, 0, 194, 952, 1, 0, 0, 0, 196, 957, 1, 0, 0, 0, 198, 961, 1, 0, 0, 0, 200, 965, 1, 0, 0, 0, 202, 969, 1, 0, 0, 0, 204, 973, 1, 0, 0, 0, 206, 977, 1, 0, 0, 0, 208, 986, 1, 0, 0, 0, 210, 990, 1, 0, 0, 0, 212, 994, 1, 0, 0, 0, 214, 998, 1, 0, 0, 0, 216, 1002, 1, 0, 0, 0, 218, 1006, 1, 0, 0, 0, 220, 1011, 1, 0, 0, 0, 222, 1015, 1, 0, 0, 0, 224, 1023, 1, 0, 0, 0, 226, 1044, 1, 0, 0, 0, 228, 1048, 1, 0, 0, 0, 230, 1052, 1, 0, 0, 0, 232, 1056, 1, 0, 0, 0, 234, 1060, 1, 0, 0, 0, 236, 1064, 1, 0, 0, 0, 238, 1069, 1, 0, 0, 0, 240, 1073, 1, 0, 0, 0, 242, 1077, 1, 0, 0, 0, 244, 1081, 1, 0, 0, 0, 246, 1084, 1, 0, 0, 0, 248, 1088, 1, 0, 0, 0, 250, 1092, 1, 0, 0, 0, 252, 1096, 1, 0, 0, 0, 254, 1100, 1, 0, 0, 0, 256, 1105, 1, 0, 0, 0, 258, 1110, 1, 0, 0, 0, 260, 1115, 1, 0, 0, 0, 262, 1122, 1, 0, 0, 0, 264, 1131, 1, 0, 0, 0, 266, 1138, 1, 0, 0, 0, 268, 1142, 1, 0, 0, 0, 270, 1146, 1, 0, 0, 0, 272, 1150, 1, 0, 0, 0, 274, 1154, 1, 0, 0, 0, 276, 1160, 1, 0, 0, 0, 278, 1164, 1, 0, 0, 0, 280, 1168, 1, 0, 0, 0, 282, 1172, 1, 0, 0, 0, 284, 1176, 1, 0, 0, 0, 286, 1180, 1, 0, 0, 0, 288, 1184, 1, 0, 0, 0, 290, 1188, 1, 0, 0, 0, 292, 1192, 1, 0, 0, 0, 294, 1196, 1, 0, 0, 0, 296, 1201, 1, 0, 0, 0, 298, 1205, 1, 0, 0, 0, 300, 1209, 1, 0, 0, 0, 302, 1213, 1, 0, 0, 0, 304, 1218, 1, 0, 0, 0, 306, 1222, 1, 0, 0, 0, 308, 1226, 1, 0, 0, 0, 310, 1230, 1, 0, 0, 0, 312, 1234, 1, 0, 0, 0, 314, 1238, 1, 0, 0, 0, 316, 1244, 1, 0, 0, 0, 318, 1248, 1, 0, 0, 0, 320, 1252, 1, 0, 0, 0, 322, 1256, 1, 0, 0, 0, 324, 1260, 1, 0, 0, 0, 326, 1264, 1, 0, 0, 0, 328, 1268, 1, 0, 0, 0, 330, 1273, 1, 0, 0, 0, 332, 1277, 1, 0, 0, 0, 334, 1281, 1, 0, 0, 0, 336, 1285, 1, 0, 0, 0, 338, 1289, 1, 0, 0, 0, 340, 1293, 1, 0, 0, 0, 342, 1297, 1, 0, 0, 0, 344, 1302, 1, 0, 0, 0, 346, 1307, 1, 0, 0, 0, 348, 1311, 1, 0, 0, 0, 350, 1315, 1, 0, 0, 0, 352, 1319, 1, 0, 0, 0, 354, 1324, 1, 0, 0, 0, 356, 1334, 1, 0, 0, 0, 358, 1338, 1, 0, 0, 0, 360, 1342, 1, 0, 0, 0, 362, 1346, 1, 0, 0, 0, 364, 1351, 1, 0, 0, 0, 366, 1358, 1, 0, 0, 0, 368, 1362, 1, 0, 0, 0, 370, 1366, 1, 0, 0, 0, 372, 1370, 1, 0, 0, 0, 374, 1374, 1, 0, 0, 0, 376, 1379, 1, 0, 0, 0, 378, 1385, 1, 0, 0, 0, 380, 1391, 1, 0, 0, 0, 382, 1395, 1, 0, 0, 0, 384, 1399, 1, 0, 0, 0, 386, 1403, 1, 0, 0, 0, 388, 1409, 1, 0, 0, 0, 390, 1415, 1, 0, 0, 0, 392, 1419, 1, 0, 0, 0, 394, 1423, 1, 0, 0, 0, 396, 1427, 1, 0, 0, 0, 398, 1433, 1, 0, 0, 0, 400, 1439, 1, 0, 0, 0, 402, 1445, 1, 0, 0, 0, 404, 405, 7, 0, 0, 0, 405, 406, 7, 1, 0, 0, 406, 407, 7, 2, 0, 0, 407, 408, 7, 2, 0, 0, 408, 409, 7, 3, 0, 0, 409, 410, 7, 4, 0, 0, 410, 411, 7, 5, 0, 0, 411, 412, 1, 0, 0, 0, 412, 413, 6, 0, 0, 0, 413, 17, 1, 0, 0, 0, 414, 415, 7, 0, 0, 0, 415, 416, 7, 6, 0, 0, 416, 417, 7, 7, 0, 0, 417, 418, 7, 8, 0, 0, 418, 419, 1, 0, 0, 0, 419, 420, 6, 1, 1, 0, 420, 19, 1, 0, 0, 0, 421, 422, 7, 3, 0, 0, 422, 423, 7, 9, 0, 0, 423, 424, 7, 6, 0, 0, 424, 425, 7, 1, 0, 0, 425, 426, 7, 4, 0, 0, 426, 427, 7, 10, 0, 0, 427, 428, 1, 0, 0, 0, 428, 429, 6, 2, 2, 0, 429, 21, 1, 0, 0, 0, 430, 431, 7, 3, 0, 0, 431, 432, 7, 11, 0, 0, 432, 433, 7, 12, 0, 0, 433, 434, 7, 13, 0, 0, 434, 435, 1, 0, 0, 0, 435, 436, 6, 3, 0, 0, 436, 23, 1, 0, 0, 0, 437, 438, 7, 3, 0, 0, 438, 439, 7, 14, 0, 0, 439, 440, 7, 8, 0, 0, 440, 441, 7, 13, 0, 0, 441, 442, 7, 12, 0, 0, 442, 443, 7, 1, 0, 0, 443, 444, 7, 9, 0, 0, 444, 445, 1, 0, 0, 0, 445, 446, 6, 4, 3, 0, 446, 25, 1, 0, 0, 0, 447, 448, 7, 15, 0, 0, 448, 449, 7, 6, 0, 0, 449, 450, 7, 7, 0, 0, 450, 451, 7, 16, 0, 0, 451, 452, 1, 0, 0, 0, 452, 453, 6, 5, 4, 0, 453, 27, 1, 0, 0, 0, 454, 455, 7, 17, 0, 0, 455, 456, 7, 6, 0, 0, 456, 457, 7, 7, 0, 0, 457, 458, 7, 18, 0, 0, 458, 459, 1, 0, 0, 0, 459, 460, 6, 6, 0, 0, 460, 29, 1, 0, 0, 0, 461, 462, 7, 1, 0, 0, 462, 463, 7, 9, 0, 0, 463, 464, 7, 13, 0, 0, 464, 465, 7, 1, 0, 0, 465, 466, 7, 9, 0, 0, 466, 467, 7, 3, 0, 0, 467, 468, 7, 2, 0, 0, 468, 469, 7, 5, 0, 0, 469, 470, 7, 12, 0, 0, 470, 471, 7, 5, 0, 0, 471, 472, 7, 2, 0, 0, 472, 473, 1, 0, 0, 0, 473, 474, 6, 7, 0, 0, 474, 31, 1, 0, 0, 0, 475, 476, 7, 18, 0, 0, 476, 477, 7, 3, 0, 0, 477, 478, 7, 3, 0, 0, 478, 479, 7, 8, 0, 0, 479, 480, 1, 0, 0, 0, 480, 481, 6, 8, 1, 0, 481, 33, 1, 0, 0, 0, 482, 483, 7, 13, 0, 0, 483, 484, 7, 1, 0, 0, 484, 485, 7, 16, 0, 0, 485, 486, 7, 1, 0, 0, 486, 487, 7, 5, 0, 0, 487, 488, 1, 0, 0, 0, 488, 489, 6, 9, 0, 0, 489, 35, 1, 0, 0, 0, 490, 491, 7, 13, 0, 0, 491, 492, 7, 7, 0, 0, 492, 493, 7, 7, 0, 0, 493, 494, 7, 18, 0, 0, 494, 495, 7, 19, 0, 0, 495, 496, 7, 8, 0, 0, 496, 497, 1, 0, 0, 0, 497, 498, 6, 10, 5, 0, 498, 37, 1, 0, 0, 0, 499, 500, 7, 16, 0, 0, 500, 501, 7, 3, 0, 0, 501, 502, 7, 5, 0, 0, 502, 503, 7, 12, 0, 0, 503, 504, 1, 0, 0, 0, 504, 505, 6, 11, 6, 0, 505, 39, 1, 0, 0, 0, 506, 507, 7, 16, 0, 0, 507, 508, 7, 3, 0, 0, 508, 509, 7, 5, 0, 0, 509, 510, 7, 6, 0, 0, 510, 511, 7, 1, 0, 0, 511, 512, 7, 4, 0, 0, 512, 513, 7, 2, 0, 0, 513, 514, 1, 0, 0, 0, 514, 515, 6, 12, 7, 0, 515, 41, 1, 0, 0, 0, 516, 517, 7, 16, 0, 0, 517, 518, 7, 11, 0, 0, 518, 519, 5, 95, 0, 0, 519, 520, 7, 3, 0, 0, 520, 521, 7, 14, 0, 0, 521, 522, 7, 8, 0, 0, 522, 523, 7, 12, 0, 0, 523, 524, 7, 9, 0, 0, 524, 525, 7, 0, 0, 0, 525, 526, 1, 0, 0, 0, 526, 527, 6, 13, 8, 0, 527, 43, 1, 0, 0, 0, 528, 529, 7, 6, 0, 0, 529, 530, 7, 3, 0, 0, 530, 531, 7, 9, 0, 0, 531, 532, 7, 12, 0, 0, 532, 533, 7, 16, 0, 0, 533, 534, 7, 3, 0, 0, 534, 535, 1, 0, 0, 0, 535, 536, 6, 14, 9, 0, 536, 45, 1, 0, 0, 0, 537, 538, 7, 6, 0, 0, 538, 539, 7, 7, 0, 0, 539, 540, 7, 20, 0, 0, 540, 541, 1, 0, 0, 0, 541, 542, 6, 15, 0, 0, 542, 47, 1, 0, 0, 0, 543, 544, 7, 2, 0, 0, 544, 545, 7, 10, 0, 0, 545, 546, 7, 7, 0, 0, 546, 547, 7, 20, 0, 0, 547, 548, 1, 0, 0, 0, 548, 549, 6, 16, 10, 0, 549, 49, 1, 0, 0, 0, 550, 551, 7, 2, 0, 0, 551, 552, 7, 7, 0, 0, 552, 553, 7, 6, 0, 0, 553, 554, 7, 5, 0, 0, 554, 555, 1, 0, 0, 0, 555, 556, 6, 17, 0, 0, 556, 51, 1, 0, 0, 0, 557, 558, 7, 2, 0, 0, 558, 559, 7, 5, 0, 0, 559, 560, 7, 12, 0, 0, 560, 561, 7, 5, 0, 0, 561, 562, 7, 2, 0, 0, 562, 563, 1, 0, 0, 0, 563, 564, 6, 18, 0, 0, 564, 53, 1, 0, 0, 0, 565, 566, 7, 20, 0, 0, 566, 567, 7, 10, 0, 0, 567, 568, 7, 3, 0, 0, 568, 569, 7, 6, 0, 0, 569, 570, 7, 3, 0, 0, 570, 571, 1, 0, 0, 0, 571, 572, 6, 19, 0, 0, 572, 55, 1, 0, 0, 0, 573, 575, 8, 21, 0, 0, 574, 573, 1, 0, 0, 0, 575, 576, 1, 0, 0, 0, 576, 574, 1, 0, 0, 0, 576, 577, 1, 0, 0, 0, 577, 578, 1, 0, 0, 0, 578, 579, 6, 20, 0, 0, 579, 57, 1, 0, 0, 0, 580, 581, 5, 47, 0, 0, 581, 582, 5, 47, 0, 0, 582, 586, 1, 0, 0, 0, 583, 585, 8, 22, 0, 0, 584, 583, 1, 0, 0, 0, 585, 588, 1, 0, 0, 0, 586, 584, 1, 0, 0, 0, 586, 587, 1, 0, 0, 0, 587, 590, 1, 0, 0, 0, 588, 586, 1, 0, 0, 0, 589, 591, 5, 13, 0, 0, 590, 589, 1, 0, 0, 0, 590, 591, 1, 0, 0, 0, 591, 593, 1, 0, 0, 0, 592, 594, 5, 10, 0, 0, 593, 592, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 595, 1, 0, 0, 0, 595, 596, 6, 21, 11, 0, 596, 59, 1, 0, 0, 0, 597, 598, 5, 47, 0, 0, 598, 599, 5, 42, 0, 0, 599, 604, 1, 0, 0, 0, 600, 603, 3, 60, 22, 0, 601, 603, 9, 0, 0, 0, 602, 600, 1, 0, 0, 0, 602, 601, 1, 0, 0, 0, 603, 606, 1, 0, 0, 0, 604, 605, 1, 0, 0, 0, 604, 602, 1, 0, 0, 0, 605, 607, 1, 0, 0, 0, 606, 604, 1, 0, 0, 0, 607, 608, 5, 42, 0, 0, 608, 609, 5, 47, 0, 0, 609, 610, 1, 0, 0, 0, 610, 611, 6, 22, 11, 0, 611, 61, 1, 0, 0, 0, 612, 614, 7, 23, 0, 0, 613, 612, 1, 0, 0, 0, 614, 615, 1, 0, 0, 0, 615, 613, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 617, 1, 0, 0, 0, 617, 618, 6, 23, 11, 0, 618, 63, 1, 0, 0, 0, 619, 623, 8, 24, 0, 0, 620, 621, 5, 47, 0, 0, 621, 623, 8, 25, 0, 0, 622, 619, 1, 0, 0, 0, 622, 620, 1, 0, 0, 0, 623, 65, 1, 0, 0, 0, 624, 626, 3, 64, 24, 0, 625, 624, 1, 0, 0, 0, 626, 627, 1, 0, 0, 0, 627, 625, 1, 0, 0, 0, 627, 628, 1, 0, 0, 0, 628, 67, 1, 0, 0, 0, 629, 630, 3, 178, 81, 0, 630, 631, 1, 0, 0, 0, 631, 632, 6, 26, 12, 0, 632, 633, 6, 26, 13, 0, 633, 69, 1, 0, 0, 0, 634, 635, 3, 78, 31, 0, 635, 636, 1, 0, 0, 0, 636, 637, 6, 27, 14, 0, 637, 638, 6, 27, 15, 0, 638, 71, 1, 0, 0, 0, 639, 640, 3, 62, 23, 0, 640, 641, 1, 0, 0, 0, 641, 642, 6, 28, 11, 0, 642, 73, 1, 0, 0, 0, 643, 644, 3, 58, 21, 0, 644, 645, 1, 0, 0, 0, 645, 646, 6, 29, 11, 0, 646, 75, 1, 0, 0, 0, 647, 648, 3, 60, 22, 0, 648, 649, 1, 0, 0, 0, 649, 650, 6, 30, 11, 0, 650, 77, 1, 0, 0, 0, 651, 652, 5, 124, 0, 0, 652, 653, 1, 0, 0, 0, 653, 654, 6, 31, 15, 0, 654, 79, 1, 0, 0, 0, 655, 656, 7, 26, 0, 0, 656, 81, 1, 0, 0, 0, 657, 658, 7, 27, 0, 0, 658, 83, 1, 0, 0, 0, 659, 660, 5, 92, 0, 0, 660, 661, 7, 28, 0, 0, 661, 85, 1, 0, 0, 0, 662, 663, 8, 29, 0, 0, 663, 87, 1, 0, 0, 0, 664, 666, 7, 3, 0, 0, 665, 667, 7, 30, 0, 0, 666, 665, 1, 0, 0, 0, 666, 667, 1, 0, 0, 0, 667, 669, 1, 0, 0, 0, 668, 670, 3, 80, 32, 0, 669, 668, 1, 0, 0, 0, 670, 671, 1, 0, 0, 0, 671, 669, 1, 0, 0, 0, 671, 672, 1, 0, 0, 0, 672, 89, 1, 0, 0, 0, 673, 674, 5, 64, 0, 0, 674, 91, 1, 0, 0, 0, 675, 676, 5, 96, 0, 0, 676, 93, 1, 0, 0, 0, 677, 681, 8, 31, 0, 0, 678, 679, 5, 96, 0, 0, 679, 681, 5, 96, 0, 0, 680, 677, 1, 0, 0, 0, 680, 678, 1, 0, 0, 0, 681, 95, 1, 0, 0, 0, 682, 683, 5, 95, 0, 0, 683, 97, 1, 0, 0, 0, 684, 688, 3, 82, 33, 0, 685, 688, 3, 80, 32, 0, 686, 688, 3, 96, 40, 0, 687, 684, 1, 0, 0, 0, 687, 685, 1, 0, 0, 0, 687, 686, 1, 0, 0, 0, 688, 99, 1, 0, 0, 0, 689, 694, 5, 34, 0, 0, 690, 693, 3, 84, 34, 0, 691, 693, 3, 86, 35, 0, 692, 690, 1, 0, 0, 0, 692, 691, 1, 0, 0, 0, 693, 696, 1, 0, 0, 0, 694, 692, 1, 0, 0, 0, 694, 695, 1, 0, 0, 0, 695, 697, 1, 0, 0, 0, 696, 694, 1, 0, 0, 0, 697, 719, 5, 34, 0, 0, 698, 699, 5, 34, 0, 0, 699, 700, 5, 34, 0, 0, 700, 701, 5, 34, 0, 0, 701, 705, 1, 0, 0, 0, 702, 704, 8, 22, 0, 0, 703, 702, 1, 0, 0, 0, 704, 707, 1, 0, 0, 0, 705, 706, 1, 0, 0, 0, 705, 703, 1, 0, 0, 0, 706, 708, 1, 0, 0, 0, 707, 705, 1, 0, 0, 0, 708, 709, 5, 34, 0, 0, 709, 710, 5, 34, 0, 0, 710, 711, 5, 34, 0, 0, 711, 713, 1, 0, 0, 0, 712, 714, 5, 34, 0, 0, 713, 712, 1, 0, 0, 0, 713, 714, 1, 0, 0, 0, 714, 716, 1, 0, 0, 0, 715, 717, 5, 34, 0, 0, 716, 715, 1, 0, 0, 0, 716, 717, 1, 0, 0, 0, 717, 719, 1, 0, 0, 0, 718, 689, 1, 0, 0, 0, 718, 698, 1, 0, 0, 0, 719, 101, 1, 0, 0, 0, 720, 722, 3, 80, 32, 0, 721, 720, 1, 0, 0, 0, 722, 723, 1, 0, 0, 0, 723, 721, 1, 0, 0, 0, 723, 724, 1, 0, 0, 0, 724, 103, 1, 0, 0, 0, 725, 727, 3, 80, 32, 0, 726, 725, 1, 0, 0, 0, 727, 728, 1, 0, 0, 0, 728, 726, 1, 0, 0, 0, 728, 729, 1, 0, 0, 0, 729, 730, 1, 0, 0, 0, 730, 734, 3, 120, 52, 0, 731, 733, 3, 80, 32, 0, 732, 731, 1, 0, 0, 0, 733, 736, 1, 0, 0, 0, 734, 732, 1, 0, 0, 0, 734, 735, 1, 0, 0, 0, 735, 768, 1, 0, 0, 0, 736, 734, 1, 0, 0, 0, 737, 739, 3, 120, 52, 0, 738, 740, 3, 80, 32, 0, 739, 738, 1, 0, 0, 0, 740, 741, 1, 0, 0, 0, 741, 739, 1, 0, 0, 0, 741, 742, 1, 0, 0, 0, 742, 768, 1, 0, 0, 0, 743, 745, 3, 80, 32, 0, 744, 743, 1, 0, 0, 0, 745, 746, 1, 0, 0, 0, 746, 744, 1, 0, 0, 0, 746, 747, 1, 0, 0, 0, 747, 755, 1, 0, 0, 0, 748, 752, 3, 120, 52, 0, 749, 751, 3, 80, 32, 0, 750, 749, 1, 0, 0, 0, 751, 754, 1, 0, 0, 0, 752, 750, 1, 0, 0, 0, 752, 753, 1, 0, 0, 0, 753, 756, 1, 0, 0, 0, 754, 752, 1, 0, 0, 0, 755, 748, 1, 0, 0, 0, 755, 756, 1, 0, 0, 0, 756, 757, 1, 0, 0, 0, 757, 758, 3, 88, 36, 0, 758, 768, 1, 0, 0, 0, 759, 761, 3, 120, 52, 0, 760, 762, 3, 80, 32, 0, 761, 760, 1, 0, 0, 0, 762, 763, 1, 0, 0, 0, 763, 761, 1, 0, 0, 0, 763, 764, 1, 0, 0, 0, 764, 765, 1, 0, 0, 0, 765, 766, 3, 88, 36, 0, 766, 768, 1, 0, 0, 0, 767, 726, 1, 0, 0, 0, 767, 737, 1, 0, 0, 0, 767, 744, 1, 0, 0, 0, 767, 759, 1, 0, 0, 0, 768, 105, 1, 0, 0, 0, 769, 770, 7, 32, 0, 0, 770, 771, 7, 33, 0, 0, 771, 107, 1, 0, 0, 0, 772, 773, 7, 12, 0, 0, 773, 774, 7, 9, 0, 0, 774, 775, 7, 0, 0, 0, 775, 109, 1, 0, 0, 0, 776, 777, 7, 12, 0, 0, 777, 778, 7, 2, 0, 0, 778, 779, 7, 4, 0, 0, 779, 111, 1, 0, 0, 0, 780, 781, 5, 61, 0, 0, 781, 113, 1, 0, 0, 0, 782, 783, 5, 58, 0, 0, 783, 784, 5, 58, 0, 0, 784, 115, 1, 0, 0, 0, 785, 786, 5, 44, 0, 0, 786, 117, 1, 0, 0, 0, 787, 788, 7, 0, 0, 0, 788, 789, 7, 3, 0, 0, 789, 790, 7, 2, 0, 0, 790, 791, 7, 4, 0, 0, 791, 119, 1, 0, 0, 0, 792, 793, 5, 46, 0, 0, 793, 121, 1, 0, 0, 0, 794, 795, 7, 15, 0, 0, 795, 796, 7, 12, 0, 0, 796, 797, 7, 13, 0, 0, 797, 798, 7, 2, 0, 0, 798, 799, 7, 3, 0, 0, 799, 123, 1, 0, 0, 0, 800, 801, 7, 15, 0, 0, 801, 802, 7, 1, 0, 0, 802, 803, 7, 6, 0, 0, 803, 804, 7, 2, 0, 0, 804, 805, 7, 5, 0, 0, 805, 125, 1, 0, 0, 0, 806, 807, 7, 13, 0, 0, 807, 808, 7, 12, 0, 0, 808, 809, 7, 2, 0, 0, 809, 810, 7, 5, 0, 0, 810, 127, 1, 0, 0, 0, 811, 812, 5, 40, 0, 0, 812, 129, 1, 0, 0, 0, 813, 814, 7, 1, 0, 0, 814, 815, 7, 9, 0, 0, 815, 131, 1, 0, 0, 0, 816, 817, 7, 1, 0, 0, 817, 818, 7, 2, 0, 0, 818, 133, 1, 0, 0, 0, 819, 820, 7, 13, 0, 0, 820, 821, 7, 1, 0, 0, 821, 822, 7, 18, 0, 0, 822, 823, 7, 3, 0, 0, 823, 135, 1, 0, 0, 0, 824, 825, 7, 9, 0, 0, 825, 826, 7, 7, 0, 0, 826, 827, 7, 5, 0, 0, 827, 137, 1, 0, 0, 0, 828, 829, 7, 9, 0, 0, 829, 830, 7, 19, 0, 0, 830, 831, 7, 13, 0, 0, 831, 832, 7, 13, 0, 0, 832, 139, 1, 0, 0, 0, 833, 834, 7, 9, 0, 0, 834, 835, 7, 19, 0, 0, 835, 836, 7, 13, 0, 0, 836, 837, 7, 13, 0, 0, 837, 838, 7, 2, 0, 0, 838, 141, 1, 0, 0, 0, 839, 840, 7, 7, 0, 0, 840, 841, 7, 6, 0, 0, 841, 143, 1, 0, 0, 0, 842, 843, 5, 63, 0, 0, 843, 145, 1, 0, 0, 0, 844, 845, 7, 6, 0, 0, 845, 846, 7, 13, 0, 0, 846, 847, 7, 1, 0, 0, 847, 848, 7, 18, 0, 0, 848, 849, 7, 3, 0, 0, 849, 147, 1, 0, 0, 0, 850, 851, 5, 41, 0, 0, 851, 149, 1, 0, 0, 0, 852, 853, 7, 5, 0, 0, 853, 854, 7, 6, 0, 0, 854, 855, 7, 19, 0, 0, 855, 856, 7, 3, 0, 0, 856, 151, 1, 0, 0, 0, 857, 858, 5, 61, 0, 0, 858, 859, 5, 61, 0, 0, 859, 153, 1, 0, 0, 0, 860, 861, 5, 61, 0, 0, 861, 862, 5, 126, 0, 0, 862, 155, 1, 0, 0, 0, 863, 864, 5, 33, 0, 0, 864, 865, 5, 61, 0, 0, 865, 157, 1, 0, 0, 0, 866, 867, 5, 60, 0, 0, 867, 159, 1, 0, 0, 0, 868, 869, 5, 60, 0, 0, 869, 870, 5, 61, 0, 0, 870, 161, 1, 0, 0, 0, 871, 872, 5, 62, 0, 0, 872, 163, 1, 0, 0, 0, 873, 874, 5, 62, 0, 0, 874, 875, 5, 61, 0, 0, 875, 165, 1, 0, 0, 0, 876, 877, 5, 43, 0, 0, 877, 167, 1, 0, 0, 0, 878, 879, 5, 45, 0, 0, 879, 169, 1, 0, 0, 0, 880, 881, 5, 42, 0, 0, 881, 171, 1, 0, 0, 0, 882, 883, 5, 47, 0, 0, 883, 173, 1, 0, 0, 0, 884, 885, 5, 37, 0, 0, 885, 175, 1, 0, 0, 0, 886, 887, 3, 144, 64, 0, 887, 891, 3, 82, 33, 0, 888, 890, 3, 98, 41, 0, 889, 888, 1, 0, 0, 0, 890, 893, 1, 0, 0, 0, 891, 889, 1, 0, 0, 0, 891, 892, 1, 0, 0, 0, 892, 901, 1, 0, 0, 0, 893, 891, 1, 0, 0, 0, 894, 896, 3, 144, 64, 0, 895, 897, 3, 80, 32, 0, 896, 895, 1, 0, 0, 0, 897, 898, 1, 0, 0, 0, 898, 896, 1, 0, 0, 0, 898, 899, 1, 0, 0, 0, 899, 901, 1, 0, 0, 0, 900, 886, 1, 0, 0, 0, 900, 894, 1, 0, 0, 0, 901, 177, 1, 0, 0, 0, 902, 903, 5, 91, 0, 0, 903, 904, 1, 0, 0, 0, 904, 905, 6, 81, 0, 0, 905, 906, 6, 81, 0, 0, 906, 179, 1, 0, 0, 0, 907, 908, 5, 93, 0, 0, 908, 909, 1, 0, 0, 0, 909, 910, 6, 82, 15, 0, 910, 911, 6, 82, 15, 0, 911, 181, 1, 0, 0, 0, 912, 916, 3, 82, 33, 0, 913, 915, 3, 98, 41, 0, 914, 913, 1, 0, 0, 0, 915, 918, 1, 0, 0, 0, 916, 914, 1, 0, 0, 0, 916, 917, 1, 0, 0, 0, 917, 929, 1, 0, 0, 0, 918, 916, 1, 0, 0, 0, 919, 922, 3, 96, 40, 0, 920, 922, 3, 90, 37, 0, 921, 919, 1, 0, 0, 0, 921, 920, 1, 0, 0, 0, 922, 924, 1, 0, 0, 0, 923, 925, 3, 98, 41, 0, 924, 923, 1, 0, 0, 0, 925, 926, 1, 0, 0, 0, 926, 924, 1, 0, 0, 0, 926, 927, 1, 0, 0, 0, 927, 929, 1, 0, 0, 0, 928, 912, 1, 0, 0, 0, 928, 921, 1, 0, 0, 0, 929, 183, 1, 0, 0, 0, 930, 932, 3, 92, 38, 0, 931, 933, 3, 94, 39, 0, 932, 931, 1, 0, 0, 0, 933, 934, 1, 0, 0, 0, 934, 932, 1, 0, 0, 0, 934, 935, 1, 0, 0, 0, 935, 936, 1, 0, 0, 0, 936, 937, 3, 92, 38, 0, 937, 185, 1, 0, 0, 0, 938, 939, 3, 184, 84, 0, 939, 187, 1, 0, 0, 0, 940, 941, 3, 58, 21, 0, 941, 942, 1, 0, 0, 0, 942, 943, 6, 86, 11, 0, 943, 189, 1, 0, 0, 0, 944, 945, 3, 60, 22, 0, 945, 946, 1, 0, 0, 0, 946, 947, 6, 87, 11, 0, 947, 191, 1, 0, 0, 0, 948, 949, 3, 62, 23, 0, 949, 950, 1, 0, 0, 0, 950, 951, 6, 88, 11, 0, 951, 193, 1, 0, 0, 0, 952, 953, 3, 78, 31, 0, 953, 954, 1, 0, 0, 0, 954, 955, 6, 89, 14, 0, 955, 956, 6, 89, 15, 0, 956, 195, 1, 0, 0, 0, 957, 958, 3, 178, 81, 0, 958, 959, 1, 0, 0, 0, 959, 960, 6, 90, 12, 0, 960, 197, 1, 0, 0, 0, 961, 962, 3, 180, 82, 0, 962, 963, 1, 0, 0, 0, 963, 964, 6, 91, 16, 0, 964, 199, 1, 0, 0, 0, 965, 966, 3, 364, 174, 0, 966, 967, 1, 0, 0, 0, 967, 968, 6, 92, 17, 0, 968, 201, 1, 0, 0, 0, 969, 970, 3, 116, 50, 0, 970, 971, 1, 0, 0, 0, 971, 972, 6, 93, 18, 0, 972, 203, 1, 0, 0, 0, 973, 974, 3, 112, 48, 0, 974, 975, 1, 0, 0, 0, 975, 976, 6, 94, 19, 0, 976, 205, 1, 0, 0, 0, 977, 978, 7, 16, 0, 0, 978, 979, 7, 3, 0, 0, 979, 980, 7, 5, 0, 0, 980, 981, 7, 12, 0, 0, 981, 982, 7, 0, 0, 0, 982, 983, 7, 12, 0, 0, 983, 984, 7, 5, 0, 0, 984, 985, 7, 12, 0, 0, 985, 207, 1, 0, 0, 0, 986, 987, 3, 66, 25, 0, 987, 988, 1, 0, 0, 0, 988, 989, 6, 96, 20, 0, 989, 209, 1, 0, 0, 0, 990, 991, 3, 100, 42, 0, 991, 992, 1, 0, 0, 0, 992, 993, 6, 97, 21, 0, 993, 211, 1, 0, 0, 0, 994, 995, 3, 58, 21, 0, 995, 996, 1, 0, 0, 0, 996, 997, 6, 98, 11, 0, 997, 213, 1, 0, 0, 0, 998, 999, 3, 60, 22, 0, 999, 1000, 1, 0, 0, 0, 1000, 1001, 6, 99, 11, 0, 1001, 215, 1, 0, 0, 0, 1002, 1003, 3, 62, 23, 0, 1003, 1004, 1, 0, 0, 0, 1004, 1005, 6, 100, 11, 0, 1005, 217, 1, 0, 0, 0, 1006, 1007, 3, 78, 31, 0, 1007, 1008, 1, 0, 0, 0, 1008, 1009, 6, 101, 14, 0, 1009, 1010, 6, 101, 15, 0, 1010, 219, 1, 0, 0, 0, 1011, 1012, 3, 120, 52, 0, 1012, 1013, 1, 0, 0, 0, 1013, 1014, 6, 102, 22, 0, 1014, 221, 1, 0, 0, 0, 1015, 1016, 3, 116, 50, 0, 1016, 1017, 1, 0, 0, 0, 1017, 1018, 6, 103, 18, 0, 1018, 223, 1, 0, 0, 0, 1019, 1024, 3, 82, 33, 0, 1020, 1024, 3, 80, 32, 0, 1021, 1024, 3, 96, 40, 0, 1022, 1024, 3, 170, 77, 0, 1023, 1019, 1, 0, 0, 0, 1023, 1020, 1, 0, 0, 0, 1023, 1021, 1, 0, 0, 0, 1023, 1022, 1, 0, 0, 0, 1024, 225, 1, 0, 0, 0, 1025, 1028, 3, 82, 33, 0, 1026, 1028, 3, 170, 77, 0, 1027, 1025, 1, 0, 0, 0, 1027, 1026, 1, 0, 0, 0, 1028, 1032, 1, 0, 0, 0, 1029, 1031, 3, 224, 104, 0, 1030, 1029, 1, 0, 0, 0, 1031, 1034, 1, 0, 0, 0, 1032, 1030, 1, 0, 0, 0, 1032, 1033, 1, 0, 0, 0, 1033, 1045, 1, 0, 0, 0, 1034, 1032, 1, 0, 0, 0, 1035, 1038, 3, 96, 40, 0, 1036, 1038, 3, 90, 37, 0, 1037, 1035, 1, 0, 0, 0, 1037, 1036, 1, 0, 0, 0, 1038, 1040, 1, 0, 0, 0, 1039, 1041, 3, 224, 104, 0, 1040, 1039, 1, 0, 0, 0, 1041, 1042, 1, 0, 0, 0, 1042, 1040, 1, 0, 0, 0, 1042, 1043, 1, 0, 0, 0, 1043, 1045, 1, 0, 0, 0, 1044, 1027, 1, 0, 0, 0, 1044, 1037, 1, 0, 0, 0, 1045, 227, 1, 0, 0, 0, 1046, 1049, 3, 226, 105, 0, 1047, 1049, 3, 184, 84, 0, 1048, 1046, 1, 0, 0, 0, 1048, 1047, 1, 0, 0, 0, 1049, 1050, 1, 0, 0, 0, 1050, 1048, 1, 0, 0, 0, 1050, 1051, 1, 0, 0, 0, 1051, 229, 1, 0, 0, 0, 1052, 1053, 3, 58, 21, 0, 1053, 1054, 1, 0, 0, 0, 1054, 1055, 6, 107, 11, 0, 1055, 231, 1, 0, 0, 0, 1056, 1057, 3, 60, 22, 0, 1057, 1058, 1, 0, 0, 0, 1058, 1059, 6, 108, 11, 0, 1059, 233, 1, 0, 0, 0, 1060, 1061, 3, 62, 23, 0, 1061, 1062, 1, 0, 0, 0, 1062, 1063, 6, 109, 11, 0, 1063, 235, 1, 0, 0, 0, 1064, 1065, 3, 78, 31, 0, 1065, 1066, 1, 0, 0, 0, 1066, 1067, 6, 110, 14, 0, 1067, 1068, 6, 110, 15, 0, 1068, 237, 1, 0, 0, 0, 1069, 1070, 3, 112, 48, 0, 1070, 1071, 1, 0, 0, 0, 1071, 1072, 6, 111, 19, 0, 1072, 239, 1, 0, 0, 0, 1073, 1074, 3, 116, 50, 0, 1074, 1075, 1, 0, 0, 0, 1075, 1076, 6, 112, 18, 0, 1076, 241, 1, 0, 0, 0, 1077, 1078, 3, 120, 52, 0, 1078, 1079, 1, 0, 0, 0, 1079, 1080, 6, 113, 22, 0, 1080, 243, 1, 0, 0, 0, 1081, 1082, 7, 12, 0, 0, 1082, 1083, 7, 2, 0, 0, 1083, 245, 1, 0, 0, 0, 1084, 1085, 3, 228, 106, 0, 1085, 1086, 1, 0, 0, 0, 1086, 1087, 6, 115, 23, 0, 1087, 247, 1, 0, 0, 0, 1088, 1089, 3, 58, 21, 0, 1089, 1090, 1, 0, 0, 0, 1090, 1091, 6, 116, 11, 0, 1091, 249, 1, 0, 0, 0, 1092, 1093, 3, 60, 22, 0, 1093, 1094, 1, 0, 0, 0, 1094, 1095, 6, 117, 11, 0, 1095, 251, 1, 0, 0, 0, 1096, 1097, 3, 62, 23, 0, 1097, 1098, 1, 0, 0, 0, 1098, 1099, 6, 118, 11, 0, 1099, 253, 1, 0, 0, 0, 1100, 1101, 3, 78, 31, 0, 1101, 1102, 1, 0, 0, 0, 1102, 1103, 6, 119, 14, 0, 1103, 1104, 6, 119, 15, 0, 1104, 255, 1, 0, 0, 0, 1105, 1106, 3, 178, 81, 0, 1106, 1107, 1, 0, 0, 0, 1107, 1108, 6, 120, 12, 0, 1108, 1109, 6, 120, 24, 0, 1109, 257, 1, 0, 0, 0, 1110, 1111, 7, 7, 0, 0, 1111, 1112, 7, 9, 0, 0, 1112, 1113, 1, 0, 0, 0, 1113, 1114, 6, 121, 25, 0, 1114, 259, 1, 0, 0, 0, 1115, 1116, 7, 20, 0, 0, 1116, 1117, 7, 1, 0, 0, 1117, 1118, 7, 5, 0, 0, 1118, 1119, 7, 10, 0, 0, 1119, 1120, 1, 0, 0, 0, 1120, 1121, 6, 122, 25, 0, 1121, 261, 1, 0, 0, 0, 1122, 1123, 8, 34, 0, 0, 1123, 263, 1, 0, 0, 0, 1124, 1126, 3, 262, 123, 0, 1125, 1124, 1, 0, 0, 0, 1126, 1127, 1, 0, 0, 0, 1127, 1125, 1, 0, 0, 0, 1127, 1128, 1, 0, 0, 0, 1128, 1129, 1, 0, 0, 0, 1129, 1130, 3, 364, 174, 0, 1130, 1132, 1, 0, 0, 0, 1131, 1125, 1, 0, 0, 0, 1131, 1132, 1, 0, 0, 0, 1132, 1134, 1, 0, 0, 0, 1133, 1135, 3, 262, 123, 0, 1134, 1133, 1, 0, 0, 0, 1135, 1136, 1, 0, 0, 0, 1136, 1134, 1, 0, 0, 0, 1136, 1137, 1, 0, 0, 0, 1137, 265, 1, 0, 0, 0, 1138, 1139, 3, 264, 124, 0, 1139, 1140, 1, 0, 0, 0, 1140, 1141, 6, 125, 26, 0, 1141, 267, 1, 0, 0, 0, 1142, 1143, 3, 58, 21, 0, 1143, 1144, 1, 0, 0, 0, 1144, 1145, 6, 126, 11, 0, 1145, 269, 1, 0, 0, 0, 1146, 1147, 3, 60, 22, 0, 1147, 1148, 1, 0, 0, 0, 1148, 1149, 6, 127, 11, 0, 1149, 271, 1, 0, 0, 0, 1150, 1151, 3, 62, 23, 0, 1151, 1152, 1, 0, 0, 0, 1152, 1153, 6, 128, 11, 0, 1153, 273, 1, 0, 0, 0, 1154, 1155, 3, 78, 31, 0, 1155, 1156, 1, 0, 0, 0, 1156, 1157, 6, 129, 14, 0, 1157, 1158, 6, 129, 15, 0, 1158, 1159, 6, 129, 15, 0, 1159, 275, 1, 0, 0, 0, 1160, 1161, 3, 112, 48, 0, 1161, 1162, 1, 0, 0, 0, 1162, 1163, 6, 130, 19, 0, 1163, 277, 1, 0, 0, 0, 1164, 1165, 3, 116, 50, 0, 1165, 1166, 1, 0, 0, 0, 1166, 1167, 6, 131, 18, 0, 1167, 279, 1, 0, 0, 0, 1168, 1169, 3, 120, 52, 0, 1169, 1170, 1, 0, 0, 0, 1170, 1171, 6, 132, 22, 0, 1171, 281, 1, 0, 0, 0, 1172, 1173, 3, 260, 122, 0, 1173, 1174, 1, 0, 0, 0, 1174, 1175, 6, 133, 27, 0, 1175, 283, 1, 0, 0, 0, 1176, 1177, 3, 228, 106, 0, 1177, 1178, 1, 0, 0, 0, 1178, 1179, 6, 134, 23, 0, 1179, 285, 1, 0, 0, 0, 1180, 1181, 3, 186, 85, 0, 1181, 1182, 1, 0, 0, 0, 1182, 1183, 6, 135, 28, 0, 1183, 287, 1, 0, 0, 0, 1184, 1185, 3, 58, 21, 0, 1185, 1186, 1, 0, 0, 0, 1186, 1187, 6, 136, 11, 0, 1187, 289, 1, 0, 0, 0, 1188, 1189, 3, 60, 22, 0, 1189, 1190, 1, 0, 0, 0, 1190, 1191, 6, 137, 11, 0, 1191, 291, 1, 0, 0, 0, 1192, 1193, 3, 62, 23, 0, 1193, 1194, 1, 0, 0, 0, 1194, 1195, 6, 138, 11, 0, 1195, 293, 1, 0, 0, 0, 1196, 1197, 3, 78, 31, 0, 1197, 1198, 1, 0, 0, 0, 1198, 1199, 6, 139, 14, 0, 1199, 1200, 6, 139, 15, 0, 1200, 295, 1, 0, 0, 0, 1201, 1202, 3, 364, 174, 0, 1202, 1203, 1, 0, 0, 0, 1203, 1204, 6, 140, 17, 0, 1204, 297, 1, 0, 0, 0, 1205, 1206, 3, 116, 50, 0, 1206, 1207, 1, 0, 0, 0, 1207, 1208, 6, 141, 18, 0, 1208, 299, 1, 0, 0, 0, 1209, 1210, 3, 120, 52, 0, 1210, 1211, 1, 0, 0, 0, 1211, 1212, 6, 142, 22, 0, 1212, 301, 1, 0, 0, 0, 1213, 1214, 3, 258, 121, 0, 1214, 1215, 1, 0, 0, 0, 1215, 1216, 6, 143, 29, 0, 1216, 1217, 6, 143, 30, 0, 1217, 303, 1, 0, 0, 0, 1218, 1219, 3, 66, 25, 0, 1219, 1220, 1, 0, 0, 0, 1220, 1221, 6, 144, 20, 0, 1221, 305, 1, 0, 0, 0, 1222, 1223, 3, 100, 42, 0, 1223, 1224, 1, 0, 0, 0, 1224, 1225, 6, 145, 21, 0, 1225, 307, 1, 0, 0, 0, 1226, 1227, 3, 58, 21, 0, 1227, 1228, 1, 0, 0, 0, 1228, 1229, 6, 146, 11, 0, 1229, 309, 1, 0, 0, 0, 1230, 1231, 3, 60, 22, 0, 1231, 1232, 1, 0, 0, 0, 1232, 1233, 6, 147, 11, 0, 1233, 311, 1, 0, 0, 0, 1234, 1235, 3, 62, 23, 0, 1235, 1236, 1, 0, 0, 0, 1236, 1237, 6, 148, 11, 0, 1237, 313, 1, 0, 0, 0, 1238, 1239, 3, 78, 31, 0, 1239, 1240, 1, 0, 0, 0, 1240, 1241, 6, 149, 14, 0, 1241, 1242, 6, 149, 15, 0, 1242, 1243, 6, 149, 15, 0, 1243, 315, 1, 0, 0, 0, 1244, 1245, 3, 116, 50, 0, 1245, 1246, 1, 0, 0, 0, 1246, 1247, 6, 150, 18, 0, 1247, 317, 1, 0, 0, 0, 1248, 1249, 3, 120, 52, 0, 1249, 1250, 1, 0, 0, 0, 1250, 1251, 6, 151, 22, 0, 1251, 319, 1, 0, 0, 0, 1252, 1253, 3, 228, 106, 0, 1253, 1254, 1, 0, 0, 0, 1254, 1255, 6, 152, 23, 0, 1255, 321, 1, 0, 0, 0, 1256, 1257, 3, 58, 21, 0, 1257, 1258, 1, 0, 0, 0, 1258, 1259, 6, 153, 11, 0, 1259, 323, 1, 0, 0, 0, 1260, 1261, 3, 60, 22, 0, 1261, 1262, 1, 0, 0, 0, 1262, 1263, 6, 154, 11, 0, 1263, 325, 1, 0, 0, 0, 1264, 1265, 3, 62, 23, 0, 1265, 1266, 1, 0, 0, 0, 1266, 1267, 6, 155, 11, 0, 1267, 327, 1, 0, 0, 0, 1268, 1269, 3, 78, 31, 0, 1269, 1270, 1, 0, 0, 0, 1270, 1271, 6, 156, 14, 0, 1271, 1272, 6, 156, 15, 0, 1272, 329, 1, 0, 0, 0, 1273, 1274, 3, 120, 52, 0, 1274, 1275, 1, 0, 0, 0, 1275, 1276, 6, 157, 22, 0, 1276, 331, 1, 0, 0, 0, 1277, 1278, 3, 186, 85, 0, 1278, 1279, 1, 0, 0, 0, 1279, 1280, 6, 158, 28, 0, 1280, 333, 1, 0, 0, 0, 1281, 1282, 3, 182, 83, 0, 1282, 1283, 1, 0, 0, 0, 1283, 1284, 6, 159, 31, 0, 1284, 335, 1, 0, 0, 0, 1285, 1286, 3, 58, 21, 0, 1286, 1287, 1, 0, 0, 0, 1287, 1288, 6, 160, 11, 0, 1288, 337, 1, 0, 0, 0, 1289, 1290, 3, 60, 22, 0, 1290, 1291, 1, 0, 0, 0, 1291, 1292, 6, 161, 11, 0, 1292, 339, 1, 0, 0, 0, 1293, 1294, 3, 62, 23, 0, 1294, 1295, 1, 0, 0, 0, 1295, 1296, 6, 162, 11, 0, 1296, 341, 1, 0, 0, 0, 1297, 1298, 3, 78, 31, 0, 1298, 1299, 1, 0, 0, 0, 1299, 1300, 6, 163, 14, 0, 1300, 1301, 6, 163, 15, 0, 1301, 343, 1, 0, 0, 0, 1302, 1303, 7, 1, 0, 0, 1303, 1304, 7, 9, 0, 0, 1304, 1305, 7, 15, 0, 0, 1305, 1306, 7, 7, 0, 0, 1306, 345, 1, 0, 0, 0, 1307, 1308, 3, 58, 21, 0, 1308, 1309, 1, 0, 0, 0, 1309, 1310, 6, 165, 11, 0, 1310, 347, 1, 0, 0, 0, 1311, 1312, 3, 60, 22, 0, 1312, 1313, 1, 0, 0, 0, 1313, 1314, 6, 166, 11, 0, 1314, 349, 1, 0, 0, 0, 1315, 1316, 3, 62, 23, 0, 1316, 1317, 1, 0, 0, 0, 1317, 1318, 6, 167, 11, 0, 1318, 351, 1, 0, 0, 0, 1319, 1320, 3, 78, 31, 0, 1320, 1321, 1, 0, 0, 0, 1321, 1322, 6, 168, 14, 0, 1322, 1323, 6, 168, 15, 0, 1323, 353, 1, 0, 0, 0, 1324, 1325, 7, 15, 0, 0, 1325, 1326, 7, 19, 0, 0, 1326, 1327, 7, 9, 0, 0, 1327, 1328, 7, 4, 0, 0, 1328, 1329, 7, 5, 0, 0, 1329, 1330, 7, 1, 0, 0, 1330, 1331, 7, 7, 0, 0, 1331, 1332, 7, 9, 0, 0, 1332, 1333, 7, 2, 0, 0, 1333, 355, 1, 0, 0, 0, 1334, 1335, 3, 58, 21, 0, 1335, 1336, 1, 0, 0, 0, 1336, 1337, 6, 170, 11, 0, 1337, 357, 1, 0, 0, 0, 1338, 1339, 3, 60, 22, 0, 1339, 1340, 1, 0, 0, 0, 1340, 1341, 6, 171, 11, 0, 1341, 359, 1, 0, 0, 0, 1342, 1343, 3, 62, 23, 0, 1343, 1344, 1, 0, 0, 0, 1344, 1345, 6, 172, 11, 0, 1345, 361, 1, 0, 0, 0, 1346, 1347, 3, 180, 82, 0, 1347, 1348, 1, 0, 0, 0, 1348, 1349, 6, 173, 16, 0, 1349, 1350, 6, 173, 15, 0, 1350, 363, 1, 0, 0, 0, 1351, 1352, 5, 58, 0, 0, 1352, 365, 1, 0, 0, 0, 1353, 1359, 3, 90, 37, 0, 1354, 1359, 3, 80, 32, 0, 1355, 1359, 3, 120, 52, 0, 1356, 1359, 3, 82, 33, 0, 1357, 1359, 3, 96, 40, 0, 1358, 1353, 1, 0, 0, 0, 1358, 1354, 1, 0, 0, 0, 1358, 1355, 1, 0, 0, 0, 1358, 1356, 1, 0, 0, 0, 1358, 1357, 1, 0, 0, 0, 1359, 1360, 1, 0, 0, 0, 1360, 1358, 1, 0, 0, 0, 1360, 1361, 1, 0, 0, 0, 1361, 367, 1, 0, 0, 0, 1362, 1363, 3, 58, 21, 0, 1363, 1364, 1, 0, 0, 0, 1364, 1365, 6, 176, 11, 0, 1365, 369, 1, 0, 0, 0, 1366, 1367, 3, 60, 22, 0, 1367, 1368, 1, 0, 0, 0, 1368, 1369, 6, 177, 11, 0, 1369, 371, 1, 0, 0, 0, 1370, 1371, 3, 62, 23, 0, 1371, 1372, 1, 0, 0, 0, 1372, 1373, 6, 178, 11, 0, 1373, 373, 1, 0, 0, 0, 1374, 1375, 3, 78, 31, 0, 1375, 1376, 1, 0, 0, 0, 1376, 1377, 6, 179, 14, 0, 1377, 1378, 6, 179, 15, 0, 1378, 375, 1, 0, 0, 0, 1379, 1380, 3, 66, 25, 0, 1380, 1381, 1, 0, 0, 0, 1381, 1382, 6, 180, 20, 0, 1382, 1383, 6, 180, 15, 0, 1383, 1384, 6, 180, 32, 0, 1384, 377, 1, 0, 0, 0, 1385, 1386, 3, 100, 42, 0, 1386, 1387, 1, 0, 0, 0, 1387, 1388, 6, 181, 21, 0, 1388, 1389, 6, 181, 15, 0, 1389, 1390, 6, 181, 32, 0, 1390, 379, 1, 0, 0, 0, 1391, 1392, 3, 58, 21, 0, 1392, 1393, 1, 0, 0, 0, 1393, 1394, 6, 182, 11, 0, 1394, 381, 1, 0, 0, 0, 1395, 1396, 3, 60, 22, 0, 1396, 1397, 1, 0, 0, 0, 1397, 1398, 6, 183, 11, 0, 1398, 383, 1, 0, 0, 0, 1399, 1400, 3, 62, 23, 0, 1400, 1401, 1, 0, 0, 0, 1401, 1402, 6, 184, 11, 0, 1402, 385, 1, 0, 0, 0, 1403, 1404, 3, 364, 174, 0, 1404, 1405, 1, 0, 0, 0, 1405, 1406, 6, 185, 17, 0, 1406, 1407, 6, 185, 15, 0, 1407, 1408, 6, 185, 7, 0, 1408, 387, 1, 0, 0, 0, 1409, 1410, 3, 116, 50, 0, 1410, 1411, 1, 0, 0, 0, 1411, 1412, 6, 186, 18, 0, 1412, 1413, 6, 186, 15, 0, 1413, 1414, 6, 186, 7, 0, 1414, 389, 1, 0, 0, 0, 1415, 1416, 3, 58, 21, 0, 1416, 1417, 1, 0, 0, 0, 1417, 1418, 6, 187, 11, 0, 1418, 391, 1, 0, 0, 0, 1419, 1420, 3, 60, 22, 0, 1420, 1421, 1, 0, 0, 0, 1421, 1422, 6, 188, 11, 0, 1422, 393, 1, 0, 0, 0, 1423, 1424, 3, 62, 23, 0, 1424, 1425, 1, 0, 0, 0, 1425, 1426, 6, 189, 11, 0, 1426, 395, 1, 0, 0, 0, 1427, 1428, 3, 186, 85, 0, 1428, 1429, 1, 0, 0, 0, 1429, 1430, 6, 190, 15, 0, 1430, 1431, 6, 190, 0, 0, 1431, 1432, 6, 190, 28, 0, 1432, 397, 1, 0, 0, 0, 1433, 1434, 3, 182, 83, 0, 1434, 1435, 1, 0, 0, 0, 1435, 1436, 6, 191, 15, 0, 1436, 1437, 6, 191, 0, 0, 1437, 1438, 6, 191, 31, 0, 1438, 399, 1, 0, 0, 0, 1439, 1440, 3, 106, 45, 0, 1440, 1441, 1, 0, 0, 0, 1441, 1442, 6, 192, 15, 0, 1442, 1443, 6, 192, 0, 0, 1443, 1444, 6, 192, 33, 0, 1444, 401, 1, 0, 0, 0, 1445, 1446, 3, 78, 31, 0, 1446, 1447, 1, 0, 0, 0, 1447, 1448, 6, 193, 14, 0, 1448, 1449, 6, 193, 15, 0, 1449, 403, 1, 0, 0, 0, 65, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 576, 586, 590, 593, 602, 604, 615, 622, 627, 666, 671, 680, 687, 692, 694, 705, 713, 716, 718, 723, 728, 734, 741, 746, 752, 755, 763, 767, 891, 898, 900, 916, 921, 926, 928, 934, 1023, 1027, 1032, 1037, 1042, 1044, 1048, 1050, 1127, 1131, 1136, 1358, 1360, 34, 5, 2, 0, 5, 4, 0, 5, 6, 0, 5, 1, 0, 5, 3, 0, 5, 8, 0, 5, 12, 0, 5, 14, 0, 5, 10, 0, 5, 5, 0, 5, 11, 0, 0, 1, 0, 7, 69, 0, 5, 0, 0, 7, 29, 0, 4, 0, 0, 7, 70, 0, 7, 114, 0, 7, 38, 0, 7, 36, 0, 7, 25, 0, 7, 30, 0, 7, 40, 0, 7, 80, 0, 5, 13, 0, 5, 7, 0, 7, 90, 0, 7, 89, 0, 7, 72, 0, 7, 88, 0, 5, 9, 0, 7, 71, 0, 5, 15, 0, 7, 33, 0] \ No newline at end of file diff --git a/packages/kbn-esql-ast/src/antlr/esql_lexer.tokens b/packages/kbn-esql-ast/src/antlr/esql_lexer.tokens index 04798fc3dca8a..63eb3a86419a3 100644 --- a/packages/kbn-esql-ast/src/antlr/esql_lexer.tokens +++ b/packages/kbn-esql-ast/src/antlr/esql_lexer.tokens @@ -22,7 +22,7 @@ UNKNOWN_CMD=21 LINE_COMMENT=22 MULTILINE_COMMENT=23 WS=24 -INDEX_UNQUOTED_IDENTIFIER=25 +UNQUOTED_SOURCE=25 EXPLAIN_WS=26 EXPLAIN_LINE_COMMENT=27 EXPLAIN_MULTILINE_COMMENT=28 diff --git a/packages/kbn-esql-ast/src/antlr/esql_lexer.ts b/packages/kbn-esql-ast/src/antlr/esql_lexer.ts index ff985e02ccf1d..ab1f2d1a3b4d5 100644 --- a/packages/kbn-esql-ast/src/antlr/esql_lexer.ts +++ b/packages/kbn-esql-ast/src/antlr/esql_lexer.ts @@ -37,7 +37,7 @@ export default class esql_lexer extends Lexer { public static readonly LINE_COMMENT = 22; public static readonly MULTILINE_COMMENT = 23; public static readonly WS = 24; - public static readonly INDEX_UNQUOTED_IDENTIFIER = 25; + public static readonly UNQUOTED_SOURCE = 25; public static readonly EXPLAIN_WS = 26; public static readonly EXPLAIN_LINE_COMMENT = 27; public static readonly EXPLAIN_MULTILINE_COMMENT = 28; @@ -230,7 +230,7 @@ export default class esql_lexer extends Lexer { "UNKNOWN_CMD", "LINE_COMMENT", "MULTILINE_COMMENT", - "WS", "INDEX_UNQUOTED_IDENTIFIER", + "WS", "UNQUOTED_SOURCE", "EXPLAIN_WS", "EXPLAIN_LINE_COMMENT", "EXPLAIN_MULTILINE_COMMENT", @@ -321,7 +321,7 @@ export default class esql_lexer extends Lexer { "DISSECT", "DROP", "ENRICH", "EVAL", "EXPLAIN", "FROM", "GROK", "INLINESTATS", "KEEP", "LIMIT", "LOOKUP", "META", "METRICS", "MV_EXPAND", "RENAME", "ROW", "SHOW", "SORT", "STATS", "WHERE", "UNKNOWN_CMD", "LINE_COMMENT", "MULTILINE_COMMENT", - "WS", "INDEX_UNQUOTED_IDENTIFIER_PART", "INDEX_UNQUOTED_IDENTIFIER", "EXPLAIN_OPENING_BRACKET", + "WS", "UNQUOTED_SOURCE_PART", "UNQUOTED_SOURCE", "EXPLAIN_OPENING_BRACKET", "EXPLAIN_PIPE", "EXPLAIN_WS", "EXPLAIN_LINE_COMMENT", "EXPLAIN_MULTILINE_COMMENT", "PIPE", "DIGIT", "LETTER", "ESCAPE_SEQUENCE", "UNESCAPED_CHARS", "EXPONENT", "ASPERAND", "BACKQUOTE", "BACKQUOTE_BLOCK", "UNDERSCORE", "UNQUOTED_ID_BODY", @@ -332,32 +332,33 @@ export default class esql_lexer extends Lexer { "ASTERISK", "SLASH", "PERCENT", "NAMED_OR_POSITIONAL_PARAM", "OPENING_BRACKET", "CLOSING_BRACKET", "UNQUOTED_IDENTIFIER", "QUOTED_ID", "QUOTED_IDENTIFIER", "EXPR_LINE_COMMENT", "EXPR_MULTILINE_COMMENT", "EXPR_WS", "FROM_PIPE", - "FROM_OPENING_BRACKET", "FROM_CLOSING_BRACKET", "FROM_COMMA", "FROM_ASSIGN", - "FROM_QUOTED_STRING", "METADATA", "FROM_INDEX_UNQUOTED_IDENTIFIER", "FROM_LINE_COMMENT", - "FROM_MULTILINE_COMMENT", "FROM_WS", "PROJECT_PIPE", "PROJECT_DOT", "PROJECT_COMMA", - "UNQUOTED_ID_BODY_WITH_PATTERN", "UNQUOTED_ID_PATTERN", "ID_PATTERN", - "PROJECT_LINE_COMMENT", "PROJECT_MULTILINE_COMMENT", "PROJECT_WS", "RENAME_PIPE", - "RENAME_ASSIGN", "RENAME_COMMA", "RENAME_DOT", "AS", "RENAME_ID_PATTERN", + "FROM_OPENING_BRACKET", "FROM_CLOSING_BRACKET", "FROM_COLON", "FROM_COMMA", + "FROM_ASSIGN", "METADATA", "FROM_UNQUOTED_SOURCE", "FROM_QUOTED_SOURCE", + "FROM_LINE_COMMENT", "FROM_MULTILINE_COMMENT", "FROM_WS", "PROJECT_PIPE", + "PROJECT_DOT", "PROJECT_COMMA", "UNQUOTED_ID_BODY_WITH_PATTERN", "UNQUOTED_ID_PATTERN", + "ID_PATTERN", "PROJECT_LINE_COMMENT", "PROJECT_MULTILINE_COMMENT", "PROJECT_WS", + "RENAME_PIPE", "RENAME_ASSIGN", "RENAME_COMMA", "RENAME_DOT", "AS", "RENAME_ID_PATTERN", "RENAME_LINE_COMMENT", "RENAME_MULTILINE_COMMENT", "RENAME_WS", "ENRICH_PIPE", "ENRICH_OPENING_BRACKET", "ON", "WITH", "ENRICH_POLICY_NAME_BODY", "ENRICH_POLICY_NAME", - "ENRICH_QUOTED_IDENTIFIER", "ENRICH_MODE_UNQUOTED_VALUE", "ENRICH_LINE_COMMENT", - "ENRICH_MULTILINE_COMMENT", "ENRICH_WS", "ENRICH_FIELD_PIPE", "ENRICH_FIELD_ASSIGN", - "ENRICH_FIELD_COMMA", "ENRICH_FIELD_DOT", "ENRICH_FIELD_WITH", "ENRICH_FIELD_ID_PATTERN", - "ENRICH_FIELD_QUOTED_IDENTIFIER", "ENRICH_FIELD_LINE_COMMENT", "ENRICH_FIELD_MULTILINE_COMMENT", - "ENRICH_FIELD_WS", "LOOKUP_PIPE", "LOOKUP_COMMA", "LOOKUP_DOT", "LOOKUP_ON", - "LOOKUP_INDEX_UNQUOTED_IDENTIFIER", "LOOKUP_LINE_COMMENT", "LOOKUP_MULTILINE_COMMENT", - "LOOKUP_WS", "LOOKUP_FIELD_PIPE", "LOOKUP_FIELD_COMMA", "LOOKUP_FIELD_DOT", - "LOOKUP_FIELD_ID_PATTERN", "LOOKUP_FIELD_LINE_COMMENT", "LOOKUP_FIELD_MULTILINE_COMMENT", - "LOOKUP_FIELD_WS", "MVEXPAND_PIPE", "MVEXPAND_DOT", "MVEXPAND_QUOTED_IDENTIFIER", - "MVEXPAND_UNQUOTED_IDENTIFIER", "MVEXPAND_LINE_COMMENT", "MVEXPAND_MULTILINE_COMMENT", - "MVEXPAND_WS", "SHOW_PIPE", "INFO", "SHOW_LINE_COMMENT", "SHOW_MULTILINE_COMMENT", - "SHOW_WS", "META_PIPE", "FUNCTIONS", "META_LINE_COMMENT", "META_MULTILINE_COMMENT", + "ENRICH_MODE_UNQUOTED_VALUE", "ENRICH_LINE_COMMENT", "ENRICH_MULTILINE_COMMENT", + "ENRICH_WS", "ENRICH_FIELD_PIPE", "ENRICH_FIELD_ASSIGN", "ENRICH_FIELD_COMMA", + "ENRICH_FIELD_DOT", "ENRICH_FIELD_WITH", "ENRICH_FIELD_ID_PATTERN", "ENRICH_FIELD_QUOTED_IDENTIFIER", + "ENRICH_FIELD_LINE_COMMENT", "ENRICH_FIELD_MULTILINE_COMMENT", "ENRICH_FIELD_WS", + "LOOKUP_PIPE", "LOOKUP_COLON", "LOOKUP_COMMA", "LOOKUP_DOT", "LOOKUP_ON", + "LOOKUP_UNQUOTED_SOURCE", "LOOKUP_QUOTED_SOURCE", "LOOKUP_LINE_COMMENT", + "LOOKUP_MULTILINE_COMMENT", "LOOKUP_WS", "LOOKUP_FIELD_PIPE", "LOOKUP_FIELD_COMMA", + "LOOKUP_FIELD_DOT", "LOOKUP_FIELD_ID_PATTERN", "LOOKUP_FIELD_LINE_COMMENT", + "LOOKUP_FIELD_MULTILINE_COMMENT", "LOOKUP_FIELD_WS", "MVEXPAND_PIPE", + "MVEXPAND_DOT", "MVEXPAND_QUOTED_IDENTIFIER", "MVEXPAND_UNQUOTED_IDENTIFIER", + "MVEXPAND_LINE_COMMENT", "MVEXPAND_MULTILINE_COMMENT", "MVEXPAND_WS", + "SHOW_PIPE", "INFO", "SHOW_LINE_COMMENT", "SHOW_MULTILINE_COMMENT", "SHOW_WS", + "META_PIPE", "FUNCTIONS", "META_LINE_COMMENT", "META_MULTILINE_COMMENT", "META_WS", "SETTING_CLOSING_BRACKET", "COLON", "SETTING", "SETTING_LINE_COMMENT", - "SETTTING_MULTILINE_COMMENT", "SETTING_WS", "METRICS_PIPE", "METRICS_INDEX_UNQUOTED_IDENTIFIER", - "METRICS_LINE_COMMENT", "METRICS_MULTILINE_COMMENT", "METRICS_WS", "CLOSING_METRICS_COMMA", - "CLOSING_METRICS_LINE_COMMENT", "CLOSING_METRICS_MULTILINE_COMMENT", "CLOSING_METRICS_WS", - "CLOSING_METRICS_QUOTED_IDENTIFIER", "CLOSING_METRICS_UNQUOTED_IDENTIFIER", - "CLOSING_METRICS_BY", "CLOSING_METRICS_PIPE", + "SETTTING_MULTILINE_COMMENT", "SETTING_WS", "METRICS_PIPE", "METRICS_UNQUOTED_SOURCE", + "METRICS_QUOTED_SOURCE", "METRICS_LINE_COMMENT", "METRICS_MULTILINE_COMMENT", + "METRICS_WS", "CLOSING_METRICS_COLON", "CLOSING_METRICS_COMMA", "CLOSING_METRICS_LINE_COMMENT", + "CLOSING_METRICS_MULTILINE_COMMENT", "CLOSING_METRICS_WS", "CLOSING_METRICS_QUOTED_IDENTIFIER", + "CLOSING_METRICS_UNQUOTED_IDENTIFIER", "CLOSING_METRICS_BY", "CLOSING_METRICS_PIPE", ]; @@ -378,7 +379,7 @@ export default class esql_lexer extends Lexer { public get modeNames(): string[] { return esql_lexer.modeNames; } - public static readonly _serializedATN: number[] = [4,0,124,1422,6,-1,6, + public static readonly _serializedATN: number[] = [4,0,124,1450,6,-1,6, -1,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1, 2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8, 2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16, @@ -408,463 +409,474 @@ export default class esql_lexer extends Lexer { 2,169,7,169,2,170,7,170,2,171,7,171,2,172,7,172,2,173,7,173,2,174,7,174, 2,175,7,175,2,176,7,176,2,177,7,177,2,178,7,178,2,179,7,179,2,180,7,180, 2,181,7,181,2,182,7,182,2,183,7,183,2,184,7,184,2,185,7,185,2,186,7,186, - 2,187,7,187,2,188,7,188,2,189,7,189,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0, - 1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,3, - 1,3,1,3,1,3,1,3,1,3,1,3,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,5,1,5, - 1,5,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,1,7,1,7, - 1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,9,1,9,1,9, - 1,9,1,9,1,9,1,9,1,9,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,11,1, - 11,1,11,1,11,1,11,1,11,1,11,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12, - 1,12,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,14,1, - 14,1,14,1,14,1,14,1,14,1,14,1,14,1,14,1,15,1,15,1,15,1,15,1,15,1,15,1,16, - 1,16,1,16,1,16,1,16,1,16,1,16,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,18,1, - 18,1,18,1,18,1,18,1,18,1,18,1,18,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19, - 1,20,4,20,567,8,20,11,20,12,20,568,1,20,1,20,1,21,1,21,1,21,1,21,5,21,577, - 8,21,10,21,12,21,580,9,21,1,21,3,21,583,8,21,1,21,3,21,586,8,21,1,21,1, - 21,1,22,1,22,1,22,1,22,1,22,5,22,595,8,22,10,22,12,22,598,9,22,1,22,1,22, - 1,22,1,22,1,22,1,23,4,23,606,8,23,11,23,12,23,607,1,23,1,23,1,24,1,24,1, - 24,3,24,615,8,24,1,25,4,25,618,8,25,11,25,12,25,619,1,26,1,26,1,26,1,26, - 1,26,1,27,1,27,1,27,1,27,1,27,1,28,1,28,1,28,1,28,1,29,1,29,1,29,1,29,1, - 30,1,30,1,30,1,30,1,31,1,31,1,31,1,31,1,32,1,32,1,33,1,33,1,34,1,34,1,34, - 1,35,1,35,1,36,1,36,3,36,659,8,36,1,36,4,36,662,8,36,11,36,12,36,663,1, - 37,1,37,1,38,1,38,1,39,1,39,1,39,3,39,673,8,39,1,40,1,40,1,41,1,41,1,41, - 3,41,680,8,41,1,42,1,42,1,42,5,42,685,8,42,10,42,12,42,688,9,42,1,42,1, - 42,1,42,1,42,1,42,1,42,5,42,696,8,42,10,42,12,42,699,9,42,1,42,1,42,1,42, - 1,42,1,42,3,42,706,8,42,1,42,3,42,709,8,42,3,42,711,8,42,1,43,4,43,714, - 8,43,11,43,12,43,715,1,44,4,44,719,8,44,11,44,12,44,720,1,44,1,44,5,44, - 725,8,44,10,44,12,44,728,9,44,1,44,1,44,4,44,732,8,44,11,44,12,44,733,1, - 44,4,44,737,8,44,11,44,12,44,738,1,44,1,44,5,44,743,8,44,10,44,12,44,746, - 9,44,3,44,748,8,44,1,44,1,44,1,44,1,44,4,44,754,8,44,11,44,12,44,755,1, - 44,1,44,3,44,760,8,44,1,45,1,45,1,45,1,46,1,46,1,46,1,46,1,47,1,47,1,47, - 1,47,1,48,1,48,1,49,1,49,1,49,1,50,1,50,1,51,1,51,1,51,1,51,1,51,1,52,1, - 52,1,53,1,53,1,53,1,53,1,53,1,53,1,54,1,54,1,54,1,54,1,54,1,54,1,55,1,55, - 1,55,1,55,1,55,1,56,1,56,1,57,1,57,1,57,1,58,1,58,1,58,1,59,1,59,1,59,1, - 59,1,59,1,60,1,60,1,60,1,60,1,61,1,61,1,61,1,61,1,61,1,62,1,62,1,62,1,62, - 1,62,1,62,1,63,1,63,1,63,1,64,1,64,1,65,1,65,1,65,1,65,1,65,1,65,1,66,1, - 66,1,67,1,67,1,67,1,67,1,67,1,68,1,68,1,68,1,69,1,69,1,69,1,70,1,70,1,70, - 1,71,1,71,1,72,1,72,1,72,1,73,1,73,1,74,1,74,1,74,1,75,1,75,1,76,1,76,1, - 77,1,77,1,78,1,78,1,79,1,79,1,80,1,80,1,80,5,80,882,8,80,10,80,12,80,885, - 9,80,1,80,1,80,4,80,889,8,80,11,80,12,80,890,3,80,893,8,80,1,81,1,81,1, - 81,1,81,1,81,1,82,1,82,1,82,1,82,1,82,1,83,1,83,5,83,907,8,83,10,83,12, - 83,910,9,83,1,83,1,83,3,83,914,8,83,1,83,4,83,917,8,83,11,83,12,83,918, - 3,83,921,8,83,1,84,1,84,4,84,925,8,84,11,84,12,84,926,1,84,1,84,1,85,1, - 85,1,86,1,86,1,86,1,86,1,87,1,87,1,87,1,87,1,88,1,88,1,88,1,88,1,89,1,89, - 1,89,1,89,1,89,1,90,1,90,1,90,1,90,1,91,1,91,1,91,1,91,1,92,1,92,1,92,1, - 92,1,93,1,93,1,93,1,93,1,94,1,94,1,94,1,94,1,95,1,95,1,95,1,95,1,95,1,95, - 1,95,1,95,1,95,1,96,1,96,1,96,1,96,1,97,1,97,1,97,1,97,1,98,1,98,1,98,1, - 98,1,99,1,99,1,99,1,99,1,100,1,100,1,100,1,100,1,100,1,101,1,101,1,101, - 1,101,1,102,1,102,1,102,1,102,1,103,1,103,1,103,1,103,3,103,1012,8,103, - 1,104,1,104,3,104,1016,8,104,1,104,5,104,1019,8,104,10,104,12,104,1022, - 9,104,1,104,1,104,3,104,1026,8,104,1,104,4,104,1029,8,104,11,104,12,104, - 1030,3,104,1033,8,104,1,105,1,105,4,105,1037,8,105,11,105,12,105,1038,1, - 106,1,106,1,106,1,106,1,107,1,107,1,107,1,107,1,108,1,108,1,108,1,108,1, - 109,1,109,1,109,1,109,1,109,1,110,1,110,1,110,1,110,1,111,1,111,1,111,1, - 111,1,112,1,112,1,112,1,112,1,113,1,113,1,113,1,114,1,114,1,114,1,114,1, - 115,1,115,1,115,1,115,1,116,1,116,1,116,1,116,1,117,1,117,1,117,1,117,1, - 118,1,118,1,118,1,118,1,118,1,119,1,119,1,119,1,119,1,119,1,120,1,120,1, - 120,1,120,1,120,1,121,1,121,1,121,1,121,1,121,1,121,1,121,1,122,1,122,1, - 123,4,123,1114,8,123,11,123,12,123,1115,1,123,1,123,3,123,1120,8,123,1, - 123,4,123,1123,8,123,11,123,12,123,1124,1,124,1,124,1,124,1,124,1,125,1, - 125,1,125,1,125,1,126,1,126,1,126,1,126,1,127,1,127,1,127,1,127,1,128,1, - 128,1,128,1,128,1,129,1,129,1,129,1,129,1,129,1,129,1,130,1,130,1,130,1, - 130,1,131,1,131,1,131,1,131,1,132,1,132,1,132,1,132,1,133,1,133,1,133,1, - 133,1,134,1,134,1,134,1,134,1,135,1,135,1,135,1,135,1,136,1,136,1,136,1, - 136,1,137,1,137,1,137,1,137,1,138,1,138,1,138,1,138,1,139,1,139,1,139,1, - 139,1,139,1,140,1,140,1,140,1,140,1,141,1,141,1,141,1,141,1,142,1,142,1, - 142,1,142,1,142,1,143,1,143,1,143,1,143,1,144,1,144,1,144,1,144,1,145,1, - 145,1,145,1,145,1,146,1,146,1,146,1,146,1,147,1,147,1,147,1,147,1,147,1, - 147,1,148,1,148,1,148,1,148,1,149,1,149,1,149,1,149,1,150,1,150,1,150,1, - 150,1,151,1,151,1,151,1,151,1,152,1,152,1,152,1,152,1,153,1,153,1,153,1, - 153,1,154,1,154,1,154,1,154,1,154,1,155,1,155,1,155,1,155,1,156,1,156,1, - 156,1,156,1,157,1,157,1,157,1,157,1,158,1,158,1,158,1,158,1,159,1,159,1, - 159,1,159,1,160,1,160,1,160,1,160,1,161,1,161,1,161,1,161,1,161,1,162,1, - 162,1,162,1,162,1,162,1,163,1,163,1,163,1,163,1,164,1,164,1,164,1,164,1, - 165,1,165,1,165,1,165,1,166,1,166,1,166,1,166,1,166,1,167,1,167,1,167,1, - 167,1,167,1,167,1,167,1,167,1,167,1,167,1,168,1,168,1,168,1,168,1,169,1, - 169,1,169,1,169,1,170,1,170,1,170,1,170,1,171,1,171,1,171,1,171,1,171,1, - 172,1,172,1,173,1,173,1,173,1,173,1,173,4,173,1343,8,173,11,173,12,173, - 1344,1,174,1,174,1,174,1,174,1,175,1,175,1,175,1,175,1,176,1,176,1,176, - 1,176,1,177,1,177,1,177,1,177,1,177,1,178,1,178,1,178,1,178,1,178,1,178, - 1,179,1,179,1,179,1,179,1,180,1,180,1,180,1,180,1,181,1,181,1,181,1,181, - 1,182,1,182,1,182,1,182,1,182,1,182,1,183,1,183,1,183,1,183,1,184,1,184, - 1,184,1,184,1,185,1,185,1,185,1,185,1,186,1,186,1,186,1,186,1,186,1,186, - 1,187,1,187,1,187,1,187,1,187,1,187,1,188,1,188,1,188,1,188,1,188,1,188, - 1,189,1,189,1,189,1,189,1,189,2,596,697,0,190,16,1,18,2,20,3,22,4,24,5, - 26,6,28,7,30,8,32,9,34,10,36,11,38,12,40,13,42,14,44,15,46,16,48,17,50, - 18,52,19,54,20,56,21,58,22,60,23,62,24,64,0,66,25,68,0,70,0,72,26,74,27, - 76,28,78,29,80,0,82,0,84,0,86,0,88,0,90,0,92,0,94,0,96,0,98,0,100,30,102, - 31,104,32,106,33,108,34,110,35,112,36,114,37,116,38,118,39,120,40,122,41, - 124,42,126,43,128,44,130,45,132,46,134,47,136,48,138,49,140,50,142,51,144, - 52,146,53,148,54,150,55,152,56,154,57,156,58,158,59,160,60,162,61,164,62, - 166,63,168,64,170,65,172,66,174,67,176,68,178,69,180,70,182,71,184,0,186, - 72,188,73,190,74,192,75,194,0,196,0,198,0,200,0,202,0,204,0,206,76,208, - 0,210,77,212,78,214,79,216,0,218,0,220,0,222,0,224,0,226,80,228,81,230, - 82,232,83,234,0,236,0,238,0,240,0,242,84,244,0,246,85,248,86,250,87,252, - 0,254,0,256,88,258,89,260,0,262,90,264,0,266,0,268,91,270,92,272,93,274, - 0,276,0,278,0,280,0,282,0,284,0,286,0,288,94,290,95,292,96,294,0,296,0, - 298,0,300,0,302,0,304,97,306,98,308,99,310,0,312,0,314,0,316,0,318,100, - 320,101,322,102,324,0,326,0,328,0,330,0,332,103,334,104,336,105,338,0,340, - 106,342,107,344,108,346,109,348,0,350,110,352,111,354,112,356,113,358,0, - 360,114,362,115,364,116,366,117,368,118,370,0,372,0,374,119,376,120,378, - 121,380,0,382,122,384,123,386,124,388,0,390,0,392,0,394,0,16,0,1,2,3,4, - 5,6,7,8,9,10,11,12,13,14,15,35,2,0,68,68,100,100,2,0,73,73,105,105,2,0, - 83,83,115,115,2,0,69,69,101,101,2,0,67,67,99,99,2,0,84,84,116,116,2,0,82, - 82,114,114,2,0,79,79,111,111,2,0,80,80,112,112,2,0,78,78,110,110,2,0,72, - 72,104,104,2,0,86,86,118,118,2,0,65,65,97,97,2,0,76,76,108,108,2,0,88,88, - 120,120,2,0,70,70,102,102,2,0,77,77,109,109,2,0,71,71,103,103,2,0,75,75, - 107,107,2,0,85,85,117,117,2,0,87,87,119,119,6,0,9,10,13,13,32,32,47,47, - 91,91,93,93,2,0,10,10,13,13,3,0,9,10,13,13,32,32,10,0,9,10,13,13,32,32, - 44,44,47,47,61,61,91,91,93,93,96,96,124,124,2,0,42,42,47,47,1,0,48,57,2, - 0,65,90,97,122,8,0,34,34,78,78,82,82,84,84,92,92,110,110,114,114,116,116, - 4,0,10,10,13,13,34,34,92,92,2,0,43,43,45,45,1,0,96,96,2,0,66,66,98,98,2, - 0,89,89,121,121,11,0,9,10,13,13,32,32,34,35,44,44,47,47,58,58,60,60,62, - 63,92,92,124,124,1448,0,16,1,0,0,0,0,18,1,0,0,0,0,20,1,0,0,0,0,22,1,0,0, - 0,0,24,1,0,0,0,0,26,1,0,0,0,0,28,1,0,0,0,0,30,1,0,0,0,0,32,1,0,0,0,0,34, - 1,0,0,0,0,36,1,0,0,0,0,38,1,0,0,0,0,40,1,0,0,0,0,42,1,0,0,0,0,44,1,0,0, - 0,0,46,1,0,0,0,0,48,1,0,0,0,0,50,1,0,0,0,0,52,1,0,0,0,0,54,1,0,0,0,0,56, - 1,0,0,0,0,58,1,0,0,0,0,60,1,0,0,0,0,62,1,0,0,0,0,66,1,0,0,0,1,68,1,0,0, - 0,1,70,1,0,0,0,1,72,1,0,0,0,1,74,1,0,0,0,1,76,1,0,0,0,2,78,1,0,0,0,2,100, - 1,0,0,0,2,102,1,0,0,0,2,104,1,0,0,0,2,106,1,0,0,0,2,108,1,0,0,0,2,110,1, - 0,0,0,2,112,1,0,0,0,2,114,1,0,0,0,2,116,1,0,0,0,2,118,1,0,0,0,2,120,1,0, - 0,0,2,122,1,0,0,0,2,124,1,0,0,0,2,126,1,0,0,0,2,128,1,0,0,0,2,130,1,0,0, - 0,2,132,1,0,0,0,2,134,1,0,0,0,2,136,1,0,0,0,2,138,1,0,0,0,2,140,1,0,0,0, - 2,142,1,0,0,0,2,144,1,0,0,0,2,146,1,0,0,0,2,148,1,0,0,0,2,150,1,0,0,0,2, - 152,1,0,0,0,2,154,1,0,0,0,2,156,1,0,0,0,2,158,1,0,0,0,2,160,1,0,0,0,2,162, - 1,0,0,0,2,164,1,0,0,0,2,166,1,0,0,0,2,168,1,0,0,0,2,170,1,0,0,0,2,172,1, - 0,0,0,2,174,1,0,0,0,2,176,1,0,0,0,2,178,1,0,0,0,2,180,1,0,0,0,2,182,1,0, - 0,0,2,186,1,0,0,0,2,188,1,0,0,0,2,190,1,0,0,0,2,192,1,0,0,0,3,194,1,0,0, - 0,3,196,1,0,0,0,3,198,1,0,0,0,3,200,1,0,0,0,3,202,1,0,0,0,3,204,1,0,0,0, - 3,206,1,0,0,0,3,208,1,0,0,0,3,210,1,0,0,0,3,212,1,0,0,0,3,214,1,0,0,0,4, - 216,1,0,0,0,4,218,1,0,0,0,4,220,1,0,0,0,4,226,1,0,0,0,4,228,1,0,0,0,4,230, - 1,0,0,0,4,232,1,0,0,0,5,234,1,0,0,0,5,236,1,0,0,0,5,238,1,0,0,0,5,240,1, - 0,0,0,5,242,1,0,0,0,5,244,1,0,0,0,5,246,1,0,0,0,5,248,1,0,0,0,5,250,1,0, - 0,0,6,252,1,0,0,0,6,254,1,0,0,0,6,256,1,0,0,0,6,258,1,0,0,0,6,262,1,0,0, - 0,6,264,1,0,0,0,6,266,1,0,0,0,6,268,1,0,0,0,6,270,1,0,0,0,6,272,1,0,0,0, - 7,274,1,0,0,0,7,276,1,0,0,0,7,278,1,0,0,0,7,280,1,0,0,0,7,282,1,0,0,0,7, - 284,1,0,0,0,7,286,1,0,0,0,7,288,1,0,0,0,7,290,1,0,0,0,7,292,1,0,0,0,8,294, - 1,0,0,0,8,296,1,0,0,0,8,298,1,0,0,0,8,300,1,0,0,0,8,302,1,0,0,0,8,304,1, - 0,0,0,8,306,1,0,0,0,8,308,1,0,0,0,9,310,1,0,0,0,9,312,1,0,0,0,9,314,1,0, - 0,0,9,316,1,0,0,0,9,318,1,0,0,0,9,320,1,0,0,0,9,322,1,0,0,0,10,324,1,0, - 0,0,10,326,1,0,0,0,10,328,1,0,0,0,10,330,1,0,0,0,10,332,1,0,0,0,10,334, - 1,0,0,0,10,336,1,0,0,0,11,338,1,0,0,0,11,340,1,0,0,0,11,342,1,0,0,0,11, - 344,1,0,0,0,11,346,1,0,0,0,12,348,1,0,0,0,12,350,1,0,0,0,12,352,1,0,0,0, - 12,354,1,0,0,0,12,356,1,0,0,0,13,358,1,0,0,0,13,360,1,0,0,0,13,362,1,0, - 0,0,13,364,1,0,0,0,13,366,1,0,0,0,13,368,1,0,0,0,14,370,1,0,0,0,14,372, - 1,0,0,0,14,374,1,0,0,0,14,376,1,0,0,0,14,378,1,0,0,0,15,380,1,0,0,0,15, - 382,1,0,0,0,15,384,1,0,0,0,15,386,1,0,0,0,15,388,1,0,0,0,15,390,1,0,0,0, - 15,392,1,0,0,0,15,394,1,0,0,0,16,396,1,0,0,0,18,406,1,0,0,0,20,413,1,0, - 0,0,22,422,1,0,0,0,24,429,1,0,0,0,26,439,1,0,0,0,28,446,1,0,0,0,30,453, - 1,0,0,0,32,467,1,0,0,0,34,474,1,0,0,0,36,482,1,0,0,0,38,491,1,0,0,0,40, - 498,1,0,0,0,42,508,1,0,0,0,44,520,1,0,0,0,46,529,1,0,0,0,48,535,1,0,0,0, - 50,542,1,0,0,0,52,549,1,0,0,0,54,557,1,0,0,0,56,566,1,0,0,0,58,572,1,0, - 0,0,60,589,1,0,0,0,62,605,1,0,0,0,64,614,1,0,0,0,66,617,1,0,0,0,68,621, - 1,0,0,0,70,626,1,0,0,0,72,631,1,0,0,0,74,635,1,0,0,0,76,639,1,0,0,0,78, - 643,1,0,0,0,80,647,1,0,0,0,82,649,1,0,0,0,84,651,1,0,0,0,86,654,1,0,0,0, - 88,656,1,0,0,0,90,665,1,0,0,0,92,667,1,0,0,0,94,672,1,0,0,0,96,674,1,0, - 0,0,98,679,1,0,0,0,100,710,1,0,0,0,102,713,1,0,0,0,104,759,1,0,0,0,106, - 761,1,0,0,0,108,764,1,0,0,0,110,768,1,0,0,0,112,772,1,0,0,0,114,774,1,0, - 0,0,116,777,1,0,0,0,118,779,1,0,0,0,120,784,1,0,0,0,122,786,1,0,0,0,124, - 792,1,0,0,0,126,798,1,0,0,0,128,803,1,0,0,0,130,805,1,0,0,0,132,808,1,0, - 0,0,134,811,1,0,0,0,136,816,1,0,0,0,138,820,1,0,0,0,140,825,1,0,0,0,142, - 831,1,0,0,0,144,834,1,0,0,0,146,836,1,0,0,0,148,842,1,0,0,0,150,844,1,0, - 0,0,152,849,1,0,0,0,154,852,1,0,0,0,156,855,1,0,0,0,158,858,1,0,0,0,160, - 860,1,0,0,0,162,863,1,0,0,0,164,865,1,0,0,0,166,868,1,0,0,0,168,870,1,0, - 0,0,170,872,1,0,0,0,172,874,1,0,0,0,174,876,1,0,0,0,176,892,1,0,0,0,178, - 894,1,0,0,0,180,899,1,0,0,0,182,920,1,0,0,0,184,922,1,0,0,0,186,930,1,0, - 0,0,188,932,1,0,0,0,190,936,1,0,0,0,192,940,1,0,0,0,194,944,1,0,0,0,196, - 949,1,0,0,0,198,953,1,0,0,0,200,957,1,0,0,0,202,961,1,0,0,0,204,965,1,0, - 0,0,206,969,1,0,0,0,208,978,1,0,0,0,210,982,1,0,0,0,212,986,1,0,0,0,214, - 990,1,0,0,0,216,994,1,0,0,0,218,999,1,0,0,0,220,1003,1,0,0,0,222,1011,1, - 0,0,0,224,1032,1,0,0,0,226,1036,1,0,0,0,228,1040,1,0,0,0,230,1044,1,0,0, - 0,232,1048,1,0,0,0,234,1052,1,0,0,0,236,1057,1,0,0,0,238,1061,1,0,0,0,240, - 1065,1,0,0,0,242,1069,1,0,0,0,244,1072,1,0,0,0,246,1076,1,0,0,0,248,1080, - 1,0,0,0,250,1084,1,0,0,0,252,1088,1,0,0,0,254,1093,1,0,0,0,256,1098,1,0, - 0,0,258,1103,1,0,0,0,260,1110,1,0,0,0,262,1119,1,0,0,0,264,1126,1,0,0,0, - 266,1130,1,0,0,0,268,1134,1,0,0,0,270,1138,1,0,0,0,272,1142,1,0,0,0,274, - 1146,1,0,0,0,276,1152,1,0,0,0,278,1156,1,0,0,0,280,1160,1,0,0,0,282,1164, - 1,0,0,0,284,1168,1,0,0,0,286,1172,1,0,0,0,288,1176,1,0,0,0,290,1180,1,0, - 0,0,292,1184,1,0,0,0,294,1188,1,0,0,0,296,1193,1,0,0,0,298,1197,1,0,0,0, - 300,1201,1,0,0,0,302,1206,1,0,0,0,304,1210,1,0,0,0,306,1214,1,0,0,0,308, - 1218,1,0,0,0,310,1222,1,0,0,0,312,1228,1,0,0,0,314,1232,1,0,0,0,316,1236, - 1,0,0,0,318,1240,1,0,0,0,320,1244,1,0,0,0,322,1248,1,0,0,0,324,1252,1,0, - 0,0,326,1257,1,0,0,0,328,1261,1,0,0,0,330,1265,1,0,0,0,332,1269,1,0,0,0, - 334,1273,1,0,0,0,336,1277,1,0,0,0,338,1281,1,0,0,0,340,1286,1,0,0,0,342, - 1291,1,0,0,0,344,1295,1,0,0,0,346,1299,1,0,0,0,348,1303,1,0,0,0,350,1308, - 1,0,0,0,352,1318,1,0,0,0,354,1322,1,0,0,0,356,1326,1,0,0,0,358,1330,1,0, - 0,0,360,1335,1,0,0,0,362,1342,1,0,0,0,364,1346,1,0,0,0,366,1350,1,0,0,0, - 368,1354,1,0,0,0,370,1358,1,0,0,0,372,1363,1,0,0,0,374,1369,1,0,0,0,376, - 1373,1,0,0,0,378,1377,1,0,0,0,380,1381,1,0,0,0,382,1387,1,0,0,0,384,1391, - 1,0,0,0,386,1395,1,0,0,0,388,1399,1,0,0,0,390,1405,1,0,0,0,392,1411,1,0, - 0,0,394,1417,1,0,0,0,396,397,7,0,0,0,397,398,7,1,0,0,398,399,7,2,0,0,399, - 400,7,2,0,0,400,401,7,3,0,0,401,402,7,4,0,0,402,403,7,5,0,0,403,404,1,0, - 0,0,404,405,6,0,0,0,405,17,1,0,0,0,406,407,7,0,0,0,407,408,7,6,0,0,408, - 409,7,7,0,0,409,410,7,8,0,0,410,411,1,0,0,0,411,412,6,1,1,0,412,19,1,0, - 0,0,413,414,7,3,0,0,414,415,7,9,0,0,415,416,7,6,0,0,416,417,7,1,0,0,417, - 418,7,4,0,0,418,419,7,10,0,0,419,420,1,0,0,0,420,421,6,2,2,0,421,21,1,0, - 0,0,422,423,7,3,0,0,423,424,7,11,0,0,424,425,7,12,0,0,425,426,7,13,0,0, - 426,427,1,0,0,0,427,428,6,3,0,0,428,23,1,0,0,0,429,430,7,3,0,0,430,431, - 7,14,0,0,431,432,7,8,0,0,432,433,7,13,0,0,433,434,7,12,0,0,434,435,7,1, - 0,0,435,436,7,9,0,0,436,437,1,0,0,0,437,438,6,4,3,0,438,25,1,0,0,0,439, - 440,7,15,0,0,440,441,7,6,0,0,441,442,7,7,0,0,442,443,7,16,0,0,443,444,1, - 0,0,0,444,445,6,5,4,0,445,27,1,0,0,0,446,447,7,17,0,0,447,448,7,6,0,0,448, - 449,7,7,0,0,449,450,7,18,0,0,450,451,1,0,0,0,451,452,6,6,0,0,452,29,1,0, - 0,0,453,454,7,1,0,0,454,455,7,9,0,0,455,456,7,13,0,0,456,457,7,1,0,0,457, - 458,7,9,0,0,458,459,7,3,0,0,459,460,7,2,0,0,460,461,7,5,0,0,461,462,7,12, - 0,0,462,463,7,5,0,0,463,464,7,2,0,0,464,465,1,0,0,0,465,466,6,7,0,0,466, - 31,1,0,0,0,467,468,7,18,0,0,468,469,7,3,0,0,469,470,7,3,0,0,470,471,7,8, - 0,0,471,472,1,0,0,0,472,473,6,8,1,0,473,33,1,0,0,0,474,475,7,13,0,0,475, - 476,7,1,0,0,476,477,7,16,0,0,477,478,7,1,0,0,478,479,7,5,0,0,479,480,1, - 0,0,0,480,481,6,9,0,0,481,35,1,0,0,0,482,483,7,13,0,0,483,484,7,7,0,0,484, - 485,7,7,0,0,485,486,7,18,0,0,486,487,7,19,0,0,487,488,7,8,0,0,488,489,1, - 0,0,0,489,490,6,10,5,0,490,37,1,0,0,0,491,492,7,16,0,0,492,493,7,3,0,0, - 493,494,7,5,0,0,494,495,7,12,0,0,495,496,1,0,0,0,496,497,6,11,6,0,497,39, - 1,0,0,0,498,499,7,16,0,0,499,500,7,3,0,0,500,501,7,5,0,0,501,502,7,6,0, - 0,502,503,7,1,0,0,503,504,7,4,0,0,504,505,7,2,0,0,505,506,1,0,0,0,506,507, - 6,12,7,0,507,41,1,0,0,0,508,509,7,16,0,0,509,510,7,11,0,0,510,511,5,95, - 0,0,511,512,7,3,0,0,512,513,7,14,0,0,513,514,7,8,0,0,514,515,7,12,0,0,515, - 516,7,9,0,0,516,517,7,0,0,0,517,518,1,0,0,0,518,519,6,13,8,0,519,43,1,0, - 0,0,520,521,7,6,0,0,521,522,7,3,0,0,522,523,7,9,0,0,523,524,7,12,0,0,524, - 525,7,16,0,0,525,526,7,3,0,0,526,527,1,0,0,0,527,528,6,14,9,0,528,45,1, - 0,0,0,529,530,7,6,0,0,530,531,7,7,0,0,531,532,7,20,0,0,532,533,1,0,0,0, - 533,534,6,15,0,0,534,47,1,0,0,0,535,536,7,2,0,0,536,537,7,10,0,0,537,538, - 7,7,0,0,538,539,7,20,0,0,539,540,1,0,0,0,540,541,6,16,10,0,541,49,1,0,0, - 0,542,543,7,2,0,0,543,544,7,7,0,0,544,545,7,6,0,0,545,546,7,5,0,0,546,547, - 1,0,0,0,547,548,6,17,0,0,548,51,1,0,0,0,549,550,7,2,0,0,550,551,7,5,0,0, - 551,552,7,12,0,0,552,553,7,5,0,0,553,554,7,2,0,0,554,555,1,0,0,0,555,556, - 6,18,0,0,556,53,1,0,0,0,557,558,7,20,0,0,558,559,7,10,0,0,559,560,7,3,0, - 0,560,561,7,6,0,0,561,562,7,3,0,0,562,563,1,0,0,0,563,564,6,19,0,0,564, - 55,1,0,0,0,565,567,8,21,0,0,566,565,1,0,0,0,567,568,1,0,0,0,568,566,1,0, - 0,0,568,569,1,0,0,0,569,570,1,0,0,0,570,571,6,20,0,0,571,57,1,0,0,0,572, - 573,5,47,0,0,573,574,5,47,0,0,574,578,1,0,0,0,575,577,8,22,0,0,576,575, - 1,0,0,0,577,580,1,0,0,0,578,576,1,0,0,0,578,579,1,0,0,0,579,582,1,0,0,0, - 580,578,1,0,0,0,581,583,5,13,0,0,582,581,1,0,0,0,582,583,1,0,0,0,583,585, - 1,0,0,0,584,586,5,10,0,0,585,584,1,0,0,0,585,586,1,0,0,0,586,587,1,0,0, - 0,587,588,6,21,11,0,588,59,1,0,0,0,589,590,5,47,0,0,590,591,5,42,0,0,591, - 596,1,0,0,0,592,595,3,60,22,0,593,595,9,0,0,0,594,592,1,0,0,0,594,593,1, - 0,0,0,595,598,1,0,0,0,596,597,1,0,0,0,596,594,1,0,0,0,597,599,1,0,0,0,598, - 596,1,0,0,0,599,600,5,42,0,0,600,601,5,47,0,0,601,602,1,0,0,0,602,603,6, - 22,11,0,603,61,1,0,0,0,604,606,7,23,0,0,605,604,1,0,0,0,606,607,1,0,0,0, - 607,605,1,0,0,0,607,608,1,0,0,0,608,609,1,0,0,0,609,610,6,23,11,0,610,63, - 1,0,0,0,611,615,8,24,0,0,612,613,5,47,0,0,613,615,8,25,0,0,614,611,1,0, - 0,0,614,612,1,0,0,0,615,65,1,0,0,0,616,618,3,64,24,0,617,616,1,0,0,0,618, - 619,1,0,0,0,619,617,1,0,0,0,619,620,1,0,0,0,620,67,1,0,0,0,621,622,3,178, - 81,0,622,623,1,0,0,0,623,624,6,26,12,0,624,625,6,26,13,0,625,69,1,0,0,0, - 626,627,3,78,31,0,627,628,1,0,0,0,628,629,6,27,14,0,629,630,6,27,15,0,630, - 71,1,0,0,0,631,632,3,62,23,0,632,633,1,0,0,0,633,634,6,28,11,0,634,73,1, - 0,0,0,635,636,3,58,21,0,636,637,1,0,0,0,637,638,6,29,11,0,638,75,1,0,0, - 0,639,640,3,60,22,0,640,641,1,0,0,0,641,642,6,30,11,0,642,77,1,0,0,0,643, - 644,5,124,0,0,644,645,1,0,0,0,645,646,6,31,15,0,646,79,1,0,0,0,647,648, - 7,26,0,0,648,81,1,0,0,0,649,650,7,27,0,0,650,83,1,0,0,0,651,652,5,92,0, - 0,652,653,7,28,0,0,653,85,1,0,0,0,654,655,8,29,0,0,655,87,1,0,0,0,656,658, - 7,3,0,0,657,659,7,30,0,0,658,657,1,0,0,0,658,659,1,0,0,0,659,661,1,0,0, - 0,660,662,3,80,32,0,661,660,1,0,0,0,662,663,1,0,0,0,663,661,1,0,0,0,663, - 664,1,0,0,0,664,89,1,0,0,0,665,666,5,64,0,0,666,91,1,0,0,0,667,668,5,96, - 0,0,668,93,1,0,0,0,669,673,8,31,0,0,670,671,5,96,0,0,671,673,5,96,0,0,672, - 669,1,0,0,0,672,670,1,0,0,0,673,95,1,0,0,0,674,675,5,95,0,0,675,97,1,0, - 0,0,676,680,3,82,33,0,677,680,3,80,32,0,678,680,3,96,40,0,679,676,1,0,0, - 0,679,677,1,0,0,0,679,678,1,0,0,0,680,99,1,0,0,0,681,686,5,34,0,0,682,685, - 3,84,34,0,683,685,3,86,35,0,684,682,1,0,0,0,684,683,1,0,0,0,685,688,1,0, - 0,0,686,684,1,0,0,0,686,687,1,0,0,0,687,689,1,0,0,0,688,686,1,0,0,0,689, - 711,5,34,0,0,690,691,5,34,0,0,691,692,5,34,0,0,692,693,5,34,0,0,693,697, - 1,0,0,0,694,696,8,22,0,0,695,694,1,0,0,0,696,699,1,0,0,0,697,698,1,0,0, - 0,697,695,1,0,0,0,698,700,1,0,0,0,699,697,1,0,0,0,700,701,5,34,0,0,701, - 702,5,34,0,0,702,703,5,34,0,0,703,705,1,0,0,0,704,706,5,34,0,0,705,704, - 1,0,0,0,705,706,1,0,0,0,706,708,1,0,0,0,707,709,5,34,0,0,708,707,1,0,0, - 0,708,709,1,0,0,0,709,711,1,0,0,0,710,681,1,0,0,0,710,690,1,0,0,0,711,101, - 1,0,0,0,712,714,3,80,32,0,713,712,1,0,0,0,714,715,1,0,0,0,715,713,1,0,0, - 0,715,716,1,0,0,0,716,103,1,0,0,0,717,719,3,80,32,0,718,717,1,0,0,0,719, - 720,1,0,0,0,720,718,1,0,0,0,720,721,1,0,0,0,721,722,1,0,0,0,722,726,3,120, - 52,0,723,725,3,80,32,0,724,723,1,0,0,0,725,728,1,0,0,0,726,724,1,0,0,0, - 726,727,1,0,0,0,727,760,1,0,0,0,728,726,1,0,0,0,729,731,3,120,52,0,730, - 732,3,80,32,0,731,730,1,0,0,0,732,733,1,0,0,0,733,731,1,0,0,0,733,734,1, - 0,0,0,734,760,1,0,0,0,735,737,3,80,32,0,736,735,1,0,0,0,737,738,1,0,0,0, - 738,736,1,0,0,0,738,739,1,0,0,0,739,747,1,0,0,0,740,744,3,120,52,0,741, - 743,3,80,32,0,742,741,1,0,0,0,743,746,1,0,0,0,744,742,1,0,0,0,744,745,1, - 0,0,0,745,748,1,0,0,0,746,744,1,0,0,0,747,740,1,0,0,0,747,748,1,0,0,0,748, - 749,1,0,0,0,749,750,3,88,36,0,750,760,1,0,0,0,751,753,3,120,52,0,752,754, - 3,80,32,0,753,752,1,0,0,0,754,755,1,0,0,0,755,753,1,0,0,0,755,756,1,0,0, - 0,756,757,1,0,0,0,757,758,3,88,36,0,758,760,1,0,0,0,759,718,1,0,0,0,759, - 729,1,0,0,0,759,736,1,0,0,0,759,751,1,0,0,0,760,105,1,0,0,0,761,762,7,32, - 0,0,762,763,7,33,0,0,763,107,1,0,0,0,764,765,7,12,0,0,765,766,7,9,0,0,766, - 767,7,0,0,0,767,109,1,0,0,0,768,769,7,12,0,0,769,770,7,2,0,0,770,771,7, - 4,0,0,771,111,1,0,0,0,772,773,5,61,0,0,773,113,1,0,0,0,774,775,5,58,0,0, - 775,776,5,58,0,0,776,115,1,0,0,0,777,778,5,44,0,0,778,117,1,0,0,0,779,780, - 7,0,0,0,780,781,7,3,0,0,781,782,7,2,0,0,782,783,7,4,0,0,783,119,1,0,0,0, - 784,785,5,46,0,0,785,121,1,0,0,0,786,787,7,15,0,0,787,788,7,12,0,0,788, - 789,7,13,0,0,789,790,7,2,0,0,790,791,7,3,0,0,791,123,1,0,0,0,792,793,7, - 15,0,0,793,794,7,1,0,0,794,795,7,6,0,0,795,796,7,2,0,0,796,797,7,5,0,0, - 797,125,1,0,0,0,798,799,7,13,0,0,799,800,7,12,0,0,800,801,7,2,0,0,801,802, - 7,5,0,0,802,127,1,0,0,0,803,804,5,40,0,0,804,129,1,0,0,0,805,806,7,1,0, - 0,806,807,7,9,0,0,807,131,1,0,0,0,808,809,7,1,0,0,809,810,7,2,0,0,810,133, - 1,0,0,0,811,812,7,13,0,0,812,813,7,1,0,0,813,814,7,18,0,0,814,815,7,3,0, - 0,815,135,1,0,0,0,816,817,7,9,0,0,817,818,7,7,0,0,818,819,7,5,0,0,819,137, - 1,0,0,0,820,821,7,9,0,0,821,822,7,19,0,0,822,823,7,13,0,0,823,824,7,13, - 0,0,824,139,1,0,0,0,825,826,7,9,0,0,826,827,7,19,0,0,827,828,7,13,0,0,828, - 829,7,13,0,0,829,830,7,2,0,0,830,141,1,0,0,0,831,832,7,7,0,0,832,833,7, - 6,0,0,833,143,1,0,0,0,834,835,5,63,0,0,835,145,1,0,0,0,836,837,7,6,0,0, - 837,838,7,13,0,0,838,839,7,1,0,0,839,840,7,18,0,0,840,841,7,3,0,0,841,147, - 1,0,0,0,842,843,5,41,0,0,843,149,1,0,0,0,844,845,7,5,0,0,845,846,7,6,0, - 0,846,847,7,19,0,0,847,848,7,3,0,0,848,151,1,0,0,0,849,850,5,61,0,0,850, - 851,5,61,0,0,851,153,1,0,0,0,852,853,5,61,0,0,853,854,5,126,0,0,854,155, - 1,0,0,0,855,856,5,33,0,0,856,857,5,61,0,0,857,157,1,0,0,0,858,859,5,60, - 0,0,859,159,1,0,0,0,860,861,5,60,0,0,861,862,5,61,0,0,862,161,1,0,0,0,863, - 864,5,62,0,0,864,163,1,0,0,0,865,866,5,62,0,0,866,867,5,61,0,0,867,165, - 1,0,0,0,868,869,5,43,0,0,869,167,1,0,0,0,870,871,5,45,0,0,871,169,1,0,0, - 0,872,873,5,42,0,0,873,171,1,0,0,0,874,875,5,47,0,0,875,173,1,0,0,0,876, - 877,5,37,0,0,877,175,1,0,0,0,878,879,3,144,64,0,879,883,3,82,33,0,880,882, - 3,98,41,0,881,880,1,0,0,0,882,885,1,0,0,0,883,881,1,0,0,0,883,884,1,0,0, - 0,884,893,1,0,0,0,885,883,1,0,0,0,886,888,3,144,64,0,887,889,3,80,32,0, - 888,887,1,0,0,0,889,890,1,0,0,0,890,888,1,0,0,0,890,891,1,0,0,0,891,893, - 1,0,0,0,892,878,1,0,0,0,892,886,1,0,0,0,893,177,1,0,0,0,894,895,5,91,0, - 0,895,896,1,0,0,0,896,897,6,81,0,0,897,898,6,81,0,0,898,179,1,0,0,0,899, - 900,5,93,0,0,900,901,1,0,0,0,901,902,6,82,15,0,902,903,6,82,15,0,903,181, - 1,0,0,0,904,908,3,82,33,0,905,907,3,98,41,0,906,905,1,0,0,0,907,910,1,0, - 0,0,908,906,1,0,0,0,908,909,1,0,0,0,909,921,1,0,0,0,910,908,1,0,0,0,911, - 914,3,96,40,0,912,914,3,90,37,0,913,911,1,0,0,0,913,912,1,0,0,0,914,916, - 1,0,0,0,915,917,3,98,41,0,916,915,1,0,0,0,917,918,1,0,0,0,918,916,1,0,0, - 0,918,919,1,0,0,0,919,921,1,0,0,0,920,904,1,0,0,0,920,913,1,0,0,0,921,183, - 1,0,0,0,922,924,3,92,38,0,923,925,3,94,39,0,924,923,1,0,0,0,925,926,1,0, - 0,0,926,924,1,0,0,0,926,927,1,0,0,0,927,928,1,0,0,0,928,929,3,92,38,0,929, - 185,1,0,0,0,930,931,3,184,84,0,931,187,1,0,0,0,932,933,3,58,21,0,933,934, - 1,0,0,0,934,935,6,86,11,0,935,189,1,0,0,0,936,937,3,60,22,0,937,938,1,0, - 0,0,938,939,6,87,11,0,939,191,1,0,0,0,940,941,3,62,23,0,941,942,1,0,0,0, - 942,943,6,88,11,0,943,193,1,0,0,0,944,945,3,78,31,0,945,946,1,0,0,0,946, - 947,6,89,14,0,947,948,6,89,15,0,948,195,1,0,0,0,949,950,3,178,81,0,950, - 951,1,0,0,0,951,952,6,90,12,0,952,197,1,0,0,0,953,954,3,180,82,0,954,955, - 1,0,0,0,955,956,6,91,16,0,956,199,1,0,0,0,957,958,3,116,50,0,958,959,1, - 0,0,0,959,960,6,92,17,0,960,201,1,0,0,0,961,962,3,112,48,0,962,963,1,0, - 0,0,963,964,6,93,18,0,964,203,1,0,0,0,965,966,3,100,42,0,966,967,1,0,0, - 0,967,968,6,94,19,0,968,205,1,0,0,0,969,970,7,16,0,0,970,971,7,3,0,0,971, - 972,7,5,0,0,972,973,7,12,0,0,973,974,7,0,0,0,974,975,7,12,0,0,975,976,7, - 5,0,0,976,977,7,12,0,0,977,207,1,0,0,0,978,979,3,66,25,0,979,980,1,0,0, - 0,980,981,6,96,20,0,981,209,1,0,0,0,982,983,3,58,21,0,983,984,1,0,0,0,984, - 985,6,97,11,0,985,211,1,0,0,0,986,987,3,60,22,0,987,988,1,0,0,0,988,989, - 6,98,11,0,989,213,1,0,0,0,990,991,3,62,23,0,991,992,1,0,0,0,992,993,6,99, - 11,0,993,215,1,0,0,0,994,995,3,78,31,0,995,996,1,0,0,0,996,997,6,100,14, - 0,997,998,6,100,15,0,998,217,1,0,0,0,999,1000,3,120,52,0,1000,1001,1,0, - 0,0,1001,1002,6,101,21,0,1002,219,1,0,0,0,1003,1004,3,116,50,0,1004,1005, - 1,0,0,0,1005,1006,6,102,17,0,1006,221,1,0,0,0,1007,1012,3,82,33,0,1008, - 1012,3,80,32,0,1009,1012,3,96,40,0,1010,1012,3,170,77,0,1011,1007,1,0,0, - 0,1011,1008,1,0,0,0,1011,1009,1,0,0,0,1011,1010,1,0,0,0,1012,223,1,0,0, - 0,1013,1016,3,82,33,0,1014,1016,3,170,77,0,1015,1013,1,0,0,0,1015,1014, - 1,0,0,0,1016,1020,1,0,0,0,1017,1019,3,222,103,0,1018,1017,1,0,0,0,1019, - 1022,1,0,0,0,1020,1018,1,0,0,0,1020,1021,1,0,0,0,1021,1033,1,0,0,0,1022, - 1020,1,0,0,0,1023,1026,3,96,40,0,1024,1026,3,90,37,0,1025,1023,1,0,0,0, - 1025,1024,1,0,0,0,1026,1028,1,0,0,0,1027,1029,3,222,103,0,1028,1027,1,0, - 0,0,1029,1030,1,0,0,0,1030,1028,1,0,0,0,1030,1031,1,0,0,0,1031,1033,1,0, - 0,0,1032,1015,1,0,0,0,1032,1025,1,0,0,0,1033,225,1,0,0,0,1034,1037,3,224, - 104,0,1035,1037,3,184,84,0,1036,1034,1,0,0,0,1036,1035,1,0,0,0,1037,1038, - 1,0,0,0,1038,1036,1,0,0,0,1038,1039,1,0,0,0,1039,227,1,0,0,0,1040,1041, - 3,58,21,0,1041,1042,1,0,0,0,1042,1043,6,106,11,0,1043,229,1,0,0,0,1044, - 1045,3,60,22,0,1045,1046,1,0,0,0,1046,1047,6,107,11,0,1047,231,1,0,0,0, - 1048,1049,3,62,23,0,1049,1050,1,0,0,0,1050,1051,6,108,11,0,1051,233,1,0, - 0,0,1052,1053,3,78,31,0,1053,1054,1,0,0,0,1054,1055,6,109,14,0,1055,1056, - 6,109,15,0,1056,235,1,0,0,0,1057,1058,3,112,48,0,1058,1059,1,0,0,0,1059, - 1060,6,110,18,0,1060,237,1,0,0,0,1061,1062,3,116,50,0,1062,1063,1,0,0,0, - 1063,1064,6,111,17,0,1064,239,1,0,0,0,1065,1066,3,120,52,0,1066,1067,1, - 0,0,0,1067,1068,6,112,21,0,1068,241,1,0,0,0,1069,1070,7,12,0,0,1070,1071, - 7,2,0,0,1071,243,1,0,0,0,1072,1073,3,226,105,0,1073,1074,1,0,0,0,1074,1075, - 6,114,22,0,1075,245,1,0,0,0,1076,1077,3,58,21,0,1077,1078,1,0,0,0,1078, - 1079,6,115,11,0,1079,247,1,0,0,0,1080,1081,3,60,22,0,1081,1082,1,0,0,0, - 1082,1083,6,116,11,0,1083,249,1,0,0,0,1084,1085,3,62,23,0,1085,1086,1,0, - 0,0,1086,1087,6,117,11,0,1087,251,1,0,0,0,1088,1089,3,78,31,0,1089,1090, - 1,0,0,0,1090,1091,6,118,14,0,1091,1092,6,118,15,0,1092,253,1,0,0,0,1093, - 1094,3,178,81,0,1094,1095,1,0,0,0,1095,1096,6,119,12,0,1096,1097,6,119, - 23,0,1097,255,1,0,0,0,1098,1099,7,7,0,0,1099,1100,7,9,0,0,1100,1101,1,0, - 0,0,1101,1102,6,120,24,0,1102,257,1,0,0,0,1103,1104,7,20,0,0,1104,1105, - 7,1,0,0,1105,1106,7,5,0,0,1106,1107,7,10,0,0,1107,1108,1,0,0,0,1108,1109, - 6,121,24,0,1109,259,1,0,0,0,1110,1111,8,34,0,0,1111,261,1,0,0,0,1112,1114, - 3,260,122,0,1113,1112,1,0,0,0,1114,1115,1,0,0,0,1115,1113,1,0,0,0,1115, - 1116,1,0,0,0,1116,1117,1,0,0,0,1117,1118,3,360,172,0,1118,1120,1,0,0,0, - 1119,1113,1,0,0,0,1119,1120,1,0,0,0,1120,1122,1,0,0,0,1121,1123,3,260,122, - 0,1122,1121,1,0,0,0,1123,1124,1,0,0,0,1124,1122,1,0,0,0,1124,1125,1,0,0, - 0,1125,263,1,0,0,0,1126,1127,3,186,85,0,1127,1128,1,0,0,0,1128,1129,6,124, - 25,0,1129,265,1,0,0,0,1130,1131,3,262,123,0,1131,1132,1,0,0,0,1132,1133, - 6,125,26,0,1133,267,1,0,0,0,1134,1135,3,58,21,0,1135,1136,1,0,0,0,1136, - 1137,6,126,11,0,1137,269,1,0,0,0,1138,1139,3,60,22,0,1139,1140,1,0,0,0, - 1140,1141,6,127,11,0,1141,271,1,0,0,0,1142,1143,3,62,23,0,1143,1144,1,0, - 0,0,1144,1145,6,128,11,0,1145,273,1,0,0,0,1146,1147,3,78,31,0,1147,1148, - 1,0,0,0,1148,1149,6,129,14,0,1149,1150,6,129,15,0,1150,1151,6,129,15,0, - 1151,275,1,0,0,0,1152,1153,3,112,48,0,1153,1154,1,0,0,0,1154,1155,6,130, - 18,0,1155,277,1,0,0,0,1156,1157,3,116,50,0,1157,1158,1,0,0,0,1158,1159, - 6,131,17,0,1159,279,1,0,0,0,1160,1161,3,120,52,0,1161,1162,1,0,0,0,1162, - 1163,6,132,21,0,1163,281,1,0,0,0,1164,1165,3,258,121,0,1165,1166,1,0,0, - 0,1166,1167,6,133,27,0,1167,283,1,0,0,0,1168,1169,3,226,105,0,1169,1170, - 1,0,0,0,1170,1171,6,134,22,0,1171,285,1,0,0,0,1172,1173,3,186,85,0,1173, - 1174,1,0,0,0,1174,1175,6,135,25,0,1175,287,1,0,0,0,1176,1177,3,58,21,0, - 1177,1178,1,0,0,0,1178,1179,6,136,11,0,1179,289,1,0,0,0,1180,1181,3,60, - 22,0,1181,1182,1,0,0,0,1182,1183,6,137,11,0,1183,291,1,0,0,0,1184,1185, - 3,62,23,0,1185,1186,1,0,0,0,1186,1187,6,138,11,0,1187,293,1,0,0,0,1188, - 1189,3,78,31,0,1189,1190,1,0,0,0,1190,1191,6,139,14,0,1191,1192,6,139,15, - 0,1192,295,1,0,0,0,1193,1194,3,116,50,0,1194,1195,1,0,0,0,1195,1196,6,140, - 17,0,1196,297,1,0,0,0,1197,1198,3,120,52,0,1198,1199,1,0,0,0,1199,1200, - 6,141,21,0,1200,299,1,0,0,0,1201,1202,3,256,120,0,1202,1203,1,0,0,0,1203, - 1204,6,142,28,0,1204,1205,6,142,29,0,1205,301,1,0,0,0,1206,1207,3,66,25, - 0,1207,1208,1,0,0,0,1208,1209,6,143,20,0,1209,303,1,0,0,0,1210,1211,3,58, - 21,0,1211,1212,1,0,0,0,1212,1213,6,144,11,0,1213,305,1,0,0,0,1214,1215, - 3,60,22,0,1215,1216,1,0,0,0,1216,1217,6,145,11,0,1217,307,1,0,0,0,1218, - 1219,3,62,23,0,1219,1220,1,0,0,0,1220,1221,6,146,11,0,1221,309,1,0,0,0, - 1222,1223,3,78,31,0,1223,1224,1,0,0,0,1224,1225,6,147,14,0,1225,1226,6, - 147,15,0,1226,1227,6,147,15,0,1227,311,1,0,0,0,1228,1229,3,116,50,0,1229, - 1230,1,0,0,0,1230,1231,6,148,17,0,1231,313,1,0,0,0,1232,1233,3,120,52,0, - 1233,1234,1,0,0,0,1234,1235,6,149,21,0,1235,315,1,0,0,0,1236,1237,3,226, - 105,0,1237,1238,1,0,0,0,1238,1239,6,150,22,0,1239,317,1,0,0,0,1240,1241, - 3,58,21,0,1241,1242,1,0,0,0,1242,1243,6,151,11,0,1243,319,1,0,0,0,1244, - 1245,3,60,22,0,1245,1246,1,0,0,0,1246,1247,6,152,11,0,1247,321,1,0,0,0, - 1248,1249,3,62,23,0,1249,1250,1,0,0,0,1250,1251,6,153,11,0,1251,323,1,0, - 0,0,1252,1253,3,78,31,0,1253,1254,1,0,0,0,1254,1255,6,154,14,0,1255,1256, - 6,154,15,0,1256,325,1,0,0,0,1257,1258,3,120,52,0,1258,1259,1,0,0,0,1259, - 1260,6,155,21,0,1260,327,1,0,0,0,1261,1262,3,186,85,0,1262,1263,1,0,0,0, - 1263,1264,6,156,25,0,1264,329,1,0,0,0,1265,1266,3,182,83,0,1266,1267,1, - 0,0,0,1267,1268,6,157,30,0,1268,331,1,0,0,0,1269,1270,3,58,21,0,1270,1271, - 1,0,0,0,1271,1272,6,158,11,0,1272,333,1,0,0,0,1273,1274,3,60,22,0,1274, - 1275,1,0,0,0,1275,1276,6,159,11,0,1276,335,1,0,0,0,1277,1278,3,62,23,0, - 1278,1279,1,0,0,0,1279,1280,6,160,11,0,1280,337,1,0,0,0,1281,1282,3,78, - 31,0,1282,1283,1,0,0,0,1283,1284,6,161,14,0,1284,1285,6,161,15,0,1285,339, - 1,0,0,0,1286,1287,7,1,0,0,1287,1288,7,9,0,0,1288,1289,7,15,0,0,1289,1290, - 7,7,0,0,1290,341,1,0,0,0,1291,1292,3,58,21,0,1292,1293,1,0,0,0,1293,1294, - 6,163,11,0,1294,343,1,0,0,0,1295,1296,3,60,22,0,1296,1297,1,0,0,0,1297, - 1298,6,164,11,0,1298,345,1,0,0,0,1299,1300,3,62,23,0,1300,1301,1,0,0,0, - 1301,1302,6,165,11,0,1302,347,1,0,0,0,1303,1304,3,78,31,0,1304,1305,1,0, - 0,0,1305,1306,6,166,14,0,1306,1307,6,166,15,0,1307,349,1,0,0,0,1308,1309, - 7,15,0,0,1309,1310,7,19,0,0,1310,1311,7,9,0,0,1311,1312,7,4,0,0,1312,1313, - 7,5,0,0,1313,1314,7,1,0,0,1314,1315,7,7,0,0,1315,1316,7,9,0,0,1316,1317, - 7,2,0,0,1317,351,1,0,0,0,1318,1319,3,58,21,0,1319,1320,1,0,0,0,1320,1321, - 6,168,11,0,1321,353,1,0,0,0,1322,1323,3,60,22,0,1323,1324,1,0,0,0,1324, - 1325,6,169,11,0,1325,355,1,0,0,0,1326,1327,3,62,23,0,1327,1328,1,0,0,0, - 1328,1329,6,170,11,0,1329,357,1,0,0,0,1330,1331,3,180,82,0,1331,1332,1, - 0,0,0,1332,1333,6,171,16,0,1333,1334,6,171,15,0,1334,359,1,0,0,0,1335,1336, - 5,58,0,0,1336,361,1,0,0,0,1337,1343,3,90,37,0,1338,1343,3,80,32,0,1339, - 1343,3,120,52,0,1340,1343,3,82,33,0,1341,1343,3,96,40,0,1342,1337,1,0,0, - 0,1342,1338,1,0,0,0,1342,1339,1,0,0,0,1342,1340,1,0,0,0,1342,1341,1,0,0, - 0,1343,1344,1,0,0,0,1344,1342,1,0,0,0,1344,1345,1,0,0,0,1345,363,1,0,0, - 0,1346,1347,3,58,21,0,1347,1348,1,0,0,0,1348,1349,6,174,11,0,1349,365,1, - 0,0,0,1350,1351,3,60,22,0,1351,1352,1,0,0,0,1352,1353,6,175,11,0,1353,367, - 1,0,0,0,1354,1355,3,62,23,0,1355,1356,1,0,0,0,1356,1357,6,176,11,0,1357, - 369,1,0,0,0,1358,1359,3,78,31,0,1359,1360,1,0,0,0,1360,1361,6,177,14,0, - 1361,1362,6,177,15,0,1362,371,1,0,0,0,1363,1364,3,66,25,0,1364,1365,1,0, - 0,0,1365,1366,6,178,20,0,1366,1367,6,178,15,0,1367,1368,6,178,31,0,1368, - 373,1,0,0,0,1369,1370,3,58,21,0,1370,1371,1,0,0,0,1371,1372,6,179,11,0, - 1372,375,1,0,0,0,1373,1374,3,60,22,0,1374,1375,1,0,0,0,1375,1376,6,180, - 11,0,1376,377,1,0,0,0,1377,1378,3,62,23,0,1378,1379,1,0,0,0,1379,1380,6, - 181,11,0,1380,379,1,0,0,0,1381,1382,3,116,50,0,1382,1383,1,0,0,0,1383,1384, - 6,182,17,0,1384,1385,6,182,15,0,1385,1386,6,182,7,0,1386,381,1,0,0,0,1387, - 1388,3,58,21,0,1388,1389,1,0,0,0,1389,1390,6,183,11,0,1390,383,1,0,0,0, - 1391,1392,3,60,22,0,1392,1393,1,0,0,0,1393,1394,6,184,11,0,1394,385,1,0, - 0,0,1395,1396,3,62,23,0,1396,1397,1,0,0,0,1397,1398,6,185,11,0,1398,387, - 1,0,0,0,1399,1400,3,186,85,0,1400,1401,1,0,0,0,1401,1402,6,186,15,0,1402, - 1403,6,186,0,0,1403,1404,6,186,25,0,1404,389,1,0,0,0,1405,1406,3,182,83, - 0,1406,1407,1,0,0,0,1407,1408,6,187,15,0,1408,1409,6,187,0,0,1409,1410, - 6,187,30,0,1410,391,1,0,0,0,1411,1412,3,106,45,0,1412,1413,1,0,0,0,1413, - 1414,6,188,15,0,1414,1415,6,188,0,0,1415,1416,6,188,32,0,1416,393,1,0,0, - 0,1417,1418,3,78,31,0,1418,1419,1,0,0,0,1419,1420,6,189,14,0,1420,1421, - 6,189,15,0,1421,395,1,0,0,0,65,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,568, - 578,582,585,594,596,607,614,619,658,663,672,679,684,686,697,705,708,710, - 715,720,726,733,738,744,747,755,759,883,890,892,908,913,918,920,926,1011, - 1015,1020,1025,1030,1032,1036,1038,1115,1119,1124,1342,1344,33,5,2,0,5, + 2,187,7,187,2,188,7,188,2,189,7,189,2,190,7,190,2,191,7,191,2,192,7,192, + 2,193,7,193,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,3,1,3,1,3,1,3,1,3,1,3,1,3, + 1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,6, + 1,6,1,6,1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7, + 1,7,1,7,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,10, + 1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1,11,1,11,1, + 11,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,13,1,13,1,13,1,13, + 1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,14,1,14,1,14,1,14,1,14,1,14,1, + 14,1,14,1,14,1,15,1,15,1,15,1,15,1,15,1,15,1,16,1,16,1,16,1,16,1,16,1,16, + 1,16,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,18,1,18,1,18,1,18,1,18,1,18,1, + 18,1,18,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,1,20,4,20,575,8,20,11,20, + 12,20,576,1,20,1,20,1,21,1,21,1,21,1,21,5,21,585,8,21,10,21,12,21,588,9, + 21,1,21,3,21,591,8,21,1,21,3,21,594,8,21,1,21,1,21,1,22,1,22,1,22,1,22, + 1,22,5,22,603,8,22,10,22,12,22,606,9,22,1,22,1,22,1,22,1,22,1,22,1,23,4, + 23,614,8,23,11,23,12,23,615,1,23,1,23,1,24,1,24,1,24,3,24,623,8,24,1,25, + 4,25,626,8,25,11,25,12,25,627,1,26,1,26,1,26,1,26,1,26,1,27,1,27,1,27,1, + 27,1,27,1,28,1,28,1,28,1,28,1,29,1,29,1,29,1,29,1,30,1,30,1,30,1,30,1,31, + 1,31,1,31,1,31,1,32,1,32,1,33,1,33,1,34,1,34,1,34,1,35,1,35,1,36,1,36,3, + 36,667,8,36,1,36,4,36,670,8,36,11,36,12,36,671,1,37,1,37,1,38,1,38,1,39, + 1,39,1,39,3,39,681,8,39,1,40,1,40,1,41,1,41,1,41,3,41,688,8,41,1,42,1,42, + 1,42,5,42,693,8,42,10,42,12,42,696,9,42,1,42,1,42,1,42,1,42,1,42,1,42,5, + 42,704,8,42,10,42,12,42,707,9,42,1,42,1,42,1,42,1,42,1,42,3,42,714,8,42, + 1,42,3,42,717,8,42,3,42,719,8,42,1,43,4,43,722,8,43,11,43,12,43,723,1,44, + 4,44,727,8,44,11,44,12,44,728,1,44,1,44,5,44,733,8,44,10,44,12,44,736,9, + 44,1,44,1,44,4,44,740,8,44,11,44,12,44,741,1,44,4,44,745,8,44,11,44,12, + 44,746,1,44,1,44,5,44,751,8,44,10,44,12,44,754,9,44,3,44,756,8,44,1,44, + 1,44,1,44,1,44,4,44,762,8,44,11,44,12,44,763,1,44,1,44,3,44,768,8,44,1, + 45,1,45,1,45,1,46,1,46,1,46,1,46,1,47,1,47,1,47,1,47,1,48,1,48,1,49,1,49, + 1,49,1,50,1,50,1,51,1,51,1,51,1,51,1,51,1,52,1,52,1,53,1,53,1,53,1,53,1, + 53,1,53,1,54,1,54,1,54,1,54,1,54,1,54,1,55,1,55,1,55,1,55,1,55,1,56,1,56, + 1,57,1,57,1,57,1,58,1,58,1,58,1,59,1,59,1,59,1,59,1,59,1,60,1,60,1,60,1, + 60,1,61,1,61,1,61,1,61,1,61,1,62,1,62,1,62,1,62,1,62,1,62,1,63,1,63,1,63, + 1,64,1,64,1,65,1,65,1,65,1,65,1,65,1,65,1,66,1,66,1,67,1,67,1,67,1,67,1, + 67,1,68,1,68,1,68,1,69,1,69,1,69,1,70,1,70,1,70,1,71,1,71,1,72,1,72,1,72, + 1,73,1,73,1,74,1,74,1,74,1,75,1,75,1,76,1,76,1,77,1,77,1,78,1,78,1,79,1, + 79,1,80,1,80,1,80,5,80,890,8,80,10,80,12,80,893,9,80,1,80,1,80,4,80,897, + 8,80,11,80,12,80,898,3,80,901,8,80,1,81,1,81,1,81,1,81,1,81,1,82,1,82,1, + 82,1,82,1,82,1,83,1,83,5,83,915,8,83,10,83,12,83,918,9,83,1,83,1,83,3,83, + 922,8,83,1,83,4,83,925,8,83,11,83,12,83,926,3,83,929,8,83,1,84,1,84,4,84, + 933,8,84,11,84,12,84,934,1,84,1,84,1,85,1,85,1,86,1,86,1,86,1,86,1,87,1, + 87,1,87,1,87,1,88,1,88,1,88,1,88,1,89,1,89,1,89,1,89,1,89,1,90,1,90,1,90, + 1,90,1,91,1,91,1,91,1,91,1,92,1,92,1,92,1,92,1,93,1,93,1,93,1,93,1,94,1, + 94,1,94,1,94,1,95,1,95,1,95,1,95,1,95,1,95,1,95,1,95,1,95,1,96,1,96,1,96, + 1,96,1,97,1,97,1,97,1,97,1,98,1,98,1,98,1,98,1,99,1,99,1,99,1,99,1,100, + 1,100,1,100,1,100,1,101,1,101,1,101,1,101,1,101,1,102,1,102,1,102,1,102, + 1,103,1,103,1,103,1,103,1,104,1,104,1,104,1,104,3,104,1024,8,104,1,105, + 1,105,3,105,1028,8,105,1,105,5,105,1031,8,105,10,105,12,105,1034,9,105, + 1,105,1,105,3,105,1038,8,105,1,105,4,105,1041,8,105,11,105,12,105,1042, + 3,105,1045,8,105,1,106,1,106,4,106,1049,8,106,11,106,12,106,1050,1,107, + 1,107,1,107,1,107,1,108,1,108,1,108,1,108,1,109,1,109,1,109,1,109,1,110, + 1,110,1,110,1,110,1,110,1,111,1,111,1,111,1,111,1,112,1,112,1,112,1,112, + 1,113,1,113,1,113,1,113,1,114,1,114,1,114,1,115,1,115,1,115,1,115,1,116, + 1,116,1,116,1,116,1,117,1,117,1,117,1,117,1,118,1,118,1,118,1,118,1,119, + 1,119,1,119,1,119,1,119,1,120,1,120,1,120,1,120,1,120,1,121,1,121,1,121, + 1,121,1,121,1,122,1,122,1,122,1,122,1,122,1,122,1,122,1,123,1,123,1,124, + 4,124,1126,8,124,11,124,12,124,1127,1,124,1,124,3,124,1132,8,124,1,124, + 4,124,1135,8,124,11,124,12,124,1136,1,125,1,125,1,125,1,125,1,126,1,126, + 1,126,1,126,1,127,1,127,1,127,1,127,1,128,1,128,1,128,1,128,1,129,1,129, + 1,129,1,129,1,129,1,129,1,130,1,130,1,130,1,130,1,131,1,131,1,131,1,131, + 1,132,1,132,1,132,1,132,1,133,1,133,1,133,1,133,1,134,1,134,1,134,1,134, + 1,135,1,135,1,135,1,135,1,136,1,136,1,136,1,136,1,137,1,137,1,137,1,137, + 1,138,1,138,1,138,1,138,1,139,1,139,1,139,1,139,1,139,1,140,1,140,1,140, + 1,140,1,141,1,141,1,141,1,141,1,142,1,142,1,142,1,142,1,143,1,143,1,143, + 1,143,1,143,1,144,1,144,1,144,1,144,1,145,1,145,1,145,1,145,1,146,1,146, + 1,146,1,146,1,147,1,147,1,147,1,147,1,148,1,148,1,148,1,148,1,149,1,149, + 1,149,1,149,1,149,1,149,1,150,1,150,1,150,1,150,1,151,1,151,1,151,1,151, + 1,152,1,152,1,152,1,152,1,153,1,153,1,153,1,153,1,154,1,154,1,154,1,154, + 1,155,1,155,1,155,1,155,1,156,1,156,1,156,1,156,1,156,1,157,1,157,1,157, + 1,157,1,158,1,158,1,158,1,158,1,159,1,159,1,159,1,159,1,160,1,160,1,160, + 1,160,1,161,1,161,1,161,1,161,1,162,1,162,1,162,1,162,1,163,1,163,1,163, + 1,163,1,163,1,164,1,164,1,164,1,164,1,164,1,165,1,165,1,165,1,165,1,166, + 1,166,1,166,1,166,1,167,1,167,1,167,1,167,1,168,1,168,1,168,1,168,1,168, + 1,169,1,169,1,169,1,169,1,169,1,169,1,169,1,169,1,169,1,169,1,170,1,170, + 1,170,1,170,1,171,1,171,1,171,1,171,1,172,1,172,1,172,1,172,1,173,1,173, + 1,173,1,173,1,173,1,174,1,174,1,175,1,175,1,175,1,175,1,175,4,175,1359, + 8,175,11,175,12,175,1360,1,176,1,176,1,176,1,176,1,177,1,177,1,177,1,177, + 1,178,1,178,1,178,1,178,1,179,1,179,1,179,1,179,1,179,1,180,1,180,1,180, + 1,180,1,180,1,180,1,181,1,181,1,181,1,181,1,181,1,181,1,182,1,182,1,182, + 1,182,1,183,1,183,1,183,1,183,1,184,1,184,1,184,1,184,1,185,1,185,1,185, + 1,185,1,185,1,185,1,186,1,186,1,186,1,186,1,186,1,186,1,187,1,187,1,187, + 1,187,1,188,1,188,1,188,1,188,1,189,1,189,1,189,1,189,1,190,1,190,1,190, + 1,190,1,190,1,190,1,191,1,191,1,191,1,191,1,191,1,191,1,192,1,192,1,192, + 1,192,1,192,1,192,1,193,1,193,1,193,1,193,1,193,2,604,705,0,194,16,1,18, + 2,20,3,22,4,24,5,26,6,28,7,30,8,32,9,34,10,36,11,38,12,40,13,42,14,44,15, + 46,16,48,17,50,18,52,19,54,20,56,21,58,22,60,23,62,24,64,0,66,25,68,0,70, + 0,72,26,74,27,76,28,78,29,80,0,82,0,84,0,86,0,88,0,90,0,92,0,94,0,96,0, + 98,0,100,30,102,31,104,32,106,33,108,34,110,35,112,36,114,37,116,38,118, + 39,120,40,122,41,124,42,126,43,128,44,130,45,132,46,134,47,136,48,138,49, + 140,50,142,51,144,52,146,53,148,54,150,55,152,56,154,57,156,58,158,59,160, + 60,162,61,164,62,166,63,168,64,170,65,172,66,174,67,176,68,178,69,180,70, + 182,71,184,0,186,72,188,73,190,74,192,75,194,0,196,0,198,0,200,0,202,0, + 204,0,206,76,208,0,210,0,212,77,214,78,216,79,218,0,220,0,222,0,224,0,226, + 0,228,80,230,81,232,82,234,83,236,0,238,0,240,0,242,0,244,84,246,0,248, + 85,250,86,252,87,254,0,256,0,258,88,260,89,262,0,264,90,266,0,268,91,270, + 92,272,93,274,0,276,0,278,0,280,0,282,0,284,0,286,0,288,94,290,95,292,96, + 294,0,296,0,298,0,300,0,302,0,304,0,306,0,308,97,310,98,312,99,314,0,316, + 0,318,0,320,0,322,100,324,101,326,102,328,0,330,0,332,0,334,0,336,103,338, + 104,340,105,342,0,344,106,346,107,348,108,350,109,352,0,354,110,356,111, + 358,112,360,113,362,0,364,114,366,115,368,116,370,117,372,118,374,0,376, + 0,378,0,380,119,382,120,384,121,386,0,388,0,390,122,392,123,394,124,396, + 0,398,0,400,0,402,0,16,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,35,2,0,68, + 68,100,100,2,0,73,73,105,105,2,0,83,83,115,115,2,0,69,69,101,101,2,0,67, + 67,99,99,2,0,84,84,116,116,2,0,82,82,114,114,2,0,79,79,111,111,2,0,80,80, + 112,112,2,0,78,78,110,110,2,0,72,72,104,104,2,0,86,86,118,118,2,0,65,65, + 97,97,2,0,76,76,108,108,2,0,88,88,120,120,2,0,70,70,102,102,2,0,77,77,109, + 109,2,0,71,71,103,103,2,0,75,75,107,107,2,0,85,85,117,117,2,0,87,87,119, + 119,6,0,9,10,13,13,32,32,47,47,91,91,93,93,2,0,10,10,13,13,3,0,9,10,13, + 13,32,32,11,0,9,10,13,13,32,32,34,34,44,44,47,47,58,58,61,61,91,91,93,93, + 124,124,2,0,42,42,47,47,1,0,48,57,2,0,65,90,97,122,8,0,34,34,78,78,82,82, + 84,84,92,92,110,110,114,114,116,116,4,0,10,10,13,13,34,34,92,92,2,0,43, + 43,45,45,1,0,96,96,2,0,66,66,98,98,2,0,89,89,121,121,11,0,9,10,13,13,32, + 32,34,35,44,44,47,47,58,58,60,60,62,63,92,92,124,124,1476,0,16,1,0,0,0, + 0,18,1,0,0,0,0,20,1,0,0,0,0,22,1,0,0,0,0,24,1,0,0,0,0,26,1,0,0,0,0,28,1, + 0,0,0,0,30,1,0,0,0,0,32,1,0,0,0,0,34,1,0,0,0,0,36,1,0,0,0,0,38,1,0,0,0, + 0,40,1,0,0,0,0,42,1,0,0,0,0,44,1,0,0,0,0,46,1,0,0,0,0,48,1,0,0,0,0,50,1, + 0,0,0,0,52,1,0,0,0,0,54,1,0,0,0,0,56,1,0,0,0,0,58,1,0,0,0,0,60,1,0,0,0, + 0,62,1,0,0,0,0,66,1,0,0,0,1,68,1,0,0,0,1,70,1,0,0,0,1,72,1,0,0,0,1,74,1, + 0,0,0,1,76,1,0,0,0,2,78,1,0,0,0,2,100,1,0,0,0,2,102,1,0,0,0,2,104,1,0,0, + 0,2,106,1,0,0,0,2,108,1,0,0,0,2,110,1,0,0,0,2,112,1,0,0,0,2,114,1,0,0,0, + 2,116,1,0,0,0,2,118,1,0,0,0,2,120,1,0,0,0,2,122,1,0,0,0,2,124,1,0,0,0,2, + 126,1,0,0,0,2,128,1,0,0,0,2,130,1,0,0,0,2,132,1,0,0,0,2,134,1,0,0,0,2,136, + 1,0,0,0,2,138,1,0,0,0,2,140,1,0,0,0,2,142,1,0,0,0,2,144,1,0,0,0,2,146,1, + 0,0,0,2,148,1,0,0,0,2,150,1,0,0,0,2,152,1,0,0,0,2,154,1,0,0,0,2,156,1,0, + 0,0,2,158,1,0,0,0,2,160,1,0,0,0,2,162,1,0,0,0,2,164,1,0,0,0,2,166,1,0,0, + 0,2,168,1,0,0,0,2,170,1,0,0,0,2,172,1,0,0,0,2,174,1,0,0,0,2,176,1,0,0,0, + 2,178,1,0,0,0,2,180,1,0,0,0,2,182,1,0,0,0,2,186,1,0,0,0,2,188,1,0,0,0,2, + 190,1,0,0,0,2,192,1,0,0,0,3,194,1,0,0,0,3,196,1,0,0,0,3,198,1,0,0,0,3,200, + 1,0,0,0,3,202,1,0,0,0,3,204,1,0,0,0,3,206,1,0,0,0,3,208,1,0,0,0,3,210,1, + 0,0,0,3,212,1,0,0,0,3,214,1,0,0,0,3,216,1,0,0,0,4,218,1,0,0,0,4,220,1,0, + 0,0,4,222,1,0,0,0,4,228,1,0,0,0,4,230,1,0,0,0,4,232,1,0,0,0,4,234,1,0,0, + 0,5,236,1,0,0,0,5,238,1,0,0,0,5,240,1,0,0,0,5,242,1,0,0,0,5,244,1,0,0,0, + 5,246,1,0,0,0,5,248,1,0,0,0,5,250,1,0,0,0,5,252,1,0,0,0,6,254,1,0,0,0,6, + 256,1,0,0,0,6,258,1,0,0,0,6,260,1,0,0,0,6,264,1,0,0,0,6,266,1,0,0,0,6,268, + 1,0,0,0,6,270,1,0,0,0,6,272,1,0,0,0,7,274,1,0,0,0,7,276,1,0,0,0,7,278,1, + 0,0,0,7,280,1,0,0,0,7,282,1,0,0,0,7,284,1,0,0,0,7,286,1,0,0,0,7,288,1,0, + 0,0,7,290,1,0,0,0,7,292,1,0,0,0,8,294,1,0,0,0,8,296,1,0,0,0,8,298,1,0,0, + 0,8,300,1,0,0,0,8,302,1,0,0,0,8,304,1,0,0,0,8,306,1,0,0,0,8,308,1,0,0,0, + 8,310,1,0,0,0,8,312,1,0,0,0,9,314,1,0,0,0,9,316,1,0,0,0,9,318,1,0,0,0,9, + 320,1,0,0,0,9,322,1,0,0,0,9,324,1,0,0,0,9,326,1,0,0,0,10,328,1,0,0,0,10, + 330,1,0,0,0,10,332,1,0,0,0,10,334,1,0,0,0,10,336,1,0,0,0,10,338,1,0,0,0, + 10,340,1,0,0,0,11,342,1,0,0,0,11,344,1,0,0,0,11,346,1,0,0,0,11,348,1,0, + 0,0,11,350,1,0,0,0,12,352,1,0,0,0,12,354,1,0,0,0,12,356,1,0,0,0,12,358, + 1,0,0,0,12,360,1,0,0,0,13,362,1,0,0,0,13,364,1,0,0,0,13,366,1,0,0,0,13, + 368,1,0,0,0,13,370,1,0,0,0,13,372,1,0,0,0,14,374,1,0,0,0,14,376,1,0,0,0, + 14,378,1,0,0,0,14,380,1,0,0,0,14,382,1,0,0,0,14,384,1,0,0,0,15,386,1,0, + 0,0,15,388,1,0,0,0,15,390,1,0,0,0,15,392,1,0,0,0,15,394,1,0,0,0,15,396, + 1,0,0,0,15,398,1,0,0,0,15,400,1,0,0,0,15,402,1,0,0,0,16,404,1,0,0,0,18, + 414,1,0,0,0,20,421,1,0,0,0,22,430,1,0,0,0,24,437,1,0,0,0,26,447,1,0,0,0, + 28,454,1,0,0,0,30,461,1,0,0,0,32,475,1,0,0,0,34,482,1,0,0,0,36,490,1,0, + 0,0,38,499,1,0,0,0,40,506,1,0,0,0,42,516,1,0,0,0,44,528,1,0,0,0,46,537, + 1,0,0,0,48,543,1,0,0,0,50,550,1,0,0,0,52,557,1,0,0,0,54,565,1,0,0,0,56, + 574,1,0,0,0,58,580,1,0,0,0,60,597,1,0,0,0,62,613,1,0,0,0,64,622,1,0,0,0, + 66,625,1,0,0,0,68,629,1,0,0,0,70,634,1,0,0,0,72,639,1,0,0,0,74,643,1,0, + 0,0,76,647,1,0,0,0,78,651,1,0,0,0,80,655,1,0,0,0,82,657,1,0,0,0,84,659, + 1,0,0,0,86,662,1,0,0,0,88,664,1,0,0,0,90,673,1,0,0,0,92,675,1,0,0,0,94, + 680,1,0,0,0,96,682,1,0,0,0,98,687,1,0,0,0,100,718,1,0,0,0,102,721,1,0,0, + 0,104,767,1,0,0,0,106,769,1,0,0,0,108,772,1,0,0,0,110,776,1,0,0,0,112,780, + 1,0,0,0,114,782,1,0,0,0,116,785,1,0,0,0,118,787,1,0,0,0,120,792,1,0,0,0, + 122,794,1,0,0,0,124,800,1,0,0,0,126,806,1,0,0,0,128,811,1,0,0,0,130,813, + 1,0,0,0,132,816,1,0,0,0,134,819,1,0,0,0,136,824,1,0,0,0,138,828,1,0,0,0, + 140,833,1,0,0,0,142,839,1,0,0,0,144,842,1,0,0,0,146,844,1,0,0,0,148,850, + 1,0,0,0,150,852,1,0,0,0,152,857,1,0,0,0,154,860,1,0,0,0,156,863,1,0,0,0, + 158,866,1,0,0,0,160,868,1,0,0,0,162,871,1,0,0,0,164,873,1,0,0,0,166,876, + 1,0,0,0,168,878,1,0,0,0,170,880,1,0,0,0,172,882,1,0,0,0,174,884,1,0,0,0, + 176,900,1,0,0,0,178,902,1,0,0,0,180,907,1,0,0,0,182,928,1,0,0,0,184,930, + 1,0,0,0,186,938,1,0,0,0,188,940,1,0,0,0,190,944,1,0,0,0,192,948,1,0,0,0, + 194,952,1,0,0,0,196,957,1,0,0,0,198,961,1,0,0,0,200,965,1,0,0,0,202,969, + 1,0,0,0,204,973,1,0,0,0,206,977,1,0,0,0,208,986,1,0,0,0,210,990,1,0,0,0, + 212,994,1,0,0,0,214,998,1,0,0,0,216,1002,1,0,0,0,218,1006,1,0,0,0,220,1011, + 1,0,0,0,222,1015,1,0,0,0,224,1023,1,0,0,0,226,1044,1,0,0,0,228,1048,1,0, + 0,0,230,1052,1,0,0,0,232,1056,1,0,0,0,234,1060,1,0,0,0,236,1064,1,0,0,0, + 238,1069,1,0,0,0,240,1073,1,0,0,0,242,1077,1,0,0,0,244,1081,1,0,0,0,246, + 1084,1,0,0,0,248,1088,1,0,0,0,250,1092,1,0,0,0,252,1096,1,0,0,0,254,1100, + 1,0,0,0,256,1105,1,0,0,0,258,1110,1,0,0,0,260,1115,1,0,0,0,262,1122,1,0, + 0,0,264,1131,1,0,0,0,266,1138,1,0,0,0,268,1142,1,0,0,0,270,1146,1,0,0,0, + 272,1150,1,0,0,0,274,1154,1,0,0,0,276,1160,1,0,0,0,278,1164,1,0,0,0,280, + 1168,1,0,0,0,282,1172,1,0,0,0,284,1176,1,0,0,0,286,1180,1,0,0,0,288,1184, + 1,0,0,0,290,1188,1,0,0,0,292,1192,1,0,0,0,294,1196,1,0,0,0,296,1201,1,0, + 0,0,298,1205,1,0,0,0,300,1209,1,0,0,0,302,1213,1,0,0,0,304,1218,1,0,0,0, + 306,1222,1,0,0,0,308,1226,1,0,0,0,310,1230,1,0,0,0,312,1234,1,0,0,0,314, + 1238,1,0,0,0,316,1244,1,0,0,0,318,1248,1,0,0,0,320,1252,1,0,0,0,322,1256, + 1,0,0,0,324,1260,1,0,0,0,326,1264,1,0,0,0,328,1268,1,0,0,0,330,1273,1,0, + 0,0,332,1277,1,0,0,0,334,1281,1,0,0,0,336,1285,1,0,0,0,338,1289,1,0,0,0, + 340,1293,1,0,0,0,342,1297,1,0,0,0,344,1302,1,0,0,0,346,1307,1,0,0,0,348, + 1311,1,0,0,0,350,1315,1,0,0,0,352,1319,1,0,0,0,354,1324,1,0,0,0,356,1334, + 1,0,0,0,358,1338,1,0,0,0,360,1342,1,0,0,0,362,1346,1,0,0,0,364,1351,1,0, + 0,0,366,1358,1,0,0,0,368,1362,1,0,0,0,370,1366,1,0,0,0,372,1370,1,0,0,0, + 374,1374,1,0,0,0,376,1379,1,0,0,0,378,1385,1,0,0,0,380,1391,1,0,0,0,382, + 1395,1,0,0,0,384,1399,1,0,0,0,386,1403,1,0,0,0,388,1409,1,0,0,0,390,1415, + 1,0,0,0,392,1419,1,0,0,0,394,1423,1,0,0,0,396,1427,1,0,0,0,398,1433,1,0, + 0,0,400,1439,1,0,0,0,402,1445,1,0,0,0,404,405,7,0,0,0,405,406,7,1,0,0,406, + 407,7,2,0,0,407,408,7,2,0,0,408,409,7,3,0,0,409,410,7,4,0,0,410,411,7,5, + 0,0,411,412,1,0,0,0,412,413,6,0,0,0,413,17,1,0,0,0,414,415,7,0,0,0,415, + 416,7,6,0,0,416,417,7,7,0,0,417,418,7,8,0,0,418,419,1,0,0,0,419,420,6,1, + 1,0,420,19,1,0,0,0,421,422,7,3,0,0,422,423,7,9,0,0,423,424,7,6,0,0,424, + 425,7,1,0,0,425,426,7,4,0,0,426,427,7,10,0,0,427,428,1,0,0,0,428,429,6, + 2,2,0,429,21,1,0,0,0,430,431,7,3,0,0,431,432,7,11,0,0,432,433,7,12,0,0, + 433,434,7,13,0,0,434,435,1,0,0,0,435,436,6,3,0,0,436,23,1,0,0,0,437,438, + 7,3,0,0,438,439,7,14,0,0,439,440,7,8,0,0,440,441,7,13,0,0,441,442,7,12, + 0,0,442,443,7,1,0,0,443,444,7,9,0,0,444,445,1,0,0,0,445,446,6,4,3,0,446, + 25,1,0,0,0,447,448,7,15,0,0,448,449,7,6,0,0,449,450,7,7,0,0,450,451,7,16, + 0,0,451,452,1,0,0,0,452,453,6,5,4,0,453,27,1,0,0,0,454,455,7,17,0,0,455, + 456,7,6,0,0,456,457,7,7,0,0,457,458,7,18,0,0,458,459,1,0,0,0,459,460,6, + 6,0,0,460,29,1,0,0,0,461,462,7,1,0,0,462,463,7,9,0,0,463,464,7,13,0,0,464, + 465,7,1,0,0,465,466,7,9,0,0,466,467,7,3,0,0,467,468,7,2,0,0,468,469,7,5, + 0,0,469,470,7,12,0,0,470,471,7,5,0,0,471,472,7,2,0,0,472,473,1,0,0,0,473, + 474,6,7,0,0,474,31,1,0,0,0,475,476,7,18,0,0,476,477,7,3,0,0,477,478,7,3, + 0,0,478,479,7,8,0,0,479,480,1,0,0,0,480,481,6,8,1,0,481,33,1,0,0,0,482, + 483,7,13,0,0,483,484,7,1,0,0,484,485,7,16,0,0,485,486,7,1,0,0,486,487,7, + 5,0,0,487,488,1,0,0,0,488,489,6,9,0,0,489,35,1,0,0,0,490,491,7,13,0,0,491, + 492,7,7,0,0,492,493,7,7,0,0,493,494,7,18,0,0,494,495,7,19,0,0,495,496,7, + 8,0,0,496,497,1,0,0,0,497,498,6,10,5,0,498,37,1,0,0,0,499,500,7,16,0,0, + 500,501,7,3,0,0,501,502,7,5,0,0,502,503,7,12,0,0,503,504,1,0,0,0,504,505, + 6,11,6,0,505,39,1,0,0,0,506,507,7,16,0,0,507,508,7,3,0,0,508,509,7,5,0, + 0,509,510,7,6,0,0,510,511,7,1,0,0,511,512,7,4,0,0,512,513,7,2,0,0,513,514, + 1,0,0,0,514,515,6,12,7,0,515,41,1,0,0,0,516,517,7,16,0,0,517,518,7,11,0, + 0,518,519,5,95,0,0,519,520,7,3,0,0,520,521,7,14,0,0,521,522,7,8,0,0,522, + 523,7,12,0,0,523,524,7,9,0,0,524,525,7,0,0,0,525,526,1,0,0,0,526,527,6, + 13,8,0,527,43,1,0,0,0,528,529,7,6,0,0,529,530,7,3,0,0,530,531,7,9,0,0,531, + 532,7,12,0,0,532,533,7,16,0,0,533,534,7,3,0,0,534,535,1,0,0,0,535,536,6, + 14,9,0,536,45,1,0,0,0,537,538,7,6,0,0,538,539,7,7,0,0,539,540,7,20,0,0, + 540,541,1,0,0,0,541,542,6,15,0,0,542,47,1,0,0,0,543,544,7,2,0,0,544,545, + 7,10,0,0,545,546,7,7,0,0,546,547,7,20,0,0,547,548,1,0,0,0,548,549,6,16, + 10,0,549,49,1,0,0,0,550,551,7,2,0,0,551,552,7,7,0,0,552,553,7,6,0,0,553, + 554,7,5,0,0,554,555,1,0,0,0,555,556,6,17,0,0,556,51,1,0,0,0,557,558,7,2, + 0,0,558,559,7,5,0,0,559,560,7,12,0,0,560,561,7,5,0,0,561,562,7,2,0,0,562, + 563,1,0,0,0,563,564,6,18,0,0,564,53,1,0,0,0,565,566,7,20,0,0,566,567,7, + 10,0,0,567,568,7,3,0,0,568,569,7,6,0,0,569,570,7,3,0,0,570,571,1,0,0,0, + 571,572,6,19,0,0,572,55,1,0,0,0,573,575,8,21,0,0,574,573,1,0,0,0,575,576, + 1,0,0,0,576,574,1,0,0,0,576,577,1,0,0,0,577,578,1,0,0,0,578,579,6,20,0, + 0,579,57,1,0,0,0,580,581,5,47,0,0,581,582,5,47,0,0,582,586,1,0,0,0,583, + 585,8,22,0,0,584,583,1,0,0,0,585,588,1,0,0,0,586,584,1,0,0,0,586,587,1, + 0,0,0,587,590,1,0,0,0,588,586,1,0,0,0,589,591,5,13,0,0,590,589,1,0,0,0, + 590,591,1,0,0,0,591,593,1,0,0,0,592,594,5,10,0,0,593,592,1,0,0,0,593,594, + 1,0,0,0,594,595,1,0,0,0,595,596,6,21,11,0,596,59,1,0,0,0,597,598,5,47,0, + 0,598,599,5,42,0,0,599,604,1,0,0,0,600,603,3,60,22,0,601,603,9,0,0,0,602, + 600,1,0,0,0,602,601,1,0,0,0,603,606,1,0,0,0,604,605,1,0,0,0,604,602,1,0, + 0,0,605,607,1,0,0,0,606,604,1,0,0,0,607,608,5,42,0,0,608,609,5,47,0,0,609, + 610,1,0,0,0,610,611,6,22,11,0,611,61,1,0,0,0,612,614,7,23,0,0,613,612,1, + 0,0,0,614,615,1,0,0,0,615,613,1,0,0,0,615,616,1,0,0,0,616,617,1,0,0,0,617, + 618,6,23,11,0,618,63,1,0,0,0,619,623,8,24,0,0,620,621,5,47,0,0,621,623, + 8,25,0,0,622,619,1,0,0,0,622,620,1,0,0,0,623,65,1,0,0,0,624,626,3,64,24, + 0,625,624,1,0,0,0,626,627,1,0,0,0,627,625,1,0,0,0,627,628,1,0,0,0,628,67, + 1,0,0,0,629,630,3,178,81,0,630,631,1,0,0,0,631,632,6,26,12,0,632,633,6, + 26,13,0,633,69,1,0,0,0,634,635,3,78,31,0,635,636,1,0,0,0,636,637,6,27,14, + 0,637,638,6,27,15,0,638,71,1,0,0,0,639,640,3,62,23,0,640,641,1,0,0,0,641, + 642,6,28,11,0,642,73,1,0,0,0,643,644,3,58,21,0,644,645,1,0,0,0,645,646, + 6,29,11,0,646,75,1,0,0,0,647,648,3,60,22,0,648,649,1,0,0,0,649,650,6,30, + 11,0,650,77,1,0,0,0,651,652,5,124,0,0,652,653,1,0,0,0,653,654,6,31,15,0, + 654,79,1,0,0,0,655,656,7,26,0,0,656,81,1,0,0,0,657,658,7,27,0,0,658,83, + 1,0,0,0,659,660,5,92,0,0,660,661,7,28,0,0,661,85,1,0,0,0,662,663,8,29,0, + 0,663,87,1,0,0,0,664,666,7,3,0,0,665,667,7,30,0,0,666,665,1,0,0,0,666,667, + 1,0,0,0,667,669,1,0,0,0,668,670,3,80,32,0,669,668,1,0,0,0,670,671,1,0,0, + 0,671,669,1,0,0,0,671,672,1,0,0,0,672,89,1,0,0,0,673,674,5,64,0,0,674,91, + 1,0,0,0,675,676,5,96,0,0,676,93,1,0,0,0,677,681,8,31,0,0,678,679,5,96,0, + 0,679,681,5,96,0,0,680,677,1,0,0,0,680,678,1,0,0,0,681,95,1,0,0,0,682,683, + 5,95,0,0,683,97,1,0,0,0,684,688,3,82,33,0,685,688,3,80,32,0,686,688,3,96, + 40,0,687,684,1,0,0,0,687,685,1,0,0,0,687,686,1,0,0,0,688,99,1,0,0,0,689, + 694,5,34,0,0,690,693,3,84,34,0,691,693,3,86,35,0,692,690,1,0,0,0,692,691, + 1,0,0,0,693,696,1,0,0,0,694,692,1,0,0,0,694,695,1,0,0,0,695,697,1,0,0,0, + 696,694,1,0,0,0,697,719,5,34,0,0,698,699,5,34,0,0,699,700,5,34,0,0,700, + 701,5,34,0,0,701,705,1,0,0,0,702,704,8,22,0,0,703,702,1,0,0,0,704,707,1, + 0,0,0,705,706,1,0,0,0,705,703,1,0,0,0,706,708,1,0,0,0,707,705,1,0,0,0,708, + 709,5,34,0,0,709,710,5,34,0,0,710,711,5,34,0,0,711,713,1,0,0,0,712,714, + 5,34,0,0,713,712,1,0,0,0,713,714,1,0,0,0,714,716,1,0,0,0,715,717,5,34,0, + 0,716,715,1,0,0,0,716,717,1,0,0,0,717,719,1,0,0,0,718,689,1,0,0,0,718,698, + 1,0,0,0,719,101,1,0,0,0,720,722,3,80,32,0,721,720,1,0,0,0,722,723,1,0,0, + 0,723,721,1,0,0,0,723,724,1,0,0,0,724,103,1,0,0,0,725,727,3,80,32,0,726, + 725,1,0,0,0,727,728,1,0,0,0,728,726,1,0,0,0,728,729,1,0,0,0,729,730,1,0, + 0,0,730,734,3,120,52,0,731,733,3,80,32,0,732,731,1,0,0,0,733,736,1,0,0, + 0,734,732,1,0,0,0,734,735,1,0,0,0,735,768,1,0,0,0,736,734,1,0,0,0,737,739, + 3,120,52,0,738,740,3,80,32,0,739,738,1,0,0,0,740,741,1,0,0,0,741,739,1, + 0,0,0,741,742,1,0,0,0,742,768,1,0,0,0,743,745,3,80,32,0,744,743,1,0,0,0, + 745,746,1,0,0,0,746,744,1,0,0,0,746,747,1,0,0,0,747,755,1,0,0,0,748,752, + 3,120,52,0,749,751,3,80,32,0,750,749,1,0,0,0,751,754,1,0,0,0,752,750,1, + 0,0,0,752,753,1,0,0,0,753,756,1,0,0,0,754,752,1,0,0,0,755,748,1,0,0,0,755, + 756,1,0,0,0,756,757,1,0,0,0,757,758,3,88,36,0,758,768,1,0,0,0,759,761,3, + 120,52,0,760,762,3,80,32,0,761,760,1,0,0,0,762,763,1,0,0,0,763,761,1,0, + 0,0,763,764,1,0,0,0,764,765,1,0,0,0,765,766,3,88,36,0,766,768,1,0,0,0,767, + 726,1,0,0,0,767,737,1,0,0,0,767,744,1,0,0,0,767,759,1,0,0,0,768,105,1,0, + 0,0,769,770,7,32,0,0,770,771,7,33,0,0,771,107,1,0,0,0,772,773,7,12,0,0, + 773,774,7,9,0,0,774,775,7,0,0,0,775,109,1,0,0,0,776,777,7,12,0,0,777,778, + 7,2,0,0,778,779,7,4,0,0,779,111,1,0,0,0,780,781,5,61,0,0,781,113,1,0,0, + 0,782,783,5,58,0,0,783,784,5,58,0,0,784,115,1,0,0,0,785,786,5,44,0,0,786, + 117,1,0,0,0,787,788,7,0,0,0,788,789,7,3,0,0,789,790,7,2,0,0,790,791,7,4, + 0,0,791,119,1,0,0,0,792,793,5,46,0,0,793,121,1,0,0,0,794,795,7,15,0,0,795, + 796,7,12,0,0,796,797,7,13,0,0,797,798,7,2,0,0,798,799,7,3,0,0,799,123,1, + 0,0,0,800,801,7,15,0,0,801,802,7,1,0,0,802,803,7,6,0,0,803,804,7,2,0,0, + 804,805,7,5,0,0,805,125,1,0,0,0,806,807,7,13,0,0,807,808,7,12,0,0,808,809, + 7,2,0,0,809,810,7,5,0,0,810,127,1,0,0,0,811,812,5,40,0,0,812,129,1,0,0, + 0,813,814,7,1,0,0,814,815,7,9,0,0,815,131,1,0,0,0,816,817,7,1,0,0,817,818, + 7,2,0,0,818,133,1,0,0,0,819,820,7,13,0,0,820,821,7,1,0,0,821,822,7,18,0, + 0,822,823,7,3,0,0,823,135,1,0,0,0,824,825,7,9,0,0,825,826,7,7,0,0,826,827, + 7,5,0,0,827,137,1,0,0,0,828,829,7,9,0,0,829,830,7,19,0,0,830,831,7,13,0, + 0,831,832,7,13,0,0,832,139,1,0,0,0,833,834,7,9,0,0,834,835,7,19,0,0,835, + 836,7,13,0,0,836,837,7,13,0,0,837,838,7,2,0,0,838,141,1,0,0,0,839,840,7, + 7,0,0,840,841,7,6,0,0,841,143,1,0,0,0,842,843,5,63,0,0,843,145,1,0,0,0, + 844,845,7,6,0,0,845,846,7,13,0,0,846,847,7,1,0,0,847,848,7,18,0,0,848,849, + 7,3,0,0,849,147,1,0,0,0,850,851,5,41,0,0,851,149,1,0,0,0,852,853,7,5,0, + 0,853,854,7,6,0,0,854,855,7,19,0,0,855,856,7,3,0,0,856,151,1,0,0,0,857, + 858,5,61,0,0,858,859,5,61,0,0,859,153,1,0,0,0,860,861,5,61,0,0,861,862, + 5,126,0,0,862,155,1,0,0,0,863,864,5,33,0,0,864,865,5,61,0,0,865,157,1,0, + 0,0,866,867,5,60,0,0,867,159,1,0,0,0,868,869,5,60,0,0,869,870,5,61,0,0, + 870,161,1,0,0,0,871,872,5,62,0,0,872,163,1,0,0,0,873,874,5,62,0,0,874,875, + 5,61,0,0,875,165,1,0,0,0,876,877,5,43,0,0,877,167,1,0,0,0,878,879,5,45, + 0,0,879,169,1,0,0,0,880,881,5,42,0,0,881,171,1,0,0,0,882,883,5,47,0,0,883, + 173,1,0,0,0,884,885,5,37,0,0,885,175,1,0,0,0,886,887,3,144,64,0,887,891, + 3,82,33,0,888,890,3,98,41,0,889,888,1,0,0,0,890,893,1,0,0,0,891,889,1,0, + 0,0,891,892,1,0,0,0,892,901,1,0,0,0,893,891,1,0,0,0,894,896,3,144,64,0, + 895,897,3,80,32,0,896,895,1,0,0,0,897,898,1,0,0,0,898,896,1,0,0,0,898,899, + 1,0,0,0,899,901,1,0,0,0,900,886,1,0,0,0,900,894,1,0,0,0,901,177,1,0,0,0, + 902,903,5,91,0,0,903,904,1,0,0,0,904,905,6,81,0,0,905,906,6,81,0,0,906, + 179,1,0,0,0,907,908,5,93,0,0,908,909,1,0,0,0,909,910,6,82,15,0,910,911, + 6,82,15,0,911,181,1,0,0,0,912,916,3,82,33,0,913,915,3,98,41,0,914,913,1, + 0,0,0,915,918,1,0,0,0,916,914,1,0,0,0,916,917,1,0,0,0,917,929,1,0,0,0,918, + 916,1,0,0,0,919,922,3,96,40,0,920,922,3,90,37,0,921,919,1,0,0,0,921,920, + 1,0,0,0,922,924,1,0,0,0,923,925,3,98,41,0,924,923,1,0,0,0,925,926,1,0,0, + 0,926,924,1,0,0,0,926,927,1,0,0,0,927,929,1,0,0,0,928,912,1,0,0,0,928,921, + 1,0,0,0,929,183,1,0,0,0,930,932,3,92,38,0,931,933,3,94,39,0,932,931,1,0, + 0,0,933,934,1,0,0,0,934,932,1,0,0,0,934,935,1,0,0,0,935,936,1,0,0,0,936, + 937,3,92,38,0,937,185,1,0,0,0,938,939,3,184,84,0,939,187,1,0,0,0,940,941, + 3,58,21,0,941,942,1,0,0,0,942,943,6,86,11,0,943,189,1,0,0,0,944,945,3,60, + 22,0,945,946,1,0,0,0,946,947,6,87,11,0,947,191,1,0,0,0,948,949,3,62,23, + 0,949,950,1,0,0,0,950,951,6,88,11,0,951,193,1,0,0,0,952,953,3,78,31,0,953, + 954,1,0,0,0,954,955,6,89,14,0,955,956,6,89,15,0,956,195,1,0,0,0,957,958, + 3,178,81,0,958,959,1,0,0,0,959,960,6,90,12,0,960,197,1,0,0,0,961,962,3, + 180,82,0,962,963,1,0,0,0,963,964,6,91,16,0,964,199,1,0,0,0,965,966,3,364, + 174,0,966,967,1,0,0,0,967,968,6,92,17,0,968,201,1,0,0,0,969,970,3,116,50, + 0,970,971,1,0,0,0,971,972,6,93,18,0,972,203,1,0,0,0,973,974,3,112,48,0, + 974,975,1,0,0,0,975,976,6,94,19,0,976,205,1,0,0,0,977,978,7,16,0,0,978, + 979,7,3,0,0,979,980,7,5,0,0,980,981,7,12,0,0,981,982,7,0,0,0,982,983,7, + 12,0,0,983,984,7,5,0,0,984,985,7,12,0,0,985,207,1,0,0,0,986,987,3,66,25, + 0,987,988,1,0,0,0,988,989,6,96,20,0,989,209,1,0,0,0,990,991,3,100,42,0, + 991,992,1,0,0,0,992,993,6,97,21,0,993,211,1,0,0,0,994,995,3,58,21,0,995, + 996,1,0,0,0,996,997,6,98,11,0,997,213,1,0,0,0,998,999,3,60,22,0,999,1000, + 1,0,0,0,1000,1001,6,99,11,0,1001,215,1,0,0,0,1002,1003,3,62,23,0,1003,1004, + 1,0,0,0,1004,1005,6,100,11,0,1005,217,1,0,0,0,1006,1007,3,78,31,0,1007, + 1008,1,0,0,0,1008,1009,6,101,14,0,1009,1010,6,101,15,0,1010,219,1,0,0,0, + 1011,1012,3,120,52,0,1012,1013,1,0,0,0,1013,1014,6,102,22,0,1014,221,1, + 0,0,0,1015,1016,3,116,50,0,1016,1017,1,0,0,0,1017,1018,6,103,18,0,1018, + 223,1,0,0,0,1019,1024,3,82,33,0,1020,1024,3,80,32,0,1021,1024,3,96,40,0, + 1022,1024,3,170,77,0,1023,1019,1,0,0,0,1023,1020,1,0,0,0,1023,1021,1,0, + 0,0,1023,1022,1,0,0,0,1024,225,1,0,0,0,1025,1028,3,82,33,0,1026,1028,3, + 170,77,0,1027,1025,1,0,0,0,1027,1026,1,0,0,0,1028,1032,1,0,0,0,1029,1031, + 3,224,104,0,1030,1029,1,0,0,0,1031,1034,1,0,0,0,1032,1030,1,0,0,0,1032, + 1033,1,0,0,0,1033,1045,1,0,0,0,1034,1032,1,0,0,0,1035,1038,3,96,40,0,1036, + 1038,3,90,37,0,1037,1035,1,0,0,0,1037,1036,1,0,0,0,1038,1040,1,0,0,0,1039, + 1041,3,224,104,0,1040,1039,1,0,0,0,1041,1042,1,0,0,0,1042,1040,1,0,0,0, + 1042,1043,1,0,0,0,1043,1045,1,0,0,0,1044,1027,1,0,0,0,1044,1037,1,0,0,0, + 1045,227,1,0,0,0,1046,1049,3,226,105,0,1047,1049,3,184,84,0,1048,1046,1, + 0,0,0,1048,1047,1,0,0,0,1049,1050,1,0,0,0,1050,1048,1,0,0,0,1050,1051,1, + 0,0,0,1051,229,1,0,0,0,1052,1053,3,58,21,0,1053,1054,1,0,0,0,1054,1055, + 6,107,11,0,1055,231,1,0,0,0,1056,1057,3,60,22,0,1057,1058,1,0,0,0,1058, + 1059,6,108,11,0,1059,233,1,0,0,0,1060,1061,3,62,23,0,1061,1062,1,0,0,0, + 1062,1063,6,109,11,0,1063,235,1,0,0,0,1064,1065,3,78,31,0,1065,1066,1,0, + 0,0,1066,1067,6,110,14,0,1067,1068,6,110,15,0,1068,237,1,0,0,0,1069,1070, + 3,112,48,0,1070,1071,1,0,0,0,1071,1072,6,111,19,0,1072,239,1,0,0,0,1073, + 1074,3,116,50,0,1074,1075,1,0,0,0,1075,1076,6,112,18,0,1076,241,1,0,0,0, + 1077,1078,3,120,52,0,1078,1079,1,0,0,0,1079,1080,6,113,22,0,1080,243,1, + 0,0,0,1081,1082,7,12,0,0,1082,1083,7,2,0,0,1083,245,1,0,0,0,1084,1085,3, + 228,106,0,1085,1086,1,0,0,0,1086,1087,6,115,23,0,1087,247,1,0,0,0,1088, + 1089,3,58,21,0,1089,1090,1,0,0,0,1090,1091,6,116,11,0,1091,249,1,0,0,0, + 1092,1093,3,60,22,0,1093,1094,1,0,0,0,1094,1095,6,117,11,0,1095,251,1,0, + 0,0,1096,1097,3,62,23,0,1097,1098,1,0,0,0,1098,1099,6,118,11,0,1099,253, + 1,0,0,0,1100,1101,3,78,31,0,1101,1102,1,0,0,0,1102,1103,6,119,14,0,1103, + 1104,6,119,15,0,1104,255,1,0,0,0,1105,1106,3,178,81,0,1106,1107,1,0,0,0, + 1107,1108,6,120,12,0,1108,1109,6,120,24,0,1109,257,1,0,0,0,1110,1111,7, + 7,0,0,1111,1112,7,9,0,0,1112,1113,1,0,0,0,1113,1114,6,121,25,0,1114,259, + 1,0,0,0,1115,1116,7,20,0,0,1116,1117,7,1,0,0,1117,1118,7,5,0,0,1118,1119, + 7,10,0,0,1119,1120,1,0,0,0,1120,1121,6,122,25,0,1121,261,1,0,0,0,1122,1123, + 8,34,0,0,1123,263,1,0,0,0,1124,1126,3,262,123,0,1125,1124,1,0,0,0,1126, + 1127,1,0,0,0,1127,1125,1,0,0,0,1127,1128,1,0,0,0,1128,1129,1,0,0,0,1129, + 1130,3,364,174,0,1130,1132,1,0,0,0,1131,1125,1,0,0,0,1131,1132,1,0,0,0, + 1132,1134,1,0,0,0,1133,1135,3,262,123,0,1134,1133,1,0,0,0,1135,1136,1,0, + 0,0,1136,1134,1,0,0,0,1136,1137,1,0,0,0,1137,265,1,0,0,0,1138,1139,3,264, + 124,0,1139,1140,1,0,0,0,1140,1141,6,125,26,0,1141,267,1,0,0,0,1142,1143, + 3,58,21,0,1143,1144,1,0,0,0,1144,1145,6,126,11,0,1145,269,1,0,0,0,1146, + 1147,3,60,22,0,1147,1148,1,0,0,0,1148,1149,6,127,11,0,1149,271,1,0,0,0, + 1150,1151,3,62,23,0,1151,1152,1,0,0,0,1152,1153,6,128,11,0,1153,273,1,0, + 0,0,1154,1155,3,78,31,0,1155,1156,1,0,0,0,1156,1157,6,129,14,0,1157,1158, + 6,129,15,0,1158,1159,6,129,15,0,1159,275,1,0,0,0,1160,1161,3,112,48,0,1161, + 1162,1,0,0,0,1162,1163,6,130,19,0,1163,277,1,0,0,0,1164,1165,3,116,50,0, + 1165,1166,1,0,0,0,1166,1167,6,131,18,0,1167,279,1,0,0,0,1168,1169,3,120, + 52,0,1169,1170,1,0,0,0,1170,1171,6,132,22,0,1171,281,1,0,0,0,1172,1173, + 3,260,122,0,1173,1174,1,0,0,0,1174,1175,6,133,27,0,1175,283,1,0,0,0,1176, + 1177,3,228,106,0,1177,1178,1,0,0,0,1178,1179,6,134,23,0,1179,285,1,0,0, + 0,1180,1181,3,186,85,0,1181,1182,1,0,0,0,1182,1183,6,135,28,0,1183,287, + 1,0,0,0,1184,1185,3,58,21,0,1185,1186,1,0,0,0,1186,1187,6,136,11,0,1187, + 289,1,0,0,0,1188,1189,3,60,22,0,1189,1190,1,0,0,0,1190,1191,6,137,11,0, + 1191,291,1,0,0,0,1192,1193,3,62,23,0,1193,1194,1,0,0,0,1194,1195,6,138, + 11,0,1195,293,1,0,0,0,1196,1197,3,78,31,0,1197,1198,1,0,0,0,1198,1199,6, + 139,14,0,1199,1200,6,139,15,0,1200,295,1,0,0,0,1201,1202,3,364,174,0,1202, + 1203,1,0,0,0,1203,1204,6,140,17,0,1204,297,1,0,0,0,1205,1206,3,116,50,0, + 1206,1207,1,0,0,0,1207,1208,6,141,18,0,1208,299,1,0,0,0,1209,1210,3,120, + 52,0,1210,1211,1,0,0,0,1211,1212,6,142,22,0,1212,301,1,0,0,0,1213,1214, + 3,258,121,0,1214,1215,1,0,0,0,1215,1216,6,143,29,0,1216,1217,6,143,30,0, + 1217,303,1,0,0,0,1218,1219,3,66,25,0,1219,1220,1,0,0,0,1220,1221,6,144, + 20,0,1221,305,1,0,0,0,1222,1223,3,100,42,0,1223,1224,1,0,0,0,1224,1225, + 6,145,21,0,1225,307,1,0,0,0,1226,1227,3,58,21,0,1227,1228,1,0,0,0,1228, + 1229,6,146,11,0,1229,309,1,0,0,0,1230,1231,3,60,22,0,1231,1232,1,0,0,0, + 1232,1233,6,147,11,0,1233,311,1,0,0,0,1234,1235,3,62,23,0,1235,1236,1,0, + 0,0,1236,1237,6,148,11,0,1237,313,1,0,0,0,1238,1239,3,78,31,0,1239,1240, + 1,0,0,0,1240,1241,6,149,14,0,1241,1242,6,149,15,0,1242,1243,6,149,15,0, + 1243,315,1,0,0,0,1244,1245,3,116,50,0,1245,1246,1,0,0,0,1246,1247,6,150, + 18,0,1247,317,1,0,0,0,1248,1249,3,120,52,0,1249,1250,1,0,0,0,1250,1251, + 6,151,22,0,1251,319,1,0,0,0,1252,1253,3,228,106,0,1253,1254,1,0,0,0,1254, + 1255,6,152,23,0,1255,321,1,0,0,0,1256,1257,3,58,21,0,1257,1258,1,0,0,0, + 1258,1259,6,153,11,0,1259,323,1,0,0,0,1260,1261,3,60,22,0,1261,1262,1,0, + 0,0,1262,1263,6,154,11,0,1263,325,1,0,0,0,1264,1265,3,62,23,0,1265,1266, + 1,0,0,0,1266,1267,6,155,11,0,1267,327,1,0,0,0,1268,1269,3,78,31,0,1269, + 1270,1,0,0,0,1270,1271,6,156,14,0,1271,1272,6,156,15,0,1272,329,1,0,0,0, + 1273,1274,3,120,52,0,1274,1275,1,0,0,0,1275,1276,6,157,22,0,1276,331,1, + 0,0,0,1277,1278,3,186,85,0,1278,1279,1,0,0,0,1279,1280,6,158,28,0,1280, + 333,1,0,0,0,1281,1282,3,182,83,0,1282,1283,1,0,0,0,1283,1284,6,159,31,0, + 1284,335,1,0,0,0,1285,1286,3,58,21,0,1286,1287,1,0,0,0,1287,1288,6,160, + 11,0,1288,337,1,0,0,0,1289,1290,3,60,22,0,1290,1291,1,0,0,0,1291,1292,6, + 161,11,0,1292,339,1,0,0,0,1293,1294,3,62,23,0,1294,1295,1,0,0,0,1295,1296, + 6,162,11,0,1296,341,1,0,0,0,1297,1298,3,78,31,0,1298,1299,1,0,0,0,1299, + 1300,6,163,14,0,1300,1301,6,163,15,0,1301,343,1,0,0,0,1302,1303,7,1,0,0, + 1303,1304,7,9,0,0,1304,1305,7,15,0,0,1305,1306,7,7,0,0,1306,345,1,0,0,0, + 1307,1308,3,58,21,0,1308,1309,1,0,0,0,1309,1310,6,165,11,0,1310,347,1,0, + 0,0,1311,1312,3,60,22,0,1312,1313,1,0,0,0,1313,1314,6,166,11,0,1314,349, + 1,0,0,0,1315,1316,3,62,23,0,1316,1317,1,0,0,0,1317,1318,6,167,11,0,1318, + 351,1,0,0,0,1319,1320,3,78,31,0,1320,1321,1,0,0,0,1321,1322,6,168,14,0, + 1322,1323,6,168,15,0,1323,353,1,0,0,0,1324,1325,7,15,0,0,1325,1326,7,19, + 0,0,1326,1327,7,9,0,0,1327,1328,7,4,0,0,1328,1329,7,5,0,0,1329,1330,7,1, + 0,0,1330,1331,7,7,0,0,1331,1332,7,9,0,0,1332,1333,7,2,0,0,1333,355,1,0, + 0,0,1334,1335,3,58,21,0,1335,1336,1,0,0,0,1336,1337,6,170,11,0,1337,357, + 1,0,0,0,1338,1339,3,60,22,0,1339,1340,1,0,0,0,1340,1341,6,171,11,0,1341, + 359,1,0,0,0,1342,1343,3,62,23,0,1343,1344,1,0,0,0,1344,1345,6,172,11,0, + 1345,361,1,0,0,0,1346,1347,3,180,82,0,1347,1348,1,0,0,0,1348,1349,6,173, + 16,0,1349,1350,6,173,15,0,1350,363,1,0,0,0,1351,1352,5,58,0,0,1352,365, + 1,0,0,0,1353,1359,3,90,37,0,1354,1359,3,80,32,0,1355,1359,3,120,52,0,1356, + 1359,3,82,33,0,1357,1359,3,96,40,0,1358,1353,1,0,0,0,1358,1354,1,0,0,0, + 1358,1355,1,0,0,0,1358,1356,1,0,0,0,1358,1357,1,0,0,0,1359,1360,1,0,0,0, + 1360,1358,1,0,0,0,1360,1361,1,0,0,0,1361,367,1,0,0,0,1362,1363,3,58,21, + 0,1363,1364,1,0,0,0,1364,1365,6,176,11,0,1365,369,1,0,0,0,1366,1367,3,60, + 22,0,1367,1368,1,0,0,0,1368,1369,6,177,11,0,1369,371,1,0,0,0,1370,1371, + 3,62,23,0,1371,1372,1,0,0,0,1372,1373,6,178,11,0,1373,373,1,0,0,0,1374, + 1375,3,78,31,0,1375,1376,1,0,0,0,1376,1377,6,179,14,0,1377,1378,6,179,15, + 0,1378,375,1,0,0,0,1379,1380,3,66,25,0,1380,1381,1,0,0,0,1381,1382,6,180, + 20,0,1382,1383,6,180,15,0,1383,1384,6,180,32,0,1384,377,1,0,0,0,1385,1386, + 3,100,42,0,1386,1387,1,0,0,0,1387,1388,6,181,21,0,1388,1389,6,181,15,0, + 1389,1390,6,181,32,0,1390,379,1,0,0,0,1391,1392,3,58,21,0,1392,1393,1,0, + 0,0,1393,1394,6,182,11,0,1394,381,1,0,0,0,1395,1396,3,60,22,0,1396,1397, + 1,0,0,0,1397,1398,6,183,11,0,1398,383,1,0,0,0,1399,1400,3,62,23,0,1400, + 1401,1,0,0,0,1401,1402,6,184,11,0,1402,385,1,0,0,0,1403,1404,3,364,174, + 0,1404,1405,1,0,0,0,1405,1406,6,185,17,0,1406,1407,6,185,15,0,1407,1408, + 6,185,7,0,1408,387,1,0,0,0,1409,1410,3,116,50,0,1410,1411,1,0,0,0,1411, + 1412,6,186,18,0,1412,1413,6,186,15,0,1413,1414,6,186,7,0,1414,389,1,0,0, + 0,1415,1416,3,58,21,0,1416,1417,1,0,0,0,1417,1418,6,187,11,0,1418,391,1, + 0,0,0,1419,1420,3,60,22,0,1420,1421,1,0,0,0,1421,1422,6,188,11,0,1422,393, + 1,0,0,0,1423,1424,3,62,23,0,1424,1425,1,0,0,0,1425,1426,6,189,11,0,1426, + 395,1,0,0,0,1427,1428,3,186,85,0,1428,1429,1,0,0,0,1429,1430,6,190,15,0, + 1430,1431,6,190,0,0,1431,1432,6,190,28,0,1432,397,1,0,0,0,1433,1434,3,182, + 83,0,1434,1435,1,0,0,0,1435,1436,6,191,15,0,1436,1437,6,191,0,0,1437,1438, + 6,191,31,0,1438,399,1,0,0,0,1439,1440,3,106,45,0,1440,1441,1,0,0,0,1441, + 1442,6,192,15,0,1442,1443,6,192,0,0,1443,1444,6,192,33,0,1444,401,1,0,0, + 0,1445,1446,3,78,31,0,1446,1447,1,0,0,0,1447,1448,6,193,14,0,1448,1449, + 6,193,15,0,1449,403,1,0,0,0,65,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,576, + 586,590,593,602,604,615,622,627,666,671,680,687,692,694,705,713,716,718, + 723,728,734,741,746,752,755,763,767,891,898,900,916,921,926,928,934,1023, + 1027,1032,1037,1042,1044,1048,1050,1127,1131,1136,1358,1360,34,5,2,0,5, 4,0,5,6,0,5,1,0,5,3,0,5,8,0,5,12,0,5,14,0,5,10,0,5,5,0,5,11,0,0,1,0,7,69, - 0,5,0,0,7,29,0,4,0,0,7,70,0,7,38,0,7,36,0,7,30,0,7,25,0,7,40,0,7,80,0,5, - 13,0,5,7,0,7,72,0,7,90,0,7,89,0,7,88,0,5,9,0,7,71,0,5,15,0,7,33,0]; + 0,5,0,0,7,29,0,4,0,0,7,70,0,7,114,0,7,38,0,7,36,0,7,25,0,7,30,0,7,40,0, + 7,80,0,5,13,0,5,7,0,7,90,0,7,89,0,7,72,0,7,88,0,5,9,0,7,71,0,5,15,0,7,33, + 0]; private static __ATN: ATN; public static get _ATN(): ATN { diff --git a/packages/kbn-esql-ast/src/antlr/esql_parser.g4 b/packages/kbn-esql-ast/src/antlr/esql_parser.g4 index 59c9ee6ca5770..bae91675fbb02 100644 --- a/packages/kbn-esql-ast/src/antlr/esql_parser.g4 +++ b/packages/kbn-esql-ast/src/antlr/esql_parser.g4 @@ -115,11 +115,21 @@ field ; fromCommand - : FROM indexIdentifier (COMMA indexIdentifier)* metadata? + : FROM indexPattern (COMMA indexPattern)* metadata? ; -indexIdentifier - : INDEX_UNQUOTED_IDENTIFIER +indexPattern + : clusterString COLON indexString + | indexString + ; + +clusterString + : UNQUOTED_SOURCE + ; + +indexString + : UNQUOTED_SOURCE + | QUOTED_STRING ; metadata @@ -128,7 +138,7 @@ metadata ; metadataOption - : METADATA indexIdentifier (COMMA indexIdentifier)* + : METADATA UNQUOTED_SOURCE (COMMA UNQUOTED_SOURCE)* ; deprecated_metadata @@ -136,7 +146,7 @@ deprecated_metadata ; metricsCommand - : METRICS indexIdentifier (COMMA indexIdentifier)* aggregates=fields? (BY grouping=fields)? + : METRICS indexPattern (COMMA indexPattern)* aggregates=fields? (BY grouping=fields)? ; evalCommand @@ -289,5 +299,5 @@ enrichWithClause ; lookupCommand - : LOOKUP tableName=INDEX_UNQUOTED_IDENTIFIER ON matchFields=qualifiedNamePatterns + : LOOKUP tableName=indexPattern ON matchFields=qualifiedNamePatterns ; \ No newline at end of file diff --git a/packages/kbn-esql-ast/src/antlr/esql_parser.interp b/packages/kbn-esql-ast/src/antlr/esql_parser.interp index 5900020590110..6c5edef9e98f0 100644 --- a/packages/kbn-esql-ast/src/antlr/esql_parser.interp +++ b/packages/kbn-esql-ast/src/antlr/esql_parser.interp @@ -151,7 +151,7 @@ UNKNOWN_CMD LINE_COMMENT MULTILINE_COMMENT WS -INDEX_UNQUOTED_IDENTIFIER +UNQUOTED_SOURCE EXPLAIN_WS EXPLAIN_LINE_COMMENT EXPLAIN_MULTILINE_COMMENT @@ -269,7 +269,9 @@ rowCommand fields field fromCommand -indexIdentifier +indexPattern +clusterString +indexString metadata metadataOption deprecated_metadata @@ -312,4 +314,4 @@ lookupCommand atn: -[4, 1, 124, 554, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 122, 8, 1, 10, 1, 12, 1, 125, 9, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 133, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 149, 8, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 161, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 168, 8, 5, 10, 5, 12, 5, 171, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 178, 8, 5, 1, 5, 1, 5, 3, 5, 182, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 190, 8, 5, 10, 5, 12, 5, 193, 9, 5, 1, 6, 1, 6, 3, 6, 197, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 204, 8, 6, 1, 6, 1, 6, 1, 6, 3, 6, 209, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 216, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 222, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 230, 8, 8, 10, 8, 12, 8, 233, 9, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 243, 8, 9, 1, 9, 1, 9, 1, 9, 5, 9, 248, 8, 9, 10, 9, 12, 9, 251, 9, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 259, 8, 10, 10, 10, 12, 10, 262, 9, 10, 3, 10, 264, 8, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 5, 13, 276, 8, 13, 10, 13, 12, 13, 279, 9, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 286, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 292, 8, 15, 10, 15, 12, 15, 295, 9, 15, 1, 15, 3, 15, 298, 8, 15, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 304, 8, 17, 1, 18, 1, 18, 1, 18, 1, 18, 5, 18, 310, 8, 18, 10, 18, 12, 18, 313, 9, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 5, 20, 323, 8, 20, 10, 20, 12, 20, 326, 9, 20, 1, 20, 3, 20, 329, 8, 20, 1, 20, 1, 20, 3, 20, 333, 8, 20, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 3, 22, 340, 8, 22, 1, 22, 1, 22, 3, 22, 344, 8, 22, 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 350, 8, 23, 1, 24, 1, 24, 1, 24, 5, 24, 355, 8, 24, 10, 24, 12, 24, 358, 9, 24, 1, 25, 1, 25, 1, 25, 5, 25, 363, 8, 25, 10, 25, 12, 25, 366, 9, 25, 1, 26, 1, 26, 1, 26, 5, 26, 371, 8, 26, 10, 26, 12, 26, 374, 9, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 5, 29, 393, 8, 29, 10, 29, 12, 29, 396, 9, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 5, 29, 404, 8, 29, 10, 29, 12, 29, 407, 9, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 5, 29, 415, 8, 29, 10, 29, 12, 29, 418, 9, 29, 1, 29, 1, 29, 3, 29, 422, 8, 29, 1, 30, 1, 30, 3, 30, 426, 8, 30, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 5, 32, 435, 8, 32, 10, 32, 12, 32, 438, 9, 32, 1, 33, 1, 33, 3, 33, 442, 8, 33, 1, 33, 1, 33, 3, 33, 446, 8, 33, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 5, 36, 458, 8, 36, 10, 36, 12, 36, 461, 9, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 3, 38, 471, 8, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 5, 41, 483, 8, 41, 10, 41, 12, 41, 486, 9, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 3, 44, 496, 8, 44, 1, 45, 3, 45, 499, 8, 45, 1, 45, 1, 45, 1, 46, 3, 46, 504, 8, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 3, 53, 529, 8, 53, 1, 53, 1, 53, 1, 53, 1, 53, 5, 53, 535, 8, 53, 10, 53, 12, 53, 538, 9, 53, 3, 53, 540, 8, 53, 1, 54, 1, 54, 1, 54, 3, 54, 545, 8, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 0, 4, 2, 10, 16, 18, 56, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 0, 7, 1, 0, 63, 64, 1, 0, 65, 67, 1, 0, 71, 72, 2, 0, 35, 35, 39, 39, 1, 0, 42, 43, 2, 0, 41, 41, 55, 55, 2, 0, 56, 56, 58, 62, 580, 0, 112, 1, 0, 0, 0, 2, 115, 1, 0, 0, 0, 4, 132, 1, 0, 0, 0, 6, 148, 1, 0, 0, 0, 8, 150, 1, 0, 0, 0, 10, 181, 1, 0, 0, 0, 12, 208, 1, 0, 0, 0, 14, 215, 1, 0, 0, 0, 16, 221, 1, 0, 0, 0, 18, 242, 1, 0, 0, 0, 20, 252, 1, 0, 0, 0, 22, 267, 1, 0, 0, 0, 24, 269, 1, 0, 0, 0, 26, 272, 1, 0, 0, 0, 28, 285, 1, 0, 0, 0, 30, 287, 1, 0, 0, 0, 32, 299, 1, 0, 0, 0, 34, 303, 1, 0, 0, 0, 36, 305, 1, 0, 0, 0, 38, 314, 1, 0, 0, 0, 40, 318, 1, 0, 0, 0, 42, 334, 1, 0, 0, 0, 44, 337, 1, 0, 0, 0, 46, 345, 1, 0, 0, 0, 48, 351, 1, 0, 0, 0, 50, 359, 1, 0, 0, 0, 52, 367, 1, 0, 0, 0, 54, 375, 1, 0, 0, 0, 56, 377, 1, 0, 0, 0, 58, 421, 1, 0, 0, 0, 60, 425, 1, 0, 0, 0, 62, 427, 1, 0, 0, 0, 64, 430, 1, 0, 0, 0, 66, 439, 1, 0, 0, 0, 68, 447, 1, 0, 0, 0, 70, 450, 1, 0, 0, 0, 72, 453, 1, 0, 0, 0, 74, 462, 1, 0, 0, 0, 76, 466, 1, 0, 0, 0, 78, 472, 1, 0, 0, 0, 80, 476, 1, 0, 0, 0, 82, 479, 1, 0, 0, 0, 84, 487, 1, 0, 0, 0, 86, 491, 1, 0, 0, 0, 88, 495, 1, 0, 0, 0, 90, 498, 1, 0, 0, 0, 92, 503, 1, 0, 0, 0, 94, 507, 1, 0, 0, 0, 96, 509, 1, 0, 0, 0, 98, 511, 1, 0, 0, 0, 100, 514, 1, 0, 0, 0, 102, 518, 1, 0, 0, 0, 104, 521, 1, 0, 0, 0, 106, 524, 1, 0, 0, 0, 108, 544, 1, 0, 0, 0, 110, 548, 1, 0, 0, 0, 112, 113, 3, 2, 1, 0, 113, 114, 5, 0, 0, 1, 114, 1, 1, 0, 0, 0, 115, 116, 6, 1, -1, 0, 116, 117, 3, 4, 2, 0, 117, 123, 1, 0, 0, 0, 118, 119, 10, 1, 0, 0, 119, 120, 5, 29, 0, 0, 120, 122, 3, 6, 3, 0, 121, 118, 1, 0, 0, 0, 122, 125, 1, 0, 0, 0, 123, 121, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 3, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 126, 133, 3, 98, 49, 0, 127, 133, 3, 30, 15, 0, 128, 133, 3, 24, 12, 0, 129, 133, 3, 40, 20, 0, 130, 133, 3, 102, 51, 0, 131, 133, 3, 104, 52, 0, 132, 126, 1, 0, 0, 0, 132, 127, 1, 0, 0, 0, 132, 128, 1, 0, 0, 0, 132, 129, 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 132, 131, 1, 0, 0, 0, 133, 5, 1, 0, 0, 0, 134, 149, 3, 42, 21, 0, 135, 149, 3, 46, 23, 0, 136, 149, 3, 62, 31, 0, 137, 149, 3, 110, 55, 0, 138, 149, 3, 68, 34, 0, 139, 149, 3, 64, 32, 0, 140, 149, 3, 44, 22, 0, 141, 149, 3, 8, 4, 0, 142, 149, 3, 70, 35, 0, 143, 149, 3, 72, 36, 0, 144, 149, 3, 76, 38, 0, 145, 149, 3, 78, 39, 0, 146, 149, 3, 106, 53, 0, 147, 149, 3, 80, 40, 0, 148, 134, 1, 0, 0, 0, 148, 135, 1, 0, 0, 0, 148, 136, 1, 0, 0, 0, 148, 137, 1, 0, 0, 0, 148, 138, 1, 0, 0, 0, 148, 139, 1, 0, 0, 0, 148, 140, 1, 0, 0, 0, 148, 141, 1, 0, 0, 0, 148, 142, 1, 0, 0, 0, 148, 143, 1, 0, 0, 0, 148, 144, 1, 0, 0, 0, 148, 145, 1, 0, 0, 0, 148, 146, 1, 0, 0, 0, 148, 147, 1, 0, 0, 0, 149, 7, 1, 0, 0, 0, 150, 151, 5, 20, 0, 0, 151, 152, 3, 10, 5, 0, 152, 9, 1, 0, 0, 0, 153, 154, 6, 5, -1, 0, 154, 155, 5, 48, 0, 0, 155, 182, 3, 10, 5, 7, 156, 182, 3, 14, 7, 0, 157, 182, 3, 12, 6, 0, 158, 160, 3, 14, 7, 0, 159, 161, 5, 48, 0, 0, 160, 159, 1, 0, 0, 0, 160, 161, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 5, 45, 0, 0, 163, 164, 5, 44, 0, 0, 164, 169, 3, 14, 7, 0, 165, 166, 5, 38, 0, 0, 166, 168, 3, 14, 7, 0, 167, 165, 1, 0, 0, 0, 168, 171, 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 172, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 172, 173, 5, 54, 0, 0, 173, 182, 1, 0, 0, 0, 174, 175, 3, 14, 7, 0, 175, 177, 5, 46, 0, 0, 176, 178, 5, 48, 0, 0, 177, 176, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 179, 1, 0, 0, 0, 179, 180, 5, 49, 0, 0, 180, 182, 1, 0, 0, 0, 181, 153, 1, 0, 0, 0, 181, 156, 1, 0, 0, 0, 181, 157, 1, 0, 0, 0, 181, 158, 1, 0, 0, 0, 181, 174, 1, 0, 0, 0, 182, 191, 1, 0, 0, 0, 183, 184, 10, 4, 0, 0, 184, 185, 5, 34, 0, 0, 185, 190, 3, 10, 5, 5, 186, 187, 10, 3, 0, 0, 187, 188, 5, 51, 0, 0, 188, 190, 3, 10, 5, 4, 189, 183, 1, 0, 0, 0, 189, 186, 1, 0, 0, 0, 190, 193, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 11, 1, 0, 0, 0, 193, 191, 1, 0, 0, 0, 194, 196, 3, 14, 7, 0, 195, 197, 5, 48, 0, 0, 196, 195, 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 199, 5, 47, 0, 0, 199, 200, 3, 94, 47, 0, 200, 209, 1, 0, 0, 0, 201, 203, 3, 14, 7, 0, 202, 204, 5, 48, 0, 0, 203, 202, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 206, 5, 53, 0, 0, 206, 207, 3, 94, 47, 0, 207, 209, 1, 0, 0, 0, 208, 194, 1, 0, 0, 0, 208, 201, 1, 0, 0, 0, 209, 13, 1, 0, 0, 0, 210, 216, 3, 16, 8, 0, 211, 212, 3, 16, 8, 0, 212, 213, 3, 96, 48, 0, 213, 214, 3, 16, 8, 0, 214, 216, 1, 0, 0, 0, 215, 210, 1, 0, 0, 0, 215, 211, 1, 0, 0, 0, 216, 15, 1, 0, 0, 0, 217, 218, 6, 8, -1, 0, 218, 222, 3, 18, 9, 0, 219, 220, 7, 0, 0, 0, 220, 222, 3, 16, 8, 3, 221, 217, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 222, 231, 1, 0, 0, 0, 223, 224, 10, 2, 0, 0, 224, 225, 7, 1, 0, 0, 225, 230, 3, 16, 8, 3, 226, 227, 10, 1, 0, 0, 227, 228, 7, 0, 0, 0, 228, 230, 3, 16, 8, 2, 229, 223, 1, 0, 0, 0, 229, 226, 1, 0, 0, 0, 230, 233, 1, 0, 0, 0, 231, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 17, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 234, 235, 6, 9, -1, 0, 235, 243, 3, 58, 29, 0, 236, 243, 3, 48, 24, 0, 237, 243, 3, 20, 10, 0, 238, 239, 5, 44, 0, 0, 239, 240, 3, 10, 5, 0, 240, 241, 5, 54, 0, 0, 241, 243, 1, 0, 0, 0, 242, 234, 1, 0, 0, 0, 242, 236, 1, 0, 0, 0, 242, 237, 1, 0, 0, 0, 242, 238, 1, 0, 0, 0, 243, 249, 1, 0, 0, 0, 244, 245, 10, 1, 0, 0, 245, 246, 5, 37, 0, 0, 246, 248, 3, 22, 11, 0, 247, 244, 1, 0, 0, 0, 248, 251, 1, 0, 0, 0, 249, 247, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 19, 1, 0, 0, 0, 251, 249, 1, 0, 0, 0, 252, 253, 3, 54, 27, 0, 253, 263, 5, 44, 0, 0, 254, 264, 5, 65, 0, 0, 255, 260, 3, 10, 5, 0, 256, 257, 5, 38, 0, 0, 257, 259, 3, 10, 5, 0, 258, 256, 1, 0, 0, 0, 259, 262, 1, 0, 0, 0, 260, 258, 1, 0, 0, 0, 260, 261, 1, 0, 0, 0, 261, 264, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 263, 254, 1, 0, 0, 0, 263, 255, 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 266, 5, 54, 0, 0, 266, 21, 1, 0, 0, 0, 267, 268, 3, 54, 27, 0, 268, 23, 1, 0, 0, 0, 269, 270, 5, 16, 0, 0, 270, 271, 3, 26, 13, 0, 271, 25, 1, 0, 0, 0, 272, 277, 3, 28, 14, 0, 273, 274, 5, 38, 0, 0, 274, 276, 3, 28, 14, 0, 275, 273, 1, 0, 0, 0, 276, 279, 1, 0, 0, 0, 277, 275, 1, 0, 0, 0, 277, 278, 1, 0, 0, 0, 278, 27, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 280, 286, 3, 10, 5, 0, 281, 282, 3, 48, 24, 0, 282, 283, 5, 36, 0, 0, 283, 284, 3, 10, 5, 0, 284, 286, 1, 0, 0, 0, 285, 280, 1, 0, 0, 0, 285, 281, 1, 0, 0, 0, 286, 29, 1, 0, 0, 0, 287, 288, 5, 6, 0, 0, 288, 293, 3, 32, 16, 0, 289, 290, 5, 38, 0, 0, 290, 292, 3, 32, 16, 0, 291, 289, 1, 0, 0, 0, 292, 295, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 297, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 296, 298, 3, 34, 17, 0, 297, 296, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 31, 1, 0, 0, 0, 299, 300, 5, 25, 0, 0, 300, 33, 1, 0, 0, 0, 301, 304, 3, 36, 18, 0, 302, 304, 3, 38, 19, 0, 303, 301, 1, 0, 0, 0, 303, 302, 1, 0, 0, 0, 304, 35, 1, 0, 0, 0, 305, 306, 5, 76, 0, 0, 306, 311, 3, 32, 16, 0, 307, 308, 5, 38, 0, 0, 308, 310, 3, 32, 16, 0, 309, 307, 1, 0, 0, 0, 310, 313, 1, 0, 0, 0, 311, 309, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 37, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 314, 315, 5, 69, 0, 0, 315, 316, 3, 36, 18, 0, 316, 317, 5, 70, 0, 0, 317, 39, 1, 0, 0, 0, 318, 319, 5, 13, 0, 0, 319, 324, 3, 32, 16, 0, 320, 321, 5, 38, 0, 0, 321, 323, 3, 32, 16, 0, 322, 320, 1, 0, 0, 0, 323, 326, 1, 0, 0, 0, 324, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 328, 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 327, 329, 3, 26, 13, 0, 328, 327, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 332, 1, 0, 0, 0, 330, 331, 5, 33, 0, 0, 331, 333, 3, 26, 13, 0, 332, 330, 1, 0, 0, 0, 332, 333, 1, 0, 0, 0, 333, 41, 1, 0, 0, 0, 334, 335, 5, 4, 0, 0, 335, 336, 3, 26, 13, 0, 336, 43, 1, 0, 0, 0, 337, 339, 5, 19, 0, 0, 338, 340, 3, 26, 13, 0, 339, 338, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 343, 1, 0, 0, 0, 341, 342, 5, 33, 0, 0, 342, 344, 3, 26, 13, 0, 343, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 45, 1, 0, 0, 0, 345, 346, 5, 8, 0, 0, 346, 349, 3, 26, 13, 0, 347, 348, 5, 33, 0, 0, 348, 350, 3, 26, 13, 0, 349, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 47, 1, 0, 0, 0, 351, 356, 3, 54, 27, 0, 352, 353, 5, 40, 0, 0, 353, 355, 3, 54, 27, 0, 354, 352, 1, 0, 0, 0, 355, 358, 1, 0, 0, 0, 356, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 49, 1, 0, 0, 0, 358, 356, 1, 0, 0, 0, 359, 364, 3, 56, 28, 0, 360, 361, 5, 40, 0, 0, 361, 363, 3, 56, 28, 0, 362, 360, 1, 0, 0, 0, 363, 366, 1, 0, 0, 0, 364, 362, 1, 0, 0, 0, 364, 365, 1, 0, 0, 0, 365, 51, 1, 0, 0, 0, 366, 364, 1, 0, 0, 0, 367, 372, 3, 50, 25, 0, 368, 369, 5, 38, 0, 0, 369, 371, 3, 50, 25, 0, 370, 368, 1, 0, 0, 0, 371, 374, 1, 0, 0, 0, 372, 370, 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, 53, 1, 0, 0, 0, 374, 372, 1, 0, 0, 0, 375, 376, 7, 2, 0, 0, 376, 55, 1, 0, 0, 0, 377, 378, 5, 80, 0, 0, 378, 57, 1, 0, 0, 0, 379, 422, 5, 49, 0, 0, 380, 381, 3, 92, 46, 0, 381, 382, 5, 71, 0, 0, 382, 422, 1, 0, 0, 0, 383, 422, 3, 90, 45, 0, 384, 422, 3, 92, 46, 0, 385, 422, 3, 86, 43, 0, 386, 422, 3, 60, 30, 0, 387, 422, 3, 94, 47, 0, 388, 389, 5, 69, 0, 0, 389, 394, 3, 88, 44, 0, 390, 391, 5, 38, 0, 0, 391, 393, 3, 88, 44, 0, 392, 390, 1, 0, 0, 0, 393, 396, 1, 0, 0, 0, 394, 392, 1, 0, 0, 0, 394, 395, 1, 0, 0, 0, 395, 397, 1, 0, 0, 0, 396, 394, 1, 0, 0, 0, 397, 398, 5, 70, 0, 0, 398, 422, 1, 0, 0, 0, 399, 400, 5, 69, 0, 0, 400, 405, 3, 86, 43, 0, 401, 402, 5, 38, 0, 0, 402, 404, 3, 86, 43, 0, 403, 401, 1, 0, 0, 0, 404, 407, 1, 0, 0, 0, 405, 403, 1, 0, 0, 0, 405, 406, 1, 0, 0, 0, 406, 408, 1, 0, 0, 0, 407, 405, 1, 0, 0, 0, 408, 409, 5, 70, 0, 0, 409, 422, 1, 0, 0, 0, 410, 411, 5, 69, 0, 0, 411, 416, 3, 94, 47, 0, 412, 413, 5, 38, 0, 0, 413, 415, 3, 94, 47, 0, 414, 412, 1, 0, 0, 0, 415, 418, 1, 0, 0, 0, 416, 414, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 419, 1, 0, 0, 0, 418, 416, 1, 0, 0, 0, 419, 420, 5, 70, 0, 0, 420, 422, 1, 0, 0, 0, 421, 379, 1, 0, 0, 0, 421, 380, 1, 0, 0, 0, 421, 383, 1, 0, 0, 0, 421, 384, 1, 0, 0, 0, 421, 385, 1, 0, 0, 0, 421, 386, 1, 0, 0, 0, 421, 387, 1, 0, 0, 0, 421, 388, 1, 0, 0, 0, 421, 399, 1, 0, 0, 0, 421, 410, 1, 0, 0, 0, 422, 59, 1, 0, 0, 0, 423, 426, 5, 52, 0, 0, 424, 426, 5, 68, 0, 0, 425, 423, 1, 0, 0, 0, 425, 424, 1, 0, 0, 0, 426, 61, 1, 0, 0, 0, 427, 428, 5, 10, 0, 0, 428, 429, 5, 31, 0, 0, 429, 63, 1, 0, 0, 0, 430, 431, 5, 18, 0, 0, 431, 436, 3, 66, 33, 0, 432, 433, 5, 38, 0, 0, 433, 435, 3, 66, 33, 0, 434, 432, 1, 0, 0, 0, 435, 438, 1, 0, 0, 0, 436, 434, 1, 0, 0, 0, 436, 437, 1, 0, 0, 0, 437, 65, 1, 0, 0, 0, 438, 436, 1, 0, 0, 0, 439, 441, 3, 10, 5, 0, 440, 442, 7, 3, 0, 0, 441, 440, 1, 0, 0, 0, 441, 442, 1, 0, 0, 0, 442, 445, 1, 0, 0, 0, 443, 444, 5, 50, 0, 0, 444, 446, 7, 4, 0, 0, 445, 443, 1, 0, 0, 0, 445, 446, 1, 0, 0, 0, 446, 67, 1, 0, 0, 0, 447, 448, 5, 9, 0, 0, 448, 449, 3, 52, 26, 0, 449, 69, 1, 0, 0, 0, 450, 451, 5, 2, 0, 0, 451, 452, 3, 52, 26, 0, 452, 71, 1, 0, 0, 0, 453, 454, 5, 15, 0, 0, 454, 459, 3, 74, 37, 0, 455, 456, 5, 38, 0, 0, 456, 458, 3, 74, 37, 0, 457, 455, 1, 0, 0, 0, 458, 461, 1, 0, 0, 0, 459, 457, 1, 0, 0, 0, 459, 460, 1, 0, 0, 0, 460, 73, 1, 0, 0, 0, 461, 459, 1, 0, 0, 0, 462, 463, 3, 50, 25, 0, 463, 464, 5, 84, 0, 0, 464, 465, 3, 50, 25, 0, 465, 75, 1, 0, 0, 0, 466, 467, 5, 1, 0, 0, 467, 468, 3, 18, 9, 0, 468, 470, 3, 94, 47, 0, 469, 471, 3, 82, 41, 0, 470, 469, 1, 0, 0, 0, 470, 471, 1, 0, 0, 0, 471, 77, 1, 0, 0, 0, 472, 473, 5, 7, 0, 0, 473, 474, 3, 18, 9, 0, 474, 475, 3, 94, 47, 0, 475, 79, 1, 0, 0, 0, 476, 477, 5, 14, 0, 0, 477, 478, 3, 48, 24, 0, 478, 81, 1, 0, 0, 0, 479, 484, 3, 84, 42, 0, 480, 481, 5, 38, 0, 0, 481, 483, 3, 84, 42, 0, 482, 480, 1, 0, 0, 0, 483, 486, 1, 0, 0, 0, 484, 482, 1, 0, 0, 0, 484, 485, 1, 0, 0, 0, 485, 83, 1, 0, 0, 0, 486, 484, 1, 0, 0, 0, 487, 488, 3, 54, 27, 0, 488, 489, 5, 36, 0, 0, 489, 490, 3, 58, 29, 0, 490, 85, 1, 0, 0, 0, 491, 492, 7, 5, 0, 0, 492, 87, 1, 0, 0, 0, 493, 496, 3, 90, 45, 0, 494, 496, 3, 92, 46, 0, 495, 493, 1, 0, 0, 0, 495, 494, 1, 0, 0, 0, 496, 89, 1, 0, 0, 0, 497, 499, 7, 0, 0, 0, 498, 497, 1, 0, 0, 0, 498, 499, 1, 0, 0, 0, 499, 500, 1, 0, 0, 0, 500, 501, 5, 32, 0, 0, 501, 91, 1, 0, 0, 0, 502, 504, 7, 0, 0, 0, 503, 502, 1, 0, 0, 0, 503, 504, 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 506, 5, 31, 0, 0, 506, 93, 1, 0, 0, 0, 507, 508, 5, 30, 0, 0, 508, 95, 1, 0, 0, 0, 509, 510, 7, 6, 0, 0, 510, 97, 1, 0, 0, 0, 511, 512, 5, 5, 0, 0, 512, 513, 3, 100, 50, 0, 513, 99, 1, 0, 0, 0, 514, 515, 5, 69, 0, 0, 515, 516, 3, 2, 1, 0, 516, 517, 5, 70, 0, 0, 517, 101, 1, 0, 0, 0, 518, 519, 5, 17, 0, 0, 519, 520, 5, 106, 0, 0, 520, 103, 1, 0, 0, 0, 521, 522, 5, 12, 0, 0, 522, 523, 5, 110, 0, 0, 523, 105, 1, 0, 0, 0, 524, 525, 5, 3, 0, 0, 525, 528, 5, 90, 0, 0, 526, 527, 5, 88, 0, 0, 527, 529, 3, 50, 25, 0, 528, 526, 1, 0, 0, 0, 528, 529, 1, 0, 0, 0, 529, 539, 1, 0, 0, 0, 530, 531, 5, 89, 0, 0, 531, 536, 3, 108, 54, 0, 532, 533, 5, 38, 0, 0, 533, 535, 3, 108, 54, 0, 534, 532, 1, 0, 0, 0, 535, 538, 1, 0, 0, 0, 536, 534, 1, 0, 0, 0, 536, 537, 1, 0, 0, 0, 537, 540, 1, 0, 0, 0, 538, 536, 1, 0, 0, 0, 539, 530, 1, 0, 0, 0, 539, 540, 1, 0, 0, 0, 540, 107, 1, 0, 0, 0, 541, 542, 3, 50, 25, 0, 542, 543, 5, 36, 0, 0, 543, 545, 1, 0, 0, 0, 544, 541, 1, 0, 0, 0, 544, 545, 1, 0, 0, 0, 545, 546, 1, 0, 0, 0, 546, 547, 3, 50, 25, 0, 547, 109, 1, 0, 0, 0, 548, 549, 5, 11, 0, 0, 549, 550, 5, 25, 0, 0, 550, 551, 5, 88, 0, 0, 551, 552, 3, 52, 26, 0, 552, 111, 1, 0, 0, 0, 53, 123, 132, 148, 160, 169, 177, 181, 189, 191, 196, 203, 208, 215, 221, 229, 231, 242, 249, 260, 263, 277, 285, 293, 297, 303, 311, 324, 328, 332, 339, 343, 349, 356, 364, 372, 394, 405, 416, 421, 425, 436, 441, 445, 459, 470, 484, 495, 498, 503, 528, 536, 539, 544] \ No newline at end of file +[4, 1, 124, 567, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 126, 8, 1, 10, 1, 12, 1, 129, 9, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 137, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 153, 8, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 165, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 172, 8, 5, 10, 5, 12, 5, 175, 9, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 182, 8, 5, 1, 5, 1, 5, 3, 5, 186, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 194, 8, 5, 10, 5, 12, 5, 197, 9, 5, 1, 6, 1, 6, 3, 6, 201, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 208, 8, 6, 1, 6, 1, 6, 1, 6, 3, 6, 213, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 3, 7, 220, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 226, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 234, 8, 8, 10, 8, 12, 8, 237, 9, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 247, 8, 9, 1, 9, 1, 9, 1, 9, 5, 9, 252, 8, 9, 10, 9, 12, 9, 255, 9, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 5, 10, 263, 8, 10, 10, 10, 12, 10, 266, 9, 10, 3, 10, 268, 8, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 5, 13, 280, 8, 13, 10, 13, 12, 13, 283, 9, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 290, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 5, 15, 296, 8, 15, 10, 15, 12, 15, 299, 9, 15, 1, 15, 3, 15, 302, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 309, 8, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 3, 19, 317, 8, 19, 1, 20, 1, 20, 1, 20, 1, 20, 5, 20, 323, 8, 20, 10, 20, 12, 20, 326, 9, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 5, 22, 336, 8, 22, 10, 22, 12, 22, 339, 9, 22, 1, 22, 3, 22, 342, 8, 22, 1, 22, 1, 22, 3, 22, 346, 8, 22, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 3, 24, 353, 8, 24, 1, 24, 1, 24, 3, 24, 357, 8, 24, 1, 25, 1, 25, 1, 25, 1, 25, 3, 25, 363, 8, 25, 1, 26, 1, 26, 1, 26, 5, 26, 368, 8, 26, 10, 26, 12, 26, 371, 9, 26, 1, 27, 1, 27, 1, 27, 5, 27, 376, 8, 27, 10, 27, 12, 27, 379, 9, 27, 1, 28, 1, 28, 1, 28, 5, 28, 384, 8, 28, 10, 28, 12, 28, 387, 9, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 406, 8, 31, 10, 31, 12, 31, 409, 9, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 417, 8, 31, 10, 31, 12, 31, 420, 9, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 428, 8, 31, 10, 31, 12, 31, 431, 9, 31, 1, 31, 1, 31, 3, 31, 435, 8, 31, 1, 32, 1, 32, 3, 32, 439, 8, 32, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 448, 8, 34, 10, 34, 12, 34, 451, 9, 34, 1, 35, 1, 35, 3, 35, 455, 8, 35, 1, 35, 1, 35, 3, 35, 459, 8, 35, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 5, 38, 471, 8, 38, 10, 38, 12, 38, 474, 9, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 3, 40, 484, 8, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 5, 43, 496, 8, 43, 10, 43, 12, 43, 499, 9, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 46, 1, 46, 3, 46, 509, 8, 46, 1, 47, 3, 47, 512, 8, 47, 1, 47, 1, 47, 1, 48, 3, 48, 517, 8, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 3, 55, 542, 8, 55, 1, 55, 1, 55, 1, 55, 1, 55, 5, 55, 548, 8, 55, 10, 55, 12, 55, 551, 9, 55, 3, 55, 553, 8, 55, 1, 56, 1, 56, 1, 56, 3, 56, 558, 8, 56, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 0, 4, 2, 10, 16, 18, 58, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 0, 8, 1, 0, 63, 64, 1, 0, 65, 67, 2, 0, 25, 25, 30, 30, 1, 0, 71, 72, 2, 0, 35, 35, 39, 39, 1, 0, 42, 43, 2, 0, 41, 41, 55, 55, 2, 0, 56, 56, 58, 62, 592, 0, 116, 1, 0, 0, 0, 2, 119, 1, 0, 0, 0, 4, 136, 1, 0, 0, 0, 6, 152, 1, 0, 0, 0, 8, 154, 1, 0, 0, 0, 10, 185, 1, 0, 0, 0, 12, 212, 1, 0, 0, 0, 14, 219, 1, 0, 0, 0, 16, 225, 1, 0, 0, 0, 18, 246, 1, 0, 0, 0, 20, 256, 1, 0, 0, 0, 22, 271, 1, 0, 0, 0, 24, 273, 1, 0, 0, 0, 26, 276, 1, 0, 0, 0, 28, 289, 1, 0, 0, 0, 30, 291, 1, 0, 0, 0, 32, 308, 1, 0, 0, 0, 34, 310, 1, 0, 0, 0, 36, 312, 1, 0, 0, 0, 38, 316, 1, 0, 0, 0, 40, 318, 1, 0, 0, 0, 42, 327, 1, 0, 0, 0, 44, 331, 1, 0, 0, 0, 46, 347, 1, 0, 0, 0, 48, 350, 1, 0, 0, 0, 50, 358, 1, 0, 0, 0, 52, 364, 1, 0, 0, 0, 54, 372, 1, 0, 0, 0, 56, 380, 1, 0, 0, 0, 58, 388, 1, 0, 0, 0, 60, 390, 1, 0, 0, 0, 62, 434, 1, 0, 0, 0, 64, 438, 1, 0, 0, 0, 66, 440, 1, 0, 0, 0, 68, 443, 1, 0, 0, 0, 70, 452, 1, 0, 0, 0, 72, 460, 1, 0, 0, 0, 74, 463, 1, 0, 0, 0, 76, 466, 1, 0, 0, 0, 78, 475, 1, 0, 0, 0, 80, 479, 1, 0, 0, 0, 82, 485, 1, 0, 0, 0, 84, 489, 1, 0, 0, 0, 86, 492, 1, 0, 0, 0, 88, 500, 1, 0, 0, 0, 90, 504, 1, 0, 0, 0, 92, 508, 1, 0, 0, 0, 94, 511, 1, 0, 0, 0, 96, 516, 1, 0, 0, 0, 98, 520, 1, 0, 0, 0, 100, 522, 1, 0, 0, 0, 102, 524, 1, 0, 0, 0, 104, 527, 1, 0, 0, 0, 106, 531, 1, 0, 0, 0, 108, 534, 1, 0, 0, 0, 110, 537, 1, 0, 0, 0, 112, 557, 1, 0, 0, 0, 114, 561, 1, 0, 0, 0, 116, 117, 3, 2, 1, 0, 117, 118, 5, 0, 0, 1, 118, 1, 1, 0, 0, 0, 119, 120, 6, 1, -1, 0, 120, 121, 3, 4, 2, 0, 121, 127, 1, 0, 0, 0, 122, 123, 10, 1, 0, 0, 123, 124, 5, 29, 0, 0, 124, 126, 3, 6, 3, 0, 125, 122, 1, 0, 0, 0, 126, 129, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 127, 128, 1, 0, 0, 0, 128, 3, 1, 0, 0, 0, 129, 127, 1, 0, 0, 0, 130, 137, 3, 102, 51, 0, 131, 137, 3, 30, 15, 0, 132, 137, 3, 24, 12, 0, 133, 137, 3, 44, 22, 0, 134, 137, 3, 106, 53, 0, 135, 137, 3, 108, 54, 0, 136, 130, 1, 0, 0, 0, 136, 131, 1, 0, 0, 0, 136, 132, 1, 0, 0, 0, 136, 133, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 135, 1, 0, 0, 0, 137, 5, 1, 0, 0, 0, 138, 153, 3, 46, 23, 0, 139, 153, 3, 50, 25, 0, 140, 153, 3, 66, 33, 0, 141, 153, 3, 114, 57, 0, 142, 153, 3, 72, 36, 0, 143, 153, 3, 68, 34, 0, 144, 153, 3, 48, 24, 0, 145, 153, 3, 8, 4, 0, 146, 153, 3, 74, 37, 0, 147, 153, 3, 76, 38, 0, 148, 153, 3, 80, 40, 0, 149, 153, 3, 82, 41, 0, 150, 153, 3, 110, 55, 0, 151, 153, 3, 84, 42, 0, 152, 138, 1, 0, 0, 0, 152, 139, 1, 0, 0, 0, 152, 140, 1, 0, 0, 0, 152, 141, 1, 0, 0, 0, 152, 142, 1, 0, 0, 0, 152, 143, 1, 0, 0, 0, 152, 144, 1, 0, 0, 0, 152, 145, 1, 0, 0, 0, 152, 146, 1, 0, 0, 0, 152, 147, 1, 0, 0, 0, 152, 148, 1, 0, 0, 0, 152, 149, 1, 0, 0, 0, 152, 150, 1, 0, 0, 0, 152, 151, 1, 0, 0, 0, 153, 7, 1, 0, 0, 0, 154, 155, 5, 20, 0, 0, 155, 156, 3, 10, 5, 0, 156, 9, 1, 0, 0, 0, 157, 158, 6, 5, -1, 0, 158, 159, 5, 48, 0, 0, 159, 186, 3, 10, 5, 7, 160, 186, 3, 14, 7, 0, 161, 186, 3, 12, 6, 0, 162, 164, 3, 14, 7, 0, 163, 165, 5, 48, 0, 0, 164, 163, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 167, 5, 45, 0, 0, 167, 168, 5, 44, 0, 0, 168, 173, 3, 14, 7, 0, 169, 170, 5, 38, 0, 0, 170, 172, 3, 14, 7, 0, 171, 169, 1, 0, 0, 0, 172, 175, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 176, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 176, 177, 5, 54, 0, 0, 177, 186, 1, 0, 0, 0, 178, 179, 3, 14, 7, 0, 179, 181, 5, 46, 0, 0, 180, 182, 5, 48, 0, 0, 181, 180, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 184, 5, 49, 0, 0, 184, 186, 1, 0, 0, 0, 185, 157, 1, 0, 0, 0, 185, 160, 1, 0, 0, 0, 185, 161, 1, 0, 0, 0, 185, 162, 1, 0, 0, 0, 185, 178, 1, 0, 0, 0, 186, 195, 1, 0, 0, 0, 187, 188, 10, 4, 0, 0, 188, 189, 5, 34, 0, 0, 189, 194, 3, 10, 5, 5, 190, 191, 10, 3, 0, 0, 191, 192, 5, 51, 0, 0, 192, 194, 3, 10, 5, 4, 193, 187, 1, 0, 0, 0, 193, 190, 1, 0, 0, 0, 194, 197, 1, 0, 0, 0, 195, 193, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 11, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 198, 200, 3, 14, 7, 0, 199, 201, 5, 48, 0, 0, 200, 199, 1, 0, 0, 0, 200, 201, 1, 0, 0, 0, 201, 202, 1, 0, 0, 0, 202, 203, 5, 47, 0, 0, 203, 204, 3, 98, 49, 0, 204, 213, 1, 0, 0, 0, 205, 207, 3, 14, 7, 0, 206, 208, 5, 48, 0, 0, 207, 206, 1, 0, 0, 0, 207, 208, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 210, 5, 53, 0, 0, 210, 211, 3, 98, 49, 0, 211, 213, 1, 0, 0, 0, 212, 198, 1, 0, 0, 0, 212, 205, 1, 0, 0, 0, 213, 13, 1, 0, 0, 0, 214, 220, 3, 16, 8, 0, 215, 216, 3, 16, 8, 0, 216, 217, 3, 100, 50, 0, 217, 218, 3, 16, 8, 0, 218, 220, 1, 0, 0, 0, 219, 214, 1, 0, 0, 0, 219, 215, 1, 0, 0, 0, 220, 15, 1, 0, 0, 0, 221, 222, 6, 8, -1, 0, 222, 226, 3, 18, 9, 0, 223, 224, 7, 0, 0, 0, 224, 226, 3, 16, 8, 3, 225, 221, 1, 0, 0, 0, 225, 223, 1, 0, 0, 0, 226, 235, 1, 0, 0, 0, 227, 228, 10, 2, 0, 0, 228, 229, 7, 1, 0, 0, 229, 234, 3, 16, 8, 3, 230, 231, 10, 1, 0, 0, 231, 232, 7, 0, 0, 0, 232, 234, 3, 16, 8, 2, 233, 227, 1, 0, 0, 0, 233, 230, 1, 0, 0, 0, 234, 237, 1, 0, 0, 0, 235, 233, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 17, 1, 0, 0, 0, 237, 235, 1, 0, 0, 0, 238, 239, 6, 9, -1, 0, 239, 247, 3, 62, 31, 0, 240, 247, 3, 52, 26, 0, 241, 247, 3, 20, 10, 0, 242, 243, 5, 44, 0, 0, 243, 244, 3, 10, 5, 0, 244, 245, 5, 54, 0, 0, 245, 247, 1, 0, 0, 0, 246, 238, 1, 0, 0, 0, 246, 240, 1, 0, 0, 0, 246, 241, 1, 0, 0, 0, 246, 242, 1, 0, 0, 0, 247, 253, 1, 0, 0, 0, 248, 249, 10, 1, 0, 0, 249, 250, 5, 37, 0, 0, 250, 252, 3, 22, 11, 0, 251, 248, 1, 0, 0, 0, 252, 255, 1, 0, 0, 0, 253, 251, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 19, 1, 0, 0, 0, 255, 253, 1, 0, 0, 0, 256, 257, 3, 58, 29, 0, 257, 267, 5, 44, 0, 0, 258, 268, 5, 65, 0, 0, 259, 264, 3, 10, 5, 0, 260, 261, 5, 38, 0, 0, 261, 263, 3, 10, 5, 0, 262, 260, 1, 0, 0, 0, 263, 266, 1, 0, 0, 0, 264, 262, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 268, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 267, 258, 1, 0, 0, 0, 267, 259, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 270, 5, 54, 0, 0, 270, 21, 1, 0, 0, 0, 271, 272, 3, 58, 29, 0, 272, 23, 1, 0, 0, 0, 273, 274, 5, 16, 0, 0, 274, 275, 3, 26, 13, 0, 275, 25, 1, 0, 0, 0, 276, 281, 3, 28, 14, 0, 277, 278, 5, 38, 0, 0, 278, 280, 3, 28, 14, 0, 279, 277, 1, 0, 0, 0, 280, 283, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 27, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 284, 290, 3, 10, 5, 0, 285, 286, 3, 52, 26, 0, 286, 287, 5, 36, 0, 0, 287, 288, 3, 10, 5, 0, 288, 290, 1, 0, 0, 0, 289, 284, 1, 0, 0, 0, 289, 285, 1, 0, 0, 0, 290, 29, 1, 0, 0, 0, 291, 292, 5, 6, 0, 0, 292, 297, 3, 32, 16, 0, 293, 294, 5, 38, 0, 0, 294, 296, 3, 32, 16, 0, 295, 293, 1, 0, 0, 0, 296, 299, 1, 0, 0, 0, 297, 295, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 301, 1, 0, 0, 0, 299, 297, 1, 0, 0, 0, 300, 302, 3, 38, 19, 0, 301, 300, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 31, 1, 0, 0, 0, 303, 304, 3, 34, 17, 0, 304, 305, 5, 114, 0, 0, 305, 306, 3, 36, 18, 0, 306, 309, 1, 0, 0, 0, 307, 309, 3, 36, 18, 0, 308, 303, 1, 0, 0, 0, 308, 307, 1, 0, 0, 0, 309, 33, 1, 0, 0, 0, 310, 311, 5, 25, 0, 0, 311, 35, 1, 0, 0, 0, 312, 313, 7, 2, 0, 0, 313, 37, 1, 0, 0, 0, 314, 317, 3, 40, 20, 0, 315, 317, 3, 42, 21, 0, 316, 314, 1, 0, 0, 0, 316, 315, 1, 0, 0, 0, 317, 39, 1, 0, 0, 0, 318, 319, 5, 76, 0, 0, 319, 324, 5, 25, 0, 0, 320, 321, 5, 38, 0, 0, 321, 323, 5, 25, 0, 0, 322, 320, 1, 0, 0, 0, 323, 326, 1, 0, 0, 0, 324, 322, 1, 0, 0, 0, 324, 325, 1, 0, 0, 0, 325, 41, 1, 0, 0, 0, 326, 324, 1, 0, 0, 0, 327, 328, 5, 69, 0, 0, 328, 329, 3, 40, 20, 0, 329, 330, 5, 70, 0, 0, 330, 43, 1, 0, 0, 0, 331, 332, 5, 13, 0, 0, 332, 337, 3, 32, 16, 0, 333, 334, 5, 38, 0, 0, 334, 336, 3, 32, 16, 0, 335, 333, 1, 0, 0, 0, 336, 339, 1, 0, 0, 0, 337, 335, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 341, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 340, 342, 3, 26, 13, 0, 341, 340, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 345, 1, 0, 0, 0, 343, 344, 5, 33, 0, 0, 344, 346, 3, 26, 13, 0, 345, 343, 1, 0, 0, 0, 345, 346, 1, 0, 0, 0, 346, 45, 1, 0, 0, 0, 347, 348, 5, 4, 0, 0, 348, 349, 3, 26, 13, 0, 349, 47, 1, 0, 0, 0, 350, 352, 5, 19, 0, 0, 351, 353, 3, 26, 13, 0, 352, 351, 1, 0, 0, 0, 352, 353, 1, 0, 0, 0, 353, 356, 1, 0, 0, 0, 354, 355, 5, 33, 0, 0, 355, 357, 3, 26, 13, 0, 356, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 49, 1, 0, 0, 0, 358, 359, 5, 8, 0, 0, 359, 362, 3, 26, 13, 0, 360, 361, 5, 33, 0, 0, 361, 363, 3, 26, 13, 0, 362, 360, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 51, 1, 0, 0, 0, 364, 369, 3, 58, 29, 0, 365, 366, 5, 40, 0, 0, 366, 368, 3, 58, 29, 0, 367, 365, 1, 0, 0, 0, 368, 371, 1, 0, 0, 0, 369, 367, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 53, 1, 0, 0, 0, 371, 369, 1, 0, 0, 0, 372, 377, 3, 60, 30, 0, 373, 374, 5, 40, 0, 0, 374, 376, 3, 60, 30, 0, 375, 373, 1, 0, 0, 0, 376, 379, 1, 0, 0, 0, 377, 375, 1, 0, 0, 0, 377, 378, 1, 0, 0, 0, 378, 55, 1, 0, 0, 0, 379, 377, 1, 0, 0, 0, 380, 385, 3, 54, 27, 0, 381, 382, 5, 38, 0, 0, 382, 384, 3, 54, 27, 0, 383, 381, 1, 0, 0, 0, 384, 387, 1, 0, 0, 0, 385, 383, 1, 0, 0, 0, 385, 386, 1, 0, 0, 0, 386, 57, 1, 0, 0, 0, 387, 385, 1, 0, 0, 0, 388, 389, 7, 3, 0, 0, 389, 59, 1, 0, 0, 0, 390, 391, 5, 80, 0, 0, 391, 61, 1, 0, 0, 0, 392, 435, 5, 49, 0, 0, 393, 394, 3, 96, 48, 0, 394, 395, 5, 71, 0, 0, 395, 435, 1, 0, 0, 0, 396, 435, 3, 94, 47, 0, 397, 435, 3, 96, 48, 0, 398, 435, 3, 90, 45, 0, 399, 435, 3, 64, 32, 0, 400, 435, 3, 98, 49, 0, 401, 402, 5, 69, 0, 0, 402, 407, 3, 92, 46, 0, 403, 404, 5, 38, 0, 0, 404, 406, 3, 92, 46, 0, 405, 403, 1, 0, 0, 0, 406, 409, 1, 0, 0, 0, 407, 405, 1, 0, 0, 0, 407, 408, 1, 0, 0, 0, 408, 410, 1, 0, 0, 0, 409, 407, 1, 0, 0, 0, 410, 411, 5, 70, 0, 0, 411, 435, 1, 0, 0, 0, 412, 413, 5, 69, 0, 0, 413, 418, 3, 90, 45, 0, 414, 415, 5, 38, 0, 0, 415, 417, 3, 90, 45, 0, 416, 414, 1, 0, 0, 0, 417, 420, 1, 0, 0, 0, 418, 416, 1, 0, 0, 0, 418, 419, 1, 0, 0, 0, 419, 421, 1, 0, 0, 0, 420, 418, 1, 0, 0, 0, 421, 422, 5, 70, 0, 0, 422, 435, 1, 0, 0, 0, 423, 424, 5, 69, 0, 0, 424, 429, 3, 98, 49, 0, 425, 426, 5, 38, 0, 0, 426, 428, 3, 98, 49, 0, 427, 425, 1, 0, 0, 0, 428, 431, 1, 0, 0, 0, 429, 427, 1, 0, 0, 0, 429, 430, 1, 0, 0, 0, 430, 432, 1, 0, 0, 0, 431, 429, 1, 0, 0, 0, 432, 433, 5, 70, 0, 0, 433, 435, 1, 0, 0, 0, 434, 392, 1, 0, 0, 0, 434, 393, 1, 0, 0, 0, 434, 396, 1, 0, 0, 0, 434, 397, 1, 0, 0, 0, 434, 398, 1, 0, 0, 0, 434, 399, 1, 0, 0, 0, 434, 400, 1, 0, 0, 0, 434, 401, 1, 0, 0, 0, 434, 412, 1, 0, 0, 0, 434, 423, 1, 0, 0, 0, 435, 63, 1, 0, 0, 0, 436, 439, 5, 52, 0, 0, 437, 439, 5, 68, 0, 0, 438, 436, 1, 0, 0, 0, 438, 437, 1, 0, 0, 0, 439, 65, 1, 0, 0, 0, 440, 441, 5, 10, 0, 0, 441, 442, 5, 31, 0, 0, 442, 67, 1, 0, 0, 0, 443, 444, 5, 18, 0, 0, 444, 449, 3, 70, 35, 0, 445, 446, 5, 38, 0, 0, 446, 448, 3, 70, 35, 0, 447, 445, 1, 0, 0, 0, 448, 451, 1, 0, 0, 0, 449, 447, 1, 0, 0, 0, 449, 450, 1, 0, 0, 0, 450, 69, 1, 0, 0, 0, 451, 449, 1, 0, 0, 0, 452, 454, 3, 10, 5, 0, 453, 455, 7, 4, 0, 0, 454, 453, 1, 0, 0, 0, 454, 455, 1, 0, 0, 0, 455, 458, 1, 0, 0, 0, 456, 457, 5, 50, 0, 0, 457, 459, 7, 5, 0, 0, 458, 456, 1, 0, 0, 0, 458, 459, 1, 0, 0, 0, 459, 71, 1, 0, 0, 0, 460, 461, 5, 9, 0, 0, 461, 462, 3, 56, 28, 0, 462, 73, 1, 0, 0, 0, 463, 464, 5, 2, 0, 0, 464, 465, 3, 56, 28, 0, 465, 75, 1, 0, 0, 0, 466, 467, 5, 15, 0, 0, 467, 472, 3, 78, 39, 0, 468, 469, 5, 38, 0, 0, 469, 471, 3, 78, 39, 0, 470, 468, 1, 0, 0, 0, 471, 474, 1, 0, 0, 0, 472, 470, 1, 0, 0, 0, 472, 473, 1, 0, 0, 0, 473, 77, 1, 0, 0, 0, 474, 472, 1, 0, 0, 0, 475, 476, 3, 54, 27, 0, 476, 477, 5, 84, 0, 0, 477, 478, 3, 54, 27, 0, 478, 79, 1, 0, 0, 0, 479, 480, 5, 1, 0, 0, 480, 481, 3, 18, 9, 0, 481, 483, 3, 98, 49, 0, 482, 484, 3, 86, 43, 0, 483, 482, 1, 0, 0, 0, 483, 484, 1, 0, 0, 0, 484, 81, 1, 0, 0, 0, 485, 486, 5, 7, 0, 0, 486, 487, 3, 18, 9, 0, 487, 488, 3, 98, 49, 0, 488, 83, 1, 0, 0, 0, 489, 490, 5, 14, 0, 0, 490, 491, 3, 52, 26, 0, 491, 85, 1, 0, 0, 0, 492, 497, 3, 88, 44, 0, 493, 494, 5, 38, 0, 0, 494, 496, 3, 88, 44, 0, 495, 493, 1, 0, 0, 0, 496, 499, 1, 0, 0, 0, 497, 495, 1, 0, 0, 0, 497, 498, 1, 0, 0, 0, 498, 87, 1, 0, 0, 0, 499, 497, 1, 0, 0, 0, 500, 501, 3, 58, 29, 0, 501, 502, 5, 36, 0, 0, 502, 503, 3, 62, 31, 0, 503, 89, 1, 0, 0, 0, 504, 505, 7, 6, 0, 0, 505, 91, 1, 0, 0, 0, 506, 509, 3, 94, 47, 0, 507, 509, 3, 96, 48, 0, 508, 506, 1, 0, 0, 0, 508, 507, 1, 0, 0, 0, 509, 93, 1, 0, 0, 0, 510, 512, 7, 0, 0, 0, 511, 510, 1, 0, 0, 0, 511, 512, 1, 0, 0, 0, 512, 513, 1, 0, 0, 0, 513, 514, 5, 32, 0, 0, 514, 95, 1, 0, 0, 0, 515, 517, 7, 0, 0, 0, 516, 515, 1, 0, 0, 0, 516, 517, 1, 0, 0, 0, 517, 518, 1, 0, 0, 0, 518, 519, 5, 31, 0, 0, 519, 97, 1, 0, 0, 0, 520, 521, 5, 30, 0, 0, 521, 99, 1, 0, 0, 0, 522, 523, 7, 7, 0, 0, 523, 101, 1, 0, 0, 0, 524, 525, 5, 5, 0, 0, 525, 526, 3, 104, 52, 0, 526, 103, 1, 0, 0, 0, 527, 528, 5, 69, 0, 0, 528, 529, 3, 2, 1, 0, 529, 530, 5, 70, 0, 0, 530, 105, 1, 0, 0, 0, 531, 532, 5, 17, 0, 0, 532, 533, 5, 106, 0, 0, 533, 107, 1, 0, 0, 0, 534, 535, 5, 12, 0, 0, 535, 536, 5, 110, 0, 0, 536, 109, 1, 0, 0, 0, 537, 538, 5, 3, 0, 0, 538, 541, 5, 90, 0, 0, 539, 540, 5, 88, 0, 0, 540, 542, 3, 54, 27, 0, 541, 539, 1, 0, 0, 0, 541, 542, 1, 0, 0, 0, 542, 552, 1, 0, 0, 0, 543, 544, 5, 89, 0, 0, 544, 549, 3, 112, 56, 0, 545, 546, 5, 38, 0, 0, 546, 548, 3, 112, 56, 0, 547, 545, 1, 0, 0, 0, 548, 551, 1, 0, 0, 0, 549, 547, 1, 0, 0, 0, 549, 550, 1, 0, 0, 0, 550, 553, 1, 0, 0, 0, 551, 549, 1, 0, 0, 0, 552, 543, 1, 0, 0, 0, 552, 553, 1, 0, 0, 0, 553, 111, 1, 0, 0, 0, 554, 555, 3, 54, 27, 0, 555, 556, 5, 36, 0, 0, 556, 558, 1, 0, 0, 0, 557, 554, 1, 0, 0, 0, 557, 558, 1, 0, 0, 0, 558, 559, 1, 0, 0, 0, 559, 560, 3, 54, 27, 0, 560, 113, 1, 0, 0, 0, 561, 562, 5, 11, 0, 0, 562, 563, 3, 32, 16, 0, 563, 564, 5, 88, 0, 0, 564, 565, 3, 56, 28, 0, 565, 115, 1, 0, 0, 0, 54, 127, 136, 152, 164, 173, 181, 185, 193, 195, 200, 207, 212, 219, 225, 233, 235, 246, 253, 264, 267, 281, 289, 297, 301, 308, 316, 324, 337, 341, 345, 352, 356, 362, 369, 377, 385, 407, 418, 429, 434, 438, 449, 454, 458, 472, 483, 497, 508, 511, 516, 541, 549, 552, 557] \ No newline at end of file diff --git a/packages/kbn-esql-ast/src/antlr/esql_parser.tokens b/packages/kbn-esql-ast/src/antlr/esql_parser.tokens index 04798fc3dca8a..63eb3a86419a3 100644 --- a/packages/kbn-esql-ast/src/antlr/esql_parser.tokens +++ b/packages/kbn-esql-ast/src/antlr/esql_parser.tokens @@ -22,7 +22,7 @@ UNKNOWN_CMD=21 LINE_COMMENT=22 MULTILINE_COMMENT=23 WS=24 -INDEX_UNQUOTED_IDENTIFIER=25 +UNQUOTED_SOURCE=25 EXPLAIN_WS=26 EXPLAIN_LINE_COMMENT=27 EXPLAIN_MULTILINE_COMMENT=28 diff --git a/packages/kbn-esql-ast/src/antlr/esql_parser.ts b/packages/kbn-esql-ast/src/antlr/esql_parser.ts index 5181349c62c88..1c8ce9f0d86e5 100644 --- a/packages/kbn-esql-ast/src/antlr/esql_parser.ts +++ b/packages/kbn-esql-ast/src/antlr/esql_parser.ts @@ -42,7 +42,7 @@ export default class esql_parser extends Parser { public static readonly LINE_COMMENT = 22; public static readonly MULTILINE_COMMENT = 23; public static readonly WS = 24; - public static readonly INDEX_UNQUOTED_IDENTIFIER = 25; + public static readonly UNQUOTED_SOURCE = 25; public static readonly EXPLAIN_WS = 26; public static readonly EXPLAIN_LINE_COMMENT = 27; public static readonly EXPLAIN_MULTILINE_COMMENT = 28; @@ -159,213 +159,216 @@ export default class esql_parser extends Parser { public static readonly RULE_fields = 13; public static readonly RULE_field = 14; public static readonly RULE_fromCommand = 15; - public static readonly RULE_indexIdentifier = 16; - public static readonly RULE_metadata = 17; - public static readonly RULE_metadataOption = 18; - public static readonly RULE_deprecated_metadata = 19; - public static readonly RULE_metricsCommand = 20; - public static readonly RULE_evalCommand = 21; - public static readonly RULE_statsCommand = 22; - public static readonly RULE_inlinestatsCommand = 23; - public static readonly RULE_qualifiedName = 24; - public static readonly RULE_qualifiedNamePattern = 25; - public static readonly RULE_qualifiedNamePatterns = 26; - public static readonly RULE_identifier = 27; - public static readonly RULE_identifierPattern = 28; - public static readonly RULE_constant = 29; - public static readonly RULE_params = 30; - public static readonly RULE_limitCommand = 31; - public static readonly RULE_sortCommand = 32; - public static readonly RULE_orderExpression = 33; - public static readonly RULE_keepCommand = 34; - public static readonly RULE_dropCommand = 35; - public static readonly RULE_renameCommand = 36; - public static readonly RULE_renameClause = 37; - public static readonly RULE_dissectCommand = 38; - public static readonly RULE_grokCommand = 39; - public static readonly RULE_mvExpandCommand = 40; - public static readonly RULE_commandOptions = 41; - public static readonly RULE_commandOption = 42; - public static readonly RULE_booleanValue = 43; - public static readonly RULE_numericValue = 44; - public static readonly RULE_decimalValue = 45; - public static readonly RULE_integerValue = 46; - public static readonly RULE_string = 47; - public static readonly RULE_comparisonOperator = 48; - public static readonly RULE_explainCommand = 49; - public static readonly RULE_subqueryExpression = 50; - public static readonly RULE_showCommand = 51; - public static readonly RULE_metaCommand = 52; - public static readonly RULE_enrichCommand = 53; - public static readonly RULE_enrichWithClause = 54; - public static readonly RULE_lookupCommand = 55; - public static readonly literalNames: (string | null)[] = [ null, "'dissect'", - "'drop'", "'enrich'", - "'eval'", "'explain'", - "'from'", "'grok'", - "'inlinestats'", - "'keep'", "'limit'", - "'lookup'", - "'meta'", "'metrics'", - "'mv_expand'", - "'rename'", - "'row'", "'show'", - "'sort'", "'stats'", - "'where'", null, - null, null, - null, null, - null, null, - null, "'|'", - null, null, - null, "'by'", - "'and'", "'asc'", - "'='", "'::'", - "','", "'desc'", - "'.'", "'false'", - "'first'", "'last'", - "'('", "'in'", - "'is'", "'like'", - "'not'", "'null'", - "'nulls'", "'or'", - "'?'", "'rlike'", - "')'", "'true'", - "'=='", "'=~'", - "'!='", "'<'", - "'<='", "'>'", - "'>='", "'+'", - "'-'", "'*'", - "'/'", "'%'", - null, null, - "']'", null, - null, null, - null, null, - "'metadata'", - null, null, - null, null, - null, null, - null, "'as'", - null, null, - null, "'on'", - "'with'", null, - null, null, - null, null, - null, null, - null, null, - null, null, - null, null, - null, null, - null, "'info'", - null, null, - null, "'functions'", - null, null, + public static readonly RULE_indexPattern = 16; + public static readonly RULE_clusterString = 17; + public static readonly RULE_indexString = 18; + public static readonly RULE_metadata = 19; + public static readonly RULE_metadataOption = 20; + public static readonly RULE_deprecated_metadata = 21; + public static readonly RULE_metricsCommand = 22; + public static readonly RULE_evalCommand = 23; + public static readonly RULE_statsCommand = 24; + public static readonly RULE_inlinestatsCommand = 25; + public static readonly RULE_qualifiedName = 26; + public static readonly RULE_qualifiedNamePattern = 27; + public static readonly RULE_qualifiedNamePatterns = 28; + public static readonly RULE_identifier = 29; + public static readonly RULE_identifierPattern = 30; + public static readonly RULE_constant = 31; + public static readonly RULE_params = 32; + public static readonly RULE_limitCommand = 33; + public static readonly RULE_sortCommand = 34; + public static readonly RULE_orderExpression = 35; + public static readonly RULE_keepCommand = 36; + public static readonly RULE_dropCommand = 37; + public static readonly RULE_renameCommand = 38; + public static readonly RULE_renameClause = 39; + public static readonly RULE_dissectCommand = 40; + public static readonly RULE_grokCommand = 41; + public static readonly RULE_mvExpandCommand = 42; + public static readonly RULE_commandOptions = 43; + public static readonly RULE_commandOption = 44; + public static readonly RULE_booleanValue = 45; + public static readonly RULE_numericValue = 46; + public static readonly RULE_decimalValue = 47; + public static readonly RULE_integerValue = 48; + public static readonly RULE_string = 49; + public static readonly RULE_comparisonOperator = 50; + public static readonly RULE_explainCommand = 51; + public static readonly RULE_subqueryExpression = 52; + public static readonly RULE_showCommand = 53; + public static readonly RULE_metaCommand = 54; + public static readonly RULE_enrichCommand = 55; + public static readonly RULE_enrichWithClause = 56; + public static readonly RULE_lookupCommand = 57; + public static readonly literalNames: (string | null)[] = [ null, "'dissect'", + "'drop'", "'enrich'", + "'eval'", "'explain'", + "'from'", "'grok'", + "'inlinestats'", + "'keep'", "'limit'", + "'lookup'", + "'meta'", "'metrics'", + "'mv_expand'", + "'rename'", + "'row'", "'show'", + "'sort'", "'stats'", + "'where'", null, + null, null, + null, null, + null, null, + null, "'|'", + null, null, + null, "'by'", + "'and'", "'asc'", + "'='", "'::'", + "','", "'desc'", + "'.'", "'false'", + "'first'", "'last'", + "'('", "'in'", + "'is'", "'like'", + "'not'", "'null'", + "'nulls'", "'or'", + "'?'", "'rlike'", + "')'", "'true'", + "'=='", "'=~'", + "'!='", "'<'", + "'<='", "'>'", + "'>='", "'+'", + "'-'", "'*'", + "'/'", "'%'", + null, null, + "']'", null, + null, null, + null, null, + "'metadata'", + null, null, + null, null, + null, null, + null, "'as'", + null, null, + null, "'on'", + "'with'", null, + null, null, + null, null, + null, null, + null, null, + null, null, + null, null, + null, null, + null, "'info'", + null, null, + null, "'functions'", + null, null, null, "':'" ]; - public static readonly symbolicNames: (string | null)[] = [ null, "DISSECT", - "DROP", "ENRICH", - "EVAL", "EXPLAIN", - "FROM", "GROK", - "INLINESTATS", - "KEEP", "LIMIT", - "LOOKUP", "META", - "METRICS", - "MV_EXPAND", - "RENAME", "ROW", - "SHOW", "SORT", - "STATS", "WHERE", - "UNKNOWN_CMD", - "LINE_COMMENT", - "MULTILINE_COMMENT", - "WS", "INDEX_UNQUOTED_IDENTIFIER", - "EXPLAIN_WS", - "EXPLAIN_LINE_COMMENT", - "EXPLAIN_MULTILINE_COMMENT", - "PIPE", "QUOTED_STRING", - "INTEGER_LITERAL", - "DECIMAL_LITERAL", - "BY", "AND", - "ASC", "ASSIGN", - "CAST_OP", - "COMMA", "DESC", - "DOT", "FALSE", - "FIRST", "LAST", - "LP", "IN", - "IS", "LIKE", - "NOT", "NULL", - "NULLS", "OR", - "PARAM", "RLIKE", - "RP", "TRUE", - "EQ", "CIEQ", - "NEQ", "LT", - "LTE", "GT", - "GTE", "PLUS", - "MINUS", "ASTERISK", - "SLASH", "PERCENT", - "NAMED_OR_POSITIONAL_PARAM", - "OPENING_BRACKET", - "CLOSING_BRACKET", - "UNQUOTED_IDENTIFIER", - "QUOTED_IDENTIFIER", - "EXPR_LINE_COMMENT", - "EXPR_MULTILINE_COMMENT", - "EXPR_WS", - "METADATA", - "FROM_LINE_COMMENT", - "FROM_MULTILINE_COMMENT", - "FROM_WS", - "ID_PATTERN", - "PROJECT_LINE_COMMENT", - "PROJECT_MULTILINE_COMMENT", - "PROJECT_WS", - "AS", "RENAME_LINE_COMMENT", - "RENAME_MULTILINE_COMMENT", - "RENAME_WS", - "ON", "WITH", - "ENRICH_POLICY_NAME", - "ENRICH_LINE_COMMENT", - "ENRICH_MULTILINE_COMMENT", - "ENRICH_WS", - "ENRICH_FIELD_LINE_COMMENT", - "ENRICH_FIELD_MULTILINE_COMMENT", - "ENRICH_FIELD_WS", - "LOOKUP_LINE_COMMENT", - "LOOKUP_MULTILINE_COMMENT", - "LOOKUP_WS", - "LOOKUP_FIELD_LINE_COMMENT", - "LOOKUP_FIELD_MULTILINE_COMMENT", - "LOOKUP_FIELD_WS", - "MVEXPAND_LINE_COMMENT", - "MVEXPAND_MULTILINE_COMMENT", - "MVEXPAND_WS", - "INFO", "SHOW_LINE_COMMENT", - "SHOW_MULTILINE_COMMENT", - "SHOW_WS", - "FUNCTIONS", - "META_LINE_COMMENT", - "META_MULTILINE_COMMENT", - "META_WS", - "COLON", "SETTING", - "SETTING_LINE_COMMENT", - "SETTTING_MULTILINE_COMMENT", - "SETTING_WS", - "METRICS_LINE_COMMENT", - "METRICS_MULTILINE_COMMENT", - "METRICS_WS", - "CLOSING_METRICS_LINE_COMMENT", - "CLOSING_METRICS_MULTILINE_COMMENT", + public static readonly symbolicNames: (string | null)[] = [ null, "DISSECT", + "DROP", "ENRICH", + "EVAL", "EXPLAIN", + "FROM", "GROK", + "INLINESTATS", + "KEEP", "LIMIT", + "LOOKUP", "META", + "METRICS", + "MV_EXPAND", + "RENAME", "ROW", + "SHOW", "SORT", + "STATS", "WHERE", + "UNKNOWN_CMD", + "LINE_COMMENT", + "MULTILINE_COMMENT", + "WS", "UNQUOTED_SOURCE", + "EXPLAIN_WS", + "EXPLAIN_LINE_COMMENT", + "EXPLAIN_MULTILINE_COMMENT", + "PIPE", "QUOTED_STRING", + "INTEGER_LITERAL", + "DECIMAL_LITERAL", + "BY", "AND", + "ASC", "ASSIGN", + "CAST_OP", + "COMMA", "DESC", + "DOT", "FALSE", + "FIRST", "LAST", + "LP", "IN", + "IS", "LIKE", + "NOT", "NULL", + "NULLS", "OR", + "PARAM", "RLIKE", + "RP", "TRUE", + "EQ", "CIEQ", + "NEQ", "LT", + "LTE", "GT", + "GTE", "PLUS", + "MINUS", "ASTERISK", + "SLASH", "PERCENT", + "NAMED_OR_POSITIONAL_PARAM", + "OPENING_BRACKET", + "CLOSING_BRACKET", + "UNQUOTED_IDENTIFIER", + "QUOTED_IDENTIFIER", + "EXPR_LINE_COMMENT", + "EXPR_MULTILINE_COMMENT", + "EXPR_WS", + "METADATA", + "FROM_LINE_COMMENT", + "FROM_MULTILINE_COMMENT", + "FROM_WS", + "ID_PATTERN", + "PROJECT_LINE_COMMENT", + "PROJECT_MULTILINE_COMMENT", + "PROJECT_WS", + "AS", "RENAME_LINE_COMMENT", + "RENAME_MULTILINE_COMMENT", + "RENAME_WS", + "ON", "WITH", + "ENRICH_POLICY_NAME", + "ENRICH_LINE_COMMENT", + "ENRICH_MULTILINE_COMMENT", + "ENRICH_WS", + "ENRICH_FIELD_LINE_COMMENT", + "ENRICH_FIELD_MULTILINE_COMMENT", + "ENRICH_FIELD_WS", + "LOOKUP_LINE_COMMENT", + "LOOKUP_MULTILINE_COMMENT", + "LOOKUP_WS", + "LOOKUP_FIELD_LINE_COMMENT", + "LOOKUP_FIELD_MULTILINE_COMMENT", + "LOOKUP_FIELD_WS", + "MVEXPAND_LINE_COMMENT", + "MVEXPAND_MULTILINE_COMMENT", + "MVEXPAND_WS", + "INFO", "SHOW_LINE_COMMENT", + "SHOW_MULTILINE_COMMENT", + "SHOW_WS", + "FUNCTIONS", + "META_LINE_COMMENT", + "META_MULTILINE_COMMENT", + "META_WS", + "COLON", "SETTING", + "SETTING_LINE_COMMENT", + "SETTTING_MULTILINE_COMMENT", + "SETTING_WS", + "METRICS_LINE_COMMENT", + "METRICS_MULTILINE_COMMENT", + "METRICS_WS", + "CLOSING_METRICS_LINE_COMMENT", + "CLOSING_METRICS_MULTILINE_COMMENT", "CLOSING_METRICS_WS" ]; // tslint:disable:no-trailing-whitespace public static readonly ruleNames: string[] = [ - "singleStatement", "query", "sourceCommand", "processingCommand", "whereCommand", - "booleanExpression", "regexBooleanExpression", "valueExpression", "operatorExpression", - "primaryExpression", "functionExpression", "dataType", "rowCommand", "fields", - "field", "fromCommand", "indexIdentifier", "metadata", "metadataOption", - "deprecated_metadata", "metricsCommand", "evalCommand", "statsCommand", - "inlinestatsCommand", "qualifiedName", "qualifiedNamePattern", "qualifiedNamePatterns", - "identifier", "identifierPattern", "constant", "params", "limitCommand", - "sortCommand", "orderExpression", "keepCommand", "dropCommand", "renameCommand", - "renameClause", "dissectCommand", "grokCommand", "mvExpandCommand", "commandOptions", - "commandOption", "booleanValue", "numericValue", "decimalValue", "integerValue", - "string", "comparisonOperator", "explainCommand", "subqueryExpression", - "showCommand", "metaCommand", "enrichCommand", "enrichWithClause", "lookupCommand", + "singleStatement", "query", "sourceCommand", "processingCommand", "whereCommand", + "booleanExpression", "regexBooleanExpression", "valueExpression", "operatorExpression", + "primaryExpression", "functionExpression", "dataType", "rowCommand", "fields", + "field", "fromCommand", "indexPattern", "clusterString", "indexString", + "metadata", "metadataOption", "deprecated_metadata", "metricsCommand", + "evalCommand", "statsCommand", "inlinestatsCommand", "qualifiedName", + "qualifiedNamePattern", "qualifiedNamePatterns", "identifier", "identifierPattern", + "constant", "params", "limitCommand", "sortCommand", "orderExpression", + "keepCommand", "dropCommand", "renameCommand", "renameClause", "dissectCommand", + "grokCommand", "mvExpandCommand", "commandOptions", "commandOption", "booleanValue", + "numericValue", "decimalValue", "integerValue", "string", "comparisonOperator", + "explainCommand", "subqueryExpression", "showCommand", "metaCommand", + "enrichCommand", "enrichWithClause", "lookupCommand", ]; public get grammarFileName(): string { return "esql_parser.g4"; } public get literalNames(): (string | null)[] { return esql_parser.literalNames; } @@ -388,9 +391,9 @@ export default class esql_parser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 112; + this.state = 116; this.query(0); - this.state = 113; + this.state = 117; this.match(esql_parser.EOF); } } @@ -432,11 +435,11 @@ export default class esql_parser extends Parser { this._ctx = localctx; _prevctx = localctx; - this.state = 116; + this.state = 120; this.sourceCommand(); } this._ctx.stop = this._input.LT(-1); - this.state = 123; + this.state = 127; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 0, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { @@ -449,18 +452,18 @@ export default class esql_parser extends Parser { { localctx = new CompositeQueryContext(this, new QueryContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, esql_parser.RULE_query); - this.state = 118; + this.state = 122; if (!(this.precpred(this._ctx, 1))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); } - this.state = 119; + this.state = 123; this.match(esql_parser.PIPE); - this.state = 120; + this.state = 124; this.processingCommand(); } } } - this.state = 125; + this.state = 129; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 0, this._ctx); } @@ -485,48 +488,48 @@ export default class esql_parser extends Parser { let localctx: SourceCommandContext = new SourceCommandContext(this, this._ctx, this.state); this.enterRule(localctx, 4, esql_parser.RULE_sourceCommand); try { - this.state = 132; + this.state = 136; this._errHandler.sync(this); switch (this._input.LA(1)) { case 5: this.enterOuterAlt(localctx, 1); { - this.state = 126; + this.state = 130; this.explainCommand(); } break; case 6: this.enterOuterAlt(localctx, 2); { - this.state = 127; + this.state = 131; this.fromCommand(); } break; case 16: this.enterOuterAlt(localctx, 3); { - this.state = 128; + this.state = 132; this.rowCommand(); } break; case 13: this.enterOuterAlt(localctx, 4); { - this.state = 129; + this.state = 133; this.metricsCommand(); } break; case 17: this.enterOuterAlt(localctx, 5); { - this.state = 130; + this.state = 134; this.showCommand(); } break; case 12: this.enterOuterAlt(localctx, 6); { - this.state = 131; + this.state = 135; this.metaCommand(); } break; @@ -553,104 +556,104 @@ export default class esql_parser extends Parser { let localctx: ProcessingCommandContext = new ProcessingCommandContext(this, this._ctx, this.state); this.enterRule(localctx, 6, esql_parser.RULE_processingCommand); try { - this.state = 148; + this.state = 152; this._errHandler.sync(this); switch (this._input.LA(1)) { case 4: this.enterOuterAlt(localctx, 1); { - this.state = 134; + this.state = 138; this.evalCommand(); } break; case 8: this.enterOuterAlt(localctx, 2); { - this.state = 135; + this.state = 139; this.inlinestatsCommand(); } break; case 10: this.enterOuterAlt(localctx, 3); { - this.state = 136; + this.state = 140; this.limitCommand(); } break; case 11: this.enterOuterAlt(localctx, 4); { - this.state = 137; + this.state = 141; this.lookupCommand(); } break; case 9: this.enterOuterAlt(localctx, 5); { - this.state = 138; + this.state = 142; this.keepCommand(); } break; case 18: this.enterOuterAlt(localctx, 6); { - this.state = 139; + this.state = 143; this.sortCommand(); } break; case 19: this.enterOuterAlt(localctx, 7); { - this.state = 140; + this.state = 144; this.statsCommand(); } break; case 20: this.enterOuterAlt(localctx, 8); { - this.state = 141; + this.state = 145; this.whereCommand(); } break; case 2: this.enterOuterAlt(localctx, 9); { - this.state = 142; + this.state = 146; this.dropCommand(); } break; case 15: this.enterOuterAlt(localctx, 10); { - this.state = 143; + this.state = 147; this.renameCommand(); } break; case 1: this.enterOuterAlt(localctx, 11); { - this.state = 144; + this.state = 148; this.dissectCommand(); } break; case 7: this.enterOuterAlt(localctx, 12); { - this.state = 145; + this.state = 149; this.grokCommand(); } break; case 3: this.enterOuterAlt(localctx, 13); { - this.state = 146; + this.state = 150; this.enrichCommand(); } break; case 14: this.enterOuterAlt(localctx, 14); { - this.state = 147; + this.state = 151; this.mvExpandCommand(); } break; @@ -679,9 +682,9 @@ export default class esql_parser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 150; + this.state = 154; this.match(esql_parser.WHERE); - this.state = 151; + this.state = 155; this.booleanExpression(0); } } @@ -719,7 +722,7 @@ export default class esql_parser extends Parser { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 181; + this.state = 185; this._errHandler.sync(this); switch ( this._interp.adaptivePredict(this._input, 6, this._ctx) ) { case 1: @@ -728,9 +731,9 @@ export default class esql_parser extends Parser { this._ctx = localctx; _prevctx = localctx; - this.state = 154; + this.state = 158; this.match(esql_parser.NOT); - this.state = 155; + this.state = 159; this.booleanExpression(7); } break; @@ -739,7 +742,7 @@ export default class esql_parser extends Parser { localctx = new BooleanDefaultContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 156; + this.state = 160; this.valueExpression(); } break; @@ -748,7 +751,7 @@ export default class esql_parser extends Parser { localctx = new RegexExpressionContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 157; + this.state = 161; this.regexBooleanExpression(); } break; @@ -757,41 +760,41 @@ export default class esql_parser extends Parser { localctx = new LogicalInContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 158; + this.state = 162; this.valueExpression(); - this.state = 160; + this.state = 164; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===48) { { - this.state = 159; + this.state = 163; this.match(esql_parser.NOT); } } - this.state = 162; + this.state = 166; this.match(esql_parser.IN); - this.state = 163; + this.state = 167; this.match(esql_parser.LP); - this.state = 164; + this.state = 168; this.valueExpression(); - this.state = 169; + this.state = 173; this._errHandler.sync(this); _la = this._input.LA(1); while (_la===38) { { { - this.state = 165; + this.state = 169; this.match(esql_parser.COMMA); - this.state = 166; + this.state = 170; this.valueExpression(); } } - this.state = 171; + this.state = 175; this._errHandler.sync(this); _la = this._input.LA(1); } - this.state = 172; + this.state = 176; this.match(esql_parser.RP); } break; @@ -800,27 +803,27 @@ export default class esql_parser extends Parser { localctx = new IsNullContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 174; + this.state = 178; this.valueExpression(); - this.state = 175; + this.state = 179; this.match(esql_parser.IS); - this.state = 177; + this.state = 181; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===48) { { - this.state = 176; + this.state = 180; this.match(esql_parser.NOT); } } - this.state = 179; + this.state = 183; this.match(esql_parser.NULL); } break; } this._ctx.stop = this._input.LT(-1); - this.state = 191; + this.state = 195; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 8, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { @@ -830,7 +833,7 @@ export default class esql_parser extends Parser { } _prevctx = localctx; { - this.state = 189; + this.state = 193; this._errHandler.sync(this); switch ( this._interp.adaptivePredict(this._input, 7, this._ctx) ) { case 1: @@ -838,13 +841,13 @@ export default class esql_parser extends Parser { localctx = new LogicalBinaryContext(this, new BooleanExpressionContext(this, _parentctx, _parentState)); (localctx as LogicalBinaryContext)._left = _prevctx; this.pushNewRecursionContext(localctx, _startState, esql_parser.RULE_booleanExpression); - this.state = 183; + this.state = 187; if (!(this.precpred(this._ctx, 4))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 4)"); } - this.state = 184; + this.state = 188; (localctx as LogicalBinaryContext)._operator = this.match(esql_parser.AND); - this.state = 185; + this.state = 189; (localctx as LogicalBinaryContext)._right = this.booleanExpression(5); } break; @@ -853,20 +856,20 @@ export default class esql_parser extends Parser { localctx = new LogicalBinaryContext(this, new BooleanExpressionContext(this, _parentctx, _parentState)); (localctx as LogicalBinaryContext)._left = _prevctx; this.pushNewRecursionContext(localctx, _startState, esql_parser.RULE_booleanExpression); - this.state = 186; + this.state = 190; if (!(this.precpred(this._ctx, 3))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); } - this.state = 187; + this.state = 191; (localctx as LogicalBinaryContext)._operator = this.match(esql_parser.OR); - this.state = 188; + this.state = 192; (localctx as LogicalBinaryContext)._right = this.booleanExpression(4); } break; } } } - this.state = 193; + this.state = 197; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 8, this._ctx); } @@ -892,48 +895,48 @@ export default class esql_parser extends Parser { this.enterRule(localctx, 12, esql_parser.RULE_regexBooleanExpression); let _la: number; try { - this.state = 208; + this.state = 212; this._errHandler.sync(this); switch ( this._interp.adaptivePredict(this._input, 11, this._ctx) ) { case 1: this.enterOuterAlt(localctx, 1); { - this.state = 194; + this.state = 198; this.valueExpression(); - this.state = 196; + this.state = 200; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===48) { { - this.state = 195; + this.state = 199; this.match(esql_parser.NOT); } } - this.state = 198; + this.state = 202; localctx._kind = this.match(esql_parser.LIKE); - this.state = 199; + this.state = 203; localctx._pattern = this.string_(); } break; case 2: this.enterOuterAlt(localctx, 2); { - this.state = 201; + this.state = 205; this.valueExpression(); - this.state = 203; + this.state = 207; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===48) { { - this.state = 202; + this.state = 206; this.match(esql_parser.NOT); } } - this.state = 205; + this.state = 209; localctx._kind = this.match(esql_parser.RLIKE); - this.state = 206; + this.state = 210; localctx._pattern = this.string_(); } break; @@ -958,14 +961,14 @@ export default class esql_parser extends Parser { let localctx: ValueExpressionContext = new ValueExpressionContext(this, this._ctx, this.state); this.enterRule(localctx, 14, esql_parser.RULE_valueExpression); try { - this.state = 215; + this.state = 219; this._errHandler.sync(this); switch ( this._interp.adaptivePredict(this._input, 12, this._ctx) ) { case 1: localctx = new ValueExpressionDefaultContext(this, localctx); this.enterOuterAlt(localctx, 1); { - this.state = 210; + this.state = 214; this.operatorExpression(0); } break; @@ -973,11 +976,11 @@ export default class esql_parser extends Parser { localctx = new ComparisonContext(this, localctx); this.enterOuterAlt(localctx, 2); { - this.state = 211; + this.state = 215; (localctx as ComparisonContext)._left = this.operatorExpression(0); - this.state = 212; + this.state = 216; this.comparisonOperator(); - this.state = 213; + this.state = 217; (localctx as ComparisonContext)._right = this.operatorExpression(0); } break; @@ -1017,7 +1020,7 @@ export default class esql_parser extends Parser { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 221; + this.state = 225; this._errHandler.sync(this); switch ( this._interp.adaptivePredict(this._input, 13, this._ctx) ) { case 1: @@ -1026,7 +1029,7 @@ export default class esql_parser extends Parser { this._ctx = localctx; _prevctx = localctx; - this.state = 218; + this.state = 222; this.primaryExpression(0); } break; @@ -1035,7 +1038,7 @@ export default class esql_parser extends Parser { localctx = new ArithmeticUnaryContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 219; + this.state = 223; (localctx as ArithmeticUnaryContext)._operator = this._input.LT(1); _la = this._input.LA(1); if(!(_la===63 || _la===64)) { @@ -1045,13 +1048,13 @@ export default class esql_parser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 220; + this.state = 224; this.operatorExpression(3); } break; } this._ctx.stop = this._input.LT(-1); - this.state = 231; + this.state = 235; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 15, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { @@ -1061,7 +1064,7 @@ export default class esql_parser extends Parser { } _prevctx = localctx; { - this.state = 229; + this.state = 233; this._errHandler.sync(this); switch ( this._interp.adaptivePredict(this._input, 14, this._ctx) ) { case 1: @@ -1069,11 +1072,11 @@ export default class esql_parser extends Parser { localctx = new ArithmeticBinaryContext(this, new OperatorExpressionContext(this, _parentctx, _parentState)); (localctx as ArithmeticBinaryContext)._left = _prevctx; this.pushNewRecursionContext(localctx, _startState, esql_parser.RULE_operatorExpression); - this.state = 223; + this.state = 227; if (!(this.precpred(this._ctx, 2))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 2)"); } - this.state = 224; + this.state = 228; (localctx as ArithmeticBinaryContext)._operator = this._input.LT(1); _la = this._input.LA(1); if(!(((((_la - 65)) & ~0x1F) === 0 && ((1 << (_la - 65)) & 7) !== 0))) { @@ -1083,7 +1086,7 @@ export default class esql_parser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 225; + this.state = 229; (localctx as ArithmeticBinaryContext)._right = this.operatorExpression(3); } break; @@ -1092,11 +1095,11 @@ export default class esql_parser extends Parser { localctx = new ArithmeticBinaryContext(this, new OperatorExpressionContext(this, _parentctx, _parentState)); (localctx as ArithmeticBinaryContext)._left = _prevctx; this.pushNewRecursionContext(localctx, _startState, esql_parser.RULE_operatorExpression); - this.state = 226; + this.state = 230; if (!(this.precpred(this._ctx, 1))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); } - this.state = 227; + this.state = 231; (localctx as ArithmeticBinaryContext)._operator = this._input.LT(1); _la = this._input.LA(1); if(!(_la===63 || _la===64)) { @@ -1106,14 +1109,14 @@ export default class esql_parser extends Parser { this._errHandler.reportMatch(this); this.consume(); } - this.state = 228; + this.state = 232; (localctx as ArithmeticBinaryContext)._right = this.operatorExpression(2); } break; } } } - this.state = 233; + this.state = 237; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 15, this._ctx); } @@ -1152,7 +1155,7 @@ export default class esql_parser extends Parser { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 242; + this.state = 246; this._errHandler.sync(this); switch ( this._interp.adaptivePredict(this._input, 16, this._ctx) ) { case 1: @@ -1161,7 +1164,7 @@ export default class esql_parser extends Parser { this._ctx = localctx; _prevctx = localctx; - this.state = 235; + this.state = 239; this.constant(); } break; @@ -1170,7 +1173,7 @@ export default class esql_parser extends Parser { localctx = new DereferenceContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 236; + this.state = 240; this.qualifiedName(); } break; @@ -1179,7 +1182,7 @@ export default class esql_parser extends Parser { localctx = new FunctionContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 237; + this.state = 241; this.functionExpression(); } break; @@ -1188,17 +1191,17 @@ export default class esql_parser extends Parser { localctx = new ParenthesizedExpressionContext(this, localctx); this._ctx = localctx; _prevctx = localctx; - this.state = 238; + this.state = 242; this.match(esql_parser.LP); - this.state = 239; + this.state = 243; this.booleanExpression(0); - this.state = 240; + this.state = 244; this.match(esql_parser.RP); } break; } this._ctx.stop = this._input.LT(-1); - this.state = 249; + this.state = 253; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 17, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { @@ -1211,18 +1214,18 @@ export default class esql_parser extends Parser { { localctx = new InlineCastContext(this, new PrimaryExpressionContext(this, _parentctx, _parentState)); this.pushNewRecursionContext(localctx, _startState, esql_parser.RULE_primaryExpression); - this.state = 244; + this.state = 248; if (!(this.precpred(this._ctx, 1))) { throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); } - this.state = 245; + this.state = 249; this.match(esql_parser.CAST_OP); - this.state = 246; + this.state = 250; this.dataType(); } } } - this.state = 251; + this.state = 255; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 17, this._ctx); } @@ -1250,16 +1253,16 @@ export default class esql_parser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 252; + this.state = 256; this.identifier(); - this.state = 253; + this.state = 257; this.match(esql_parser.LP); - this.state = 263; + this.state = 267; this._errHandler.sync(this); switch (this._input.LA(1)) { case 65: { - this.state = 254; + this.state = 258; this.match(esql_parser.ASTERISK); } break; @@ -1280,21 +1283,21 @@ export default class esql_parser extends Parser { case 72: { { - this.state = 255; + this.state = 259; this.booleanExpression(0); - this.state = 260; + this.state = 264; this._errHandler.sync(this); _la = this._input.LA(1); while (_la===38) { { { - this.state = 256; + this.state = 260; this.match(esql_parser.COMMA); - this.state = 257; + this.state = 261; this.booleanExpression(0); } } - this.state = 262; + this.state = 266; this._errHandler.sync(this); _la = this._input.LA(1); } @@ -1306,7 +1309,7 @@ export default class esql_parser extends Parser { default: break; } - this.state = 265; + this.state = 269; this.match(esql_parser.RP); } } @@ -1332,7 +1335,7 @@ export default class esql_parser extends Parser { localctx = new ToDataTypeContext(this, localctx); this.enterOuterAlt(localctx, 1); { - this.state = 267; + this.state = 271; this.identifier(); } } @@ -1357,9 +1360,9 @@ export default class esql_parser extends Parser { try { this.enterOuterAlt(localctx, 1); { - this.state = 269; + this.state = 273; this.match(esql_parser.ROW); - this.state = 270; + this.state = 274; this.fields(); } } @@ -1385,23 +1388,23 @@ export default class esql_parser extends Parser { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 272; + this.state = 276; this.field(); - this.state = 277; + this.state = 281; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 20, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 273; + this.state = 277; this.match(esql_parser.COMMA); - this.state = 274; + this.state = 278; this.field(); } } } - this.state = 279; + this.state = 283; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 20, this._ctx); } @@ -1426,24 +1429,24 @@ export default class esql_parser extends Parser { let localctx: FieldContext = new FieldContext(this, this._ctx, this.state); this.enterRule(localctx, 28, esql_parser.RULE_field); try { - this.state = 285; + this.state = 289; this._errHandler.sync(this); switch ( this._interp.adaptivePredict(this._input, 21, this._ctx) ) { case 1: this.enterOuterAlt(localctx, 1); { - this.state = 280; + this.state = 284; this.booleanExpression(0); } break; case 2: this.enterOuterAlt(localctx, 2); { - this.state = 281; + this.state = 285; this.qualifiedName(); - this.state = 282; + this.state = 286; this.match(esql_parser.ASSIGN); - this.state = 283; + this.state = 287; this.booleanExpression(0); } break; @@ -1471,34 +1474,34 @@ export default class esql_parser extends Parser { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 287; + this.state = 291; this.match(esql_parser.FROM); - this.state = 288; - this.indexIdentifier(); - this.state = 293; + this.state = 292; + this.indexPattern(); + this.state = 297; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 22, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 289; + this.state = 293; this.match(esql_parser.COMMA); - this.state = 290; - this.indexIdentifier(); + this.state = 294; + this.indexPattern(); } } } - this.state = 295; + this.state = 299; this._errHandler.sync(this); _alt = this._interp.adaptivePredict(this._input, 22, this._ctx); } - this.state = 297; + this.state = 301; this._errHandler.sync(this); switch ( this._interp.adaptivePredict(this._input, 23, this._ctx) ) { case 1: { - this.state = 296; + this.state = 300; this.metadata(); } break; @@ -1520,14 +1523,89 @@ export default class esql_parser extends Parser { return localctx; } // @RuleVersion(0) - public indexIdentifier(): IndexIdentifierContext { - let localctx: IndexIdentifierContext = new IndexIdentifierContext(this, this._ctx, this.state); - this.enterRule(localctx, 32, esql_parser.RULE_indexIdentifier); + public indexPattern(): IndexPatternContext { + let localctx: IndexPatternContext = new IndexPatternContext(this, this._ctx, this.state); + this.enterRule(localctx, 32, esql_parser.RULE_indexPattern); + try { + this.state = 308; + this._errHandler.sync(this); + switch ( this._interp.adaptivePredict(this._input, 24, this._ctx) ) { + case 1: + this.enterOuterAlt(localctx, 1); + { + this.state = 303; + this.clusterString(); + this.state = 304; + this.match(esql_parser.COLON); + this.state = 305; + this.indexString(); + } + break; + case 2: + this.enterOuterAlt(localctx, 2); + { + this.state = 307; + this.indexString(); + } + break; + } + } + catch (re) { + if (re instanceof RecognitionException) { + localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localctx; + } + // @RuleVersion(0) + public clusterString(): ClusterStringContext { + let localctx: ClusterStringContext = new ClusterStringContext(this, this._ctx, this.state); + this.enterRule(localctx, 34, esql_parser.RULE_clusterString); try { this.enterOuterAlt(localctx, 1); { - this.state = 299; - this.match(esql_parser.INDEX_UNQUOTED_IDENTIFIER); + this.state = 310; + this.match(esql_parser.UNQUOTED_SOURCE); + } + } + catch (re) { + if (re instanceof RecognitionException) { + localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return localctx; + } + // @RuleVersion(0) + public indexString(): IndexStringContext { + let localctx: IndexStringContext = new IndexStringContext(this, this._ctx, this.state); + this.enterRule(localctx, 36, esql_parser.RULE_indexString); + let _la: number; + try { + this.enterOuterAlt(localctx, 1); + { + this.state = 312; + _la = this._input.LA(1); + if(!(_la===25 || _la===30)) { + this._errHandler.recoverInline(this); + } + else { + this._errHandler.reportMatch(this); + this.consume(); + } } } catch (re) { @@ -1547,22 +1625,22 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public metadata(): MetadataContext { let localctx: MetadataContext = new MetadataContext(this, this._ctx, this.state); - this.enterRule(localctx, 34, esql_parser.RULE_metadata); + this.enterRule(localctx, 38, esql_parser.RULE_metadata); try { - this.state = 303; + this.state = 316; this._errHandler.sync(this); switch (this._input.LA(1)) { case 76: this.enterOuterAlt(localctx, 1); { - this.state = 301; + this.state = 314; this.metadataOption(); } break; case 69: this.enterOuterAlt(localctx, 2); { - this.state = 302; + this.state = 315; this.deprecated_metadata(); } break; @@ -1587,32 +1665,32 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public metadataOption(): MetadataOptionContext { let localctx: MetadataOptionContext = new MetadataOptionContext(this, this._ctx, this.state); - this.enterRule(localctx, 36, esql_parser.RULE_metadataOption); + this.enterRule(localctx, 40, esql_parser.RULE_metadataOption); try { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 305; + this.state = 318; this.match(esql_parser.METADATA); - this.state = 306; - this.indexIdentifier(); - this.state = 311; + this.state = 319; + this.match(esql_parser.UNQUOTED_SOURCE); + this.state = 324; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 25, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 26, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 307; + this.state = 320; this.match(esql_parser.COMMA); - this.state = 308; - this.indexIdentifier(); + this.state = 321; + this.match(esql_parser.UNQUOTED_SOURCE); } } } - this.state = 313; + this.state = 326; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 25, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 26, this._ctx); } } } @@ -1633,15 +1711,15 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public deprecated_metadata(): Deprecated_metadataContext { let localctx: Deprecated_metadataContext = new Deprecated_metadataContext(this, this._ctx, this.state); - this.enterRule(localctx, 38, esql_parser.RULE_deprecated_metadata); + this.enterRule(localctx, 42, esql_parser.RULE_deprecated_metadata); try { this.enterOuterAlt(localctx, 1); { - this.state = 314; + this.state = 327; this.match(esql_parser.OPENING_BRACKET); - this.state = 315; + this.state = 328; this.metadataOption(); - this.state = 316; + this.state = 329; this.match(esql_parser.CLOSING_BRACKET); } } @@ -1662,51 +1740,51 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public metricsCommand(): MetricsCommandContext { let localctx: MetricsCommandContext = new MetricsCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 40, esql_parser.RULE_metricsCommand); + this.enterRule(localctx, 44, esql_parser.RULE_metricsCommand); try { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 318; + this.state = 331; this.match(esql_parser.METRICS); - this.state = 319; - this.indexIdentifier(); - this.state = 324; + this.state = 332; + this.indexPattern(); + this.state = 337; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 26, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 27, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 320; + this.state = 333; this.match(esql_parser.COMMA); - this.state = 321; - this.indexIdentifier(); + this.state = 334; + this.indexPattern(); } } } - this.state = 326; + this.state = 339; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 26, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 27, this._ctx); } - this.state = 328; + this.state = 341; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 27, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 28, this._ctx) ) { case 1: { - this.state = 327; + this.state = 340; localctx._aggregates = this.fields(); } break; } - this.state = 332; + this.state = 345; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 28, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 29, this._ctx) ) { case 1: { - this.state = 330; + this.state = 343; this.match(esql_parser.BY); - this.state = 331; + this.state = 344; localctx._grouping = this.fields(); } break; @@ -1730,13 +1808,13 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public evalCommand(): EvalCommandContext { let localctx: EvalCommandContext = new EvalCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 42, esql_parser.RULE_evalCommand); + this.enterRule(localctx, 46, esql_parser.RULE_evalCommand); try { this.enterOuterAlt(localctx, 1); { - this.state = 334; + this.state = 347; this.match(esql_parser.EVAL); - this.state = 335; + this.state = 348; this.fields(); } } @@ -1757,30 +1835,30 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public statsCommand(): StatsCommandContext { let localctx: StatsCommandContext = new StatsCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 44, esql_parser.RULE_statsCommand); + this.enterRule(localctx, 48, esql_parser.RULE_statsCommand); try { this.enterOuterAlt(localctx, 1); { - this.state = 337; + this.state = 350; this.match(esql_parser.STATS); - this.state = 339; + this.state = 352; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 29, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 30, this._ctx) ) { case 1: { - this.state = 338; + this.state = 351; localctx._stats = this.fields(); } break; } - this.state = 343; + this.state = 356; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 30, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 31, this._ctx) ) { case 1: { - this.state = 341; + this.state = 354; this.match(esql_parser.BY); - this.state = 342; + this.state = 355; localctx._grouping = this.fields(); } break; @@ -1804,22 +1882,22 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public inlinestatsCommand(): InlinestatsCommandContext { let localctx: InlinestatsCommandContext = new InlinestatsCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 46, esql_parser.RULE_inlinestatsCommand); + this.enterRule(localctx, 50, esql_parser.RULE_inlinestatsCommand); try { this.enterOuterAlt(localctx, 1); { - this.state = 345; + this.state = 358; this.match(esql_parser.INLINESTATS); - this.state = 346; + this.state = 359; localctx._stats = this.fields(); - this.state = 349; + this.state = 362; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 31, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 32, this._ctx) ) { case 1: { - this.state = 347; + this.state = 360; this.match(esql_parser.BY); - this.state = 348; + this.state = 361; localctx._grouping = this.fields(); } break; @@ -1843,30 +1921,30 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public qualifiedName(): QualifiedNameContext { let localctx: QualifiedNameContext = new QualifiedNameContext(this, this._ctx, this.state); - this.enterRule(localctx, 48, esql_parser.RULE_qualifiedName); + this.enterRule(localctx, 52, esql_parser.RULE_qualifiedName); try { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 351; + this.state = 364; this.identifier(); - this.state = 356; + this.state = 369; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 32, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 33, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 352; + this.state = 365; this.match(esql_parser.DOT); - this.state = 353; + this.state = 366; this.identifier(); } } } - this.state = 358; + this.state = 371; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 32, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 33, this._ctx); } } } @@ -1887,30 +1965,30 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public qualifiedNamePattern(): QualifiedNamePatternContext { let localctx: QualifiedNamePatternContext = new QualifiedNamePatternContext(this, this._ctx, this.state); - this.enterRule(localctx, 50, esql_parser.RULE_qualifiedNamePattern); + this.enterRule(localctx, 54, esql_parser.RULE_qualifiedNamePattern); try { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 359; + this.state = 372; this.identifierPattern(); - this.state = 364; + this.state = 377; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 33, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 34, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 360; + this.state = 373; this.match(esql_parser.DOT); - this.state = 361; + this.state = 374; this.identifierPattern(); } } } - this.state = 366; + this.state = 379; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 33, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 34, this._ctx); } } } @@ -1931,30 +2009,30 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public qualifiedNamePatterns(): QualifiedNamePatternsContext { let localctx: QualifiedNamePatternsContext = new QualifiedNamePatternsContext(this, this._ctx, this.state); - this.enterRule(localctx, 52, esql_parser.RULE_qualifiedNamePatterns); + this.enterRule(localctx, 56, esql_parser.RULE_qualifiedNamePatterns); try { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 367; + this.state = 380; this.qualifiedNamePattern(); - this.state = 372; + this.state = 385; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 34, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 35, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 368; + this.state = 381; this.match(esql_parser.COMMA); - this.state = 369; + this.state = 382; this.qualifiedNamePattern(); } } } - this.state = 374; + this.state = 387; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 34, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 35, this._ctx); } } } @@ -1975,12 +2053,12 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public identifier(): IdentifierContext { let localctx: IdentifierContext = new IdentifierContext(this, this._ctx, this.state); - this.enterRule(localctx, 54, esql_parser.RULE_identifier); + this.enterRule(localctx, 58, esql_parser.RULE_identifier); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 375; + this.state = 388; _la = this._input.LA(1); if(!(_la===71 || _la===72)) { this._errHandler.recoverInline(this); @@ -2008,11 +2086,11 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public identifierPattern(): IdentifierPatternContext { let localctx: IdentifierPatternContext = new IdentifierPatternContext(this, this._ctx, this.state); - this.enterRule(localctx, 56, esql_parser.RULE_identifierPattern); + this.enterRule(localctx, 60, esql_parser.RULE_identifierPattern); try { this.enterOuterAlt(localctx, 1); { - this.state = 377; + this.state = 390; this.match(esql_parser.ID_PATTERN); } } @@ -2033,17 +2111,17 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public constant(): ConstantContext { let localctx: ConstantContext = new ConstantContext(this, this._ctx, this.state); - this.enterRule(localctx, 58, esql_parser.RULE_constant); + this.enterRule(localctx, 62, esql_parser.RULE_constant); let _la: number; try { - this.state = 421; + this.state = 434; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 38, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 39, this._ctx) ) { case 1: localctx = new NullLiteralContext(this, localctx); this.enterOuterAlt(localctx, 1); { - this.state = 379; + this.state = 392; this.match(esql_parser.NULL); } break; @@ -2051,9 +2129,9 @@ export default class esql_parser extends Parser { localctx = new QualifiedIntegerLiteralContext(this, localctx); this.enterOuterAlt(localctx, 2); { - this.state = 380; + this.state = 393; this.integerValue(); - this.state = 381; + this.state = 394; this.match(esql_parser.UNQUOTED_IDENTIFIER); } break; @@ -2061,7 +2139,7 @@ export default class esql_parser extends Parser { localctx = new DecimalLiteralContext(this, localctx); this.enterOuterAlt(localctx, 3); { - this.state = 383; + this.state = 396; this.decimalValue(); } break; @@ -2069,7 +2147,7 @@ export default class esql_parser extends Parser { localctx = new IntegerLiteralContext(this, localctx); this.enterOuterAlt(localctx, 4); { - this.state = 384; + this.state = 397; this.integerValue(); } break; @@ -2077,7 +2155,7 @@ export default class esql_parser extends Parser { localctx = new BooleanLiteralContext(this, localctx); this.enterOuterAlt(localctx, 5); { - this.state = 385; + this.state = 398; this.booleanValue(); } break; @@ -2085,7 +2163,7 @@ export default class esql_parser extends Parser { localctx = new InputParamsContext(this, localctx); this.enterOuterAlt(localctx, 6); { - this.state = 386; + this.state = 399; this.params(); } break; @@ -2093,7 +2171,7 @@ export default class esql_parser extends Parser { localctx = new StringLiteralContext(this, localctx); this.enterOuterAlt(localctx, 7); { - this.state = 387; + this.state = 400; this.string_(); } break; @@ -2101,27 +2179,27 @@ export default class esql_parser extends Parser { localctx = new NumericArrayLiteralContext(this, localctx); this.enterOuterAlt(localctx, 8); { - this.state = 388; + this.state = 401; this.match(esql_parser.OPENING_BRACKET); - this.state = 389; + this.state = 402; this.numericValue(); - this.state = 394; + this.state = 407; this._errHandler.sync(this); _la = this._input.LA(1); while (_la===38) { { { - this.state = 390; + this.state = 403; this.match(esql_parser.COMMA); - this.state = 391; + this.state = 404; this.numericValue(); } } - this.state = 396; + this.state = 409; this._errHandler.sync(this); _la = this._input.LA(1); } - this.state = 397; + this.state = 410; this.match(esql_parser.CLOSING_BRACKET); } break; @@ -2129,27 +2207,27 @@ export default class esql_parser extends Parser { localctx = new BooleanArrayLiteralContext(this, localctx); this.enterOuterAlt(localctx, 9); { - this.state = 399; + this.state = 412; this.match(esql_parser.OPENING_BRACKET); - this.state = 400; + this.state = 413; this.booleanValue(); - this.state = 405; + this.state = 418; this._errHandler.sync(this); _la = this._input.LA(1); while (_la===38) { { { - this.state = 401; + this.state = 414; this.match(esql_parser.COMMA); - this.state = 402; + this.state = 415; this.booleanValue(); } } - this.state = 407; + this.state = 420; this._errHandler.sync(this); _la = this._input.LA(1); } - this.state = 408; + this.state = 421; this.match(esql_parser.CLOSING_BRACKET); } break; @@ -2157,27 +2235,27 @@ export default class esql_parser extends Parser { localctx = new StringArrayLiteralContext(this, localctx); this.enterOuterAlt(localctx, 10); { - this.state = 410; + this.state = 423; this.match(esql_parser.OPENING_BRACKET); - this.state = 411; + this.state = 424; this.string_(); - this.state = 416; + this.state = 429; this._errHandler.sync(this); _la = this._input.LA(1); while (_la===38) { { { - this.state = 412; + this.state = 425; this.match(esql_parser.COMMA); - this.state = 413; + this.state = 426; this.string_(); } } - this.state = 418; + this.state = 431; this._errHandler.sync(this); _la = this._input.LA(1); } - this.state = 419; + this.state = 432; this.match(esql_parser.CLOSING_BRACKET); } break; @@ -2200,16 +2278,16 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public params(): ParamsContext { let localctx: ParamsContext = new ParamsContext(this, this._ctx, this.state); - this.enterRule(localctx, 60, esql_parser.RULE_params); + this.enterRule(localctx, 64, esql_parser.RULE_params); try { - this.state = 425; + this.state = 438; this._errHandler.sync(this); switch (this._input.LA(1)) { case 52: localctx = new InputParamContext(this, localctx); this.enterOuterAlt(localctx, 1); { - this.state = 423; + this.state = 436; this.match(esql_parser.PARAM); } break; @@ -2217,7 +2295,7 @@ export default class esql_parser extends Parser { localctx = new InputNamedOrPositionalParamContext(this, localctx); this.enterOuterAlt(localctx, 2); { - this.state = 424; + this.state = 437; this.match(esql_parser.NAMED_OR_POSITIONAL_PARAM); } break; @@ -2242,13 +2320,13 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public limitCommand(): LimitCommandContext { let localctx: LimitCommandContext = new LimitCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 62, esql_parser.RULE_limitCommand); + this.enterRule(localctx, 66, esql_parser.RULE_limitCommand); try { this.enterOuterAlt(localctx, 1); { - this.state = 427; + this.state = 440; this.match(esql_parser.LIMIT); - this.state = 428; + this.state = 441; this.match(esql_parser.INTEGER_LITERAL); } } @@ -2269,32 +2347,32 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public sortCommand(): SortCommandContext { let localctx: SortCommandContext = new SortCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 64, esql_parser.RULE_sortCommand); + this.enterRule(localctx, 68, esql_parser.RULE_sortCommand); try { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 430; + this.state = 443; this.match(esql_parser.SORT); - this.state = 431; + this.state = 444; this.orderExpression(); - this.state = 436; + this.state = 449; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 40, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 41, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 432; + this.state = 445; this.match(esql_parser.COMMA); - this.state = 433; + this.state = 446; this.orderExpression(); } } } - this.state = 438; + this.state = 451; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 40, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 41, this._ctx); } } } @@ -2315,19 +2393,19 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public orderExpression(): OrderExpressionContext { let localctx: OrderExpressionContext = new OrderExpressionContext(this, this._ctx, this.state); - this.enterRule(localctx, 66, esql_parser.RULE_orderExpression); + this.enterRule(localctx, 70, esql_parser.RULE_orderExpression); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 439; + this.state = 452; this.booleanExpression(0); - this.state = 441; + this.state = 454; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 41, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 42, this._ctx) ) { case 1: { - this.state = 440; + this.state = 453; localctx._ordering = this._input.LT(1); _la = this._input.LA(1); if(!(_la===35 || _la===39)) { @@ -2340,14 +2418,14 @@ export default class esql_parser extends Parser { } break; } - this.state = 445; + this.state = 458; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 42, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 43, this._ctx) ) { case 1: { - this.state = 443; + this.state = 456; this.match(esql_parser.NULLS); - this.state = 444; + this.state = 457; localctx._nullOrdering = this._input.LT(1); _la = this._input.LA(1); if(!(_la===42 || _la===43)) { @@ -2379,13 +2457,13 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public keepCommand(): KeepCommandContext { let localctx: KeepCommandContext = new KeepCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 68, esql_parser.RULE_keepCommand); + this.enterRule(localctx, 72, esql_parser.RULE_keepCommand); try { this.enterOuterAlt(localctx, 1); { - this.state = 447; + this.state = 460; this.match(esql_parser.KEEP); - this.state = 448; + this.state = 461; this.qualifiedNamePatterns(); } } @@ -2406,13 +2484,13 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public dropCommand(): DropCommandContext { let localctx: DropCommandContext = new DropCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 70, esql_parser.RULE_dropCommand); + this.enterRule(localctx, 74, esql_parser.RULE_dropCommand); try { this.enterOuterAlt(localctx, 1); { - this.state = 450; + this.state = 463; this.match(esql_parser.DROP); - this.state = 451; + this.state = 464; this.qualifiedNamePatterns(); } } @@ -2433,32 +2511,32 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public renameCommand(): RenameCommandContext { let localctx: RenameCommandContext = new RenameCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 72, esql_parser.RULE_renameCommand); + this.enterRule(localctx, 76, esql_parser.RULE_renameCommand); try { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 453; + this.state = 466; this.match(esql_parser.RENAME); - this.state = 454; + this.state = 467; this.renameClause(); - this.state = 459; + this.state = 472; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 43, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 44, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 455; + this.state = 468; this.match(esql_parser.COMMA); - this.state = 456; + this.state = 469; this.renameClause(); } } } - this.state = 461; + this.state = 474; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 43, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 44, this._ctx); } } } @@ -2479,15 +2557,15 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public renameClause(): RenameClauseContext { let localctx: RenameClauseContext = new RenameClauseContext(this, this._ctx, this.state); - this.enterRule(localctx, 74, esql_parser.RULE_renameClause); + this.enterRule(localctx, 78, esql_parser.RULE_renameClause); try { this.enterOuterAlt(localctx, 1); { - this.state = 462; + this.state = 475; localctx._oldName = this.qualifiedNamePattern(); - this.state = 463; + this.state = 476; this.match(esql_parser.AS); - this.state = 464; + this.state = 477; localctx._newName = this.qualifiedNamePattern(); } } @@ -2508,22 +2586,22 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public dissectCommand(): DissectCommandContext { let localctx: DissectCommandContext = new DissectCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 76, esql_parser.RULE_dissectCommand); + this.enterRule(localctx, 80, esql_parser.RULE_dissectCommand); try { this.enterOuterAlt(localctx, 1); { - this.state = 466; + this.state = 479; this.match(esql_parser.DISSECT); - this.state = 467; + this.state = 480; this.primaryExpression(0); - this.state = 468; + this.state = 481; this.string_(); - this.state = 470; + this.state = 483; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 44, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 45, this._ctx) ) { case 1: { - this.state = 469; + this.state = 482; this.commandOptions(); } break; @@ -2547,15 +2625,15 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public grokCommand(): GrokCommandContext { let localctx: GrokCommandContext = new GrokCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 78, esql_parser.RULE_grokCommand); + this.enterRule(localctx, 82, esql_parser.RULE_grokCommand); try { this.enterOuterAlt(localctx, 1); { - this.state = 472; + this.state = 485; this.match(esql_parser.GROK); - this.state = 473; + this.state = 486; this.primaryExpression(0); - this.state = 474; + this.state = 487; this.string_(); } } @@ -2576,13 +2654,13 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public mvExpandCommand(): MvExpandCommandContext { let localctx: MvExpandCommandContext = new MvExpandCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 80, esql_parser.RULE_mvExpandCommand); + this.enterRule(localctx, 84, esql_parser.RULE_mvExpandCommand); try { this.enterOuterAlt(localctx, 1); { - this.state = 476; + this.state = 489; this.match(esql_parser.MV_EXPAND); - this.state = 477; + this.state = 490; this.qualifiedName(); } } @@ -2603,30 +2681,30 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public commandOptions(): CommandOptionsContext { let localctx: CommandOptionsContext = new CommandOptionsContext(this, this._ctx, this.state); - this.enterRule(localctx, 82, esql_parser.RULE_commandOptions); + this.enterRule(localctx, 86, esql_parser.RULE_commandOptions); try { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 479; + this.state = 492; this.commandOption(); - this.state = 484; + this.state = 497; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 45, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 46, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 480; + this.state = 493; this.match(esql_parser.COMMA); - this.state = 481; + this.state = 494; this.commandOption(); } } } - this.state = 486; + this.state = 499; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 45, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 46, this._ctx); } } } @@ -2647,15 +2725,15 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public commandOption(): CommandOptionContext { let localctx: CommandOptionContext = new CommandOptionContext(this, this._ctx, this.state); - this.enterRule(localctx, 84, esql_parser.RULE_commandOption); + this.enterRule(localctx, 88, esql_parser.RULE_commandOption); try { this.enterOuterAlt(localctx, 1); { - this.state = 487; + this.state = 500; this.identifier(); - this.state = 488; + this.state = 501; this.match(esql_parser.ASSIGN); - this.state = 489; + this.state = 502; this.constant(); } } @@ -2676,12 +2754,12 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public booleanValue(): BooleanValueContext { let localctx: BooleanValueContext = new BooleanValueContext(this, this._ctx, this.state); - this.enterRule(localctx, 86, esql_parser.RULE_booleanValue); + this.enterRule(localctx, 90, esql_parser.RULE_booleanValue); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 491; + this.state = 504; _la = this._input.LA(1); if(!(_la===41 || _la===55)) { this._errHandler.recoverInline(this); @@ -2709,22 +2787,22 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public numericValue(): NumericValueContext { let localctx: NumericValueContext = new NumericValueContext(this, this._ctx, this.state); - this.enterRule(localctx, 88, esql_parser.RULE_numericValue); + this.enterRule(localctx, 92, esql_parser.RULE_numericValue); try { - this.state = 495; + this.state = 508; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 46, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 47, this._ctx) ) { case 1: this.enterOuterAlt(localctx, 1); { - this.state = 493; + this.state = 506; this.decimalValue(); } break; case 2: this.enterOuterAlt(localctx, 2); { - this.state = 494; + this.state = 507; this.integerValue(); } break; @@ -2747,17 +2825,17 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public decimalValue(): DecimalValueContext { let localctx: DecimalValueContext = new DecimalValueContext(this, this._ctx, this.state); - this.enterRule(localctx, 90, esql_parser.RULE_decimalValue); + this.enterRule(localctx, 94, esql_parser.RULE_decimalValue); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 498; + this.state = 511; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===63 || _la===64) { { - this.state = 497; + this.state = 510; _la = this._input.LA(1); if(!(_la===63 || _la===64)) { this._errHandler.recoverInline(this); @@ -2769,7 +2847,7 @@ export default class esql_parser extends Parser { } } - this.state = 500; + this.state = 513; this.match(esql_parser.DECIMAL_LITERAL); } } @@ -2790,17 +2868,17 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public integerValue(): IntegerValueContext { let localctx: IntegerValueContext = new IntegerValueContext(this, this._ctx, this.state); - this.enterRule(localctx, 92, esql_parser.RULE_integerValue); + this.enterRule(localctx, 96, esql_parser.RULE_integerValue); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 503; + this.state = 516; this._errHandler.sync(this); _la = this._input.LA(1); if (_la===63 || _la===64) { { - this.state = 502; + this.state = 515; _la = this._input.LA(1); if(!(_la===63 || _la===64)) { this._errHandler.recoverInline(this); @@ -2812,7 +2890,7 @@ export default class esql_parser extends Parser { } } - this.state = 505; + this.state = 518; this.match(esql_parser.INTEGER_LITERAL); } } @@ -2833,11 +2911,11 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public string_(): StringContext { let localctx: StringContext = new StringContext(this, this._ctx, this.state); - this.enterRule(localctx, 94, esql_parser.RULE_string); + this.enterRule(localctx, 98, esql_parser.RULE_string); try { this.enterOuterAlt(localctx, 1); { - this.state = 507; + this.state = 520; this.match(esql_parser.QUOTED_STRING); } } @@ -2858,12 +2936,12 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public comparisonOperator(): ComparisonOperatorContext { let localctx: ComparisonOperatorContext = new ComparisonOperatorContext(this, this._ctx, this.state); - this.enterRule(localctx, 96, esql_parser.RULE_comparisonOperator); + this.enterRule(localctx, 100, esql_parser.RULE_comparisonOperator); let _la: number; try { this.enterOuterAlt(localctx, 1); { - this.state = 509; + this.state = 522; _la = this._input.LA(1); if(!(((((_la - 56)) & ~0x1F) === 0 && ((1 << (_la - 56)) & 125) !== 0))) { this._errHandler.recoverInline(this); @@ -2891,13 +2969,13 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public explainCommand(): ExplainCommandContext { let localctx: ExplainCommandContext = new ExplainCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 98, esql_parser.RULE_explainCommand); + this.enterRule(localctx, 102, esql_parser.RULE_explainCommand); try { this.enterOuterAlt(localctx, 1); { - this.state = 511; + this.state = 524; this.match(esql_parser.EXPLAIN); - this.state = 512; + this.state = 525; this.subqueryExpression(); } } @@ -2918,15 +2996,15 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public subqueryExpression(): SubqueryExpressionContext { let localctx: SubqueryExpressionContext = new SubqueryExpressionContext(this, this._ctx, this.state); - this.enterRule(localctx, 100, esql_parser.RULE_subqueryExpression); + this.enterRule(localctx, 104, esql_parser.RULE_subqueryExpression); try { this.enterOuterAlt(localctx, 1); { - this.state = 514; + this.state = 527; this.match(esql_parser.OPENING_BRACKET); - this.state = 515; + this.state = 528; this.query(0); - this.state = 516; + this.state = 529; this.match(esql_parser.CLOSING_BRACKET); } } @@ -2947,14 +3025,14 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public showCommand(): ShowCommandContext { let localctx: ShowCommandContext = new ShowCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 102, esql_parser.RULE_showCommand); + this.enterRule(localctx, 106, esql_parser.RULE_showCommand); try { localctx = new ShowInfoContext(this, localctx); this.enterOuterAlt(localctx, 1); { - this.state = 518; + this.state = 531; this.match(esql_parser.SHOW); - this.state = 519; + this.state = 532; this.match(esql_parser.INFO); } } @@ -2975,14 +3053,14 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public metaCommand(): MetaCommandContext { let localctx: MetaCommandContext = new MetaCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 104, esql_parser.RULE_metaCommand); + this.enterRule(localctx, 108, esql_parser.RULE_metaCommand); try { localctx = new MetaFunctionsContext(this, localctx); this.enterOuterAlt(localctx, 1); { - this.state = 521; + this.state = 534; this.match(esql_parser.META); - this.state = 522; + this.state = 535; this.match(esql_parser.FUNCTIONS); } } @@ -3003,53 +3081,53 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public enrichCommand(): EnrichCommandContext { let localctx: EnrichCommandContext = new EnrichCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 106, esql_parser.RULE_enrichCommand); + this.enterRule(localctx, 110, esql_parser.RULE_enrichCommand); try { let _alt: number; this.enterOuterAlt(localctx, 1); { - this.state = 524; + this.state = 537; this.match(esql_parser.ENRICH); - this.state = 525; + this.state = 538; localctx._policyName = this.match(esql_parser.ENRICH_POLICY_NAME); - this.state = 528; + this.state = 541; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 49, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 50, this._ctx) ) { case 1: { - this.state = 526; + this.state = 539; this.match(esql_parser.ON); - this.state = 527; + this.state = 540; localctx._matchField = this.qualifiedNamePattern(); } break; } - this.state = 539; + this.state = 552; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 51, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 52, this._ctx) ) { case 1: { - this.state = 530; + this.state = 543; this.match(esql_parser.WITH); - this.state = 531; + this.state = 544; this.enrichWithClause(); - this.state = 536; + this.state = 549; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 50, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 51, this._ctx); while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { - this.state = 532; + this.state = 545; this.match(esql_parser.COMMA); - this.state = 533; + this.state = 546; this.enrichWithClause(); } } } - this.state = 538; + this.state = 551; this._errHandler.sync(this); - _alt = this._interp.adaptivePredict(this._input, 50, this._ctx); + _alt = this._interp.adaptivePredict(this._input, 51, this._ctx); } } break; @@ -3073,23 +3151,23 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public enrichWithClause(): EnrichWithClauseContext { let localctx: EnrichWithClauseContext = new EnrichWithClauseContext(this, this._ctx, this.state); - this.enterRule(localctx, 108, esql_parser.RULE_enrichWithClause); + this.enterRule(localctx, 112, esql_parser.RULE_enrichWithClause); try { this.enterOuterAlt(localctx, 1); { - this.state = 544; + this.state = 557; this._errHandler.sync(this); - switch ( this._interp.adaptivePredict(this._input, 52, this._ctx) ) { + switch ( this._interp.adaptivePredict(this._input, 53, this._ctx) ) { case 1: { - this.state = 541; + this.state = 554; localctx._newName = this.qualifiedNamePattern(); - this.state = 542; + this.state = 555; this.match(esql_parser.ASSIGN); } break; } - this.state = 546; + this.state = 559; localctx._enrichField = this.qualifiedNamePattern(); } } @@ -3110,17 +3188,17 @@ export default class esql_parser extends Parser { // @RuleVersion(0) public lookupCommand(): LookupCommandContext { let localctx: LookupCommandContext = new LookupCommandContext(this, this._ctx, this.state); - this.enterRule(localctx, 110, esql_parser.RULE_lookupCommand); + this.enterRule(localctx, 114, esql_parser.RULE_lookupCommand); try { this.enterOuterAlt(localctx, 1); { - this.state = 548; + this.state = 561; this.match(esql_parser.LOOKUP); - this.state = 549; - localctx._tableName = this.match(esql_parser.INDEX_UNQUOTED_IDENTIFIER); - this.state = 550; + this.state = 562; + localctx._tableName = this.indexPattern(); + this.state = 563; this.match(esql_parser.ON); - this.state = 551; + this.state = 564; localctx._matchFields = this.qualifiedNamePatterns(); } } @@ -3185,7 +3263,7 @@ export default class esql_parser extends Parser { return true; } - public static readonly _serializedATN: number[] = [4,1,124,554,2,0,7,0, + public static readonly _serializedATN: number[] = [4,1,124,567,2,0,7,0, 2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9, 2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2, 17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24, @@ -3193,179 +3271,183 @@ export default class esql_parser extends Parser { 31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38, 2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2, 46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,7,52,2,53, - 7,53,2,54,7,54,2,55,7,55,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,5,1,122,8, - 1,10,1,12,1,125,9,1,1,2,1,2,1,2,1,2,1,2,1,2,3,2,133,8,2,1,3,1,3,1,3,1,3, - 1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,3,3,149,8,3,1,4,1,4,1,4,1,5,1,5, - 1,5,1,5,1,5,1,5,1,5,3,5,161,8,5,1,5,1,5,1,5,1,5,1,5,5,5,168,8,5,10,5,12, - 5,171,9,5,1,5,1,5,1,5,1,5,1,5,3,5,178,8,5,1,5,1,5,3,5,182,8,5,1,5,1,5,1, - 5,1,5,1,5,1,5,5,5,190,8,5,10,5,12,5,193,9,5,1,6,1,6,3,6,197,8,6,1,6,1,6, - 1,6,1,6,1,6,3,6,204,8,6,1,6,1,6,1,6,3,6,209,8,6,1,7,1,7,1,7,1,7,1,7,3,7, - 216,8,7,1,8,1,8,1,8,1,8,3,8,222,8,8,1,8,1,8,1,8,1,8,1,8,1,8,5,8,230,8,8, - 10,8,12,8,233,9,8,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,3,9,243,8,9,1,9,1,9,1, - 9,5,9,248,8,9,10,9,12,9,251,9,9,1,10,1,10,1,10,1,10,1,10,1,10,5,10,259, - 8,10,10,10,12,10,262,9,10,3,10,264,8,10,1,10,1,10,1,11,1,11,1,12,1,12,1, - 12,1,13,1,13,1,13,5,13,276,8,13,10,13,12,13,279,9,13,1,14,1,14,1,14,1,14, - 1,14,3,14,286,8,14,1,15,1,15,1,15,1,15,5,15,292,8,15,10,15,12,15,295,9, - 15,1,15,3,15,298,8,15,1,16,1,16,1,17,1,17,3,17,304,8,17,1,18,1,18,1,18, - 1,18,5,18,310,8,18,10,18,12,18,313,9,18,1,19,1,19,1,19,1,19,1,20,1,20,1, - 20,1,20,5,20,323,8,20,10,20,12,20,326,9,20,1,20,3,20,329,8,20,1,20,1,20, - 3,20,333,8,20,1,21,1,21,1,21,1,22,1,22,3,22,340,8,22,1,22,1,22,3,22,344, - 8,22,1,23,1,23,1,23,1,23,3,23,350,8,23,1,24,1,24,1,24,5,24,355,8,24,10, - 24,12,24,358,9,24,1,25,1,25,1,25,5,25,363,8,25,10,25,12,25,366,9,25,1,26, - 1,26,1,26,5,26,371,8,26,10,26,12,26,374,9,26,1,27,1,27,1,28,1,28,1,29,1, - 29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,5,29,393,8,29, - 10,29,12,29,396,9,29,1,29,1,29,1,29,1,29,1,29,1,29,5,29,404,8,29,10,29, - 12,29,407,9,29,1,29,1,29,1,29,1,29,1,29,1,29,5,29,415,8,29,10,29,12,29, - 418,9,29,1,29,1,29,3,29,422,8,29,1,30,1,30,3,30,426,8,30,1,31,1,31,1,31, - 1,32,1,32,1,32,1,32,5,32,435,8,32,10,32,12,32,438,9,32,1,33,1,33,3,33,442, - 8,33,1,33,1,33,3,33,446,8,33,1,34,1,34,1,34,1,35,1,35,1,35,1,36,1,36,1, - 36,1,36,5,36,458,8,36,10,36,12,36,461,9,36,1,37,1,37,1,37,1,37,1,38,1,38, - 1,38,1,38,3,38,471,8,38,1,39,1,39,1,39,1,39,1,40,1,40,1,40,1,41,1,41,1, - 41,5,41,483,8,41,10,41,12,41,486,9,41,1,42,1,42,1,42,1,42,1,43,1,43,1,44, - 1,44,3,44,496,8,44,1,45,3,45,499,8,45,1,45,1,45,1,46,3,46,504,8,46,1,46, - 1,46,1,47,1,47,1,48,1,48,1,49,1,49,1,49,1,50,1,50,1,50,1,50,1,51,1,51,1, - 51,1,52,1,52,1,52,1,53,1,53,1,53,1,53,3,53,529,8,53,1,53,1,53,1,53,1,53, - 5,53,535,8,53,10,53,12,53,538,9,53,3,53,540,8,53,1,54,1,54,1,54,3,54,545, - 8,54,1,54,1,54,1,55,1,55,1,55,1,55,1,55,1,55,0,4,2,10,16,18,56,0,2,4,6, - 8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54, - 56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102, - 104,106,108,110,0,7,1,0,63,64,1,0,65,67,1,0,71,72,2,0,35,35,39,39,1,0,42, - 43,2,0,41,41,55,55,2,0,56,56,58,62,580,0,112,1,0,0,0,2,115,1,0,0,0,4,132, - 1,0,0,0,6,148,1,0,0,0,8,150,1,0,0,0,10,181,1,0,0,0,12,208,1,0,0,0,14,215, - 1,0,0,0,16,221,1,0,0,0,18,242,1,0,0,0,20,252,1,0,0,0,22,267,1,0,0,0,24, - 269,1,0,0,0,26,272,1,0,0,0,28,285,1,0,0,0,30,287,1,0,0,0,32,299,1,0,0,0, - 34,303,1,0,0,0,36,305,1,0,0,0,38,314,1,0,0,0,40,318,1,0,0,0,42,334,1,0, - 0,0,44,337,1,0,0,0,46,345,1,0,0,0,48,351,1,0,0,0,50,359,1,0,0,0,52,367, - 1,0,0,0,54,375,1,0,0,0,56,377,1,0,0,0,58,421,1,0,0,0,60,425,1,0,0,0,62, - 427,1,0,0,0,64,430,1,0,0,0,66,439,1,0,0,0,68,447,1,0,0,0,70,450,1,0,0,0, - 72,453,1,0,0,0,74,462,1,0,0,0,76,466,1,0,0,0,78,472,1,0,0,0,80,476,1,0, - 0,0,82,479,1,0,0,0,84,487,1,0,0,0,86,491,1,0,0,0,88,495,1,0,0,0,90,498, - 1,0,0,0,92,503,1,0,0,0,94,507,1,0,0,0,96,509,1,0,0,0,98,511,1,0,0,0,100, - 514,1,0,0,0,102,518,1,0,0,0,104,521,1,0,0,0,106,524,1,0,0,0,108,544,1,0, - 0,0,110,548,1,0,0,0,112,113,3,2,1,0,113,114,5,0,0,1,114,1,1,0,0,0,115,116, - 6,1,-1,0,116,117,3,4,2,0,117,123,1,0,0,0,118,119,10,1,0,0,119,120,5,29, - 0,0,120,122,3,6,3,0,121,118,1,0,0,0,122,125,1,0,0,0,123,121,1,0,0,0,123, - 124,1,0,0,0,124,3,1,0,0,0,125,123,1,0,0,0,126,133,3,98,49,0,127,133,3,30, - 15,0,128,133,3,24,12,0,129,133,3,40,20,0,130,133,3,102,51,0,131,133,3,104, - 52,0,132,126,1,0,0,0,132,127,1,0,0,0,132,128,1,0,0,0,132,129,1,0,0,0,132, - 130,1,0,0,0,132,131,1,0,0,0,133,5,1,0,0,0,134,149,3,42,21,0,135,149,3,46, - 23,0,136,149,3,62,31,0,137,149,3,110,55,0,138,149,3,68,34,0,139,149,3,64, - 32,0,140,149,3,44,22,0,141,149,3,8,4,0,142,149,3,70,35,0,143,149,3,72,36, - 0,144,149,3,76,38,0,145,149,3,78,39,0,146,149,3,106,53,0,147,149,3,80,40, - 0,148,134,1,0,0,0,148,135,1,0,0,0,148,136,1,0,0,0,148,137,1,0,0,0,148,138, - 1,0,0,0,148,139,1,0,0,0,148,140,1,0,0,0,148,141,1,0,0,0,148,142,1,0,0,0, - 148,143,1,0,0,0,148,144,1,0,0,0,148,145,1,0,0,0,148,146,1,0,0,0,148,147, - 1,0,0,0,149,7,1,0,0,0,150,151,5,20,0,0,151,152,3,10,5,0,152,9,1,0,0,0,153, - 154,6,5,-1,0,154,155,5,48,0,0,155,182,3,10,5,7,156,182,3,14,7,0,157,182, - 3,12,6,0,158,160,3,14,7,0,159,161,5,48,0,0,160,159,1,0,0,0,160,161,1,0, - 0,0,161,162,1,0,0,0,162,163,5,45,0,0,163,164,5,44,0,0,164,169,3,14,7,0, - 165,166,5,38,0,0,166,168,3,14,7,0,167,165,1,0,0,0,168,171,1,0,0,0,169,167, - 1,0,0,0,169,170,1,0,0,0,170,172,1,0,0,0,171,169,1,0,0,0,172,173,5,54,0, - 0,173,182,1,0,0,0,174,175,3,14,7,0,175,177,5,46,0,0,176,178,5,48,0,0,177, - 176,1,0,0,0,177,178,1,0,0,0,178,179,1,0,0,0,179,180,5,49,0,0,180,182,1, - 0,0,0,181,153,1,0,0,0,181,156,1,0,0,0,181,157,1,0,0,0,181,158,1,0,0,0,181, - 174,1,0,0,0,182,191,1,0,0,0,183,184,10,4,0,0,184,185,5,34,0,0,185,190,3, - 10,5,5,186,187,10,3,0,0,187,188,5,51,0,0,188,190,3,10,5,4,189,183,1,0,0, - 0,189,186,1,0,0,0,190,193,1,0,0,0,191,189,1,0,0,0,191,192,1,0,0,0,192,11, - 1,0,0,0,193,191,1,0,0,0,194,196,3,14,7,0,195,197,5,48,0,0,196,195,1,0,0, - 0,196,197,1,0,0,0,197,198,1,0,0,0,198,199,5,47,0,0,199,200,3,94,47,0,200, - 209,1,0,0,0,201,203,3,14,7,0,202,204,5,48,0,0,203,202,1,0,0,0,203,204,1, - 0,0,0,204,205,1,0,0,0,205,206,5,53,0,0,206,207,3,94,47,0,207,209,1,0,0, - 0,208,194,1,0,0,0,208,201,1,0,0,0,209,13,1,0,0,0,210,216,3,16,8,0,211,212, - 3,16,8,0,212,213,3,96,48,0,213,214,3,16,8,0,214,216,1,0,0,0,215,210,1,0, - 0,0,215,211,1,0,0,0,216,15,1,0,0,0,217,218,6,8,-1,0,218,222,3,18,9,0,219, - 220,7,0,0,0,220,222,3,16,8,3,221,217,1,0,0,0,221,219,1,0,0,0,222,231,1, - 0,0,0,223,224,10,2,0,0,224,225,7,1,0,0,225,230,3,16,8,3,226,227,10,1,0, - 0,227,228,7,0,0,0,228,230,3,16,8,2,229,223,1,0,0,0,229,226,1,0,0,0,230, - 233,1,0,0,0,231,229,1,0,0,0,231,232,1,0,0,0,232,17,1,0,0,0,233,231,1,0, - 0,0,234,235,6,9,-1,0,235,243,3,58,29,0,236,243,3,48,24,0,237,243,3,20,10, - 0,238,239,5,44,0,0,239,240,3,10,5,0,240,241,5,54,0,0,241,243,1,0,0,0,242, - 234,1,0,0,0,242,236,1,0,0,0,242,237,1,0,0,0,242,238,1,0,0,0,243,249,1,0, - 0,0,244,245,10,1,0,0,245,246,5,37,0,0,246,248,3,22,11,0,247,244,1,0,0,0, - 248,251,1,0,0,0,249,247,1,0,0,0,249,250,1,0,0,0,250,19,1,0,0,0,251,249, - 1,0,0,0,252,253,3,54,27,0,253,263,5,44,0,0,254,264,5,65,0,0,255,260,3,10, - 5,0,256,257,5,38,0,0,257,259,3,10,5,0,258,256,1,0,0,0,259,262,1,0,0,0,260, - 258,1,0,0,0,260,261,1,0,0,0,261,264,1,0,0,0,262,260,1,0,0,0,263,254,1,0, - 0,0,263,255,1,0,0,0,263,264,1,0,0,0,264,265,1,0,0,0,265,266,5,54,0,0,266, - 21,1,0,0,0,267,268,3,54,27,0,268,23,1,0,0,0,269,270,5,16,0,0,270,271,3, - 26,13,0,271,25,1,0,0,0,272,277,3,28,14,0,273,274,5,38,0,0,274,276,3,28, - 14,0,275,273,1,0,0,0,276,279,1,0,0,0,277,275,1,0,0,0,277,278,1,0,0,0,278, - 27,1,0,0,0,279,277,1,0,0,0,280,286,3,10,5,0,281,282,3,48,24,0,282,283,5, - 36,0,0,283,284,3,10,5,0,284,286,1,0,0,0,285,280,1,0,0,0,285,281,1,0,0,0, - 286,29,1,0,0,0,287,288,5,6,0,0,288,293,3,32,16,0,289,290,5,38,0,0,290,292, - 3,32,16,0,291,289,1,0,0,0,292,295,1,0,0,0,293,291,1,0,0,0,293,294,1,0,0, - 0,294,297,1,0,0,0,295,293,1,0,0,0,296,298,3,34,17,0,297,296,1,0,0,0,297, - 298,1,0,0,0,298,31,1,0,0,0,299,300,5,25,0,0,300,33,1,0,0,0,301,304,3,36, - 18,0,302,304,3,38,19,0,303,301,1,0,0,0,303,302,1,0,0,0,304,35,1,0,0,0,305, - 306,5,76,0,0,306,311,3,32,16,0,307,308,5,38,0,0,308,310,3,32,16,0,309,307, - 1,0,0,0,310,313,1,0,0,0,311,309,1,0,0,0,311,312,1,0,0,0,312,37,1,0,0,0, - 313,311,1,0,0,0,314,315,5,69,0,0,315,316,3,36,18,0,316,317,5,70,0,0,317, - 39,1,0,0,0,318,319,5,13,0,0,319,324,3,32,16,0,320,321,5,38,0,0,321,323, - 3,32,16,0,322,320,1,0,0,0,323,326,1,0,0,0,324,322,1,0,0,0,324,325,1,0,0, - 0,325,328,1,0,0,0,326,324,1,0,0,0,327,329,3,26,13,0,328,327,1,0,0,0,328, - 329,1,0,0,0,329,332,1,0,0,0,330,331,5,33,0,0,331,333,3,26,13,0,332,330, - 1,0,0,0,332,333,1,0,0,0,333,41,1,0,0,0,334,335,5,4,0,0,335,336,3,26,13, - 0,336,43,1,0,0,0,337,339,5,19,0,0,338,340,3,26,13,0,339,338,1,0,0,0,339, - 340,1,0,0,0,340,343,1,0,0,0,341,342,5,33,0,0,342,344,3,26,13,0,343,341, - 1,0,0,0,343,344,1,0,0,0,344,45,1,0,0,0,345,346,5,8,0,0,346,349,3,26,13, - 0,347,348,5,33,0,0,348,350,3,26,13,0,349,347,1,0,0,0,349,350,1,0,0,0,350, - 47,1,0,0,0,351,356,3,54,27,0,352,353,5,40,0,0,353,355,3,54,27,0,354,352, - 1,0,0,0,355,358,1,0,0,0,356,354,1,0,0,0,356,357,1,0,0,0,357,49,1,0,0,0, - 358,356,1,0,0,0,359,364,3,56,28,0,360,361,5,40,0,0,361,363,3,56,28,0,362, - 360,1,0,0,0,363,366,1,0,0,0,364,362,1,0,0,0,364,365,1,0,0,0,365,51,1,0, - 0,0,366,364,1,0,0,0,367,372,3,50,25,0,368,369,5,38,0,0,369,371,3,50,25, - 0,370,368,1,0,0,0,371,374,1,0,0,0,372,370,1,0,0,0,372,373,1,0,0,0,373,53, - 1,0,0,0,374,372,1,0,0,0,375,376,7,2,0,0,376,55,1,0,0,0,377,378,5,80,0,0, - 378,57,1,0,0,0,379,422,5,49,0,0,380,381,3,92,46,0,381,382,5,71,0,0,382, - 422,1,0,0,0,383,422,3,90,45,0,384,422,3,92,46,0,385,422,3,86,43,0,386,422, - 3,60,30,0,387,422,3,94,47,0,388,389,5,69,0,0,389,394,3,88,44,0,390,391, - 5,38,0,0,391,393,3,88,44,0,392,390,1,0,0,0,393,396,1,0,0,0,394,392,1,0, - 0,0,394,395,1,0,0,0,395,397,1,0,0,0,396,394,1,0,0,0,397,398,5,70,0,0,398, - 422,1,0,0,0,399,400,5,69,0,0,400,405,3,86,43,0,401,402,5,38,0,0,402,404, - 3,86,43,0,403,401,1,0,0,0,404,407,1,0,0,0,405,403,1,0,0,0,405,406,1,0,0, - 0,406,408,1,0,0,0,407,405,1,0,0,0,408,409,5,70,0,0,409,422,1,0,0,0,410, - 411,5,69,0,0,411,416,3,94,47,0,412,413,5,38,0,0,413,415,3,94,47,0,414,412, - 1,0,0,0,415,418,1,0,0,0,416,414,1,0,0,0,416,417,1,0,0,0,417,419,1,0,0,0, - 418,416,1,0,0,0,419,420,5,70,0,0,420,422,1,0,0,0,421,379,1,0,0,0,421,380, - 1,0,0,0,421,383,1,0,0,0,421,384,1,0,0,0,421,385,1,0,0,0,421,386,1,0,0,0, - 421,387,1,0,0,0,421,388,1,0,0,0,421,399,1,0,0,0,421,410,1,0,0,0,422,59, - 1,0,0,0,423,426,5,52,0,0,424,426,5,68,0,0,425,423,1,0,0,0,425,424,1,0,0, - 0,426,61,1,0,0,0,427,428,5,10,0,0,428,429,5,31,0,0,429,63,1,0,0,0,430,431, - 5,18,0,0,431,436,3,66,33,0,432,433,5,38,0,0,433,435,3,66,33,0,434,432,1, - 0,0,0,435,438,1,0,0,0,436,434,1,0,0,0,436,437,1,0,0,0,437,65,1,0,0,0,438, - 436,1,0,0,0,439,441,3,10,5,0,440,442,7,3,0,0,441,440,1,0,0,0,441,442,1, - 0,0,0,442,445,1,0,0,0,443,444,5,50,0,0,444,446,7,4,0,0,445,443,1,0,0,0, - 445,446,1,0,0,0,446,67,1,0,0,0,447,448,5,9,0,0,448,449,3,52,26,0,449,69, - 1,0,0,0,450,451,5,2,0,0,451,452,3,52,26,0,452,71,1,0,0,0,453,454,5,15,0, - 0,454,459,3,74,37,0,455,456,5,38,0,0,456,458,3,74,37,0,457,455,1,0,0,0, - 458,461,1,0,0,0,459,457,1,0,0,0,459,460,1,0,0,0,460,73,1,0,0,0,461,459, - 1,0,0,0,462,463,3,50,25,0,463,464,5,84,0,0,464,465,3,50,25,0,465,75,1,0, - 0,0,466,467,5,1,0,0,467,468,3,18,9,0,468,470,3,94,47,0,469,471,3,82,41, - 0,470,469,1,0,0,0,470,471,1,0,0,0,471,77,1,0,0,0,472,473,5,7,0,0,473,474, - 3,18,9,0,474,475,3,94,47,0,475,79,1,0,0,0,476,477,5,14,0,0,477,478,3,48, - 24,0,478,81,1,0,0,0,479,484,3,84,42,0,480,481,5,38,0,0,481,483,3,84,42, - 0,482,480,1,0,0,0,483,486,1,0,0,0,484,482,1,0,0,0,484,485,1,0,0,0,485,83, - 1,0,0,0,486,484,1,0,0,0,487,488,3,54,27,0,488,489,5,36,0,0,489,490,3,58, - 29,0,490,85,1,0,0,0,491,492,7,5,0,0,492,87,1,0,0,0,493,496,3,90,45,0,494, - 496,3,92,46,0,495,493,1,0,0,0,495,494,1,0,0,0,496,89,1,0,0,0,497,499,7, - 0,0,0,498,497,1,0,0,0,498,499,1,0,0,0,499,500,1,0,0,0,500,501,5,32,0,0, - 501,91,1,0,0,0,502,504,7,0,0,0,503,502,1,0,0,0,503,504,1,0,0,0,504,505, - 1,0,0,0,505,506,5,31,0,0,506,93,1,0,0,0,507,508,5,30,0,0,508,95,1,0,0,0, - 509,510,7,6,0,0,510,97,1,0,0,0,511,512,5,5,0,0,512,513,3,100,50,0,513,99, - 1,0,0,0,514,515,5,69,0,0,515,516,3,2,1,0,516,517,5,70,0,0,517,101,1,0,0, - 0,518,519,5,17,0,0,519,520,5,106,0,0,520,103,1,0,0,0,521,522,5,12,0,0,522, - 523,5,110,0,0,523,105,1,0,0,0,524,525,5,3,0,0,525,528,5,90,0,0,526,527, - 5,88,0,0,527,529,3,50,25,0,528,526,1,0,0,0,528,529,1,0,0,0,529,539,1,0, - 0,0,530,531,5,89,0,0,531,536,3,108,54,0,532,533,5,38,0,0,533,535,3,108, - 54,0,534,532,1,0,0,0,535,538,1,0,0,0,536,534,1,0,0,0,536,537,1,0,0,0,537, - 540,1,0,0,0,538,536,1,0,0,0,539,530,1,0,0,0,539,540,1,0,0,0,540,107,1,0, - 0,0,541,542,3,50,25,0,542,543,5,36,0,0,543,545,1,0,0,0,544,541,1,0,0,0, - 544,545,1,0,0,0,545,546,1,0,0,0,546,547,3,50,25,0,547,109,1,0,0,0,548,549, - 5,11,0,0,549,550,5,25,0,0,550,551,5,88,0,0,551,552,3,52,26,0,552,111,1, - 0,0,0,53,123,132,148,160,169,177,181,189,191,196,203,208,215,221,229,231, - 242,249,260,263,277,285,293,297,303,311,324,328,332,339,343,349,356,364, - 372,394,405,416,421,425,436,441,445,459,470,484,495,498,503,528,536,539, - 544]; + 7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,1,0,1,0,1,0,1,1,1,1,1,1,1, + 1,1,1,1,1,5,1,126,8,1,10,1,12,1,129,9,1,1,2,1,2,1,2,1,2,1,2,1,2,3,2,137, + 8,2,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,3,3,153,8,3, + 1,4,1,4,1,4,1,5,1,5,1,5,1,5,1,5,1,5,1,5,3,5,165,8,5,1,5,1,5,1,5,1,5,1,5, + 5,5,172,8,5,10,5,12,5,175,9,5,1,5,1,5,1,5,1,5,1,5,3,5,182,8,5,1,5,1,5,3, + 5,186,8,5,1,5,1,5,1,5,1,5,1,5,1,5,5,5,194,8,5,10,5,12,5,197,9,5,1,6,1,6, + 3,6,201,8,6,1,6,1,6,1,6,1,6,1,6,3,6,208,8,6,1,6,1,6,1,6,3,6,213,8,6,1,7, + 1,7,1,7,1,7,1,7,3,7,220,8,7,1,8,1,8,1,8,1,8,3,8,226,8,8,1,8,1,8,1,8,1,8, + 1,8,1,8,5,8,234,8,8,10,8,12,8,237,9,8,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,3, + 9,247,8,9,1,9,1,9,1,9,5,9,252,8,9,10,9,12,9,255,9,9,1,10,1,10,1,10,1,10, + 1,10,1,10,5,10,263,8,10,10,10,12,10,266,9,10,3,10,268,8,10,1,10,1,10,1, + 11,1,11,1,12,1,12,1,12,1,13,1,13,1,13,5,13,280,8,13,10,13,12,13,283,9,13, + 1,14,1,14,1,14,1,14,1,14,3,14,290,8,14,1,15,1,15,1,15,1,15,5,15,296,8,15, + 10,15,12,15,299,9,15,1,15,3,15,302,8,15,1,16,1,16,1,16,1,16,1,16,3,16,309, + 8,16,1,17,1,17,1,18,1,18,1,19,1,19,3,19,317,8,19,1,20,1,20,1,20,1,20,5, + 20,323,8,20,10,20,12,20,326,9,20,1,21,1,21,1,21,1,21,1,22,1,22,1,22,1,22, + 5,22,336,8,22,10,22,12,22,339,9,22,1,22,3,22,342,8,22,1,22,1,22,3,22,346, + 8,22,1,23,1,23,1,23,1,24,1,24,3,24,353,8,24,1,24,1,24,3,24,357,8,24,1,25, + 1,25,1,25,1,25,3,25,363,8,25,1,26,1,26,1,26,5,26,368,8,26,10,26,12,26,371, + 9,26,1,27,1,27,1,27,5,27,376,8,27,10,27,12,27,379,9,27,1,28,1,28,1,28,5, + 28,384,8,28,10,28,12,28,387,9,28,1,29,1,29,1,30,1,30,1,31,1,31,1,31,1,31, + 1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,5,31,406,8,31,10,31,12,31, + 409,9,31,1,31,1,31,1,31,1,31,1,31,1,31,5,31,417,8,31,10,31,12,31,420,9, + 31,1,31,1,31,1,31,1,31,1,31,1,31,5,31,428,8,31,10,31,12,31,431,9,31,1,31, + 1,31,3,31,435,8,31,1,32,1,32,3,32,439,8,32,1,33,1,33,1,33,1,34,1,34,1,34, + 1,34,5,34,448,8,34,10,34,12,34,451,9,34,1,35,1,35,3,35,455,8,35,1,35,1, + 35,3,35,459,8,35,1,36,1,36,1,36,1,37,1,37,1,37,1,38,1,38,1,38,1,38,5,38, + 471,8,38,10,38,12,38,474,9,38,1,39,1,39,1,39,1,39,1,40,1,40,1,40,1,40,3, + 40,484,8,40,1,41,1,41,1,41,1,41,1,42,1,42,1,42,1,43,1,43,1,43,5,43,496, + 8,43,10,43,12,43,499,9,43,1,44,1,44,1,44,1,44,1,45,1,45,1,46,1,46,3,46, + 509,8,46,1,47,3,47,512,8,47,1,47,1,47,1,48,3,48,517,8,48,1,48,1,48,1,49, + 1,49,1,50,1,50,1,51,1,51,1,51,1,52,1,52,1,52,1,52,1,53,1,53,1,53,1,54,1, + 54,1,54,1,55,1,55,1,55,1,55,3,55,542,8,55,1,55,1,55,1,55,1,55,5,55,548, + 8,55,10,55,12,55,551,9,55,3,55,553,8,55,1,56,1,56,1,56,3,56,558,8,56,1, + 56,1,56,1,57,1,57,1,57,1,57,1,57,1,57,0,4,2,10,16,18,58,0,2,4,6,8,10,12, + 14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60, + 62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106, + 108,110,112,114,0,8,1,0,63,64,1,0,65,67,2,0,25,25,30,30,1,0,71,72,2,0,35, + 35,39,39,1,0,42,43,2,0,41,41,55,55,2,0,56,56,58,62,592,0,116,1,0,0,0,2, + 119,1,0,0,0,4,136,1,0,0,0,6,152,1,0,0,0,8,154,1,0,0,0,10,185,1,0,0,0,12, + 212,1,0,0,0,14,219,1,0,0,0,16,225,1,0,0,0,18,246,1,0,0,0,20,256,1,0,0,0, + 22,271,1,0,0,0,24,273,1,0,0,0,26,276,1,0,0,0,28,289,1,0,0,0,30,291,1,0, + 0,0,32,308,1,0,0,0,34,310,1,0,0,0,36,312,1,0,0,0,38,316,1,0,0,0,40,318, + 1,0,0,0,42,327,1,0,0,0,44,331,1,0,0,0,46,347,1,0,0,0,48,350,1,0,0,0,50, + 358,1,0,0,0,52,364,1,0,0,0,54,372,1,0,0,0,56,380,1,0,0,0,58,388,1,0,0,0, + 60,390,1,0,0,0,62,434,1,0,0,0,64,438,1,0,0,0,66,440,1,0,0,0,68,443,1,0, + 0,0,70,452,1,0,0,0,72,460,1,0,0,0,74,463,1,0,0,0,76,466,1,0,0,0,78,475, + 1,0,0,0,80,479,1,0,0,0,82,485,1,0,0,0,84,489,1,0,0,0,86,492,1,0,0,0,88, + 500,1,0,0,0,90,504,1,0,0,0,92,508,1,0,0,0,94,511,1,0,0,0,96,516,1,0,0,0, + 98,520,1,0,0,0,100,522,1,0,0,0,102,524,1,0,0,0,104,527,1,0,0,0,106,531, + 1,0,0,0,108,534,1,0,0,0,110,537,1,0,0,0,112,557,1,0,0,0,114,561,1,0,0,0, + 116,117,3,2,1,0,117,118,5,0,0,1,118,1,1,0,0,0,119,120,6,1,-1,0,120,121, + 3,4,2,0,121,127,1,0,0,0,122,123,10,1,0,0,123,124,5,29,0,0,124,126,3,6,3, + 0,125,122,1,0,0,0,126,129,1,0,0,0,127,125,1,0,0,0,127,128,1,0,0,0,128,3, + 1,0,0,0,129,127,1,0,0,0,130,137,3,102,51,0,131,137,3,30,15,0,132,137,3, + 24,12,0,133,137,3,44,22,0,134,137,3,106,53,0,135,137,3,108,54,0,136,130, + 1,0,0,0,136,131,1,0,0,0,136,132,1,0,0,0,136,133,1,0,0,0,136,134,1,0,0,0, + 136,135,1,0,0,0,137,5,1,0,0,0,138,153,3,46,23,0,139,153,3,50,25,0,140,153, + 3,66,33,0,141,153,3,114,57,0,142,153,3,72,36,0,143,153,3,68,34,0,144,153, + 3,48,24,0,145,153,3,8,4,0,146,153,3,74,37,0,147,153,3,76,38,0,148,153,3, + 80,40,0,149,153,3,82,41,0,150,153,3,110,55,0,151,153,3,84,42,0,152,138, + 1,0,0,0,152,139,1,0,0,0,152,140,1,0,0,0,152,141,1,0,0,0,152,142,1,0,0,0, + 152,143,1,0,0,0,152,144,1,0,0,0,152,145,1,0,0,0,152,146,1,0,0,0,152,147, + 1,0,0,0,152,148,1,0,0,0,152,149,1,0,0,0,152,150,1,0,0,0,152,151,1,0,0,0, + 153,7,1,0,0,0,154,155,5,20,0,0,155,156,3,10,5,0,156,9,1,0,0,0,157,158,6, + 5,-1,0,158,159,5,48,0,0,159,186,3,10,5,7,160,186,3,14,7,0,161,186,3,12, + 6,0,162,164,3,14,7,0,163,165,5,48,0,0,164,163,1,0,0,0,164,165,1,0,0,0,165, + 166,1,0,0,0,166,167,5,45,0,0,167,168,5,44,0,0,168,173,3,14,7,0,169,170, + 5,38,0,0,170,172,3,14,7,0,171,169,1,0,0,0,172,175,1,0,0,0,173,171,1,0,0, + 0,173,174,1,0,0,0,174,176,1,0,0,0,175,173,1,0,0,0,176,177,5,54,0,0,177, + 186,1,0,0,0,178,179,3,14,7,0,179,181,5,46,0,0,180,182,5,48,0,0,181,180, + 1,0,0,0,181,182,1,0,0,0,182,183,1,0,0,0,183,184,5,49,0,0,184,186,1,0,0, + 0,185,157,1,0,0,0,185,160,1,0,0,0,185,161,1,0,0,0,185,162,1,0,0,0,185,178, + 1,0,0,0,186,195,1,0,0,0,187,188,10,4,0,0,188,189,5,34,0,0,189,194,3,10, + 5,5,190,191,10,3,0,0,191,192,5,51,0,0,192,194,3,10,5,4,193,187,1,0,0,0, + 193,190,1,0,0,0,194,197,1,0,0,0,195,193,1,0,0,0,195,196,1,0,0,0,196,11, + 1,0,0,0,197,195,1,0,0,0,198,200,3,14,7,0,199,201,5,48,0,0,200,199,1,0,0, + 0,200,201,1,0,0,0,201,202,1,0,0,0,202,203,5,47,0,0,203,204,3,98,49,0,204, + 213,1,0,0,0,205,207,3,14,7,0,206,208,5,48,0,0,207,206,1,0,0,0,207,208,1, + 0,0,0,208,209,1,0,0,0,209,210,5,53,0,0,210,211,3,98,49,0,211,213,1,0,0, + 0,212,198,1,0,0,0,212,205,1,0,0,0,213,13,1,0,0,0,214,220,3,16,8,0,215,216, + 3,16,8,0,216,217,3,100,50,0,217,218,3,16,8,0,218,220,1,0,0,0,219,214,1, + 0,0,0,219,215,1,0,0,0,220,15,1,0,0,0,221,222,6,8,-1,0,222,226,3,18,9,0, + 223,224,7,0,0,0,224,226,3,16,8,3,225,221,1,0,0,0,225,223,1,0,0,0,226,235, + 1,0,0,0,227,228,10,2,0,0,228,229,7,1,0,0,229,234,3,16,8,3,230,231,10,1, + 0,0,231,232,7,0,0,0,232,234,3,16,8,2,233,227,1,0,0,0,233,230,1,0,0,0,234, + 237,1,0,0,0,235,233,1,0,0,0,235,236,1,0,0,0,236,17,1,0,0,0,237,235,1,0, + 0,0,238,239,6,9,-1,0,239,247,3,62,31,0,240,247,3,52,26,0,241,247,3,20,10, + 0,242,243,5,44,0,0,243,244,3,10,5,0,244,245,5,54,0,0,245,247,1,0,0,0,246, + 238,1,0,0,0,246,240,1,0,0,0,246,241,1,0,0,0,246,242,1,0,0,0,247,253,1,0, + 0,0,248,249,10,1,0,0,249,250,5,37,0,0,250,252,3,22,11,0,251,248,1,0,0,0, + 252,255,1,0,0,0,253,251,1,0,0,0,253,254,1,0,0,0,254,19,1,0,0,0,255,253, + 1,0,0,0,256,257,3,58,29,0,257,267,5,44,0,0,258,268,5,65,0,0,259,264,3,10, + 5,0,260,261,5,38,0,0,261,263,3,10,5,0,262,260,1,0,0,0,263,266,1,0,0,0,264, + 262,1,0,0,0,264,265,1,0,0,0,265,268,1,0,0,0,266,264,1,0,0,0,267,258,1,0, + 0,0,267,259,1,0,0,0,267,268,1,0,0,0,268,269,1,0,0,0,269,270,5,54,0,0,270, + 21,1,0,0,0,271,272,3,58,29,0,272,23,1,0,0,0,273,274,5,16,0,0,274,275,3, + 26,13,0,275,25,1,0,0,0,276,281,3,28,14,0,277,278,5,38,0,0,278,280,3,28, + 14,0,279,277,1,0,0,0,280,283,1,0,0,0,281,279,1,0,0,0,281,282,1,0,0,0,282, + 27,1,0,0,0,283,281,1,0,0,0,284,290,3,10,5,0,285,286,3,52,26,0,286,287,5, + 36,0,0,287,288,3,10,5,0,288,290,1,0,0,0,289,284,1,0,0,0,289,285,1,0,0,0, + 290,29,1,0,0,0,291,292,5,6,0,0,292,297,3,32,16,0,293,294,5,38,0,0,294,296, + 3,32,16,0,295,293,1,0,0,0,296,299,1,0,0,0,297,295,1,0,0,0,297,298,1,0,0, + 0,298,301,1,0,0,0,299,297,1,0,0,0,300,302,3,38,19,0,301,300,1,0,0,0,301, + 302,1,0,0,0,302,31,1,0,0,0,303,304,3,34,17,0,304,305,5,114,0,0,305,306, + 3,36,18,0,306,309,1,0,0,0,307,309,3,36,18,0,308,303,1,0,0,0,308,307,1,0, + 0,0,309,33,1,0,0,0,310,311,5,25,0,0,311,35,1,0,0,0,312,313,7,2,0,0,313, + 37,1,0,0,0,314,317,3,40,20,0,315,317,3,42,21,0,316,314,1,0,0,0,316,315, + 1,0,0,0,317,39,1,0,0,0,318,319,5,76,0,0,319,324,5,25,0,0,320,321,5,38,0, + 0,321,323,5,25,0,0,322,320,1,0,0,0,323,326,1,0,0,0,324,322,1,0,0,0,324, + 325,1,0,0,0,325,41,1,0,0,0,326,324,1,0,0,0,327,328,5,69,0,0,328,329,3,40, + 20,0,329,330,5,70,0,0,330,43,1,0,0,0,331,332,5,13,0,0,332,337,3,32,16,0, + 333,334,5,38,0,0,334,336,3,32,16,0,335,333,1,0,0,0,336,339,1,0,0,0,337, + 335,1,0,0,0,337,338,1,0,0,0,338,341,1,0,0,0,339,337,1,0,0,0,340,342,3,26, + 13,0,341,340,1,0,0,0,341,342,1,0,0,0,342,345,1,0,0,0,343,344,5,33,0,0,344, + 346,3,26,13,0,345,343,1,0,0,0,345,346,1,0,0,0,346,45,1,0,0,0,347,348,5, + 4,0,0,348,349,3,26,13,0,349,47,1,0,0,0,350,352,5,19,0,0,351,353,3,26,13, + 0,352,351,1,0,0,0,352,353,1,0,0,0,353,356,1,0,0,0,354,355,5,33,0,0,355, + 357,3,26,13,0,356,354,1,0,0,0,356,357,1,0,0,0,357,49,1,0,0,0,358,359,5, + 8,0,0,359,362,3,26,13,0,360,361,5,33,0,0,361,363,3,26,13,0,362,360,1,0, + 0,0,362,363,1,0,0,0,363,51,1,0,0,0,364,369,3,58,29,0,365,366,5,40,0,0,366, + 368,3,58,29,0,367,365,1,0,0,0,368,371,1,0,0,0,369,367,1,0,0,0,369,370,1, + 0,0,0,370,53,1,0,0,0,371,369,1,0,0,0,372,377,3,60,30,0,373,374,5,40,0,0, + 374,376,3,60,30,0,375,373,1,0,0,0,376,379,1,0,0,0,377,375,1,0,0,0,377,378, + 1,0,0,0,378,55,1,0,0,0,379,377,1,0,0,0,380,385,3,54,27,0,381,382,5,38,0, + 0,382,384,3,54,27,0,383,381,1,0,0,0,384,387,1,0,0,0,385,383,1,0,0,0,385, + 386,1,0,0,0,386,57,1,0,0,0,387,385,1,0,0,0,388,389,7,3,0,0,389,59,1,0,0, + 0,390,391,5,80,0,0,391,61,1,0,0,0,392,435,5,49,0,0,393,394,3,96,48,0,394, + 395,5,71,0,0,395,435,1,0,0,0,396,435,3,94,47,0,397,435,3,96,48,0,398,435, + 3,90,45,0,399,435,3,64,32,0,400,435,3,98,49,0,401,402,5,69,0,0,402,407, + 3,92,46,0,403,404,5,38,0,0,404,406,3,92,46,0,405,403,1,0,0,0,406,409,1, + 0,0,0,407,405,1,0,0,0,407,408,1,0,0,0,408,410,1,0,0,0,409,407,1,0,0,0,410, + 411,5,70,0,0,411,435,1,0,0,0,412,413,5,69,0,0,413,418,3,90,45,0,414,415, + 5,38,0,0,415,417,3,90,45,0,416,414,1,0,0,0,417,420,1,0,0,0,418,416,1,0, + 0,0,418,419,1,0,0,0,419,421,1,0,0,0,420,418,1,0,0,0,421,422,5,70,0,0,422, + 435,1,0,0,0,423,424,5,69,0,0,424,429,3,98,49,0,425,426,5,38,0,0,426,428, + 3,98,49,0,427,425,1,0,0,0,428,431,1,0,0,0,429,427,1,0,0,0,429,430,1,0,0, + 0,430,432,1,0,0,0,431,429,1,0,0,0,432,433,5,70,0,0,433,435,1,0,0,0,434, + 392,1,0,0,0,434,393,1,0,0,0,434,396,1,0,0,0,434,397,1,0,0,0,434,398,1,0, + 0,0,434,399,1,0,0,0,434,400,1,0,0,0,434,401,1,0,0,0,434,412,1,0,0,0,434, + 423,1,0,0,0,435,63,1,0,0,0,436,439,5,52,0,0,437,439,5,68,0,0,438,436,1, + 0,0,0,438,437,1,0,0,0,439,65,1,0,0,0,440,441,5,10,0,0,441,442,5,31,0,0, + 442,67,1,0,0,0,443,444,5,18,0,0,444,449,3,70,35,0,445,446,5,38,0,0,446, + 448,3,70,35,0,447,445,1,0,0,0,448,451,1,0,0,0,449,447,1,0,0,0,449,450,1, + 0,0,0,450,69,1,0,0,0,451,449,1,0,0,0,452,454,3,10,5,0,453,455,7,4,0,0,454, + 453,1,0,0,0,454,455,1,0,0,0,455,458,1,0,0,0,456,457,5,50,0,0,457,459,7, + 5,0,0,458,456,1,0,0,0,458,459,1,0,0,0,459,71,1,0,0,0,460,461,5,9,0,0,461, + 462,3,56,28,0,462,73,1,0,0,0,463,464,5,2,0,0,464,465,3,56,28,0,465,75,1, + 0,0,0,466,467,5,15,0,0,467,472,3,78,39,0,468,469,5,38,0,0,469,471,3,78, + 39,0,470,468,1,0,0,0,471,474,1,0,0,0,472,470,1,0,0,0,472,473,1,0,0,0,473, + 77,1,0,0,0,474,472,1,0,0,0,475,476,3,54,27,0,476,477,5,84,0,0,477,478,3, + 54,27,0,478,79,1,0,0,0,479,480,5,1,0,0,480,481,3,18,9,0,481,483,3,98,49, + 0,482,484,3,86,43,0,483,482,1,0,0,0,483,484,1,0,0,0,484,81,1,0,0,0,485, + 486,5,7,0,0,486,487,3,18,9,0,487,488,3,98,49,0,488,83,1,0,0,0,489,490,5, + 14,0,0,490,491,3,52,26,0,491,85,1,0,0,0,492,497,3,88,44,0,493,494,5,38, + 0,0,494,496,3,88,44,0,495,493,1,0,0,0,496,499,1,0,0,0,497,495,1,0,0,0,497, + 498,1,0,0,0,498,87,1,0,0,0,499,497,1,0,0,0,500,501,3,58,29,0,501,502,5, + 36,0,0,502,503,3,62,31,0,503,89,1,0,0,0,504,505,7,6,0,0,505,91,1,0,0,0, + 506,509,3,94,47,0,507,509,3,96,48,0,508,506,1,0,0,0,508,507,1,0,0,0,509, + 93,1,0,0,0,510,512,7,0,0,0,511,510,1,0,0,0,511,512,1,0,0,0,512,513,1,0, + 0,0,513,514,5,32,0,0,514,95,1,0,0,0,515,517,7,0,0,0,516,515,1,0,0,0,516, + 517,1,0,0,0,517,518,1,0,0,0,518,519,5,31,0,0,519,97,1,0,0,0,520,521,5,30, + 0,0,521,99,1,0,0,0,522,523,7,7,0,0,523,101,1,0,0,0,524,525,5,5,0,0,525, + 526,3,104,52,0,526,103,1,0,0,0,527,528,5,69,0,0,528,529,3,2,1,0,529,530, + 5,70,0,0,530,105,1,0,0,0,531,532,5,17,0,0,532,533,5,106,0,0,533,107,1,0, + 0,0,534,535,5,12,0,0,535,536,5,110,0,0,536,109,1,0,0,0,537,538,5,3,0,0, + 538,541,5,90,0,0,539,540,5,88,0,0,540,542,3,54,27,0,541,539,1,0,0,0,541, + 542,1,0,0,0,542,552,1,0,0,0,543,544,5,89,0,0,544,549,3,112,56,0,545,546, + 5,38,0,0,546,548,3,112,56,0,547,545,1,0,0,0,548,551,1,0,0,0,549,547,1,0, + 0,0,549,550,1,0,0,0,550,553,1,0,0,0,551,549,1,0,0,0,552,543,1,0,0,0,552, + 553,1,0,0,0,553,111,1,0,0,0,554,555,3,54,27,0,555,556,5,36,0,0,556,558, + 1,0,0,0,557,554,1,0,0,0,557,558,1,0,0,0,558,559,1,0,0,0,559,560,3,54,27, + 0,560,113,1,0,0,0,561,562,5,11,0,0,562,563,3,32,16,0,563,564,5,88,0,0,564, + 565,3,56,28,0,565,115,1,0,0,0,54,127,136,152,164,173,181,185,193,195,200, + 207,212,219,225,233,235,246,253,264,267,281,289,297,301,308,316,324,337, + 341,345,352,356,362,369,377,385,407,418,429,434,438,449,454,458,472,483, + 497,508,511,516,541,549,552,557]; private static __ATN: ATN; public static get _ATN(): ATN { @@ -4262,11 +4344,11 @@ export class FromCommandContext extends ParserRuleContext { public FROM(): TerminalNode { return this.getToken(esql_parser.FROM, 0); } - public indexIdentifier_list(): IndexIdentifierContext[] { - return this.getTypedRuleContexts(IndexIdentifierContext) as IndexIdentifierContext[]; + public indexPattern_list(): IndexPatternContext[] { + return this.getTypedRuleContexts(IndexPatternContext) as IndexPatternContext[]; } - public indexIdentifier(i: number): IndexIdentifierContext { - return this.getTypedRuleContext(IndexIdentifierContext, i) as IndexIdentifierContext; + public indexPattern(i: number): IndexPatternContext { + return this.getTypedRuleContext(IndexPatternContext, i) as IndexPatternContext; } public COMMA_list(): TerminalNode[] { return this.getTokens(esql_parser.COMMA); @@ -4293,25 +4375,82 @@ export class FromCommandContext extends ParserRuleContext { } -export class IndexIdentifierContext extends ParserRuleContext { +export class IndexPatternContext extends ParserRuleContext { constructor(parser?: esql_parser, parent?: ParserRuleContext, invokingState?: number) { super(parent, invokingState); this.parser = parser; } - public INDEX_UNQUOTED_IDENTIFIER(): TerminalNode { - return this.getToken(esql_parser.INDEX_UNQUOTED_IDENTIFIER, 0); + public clusterString(): ClusterStringContext { + return this.getTypedRuleContext(ClusterStringContext, 0) as ClusterStringContext; + } + public COLON(): TerminalNode { + return this.getToken(esql_parser.COLON, 0); + } + public indexString(): IndexStringContext { + return this.getTypedRuleContext(IndexStringContext, 0) as IndexStringContext; } public get ruleIndex(): number { - return esql_parser.RULE_indexIdentifier; + return esql_parser.RULE_indexPattern; } public enterRule(listener: esql_parserListener): void { - if(listener.enterIndexIdentifier) { - listener.enterIndexIdentifier(this); + if(listener.enterIndexPattern) { + listener.enterIndexPattern(this); } } public exitRule(listener: esql_parserListener): void { - if(listener.exitIndexIdentifier) { - listener.exitIndexIdentifier(this); + if(listener.exitIndexPattern) { + listener.exitIndexPattern(this); + } + } +} + + +export class ClusterStringContext extends ParserRuleContext { + constructor(parser?: esql_parser, parent?: ParserRuleContext, invokingState?: number) { + super(parent, invokingState); + this.parser = parser; + } + public UNQUOTED_SOURCE(): TerminalNode { + return this.getToken(esql_parser.UNQUOTED_SOURCE, 0); + } + public get ruleIndex(): number { + return esql_parser.RULE_clusterString; + } + public enterRule(listener: esql_parserListener): void { + if(listener.enterClusterString) { + listener.enterClusterString(this); + } + } + public exitRule(listener: esql_parserListener): void { + if(listener.exitClusterString) { + listener.exitClusterString(this); + } + } +} + + +export class IndexStringContext extends ParserRuleContext { + constructor(parser?: esql_parser, parent?: ParserRuleContext, invokingState?: number) { + super(parent, invokingState); + this.parser = parser; + } + public UNQUOTED_SOURCE(): TerminalNode { + return this.getToken(esql_parser.UNQUOTED_SOURCE, 0); + } + public QUOTED_STRING(): TerminalNode { + return this.getToken(esql_parser.QUOTED_STRING, 0); + } + public get ruleIndex(): number { + return esql_parser.RULE_indexString; + } + public enterRule(listener: esql_parserListener): void { + if(listener.enterIndexString) { + listener.enterIndexString(this); + } + } + public exitRule(listener: esql_parserListener): void { + if(listener.exitIndexString) { + listener.exitIndexString(this); } } } @@ -4352,11 +4491,11 @@ export class MetadataOptionContext extends ParserRuleContext { public METADATA(): TerminalNode { return this.getToken(esql_parser.METADATA, 0); } - public indexIdentifier_list(): IndexIdentifierContext[] { - return this.getTypedRuleContexts(IndexIdentifierContext) as IndexIdentifierContext[]; + public UNQUOTED_SOURCE_list(): TerminalNode[] { + return this.getTokens(esql_parser.UNQUOTED_SOURCE); } - public indexIdentifier(i: number): IndexIdentifierContext { - return this.getTypedRuleContext(IndexIdentifierContext, i) as IndexIdentifierContext; + public UNQUOTED_SOURCE(i: number): TerminalNode { + return this.getToken(esql_parser.UNQUOTED_SOURCE, i); } public COMMA_list(): TerminalNode[] { return this.getTokens(esql_parser.COMMA); @@ -4364,7 +4503,7 @@ export class MetadataOptionContext extends ParserRuleContext { public COMMA(i: number): TerminalNode { return this.getToken(esql_parser.COMMA, i); } - public get ruleIndex(): number { + public get ruleIndex(): number { return esql_parser.RULE_metadataOption; } public enterRule(listener: esql_parserListener): void { @@ -4420,11 +4559,11 @@ export class MetricsCommandContext extends ParserRuleContext { public METRICS(): TerminalNode { return this.getToken(esql_parser.METRICS, 0); } - public indexIdentifier_list(): IndexIdentifierContext[] { - return this.getTypedRuleContexts(IndexIdentifierContext) as IndexIdentifierContext[]; + public indexPattern_list(): IndexPatternContext[] { + return this.getTypedRuleContexts(IndexPatternContext) as IndexPatternContext[]; } - public indexIdentifier(i: number): IndexIdentifierContext { - return this.getTypedRuleContext(IndexIdentifierContext, i) as IndexIdentifierContext; + public indexPattern(i: number): IndexPatternContext { + return this.getTypedRuleContext(IndexPatternContext, i) as IndexPatternContext; } public COMMA_list(): TerminalNode[] { return this.getTokens(esql_parser.COMMA); @@ -5776,7 +5915,7 @@ export class EnrichWithClauseContext extends ParserRuleContext { export class LookupCommandContext extends ParserRuleContext { - public _tableName!: Token; + public _tableName!: IndexPatternContext; public _matchFields!: QualifiedNamePatternsContext; constructor(parser?: esql_parser, parent?: ParserRuleContext, invokingState?: number) { super(parent, invokingState); @@ -5788,8 +5927,8 @@ export class LookupCommandContext extends ParserRuleContext { public ON(): TerminalNode { return this.getToken(esql_parser.ON, 0); } - public INDEX_UNQUOTED_IDENTIFIER(): TerminalNode { - return this.getToken(esql_parser.INDEX_UNQUOTED_IDENTIFIER, 0); + public indexPattern(): IndexPatternContext { + return this.getTypedRuleContext(IndexPatternContext, 0) as IndexPatternContext; } public qualifiedNamePatterns(): QualifiedNamePatternsContext { return this.getTypedRuleContext(QualifiedNamePatternsContext, 0) as QualifiedNamePatternsContext; diff --git a/packages/kbn-esql-ast/src/antlr/esql_parser_listener.ts b/packages/kbn-esql-ast/src/antlr/esql_parser_listener.ts index eee7a421a1593..e6a28c8d71828 100644 --- a/packages/kbn-esql-ast/src/antlr/esql_parser_listener.ts +++ b/packages/kbn-esql-ast/src/antlr/esql_parser_listener.ts @@ -33,7 +33,9 @@ import { RowCommandContext } from "./esql_parser"; import { FieldsContext } from "./esql_parser"; import { FieldContext } from "./esql_parser"; import { FromCommandContext } from "./esql_parser"; -import { IndexIdentifierContext } from "./esql_parser"; +import { IndexPatternContext } from "./esql_parser"; +import { ClusterStringContext } from "./esql_parser"; +import { IndexStringContext } from "./esql_parser"; import { MetadataContext } from "./esql_parser"; import { MetadataOptionContext } from "./esql_parser"; import { Deprecated_metadataContext } from "./esql_parser"; @@ -419,15 +421,35 @@ export default class esql_parserListener extends ParseTreeListener { */ exitFromCommand?: (ctx: FromCommandContext) => void; /** - * Enter a parse tree produced by `esql_parser.indexIdentifier`. + * Enter a parse tree produced by `esql_parser.indexPattern`. * @param ctx the parse tree */ - enterIndexIdentifier?: (ctx: IndexIdentifierContext) => void; + enterIndexPattern?: (ctx: IndexPatternContext) => void; /** - * Exit a parse tree produced by `esql_parser.indexIdentifier`. + * Exit a parse tree produced by `esql_parser.indexPattern`. * @param ctx the parse tree */ - exitIndexIdentifier?: (ctx: IndexIdentifierContext) => void; + exitIndexPattern?: (ctx: IndexPatternContext) => void; + /** + * Enter a parse tree produced by `esql_parser.clusterString`. + * @param ctx the parse tree + */ + enterClusterString?: (ctx: ClusterStringContext) => void; + /** + * Exit a parse tree produced by `esql_parser.clusterString`. + * @param ctx the parse tree + */ + exitClusterString?: (ctx: ClusterStringContext) => void; + /** + * Enter a parse tree produced by `esql_parser.indexString`. + * @param ctx the parse tree + */ + enterIndexString?: (ctx: IndexStringContext) => void; + /** + * Exit a parse tree produced by `esql_parser.indexString`. + * @param ctx the parse tree + */ + exitIndexString?: (ctx: IndexStringContext) => void; /** * Enter a parse tree produced by `esql_parser.metadata`. * @param ctx the parse tree diff --git a/packages/kbn-esql-ast/src/ast_factory.ts b/packages/kbn-esql-ast/src/ast_factory.ts index 9d76ff3a7cd4d..18c2a3c7ecbec 100644 --- a/packages/kbn-esql-ast/src/ast_factory.ts +++ b/packages/kbn-esql-ast/src/ast_factory.ts @@ -29,7 +29,7 @@ import { default as esql_parser, type MetaCommandContext, type MetricsCommandContext, - IndexIdentifierContext, + IndexPatternContext, } from './antlr/esql_parser'; import { default as ESQLParserListener } from './antlr/esql_parser_listener'; import { @@ -154,7 +154,7 @@ export class AstListener implements ESQLParserListener { type: 'command', args: [], sources: ctx - .getTypedRuleContexts(IndexIdentifierContext) + .getTypedRuleContexts(IndexPatternContext) .map((sourceCtx) => createSource(sourceCtx)), }; this.ast.push(node); diff --git a/packages/kbn-esql-ast/src/ast_helpers.ts b/packages/kbn-esql-ast/src/ast_helpers.ts index 76e130f233807..f3c5ad0b0df18 100644 --- a/packages/kbn-esql-ast/src/ast_helpers.ts +++ b/packages/kbn-esql-ast/src/ast_helpers.ts @@ -275,12 +275,24 @@ function safeBackticksRemoval(text: string | undefined) { return text?.replace(TICKS_REGEX, '').replace(DOUBLE_TICKS_REGEX, SINGLE_BACKTICK) || ''; } +function sanitizeSourceString(ctx: ParserRuleContext) { + const contextText = ctx.getText(); + // If wrapped by triple quote, remove + if (contextText.startsWith(`"""`) && contextText.endsWith(`"""`)) { + return contextText.replace(/\"\"\"/g, ''); + } + // If wrapped by single quote, remove + if (contextText.startsWith(`"`) && contextText.endsWith(`"`)) { + return contextText.slice(1, -1); + } + return contextText; +} + export function sanitizeIdentifierString(ctx: ParserRuleContext) { const result = getUnquotedText(ctx)?.getText() || safeBackticksRemoval(getQuotedText(ctx)?.getText()) || safeBackticksRemoval(ctx.getText()); // for some reason some quoted text is not detected correctly by the parser - // TODO - understand why is now returned as the match text for the FROM command return result === '' ? '' : result; } @@ -321,7 +333,7 @@ export function createSource( ctx: ParserRuleContext, type: 'index' | 'policy' = 'index' ): ESQLSource { - const text = sanitizeIdentifierString(ctx); + const text = sanitizeSourceString(ctx); return { type: 'source', name: text, diff --git a/packages/kbn-esql-ast/src/ast_walker.ts b/packages/kbn-esql-ast/src/ast_walker.ts index 870301b938a65..33aa91f66a2a6 100644 --- a/packages/kbn-esql-ast/src/ast_walker.ts +++ b/packages/kbn-esql-ast/src/ast_walker.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { type ParserRuleContext } from 'antlr4'; +import { ParserRuleContext, TerminalNode } from 'antlr4'; import { default as esql_parser, ArithmeticBinaryContext, @@ -57,10 +57,10 @@ import { StringLiteralContext, type ValueExpressionContext, ValueExpressionDefaultContext, - IndexIdentifierContext, InlineCastContext, InputNamedOrPositionalParamContext, InputParamContext, + IndexPatternContext, } from './antlr/esql_parser'; import { createSource, @@ -98,16 +98,27 @@ import type { } from './types'; export function collectAllSourceIdentifiers(ctx: FromCommandContext): ESQLAstItem[] { - const fromContexts = ctx.getTypedRuleContexts(IndexIdentifierContext); - + const fromContexts = ctx.getTypedRuleContexts(IndexPatternContext); return fromContexts.map((sourceCtx) => createSource(sourceCtx)); } +function terminalNodeToParserRuleContext(node: TerminalNode): ParserRuleContext { + const context = new ParserRuleContext(); + context.start = node.symbol; + context.stop = node.symbol; + context.children = [node]; + return context; +} function extractIdentifiers( ctx: KeepCommandContext | DropCommandContext | MvExpandCommandContext | MetadataOptionContext ) { if (ctx instanceof MetadataOptionContext) { - return wrapIdentifierAsArray(ctx.indexIdentifier_list()); + return ctx + .UNQUOTED_SOURCE_list() + .map((node) => { + return terminalNodeToParserRuleContext(node); + }) + .flat(); } if (ctx instanceof MvExpandCommandContext) { return wrapIdentifierAsArray(ctx.qualifiedName()); diff --git a/packages/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts b/packages/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts index b1bafc2ce4359..ab5c1ca04ac7f 100644 --- a/packages/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts +++ b/packages/kbn-esql-utils/src/utils/query_parsing_helpers.test.ts @@ -64,6 +64,12 @@ describe('esql query helpers', () => { 'METRICS pods load=avg(cpu), writes=max(rate(indexing_requests)) BY pod | SORT pod' ); expect(idxPattern16).toBe('pods'); + + const idxPattern17 = getIndexPatternFromESQLQuery('FROM "$foo%"'); + expect(idxPattern17).toBe('$foo%'); + + const idxPattern18 = getIndexPatternFromESQLQuery('FROM """foo-{{mm-dd_yy}}"""'); + expect(idxPattern18).toBe('foo-{{mm-dd_yy}}'); }); }); diff --git a/packages/kbn-esql-validation-autocomplete/BUILD.bazel b/packages/kbn-esql-validation-autocomplete/BUILD.bazel index 07106718615d1..1e956d1903dca 100644 --- a/packages/kbn-esql-validation-autocomplete/BUILD.bazel +++ b/packages/kbn-esql-validation-autocomplete/BUILD.bazel @@ -22,7 +22,7 @@ SRCS = glob( SHARED_DEPS = [ "//packages/kbn-i18n", - "@npm//js-levenshtein", + "@npm//fastest-levenshtein", ] js_library( diff --git a/packages/kbn-esql-validation-autocomplete/scripts/generate_function_definitions.ts b/packages/kbn-esql-validation-autocomplete/scripts/generate_function_definitions.ts index d50d7cc903fce..aa92c7bd024d5 100644 --- a/packages/kbn-esql-validation-autocomplete/scripts/generate_function_definitions.ts +++ b/packages/kbn-esql-validation-autocomplete/scripts/generate_function_definitions.ts @@ -145,6 +145,39 @@ const dateDiffOptions = [ 'ns', ]; +const dateExtractOptions = [ + 'ALIGNED_DAY_OF_WEEK_IN_MONTH', + 'ALIGNED_DAY_OF_WEEK_IN_YEAR', + 'ALIGNED_WEEK_OF_MONTH', + 'ALIGNED_WEEK_OF_YEAR', + 'AMPM_OF_DAY', + 'CLOCK_HOUR_OF_AMPM', + 'CLOCK_HOUR_OF_DAY', + 'DAY_OF_MONTH', + 'DAY_OF_WEEK', + 'DAY_OF_YEAR', + 'EPOCH_DAY', + 'ERA', + 'HOUR_OF_AMPM', + 'HOUR_OF_DAY', + 'INSTANT_SECONDS', + 'MICRO_OF_DAY', + 'MICRO_OF_SECOND', + 'MILLI_OF_DAY', + 'MILLI_OF_SECOND', + 'MINUTE_OF_DAY', + 'MINUTE_OF_HOUR', + 'MONTH_OF_YEAR', + 'NANO_OF_DAY', + 'NANO_OF_SECOND', + 'OFFSET_SECONDS', + 'PROLEPTIC_MONTH', + 'SECOND_OF_DAY', + 'SECOND_OF_MINUTE', + 'YEAR', + 'YEAR_OF_ERA', +]; + /** * Enrichments for function definitions * @@ -168,8 +201,7 @@ const functionEnrichments: Record> date_extract: { signatures: [ { - // override the first param as type chrono_literal - params: [{ type: 'chrono_literal' }], + params: [{ literalOptions: dateExtractOptions }], }, ], }, diff --git a/packages/kbn-esql-validation-autocomplete/scripts/generate_function_validation_tests.ts b/packages/kbn-esql-validation-autocomplete/scripts/generate_function_validation_tests.ts index 0ace35433b67e..8d6394fe96af6 100644 --- a/packages/kbn-esql-validation-autocomplete/scripts/generate_function_validation_tests.ts +++ b/packages/kbn-esql-validation-autocomplete/scripts/generate_function_validation_tests.ts @@ -15,7 +15,7 @@ import { statsAggregationFunctionDefinitions } from '../src/definitions/aggs'; import { evalFunctionDefinitions } from '../src/definitions/functions'; import { groupingFunctionDefinitions } from '../src/definitions/grouping'; import { getFunctionSignatures } from '../src/definitions/helpers'; -import { timeUnits, chronoLiterals } from '../src/definitions/literals'; +import { timeUnits } from '../src/definitions/literals'; import { nonNullable } from '../src/shared/helpers'; import { SupportedFieldType, @@ -1045,14 +1045,10 @@ function getFieldName( } const literals = { - chrono_literal: chronoLiterals[0].name, time_literal: timeUnits[0], }; -function getLiteralType(typeString: 'chrono_literal' | 'time_literal') { - if (typeString === 'chrono_literal') { - return literals[typeString]; - } +function getLiteralType(typeString: 'time_literal') { return `1 ${literals[typeString]}`; } @@ -1116,7 +1112,7 @@ function getFieldMapping( } if (/literal$/.test(typeString) && useLiterals) { return { - name: getLiteralType(typeString as 'chrono_literal' | 'time_literal'), + name: getLiteralType(typeString as 'time_literal'), type, ...rest, }; diff --git a/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.test.ts b/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.test.ts index 6f0562d7f118e..2f87d392a702e 100644 --- a/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.test.ts +++ b/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.test.ts @@ -10,7 +10,7 @@ import { suggest } from './autocomplete'; import { evalFunctionDefinitions } from '../definitions/functions'; import { builtinFunctions } from '../definitions/builtin'; import { statsAggregationFunctionDefinitions } from '../definitions/aggs'; -import { chronoLiterals, timeUnitsToSuggest } from '../definitions/literals'; +import { timeUnitsToSuggest } from '../definitions/literals'; import { commandDefinitions } from '../definitions/commands'; import { getUnitDuration, TRIGGER_SUGGESTION_COMMAND } from './factories'; import { camelCase, partition } from 'lodash'; @@ -53,15 +53,27 @@ const fields: Array<{ name: string; type: string; suggestedAs?: string }> = [ ]; const indexes = ([] as Array<{ name: string; hidden: boolean; suggestedAs?: string }>).concat( - ['a', 'index', 'otherIndex', '.secretIndex', 'my-index'].map((name) => ({ + [ + 'a', + 'index', + 'otherIndex', + '.secretIndex', + 'my-index', + 'my-index$', + 'my_index{}', + 'my-index+1', + 'synthetics-*', + ].map((name) => ({ name, hidden: name.startsWith('.'), })), - ['my-index[quoted]', 'my-index$', 'my_index{}'].map((name) => ({ - name, - hidden: false, - suggestedAs: `\`${name}\``, - })) + ['my-index[quoted]', 'my:index', 'my,index', 'logstash-{now/d{yyyy.MM.dd|+12:00}}'].map( + (name) => ({ + name, + hidden: false, + suggestedAs: `"${name}"`, + }) + ) ); const integrations: Integration[] = ['nginx', 'k8s'].map((name) => ({ @@ -207,9 +219,6 @@ function getLiteralsByType(_type: string | string[]) { // return only singular return timeUnitsToSuggest.map(({ name }) => `1 ${name}`).filter((s) => !/s$/.test(s)); } - if (type.includes('chrono_literal')) { - return chronoLiterals.map(({ name }) => name); - } return []; } @@ -368,8 +377,9 @@ describe('autocomplete', () => { }); describe('from', () => { - const suggestedIndexes = indexes.filter(({ hidden }) => !hidden).map(({ name }) => name); - + const suggestedIndexes = indexes + .filter(({ hidden }) => !hidden) + .map(({ name, suggestedAs }) => suggestedAs || name); // Monaco will filter further down here testSuggestions( 'f', @@ -397,8 +407,7 @@ describe('autocomplete', () => { const dataSources = indexes.concat(integrations); const suggestedDataSources = dataSources .filter(({ hidden }) => !hidden) - .map(({ name }) => name); - + .map(({ name, suggestedAs }) => suggestedAs || name); testSuggestions('from ', suggestedDataSources, '', [undefined, dataSources, undefined]); testSuggestions('from a,', suggestedDataSources, '', [undefined, dataSources, undefined]); testSuggestions('from *,', suggestedDataSources, '', [undefined, dataSources, undefined]); diff --git a/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.ts b/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.ts index 727335fe6d961..03504552370b6 100644 --- a/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.ts +++ b/packages/kbn-esql-validation-autocomplete/src/autocomplete/autocomplete.ts @@ -86,6 +86,7 @@ import { getQueryForFields, getSourcesFromCommands, isAggFunctionUsedAlready, + removeQuoteForSuggestedSources, } from './helper'; import { FunctionParameter } from '../definitions/types'; @@ -857,19 +858,28 @@ async function getExpressionSuggestionsByType( suggestions.push(...(policies.length ? policies : [buildNoPoliciesAvailableDefinition()])); } else { const index = getSourcesFromCommands(commands, 'index'); + const canRemoveQuote = isNewExpression && innerText.includes('"'); + // This is going to be empty for simple indices, and not empty for integrations - if (index && index.text) { + if (index && index.text && index.text !== EDITOR_MARKER) { const source = index.text.replace(EDITOR_MARKER, ''); const dataSource = await getDatastreamsForIntegration(source); + const newDefinitions = buildSourcesDefinitions( dataSource?.dataStreams?.map(({ name }) => ({ name, isIntegration: false })) || [] ); - suggestions.push(...newDefinitions); + suggestions.push( + ...(canRemoveQuote ? removeQuoteForSuggestedSources(newDefinitions) : newDefinitions) + ); } else { // FROM // @TODO: filter down the suggestions here based on other existing sources defined const sourcesDefinitions = await getSources(); - suggestions.push(...sourcesDefinitions); + suggestions.push( + ...(canRemoveQuote + ? removeQuoteForSuggestedSources(sourcesDefinitions) + : sourcesDefinitions) + ); } } } diff --git a/packages/kbn-esql-validation-autocomplete/src/autocomplete/factories.ts b/packages/kbn-esql-validation-autocomplete/src/autocomplete/factories.ts index 53e65c2f95aba..df1da9d092d73 100644 --- a/packages/kbn-esql-validation-autocomplete/src/autocomplete/factories.ts +++ b/packages/kbn-esql-validation-autocomplete/src/autocomplete/factories.ts @@ -12,14 +12,14 @@ import { groupingFunctionDefinitions } from '../definitions/grouping'; import { statsAggregationFunctionDefinitions } from '../definitions/aggs'; import { evalFunctionDefinitions } from '../definitions/functions'; import { getFunctionSignatures, getCommandSignature } from '../definitions/helpers'; -import { chronoLiterals, timeUnitsToSuggest } from '../definitions/literals'; +import { timeUnitsToSuggest } from '../definitions/literals'; import { FunctionDefinition, CommandDefinition, CommandOptionsDefinition, CommandModeDefinition, } from '../definitions/types'; -import { getCommandDefinition, shouldBeQuotedText } from '../shared/helpers'; +import { shouldBeQuotedSource, getCommandDefinition, shouldBeQuotedText } from '../shared/helpers'; import { buildDocumentation, buildFunctionDocumentation } from './documentation_util'; import { DOUBLE_BACKTICK, SINGLE_TICK_REGEX } from '../shared/constants'; @@ -37,6 +37,13 @@ function getSafeInsertText(text: string, options: { dashSupported?: boolean } = ? `\`${text.replace(SINGLE_TICK_REGEX, DOUBLE_BACKTICK)}\`` : text; } +export function getQuotedText(text: string) { + return text.startsWith(`"`) && text.endsWith(`"`) ? text : `"${text}"`; +} + +function getSafeInsertSourceText(text: string) { + return shouldBeQuotedSource(text) ? getQuotedText(text) : text; +} export function getSuggestionFunctionDefinition(fn: FunctionDefinition): SuggestionRawDefinition { const fullSignatures = getFunctionSignatures(fn); @@ -148,7 +155,7 @@ export const buildSourcesDefinitions = ( ): SuggestionRawDefinition[] => sources.map(({ name, isIntegration, title }) => ({ label: title ?? name, - text: name, + text: getSafeInsertSourceText(name), isSnippet: isIntegration, ...(isIntegration && { command: TRIGGER_SUGGESTION_COMMAND }), kind: isIntegration ? 'Class' : 'Issue', @@ -336,9 +343,6 @@ export function getCompatibleLiterals(commandName: string, types: string[], name if (types.includes('time_literal_unit')) { suggestions.push(...buildConstantsDefinitions(timeUnitsToSuggest.map(({ name }) => name))); // i.e. year, month, ... } - if (types.includes('chrono_literal')) { - suggestions.push(...buildConstantsDefinitions(chronoLiterals.map(({ name }) => name))); // i.e. EPOC_DAY, ... - } if (types.includes('string')) { if (names) { const index = types.indexOf('string'); diff --git a/packages/kbn-esql-validation-autocomplete/src/autocomplete/helper.ts b/packages/kbn-esql-validation-autocomplete/src/autocomplete/helper.ts index fa6e364c78ca9..f9586670b29e6 100644 --- a/packages/kbn-esql-validation-autocomplete/src/autocomplete/helper.ts +++ b/packages/kbn-esql-validation-autocomplete/src/autocomplete/helper.ts @@ -7,8 +7,9 @@ */ import type { ESQLAstItem, ESQLCommand, ESQLFunction, ESQLSource } from '@kbn/esql-ast'; -import { FunctionDefinition } from '../definitions/types'; +import type { FunctionDefinition } from '../definitions/types'; import { getFunctionDefinition, isAssignment, isFunctionItem } from '../shared/helpers'; +import type { SuggestionRawDefinition } from './types'; function extractFunctionArgs(args: ESQLAstItem[]): ESQLFunction[] { return args.flatMap((arg) => (isAssignment(arg) ? arg.args[1] : arg)).filter(isFunctionItem); @@ -71,3 +72,11 @@ export function getSourcesFromCommands(commands: ESQLCommand[], sourceType: 'ind return sources.length === 1 ? sources[0] : undefined; } + +export function removeQuoteForSuggestedSources(suggestions: SuggestionRawDefinition[]) { + return suggestions.map((d) => ({ + ...d, + // "text" -> text + text: d.text.startsWith('"') && d.text.endsWith('"') ? d.text.slice(1, -1) : d.text, + })); +} diff --git a/packages/kbn-esql-validation-autocomplete/src/code_actions/actions.ts b/packages/kbn-esql-validation-autocomplete/src/code_actions/actions.ts index 2c8620223ebb3..f6469a736a0e8 100644 --- a/packages/kbn-esql-validation-autocomplete/src/code_actions/actions.ts +++ b/packages/kbn-esql-validation-autocomplete/src/code_actions/actions.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import { i18n } from '@kbn/i18n'; -import levenshtein from 'js-levenshtein'; +import { distance } from 'fastest-levenshtein'; import type { AstProviderFn, ESQLAst, EditorError, ESQLMessage } from '@kbn/esql-ast'; import { uniqBy } from 'lodash'; import { @@ -90,8 +90,7 @@ function createAction(title: string, solution: string, error: EditorError): Code async function getSpellingPossibilities(fn: () => Promise, errorText: string) { const allPossibilities = await fn(); const allSolutions = allPossibilities.reduce((solutions, item) => { - const distance = levenshtein(item, errorText); - if (distance < 3) { + if (distance(item, errorText) < 3) { solutions.push(item); } return solutions; @@ -306,8 +305,8 @@ async function getSpellingActionForMetadata( ) { const errorText = queryString.substring(error.startColumn - 1, error.endColumn - 1); const allSolutions = METADATA_FIELDS.reduce((solutions, item) => { - const distance = levenshtein(item, errorText); - if (distance < 3) { + const dist = distance(item, errorText); + if (dist < 3) { solutions.push(item); } return solutions; diff --git a/packages/kbn-esql-validation-autocomplete/src/definitions/functions.ts b/packages/kbn-esql-validation-autocomplete/src/definitions/functions.ts index ceb5789e0dd39..87c9f82360b44 100644 --- a/packages/kbn-esql-validation-autocomplete/src/definitions/functions.ts +++ b/packages/kbn-esql-validation-autocomplete/src/definitions/functions.ts @@ -668,8 +668,40 @@ const dateExtractDefinition: FunctionDefinition = { params: [ { name: 'datePart', - type: 'chrono_literal', + type: 'string', optional: false, + literalOptions: [ + 'ALIGNED_DAY_OF_WEEK_IN_MONTH', + 'ALIGNED_DAY_OF_WEEK_IN_YEAR', + 'ALIGNED_WEEK_OF_MONTH', + 'ALIGNED_WEEK_OF_YEAR', + 'AMPM_OF_DAY', + 'CLOCK_HOUR_OF_AMPM', + 'CLOCK_HOUR_OF_DAY', + 'DAY_OF_MONTH', + 'DAY_OF_WEEK', + 'DAY_OF_YEAR', + 'EPOCH_DAY', + 'ERA', + 'HOUR_OF_AMPM', + 'HOUR_OF_DAY', + 'INSTANT_SECONDS', + 'MICRO_OF_DAY', + 'MICRO_OF_SECOND', + 'MILLI_OF_DAY', + 'MILLI_OF_SECOND', + 'MINUTE_OF_DAY', + 'MINUTE_OF_HOUR', + 'MONTH_OF_YEAR', + 'NANO_OF_DAY', + 'NANO_OF_SECOND', + 'OFFSET_SECONDS', + 'PROLEPTIC_MONTH', + 'SECOND_OF_DAY', + 'SECOND_OF_MINUTE', + 'YEAR', + 'YEAR_OF_ERA', + ], }, { name: 'date', diff --git a/packages/kbn-esql-validation-autocomplete/src/shared/helpers.test.ts b/packages/kbn-esql-validation-autocomplete/src/shared/helpers.test.ts new file mode 100644 index 0000000000000..87eb31de4d3c9 --- /dev/null +++ b/packages/kbn-esql-validation-autocomplete/src/shared/helpers.test.ts @@ -0,0 +1,48 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { shouldBeQuotedSource } from './helpers'; + +describe('shouldBeQuotedSource', () => { + it('does not have to be quoted for sources with acceptable characters @-+$', () => { + expect(shouldBeQuotedSource('foo')).toBe(false); + expect(shouldBeQuotedSource('123-test@foo_bar+baz1')).toBe(false); + expect(shouldBeQuotedSource('my-index*')).toBe(false); + expect(shouldBeQuotedSource('my-index$')).toBe(false); + expect(shouldBeQuotedSource('.my-index$')).toBe(false); + }); + it(`should be quoted if containing any of special characters [:"=|,[\]/ \t\r\n]`, () => { + expect(shouldBeQuotedSource('foo\ttest')).toBe(true); + expect(shouldBeQuotedSource('foo\rtest')).toBe(true); + expect(shouldBeQuotedSource('foo\ntest')).toBe(true); + expect(shouldBeQuotedSource('foo:test=bar')).toBe(true); + expect(shouldBeQuotedSource('foo|test=bar')).toBe(true); + expect(shouldBeQuotedSource('foo[test]=bar')).toBe(true); + expect(shouldBeQuotedSource('foo/test=bar')).toBe(true); + expect(shouldBeQuotedSource('foo test=bar')).toBe(true); + expect(shouldBeQuotedSource('foo,test-*,abc')).toBe(true); + expect(shouldBeQuotedSource('foo, test-*, abc, xyz')).toBe(true); + expect(shouldBeQuotedSource('foo, test-*, abc, xyz,test123')).toBe(true); + expect(shouldBeQuotedSource('foo,test,xyz')).toBe(true); + expect( + shouldBeQuotedSource(',') + ).toBe(true); + expect(shouldBeQuotedSource('`backtick`,``multiple`back``ticks```')).toBe(true); + expect(shouldBeQuotedSource('test,metadata,metaata,.metadata')).toBe(true); + expect(shouldBeQuotedSource('cluster:index')).toBe(true); + expect(shouldBeQuotedSource('cluster:index|pattern')).toBe(true); + expect(shouldBeQuotedSource('cluster:.index')).toBe(true); + expect(shouldBeQuotedSource('cluster*:index*')).toBe(true); + expect(shouldBeQuotedSource('cluster*:*')).toBe(true); + expect(shouldBeQuotedSource('*:index*')).toBe(true); + expect(shouldBeQuotedSource('*:index|pattern')).toBe(true); + expect(shouldBeQuotedSource('*:*')).toBe(true); + expect(shouldBeQuotedSource('*:*,cluster*:index|pattern,i|p')).toBe(true); + expect(shouldBeQuotedSource('index-[dd-mm]')).toBe(true); + }); +}); diff --git a/packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts b/packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts index effd6b1b16ddd..9bdb1f4e416a1 100644 --- a/packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts +++ b/packages/kbn-esql-validation-autocomplete/src/shared/helpers.ts @@ -17,14 +17,14 @@ import type { ESQLSource, ESQLTimeInterval, } from '@kbn/esql-ast'; -import { ESQLInlineCast } from '@kbn/esql-ast/src/types'; +import { ESQLInlineCast, ESQLParamLiteral } from '@kbn/esql-ast/src/types'; import { statsAggregationFunctionDefinitions } from '../definitions/aggs'; import { builtinFunctions } from '../definitions/builtin'; import { commandDefinitions } from '../definitions/commands'; import { evalFunctionDefinitions } from '../definitions/functions'; import { groupingFunctionDefinitions } from '../definitions/grouping'; import { getFunctionSignatures } from '../definitions/helpers'; -import { timeUnits, chronoLiterals } from '../definitions/literals'; +import { timeUnits } from '../definitions/literals'; import { byOption, metadataOption, @@ -233,9 +233,6 @@ function compareLiteralType(argType: string, item: ESQLLiteral) { return false; } - if (argType === 'chrono_literal') { - return chronoLiterals.some(({ name }) => name === item.text); - } // date-type parameters accept string literals because of ES auto-casting return ['string', 'date'].includes(argType); } @@ -407,7 +404,7 @@ export function checkFunctionArgMatchesDefinition( parentCommand?: string ) { const argType = parameterDefinition.type; - if (argType === 'any') { + if (argType === 'any' || isParam(arg)) { return true; } if (arg.type === 'literal') { @@ -566,6 +563,10 @@ export function isRestartingExpression(text: string) { return getLastCharFromTrimmed(text) === ','; } +export function shouldBeQuotedSource(text: string) { + // Based on lexer `fragment UNQUOTED_SOURCE_PART` + return /[:"=|,[\]\/ \t\r\n]/.test(text); +} export function shouldBeQuotedText( text: string, { dashSupported }: { dashSupported?: boolean } = {} @@ -575,3 +576,9 @@ export function shouldBeQuotedText( export const isAggFunction = (arg: ESQLFunction): boolean => getFunctionDefinition(arg.name)?.type === 'agg'; + +export const isParam = (x: unknown): x is ESQLParamLiteral => + !!x && + typeof x === 'object' && + (x as ESQLParamLiteral).type === 'literal' && + (x as ESQLParamLiteral).literalType === 'param'; diff --git a/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/test_suites/validation.command.from.ts b/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/test_suites/validation.command.from.ts index 74301ced77e63..06d23a30c441d 100644 --- a/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/test_suites/validation.command.from.ts +++ b/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/test_suites/validation.command.from.ts @@ -20,7 +20,7 @@ export const validationFromCommandTestSuite = (setup: helpers.Setup) => { "SyntaxError: mismatched input 'f' expecting {'explain', 'from', 'meta', 'metrics', 'row', 'show'}", ]); await expectErrors('from ', [ - "SyntaxError: missing INDEX_UNQUOTED_IDENTIFIER at ''", + "SyntaxError: mismatched input '' expecting {UNQUOTED_SOURCE, QUOTED_STRING}", ]); }); @@ -30,6 +30,8 @@ export const validationFromCommandTestSuite = (setup: helpers.Setup) => { await expectErrors('from index', []); await expectErrors('FROM index', []); + await expectErrors('FROM "index"', []); + await expectErrors('FROM """index"""', []); await expectErrors('FrOm index', []); await expectErrors('from index, other_index', []); await expectErrors('from index, other_index,.secret_index', []); @@ -65,10 +67,10 @@ export const validationFromCommandTestSuite = (setup: helpers.Setup) => { const { expectErrors } = await setup(); await expectErrors('from index,', [ - "SyntaxError: missing INDEX_UNQUOTED_IDENTIFIER at ''", + "SyntaxError: mismatched input '' expecting {UNQUOTED_SOURCE, QUOTED_STRING}", ]); await expectErrors(`FROM index\n, \tother_index\t,\n \t `, [ - "SyntaxError: missing INDEX_UNQUOTED_IDENTIFIER at ''", + "SyntaxError: mismatched input '' expecting {UNQUOTED_SOURCE, QUOTED_STRING}", ]); await expectErrors(`from assignment = 1`, [ @@ -80,10 +82,7 @@ export const validationFromCommandTestSuite = (setup: helpers.Setup) => { test('errors on invalid syntax', async () => { const { expectErrors } = await setup(); - await expectErrors('FROM `index`', [ - "SyntaxError: token recognition error at: '`'", - "SyntaxError: token recognition error at: '`'", - ]); + await expectErrors('FROM `index`', ['Unknown index [`index`]']); await expectErrors(`from assignment = 1`, [ "SyntaxError: mismatched input '=' expecting ", 'Unknown index [assignment]', diff --git a/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/test_suites/validation.command.metrics.ts b/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/test_suites/validation.command.metrics.ts index 5d1ddb0865ea5..44c15c722a1de 100644 --- a/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/test_suites/validation.command.metrics.ts +++ b/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/test_suites/validation.command.metrics.ts @@ -19,7 +19,7 @@ export const validationMetricsCommandTestSuite = (setup: helpers.Setup) => { "SyntaxError: mismatched input 'm' expecting {'explain', 'from', 'meta', 'metrics', 'row', 'show'}", ]); await expectErrors('metrics ', [ - "SyntaxError: missing INDEX_UNQUOTED_IDENTIFIER at ''", + "SyntaxError: mismatched input '' expecting {UNQUOTED_SOURCE, QUOTED_STRING}", ]); }); @@ -61,10 +61,10 @@ export const validationMetricsCommandTestSuite = (setup: helpers.Setup) => { const { expectErrors } = await setup(); await expectErrors('metrics index,', [ - "SyntaxError: missing INDEX_UNQUOTED_IDENTIFIER at ''", + "SyntaxError: mismatched input '' expecting {UNQUOTED_SOURCE, QUOTED_STRING}", ]); await expectErrors(`metrics index\n, \tother_index\t,\n \t `, [ - "SyntaxError: missing INDEX_UNQUOTED_IDENTIFIER at ''", + "SyntaxError: mismatched input '' expecting {UNQUOTED_SOURCE, QUOTED_STRING}", ]); }); @@ -75,10 +75,7 @@ export const validationMetricsCommandTestSuite = (setup: helpers.Setup) => { "SyntaxError: token recognition error at: '='", "SyntaxError: token recognition error at: '1'", ]); - await expectErrors('metrics `index`', [ - "SyntaxError: token recognition error at: '`'", - "SyntaxError: token recognition error at: '`'", - ]); + await expectErrors('metrics `index`', ['Unknown index [`index`]']); }); test('errors on unknown index', async () => { diff --git a/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/validation.params.test.ts b/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/validation.params.test.ts new file mode 100644 index 0000000000000..17f91a72c52a4 --- /dev/null +++ b/packages/kbn-esql-validation-autocomplete/src/validation/__tests__/validation.params.test.ts @@ -0,0 +1,43 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { setup } from './helpers'; + +test('should allow param inside agg function argument', async () => { + const { validate } = await setup(); + + const res1 = await validate('FROM index | STATS avg(?)'); + const res2 = await validate('FROM index | STATS avg(?named)'); + const res3 = await validate('FROM index | STATS avg(?123)'); + + expect(res1).toMatchObject({ errors: [], warnings: [] }); + expect(res2).toMatchObject({ errors: [], warnings: [] }); + expect(res3).toMatchObject({ errors: [], warnings: [] }); +}); + +test('allow params in WHERE command expressions', async () => { + const { validate } = await setup(); + + const res1 = await validate('FROM index | WHERE stringField >= ?earliest'); + const res2 = await validate(` + FROM index + | WHERE stringField >= ?earliest + | WHERE stringField <= ?0 + | WHERE stringField == ? + `); + const res3 = await validate(` + FROM index + | WHERE stringField >= ?earliest + AND stringField <= ?0 + AND stringField == ? + `); + + expect(res1).toMatchObject({ errors: [], warnings: [] }); + expect(res2).toMatchObject({ errors: [], warnings: [] }); + expect(res3).toMatchObject({ errors: [], warnings: [] }); +}); diff --git a/packages/kbn-esql-validation-autocomplete/src/validation/esql_validation_meta_tests.json b/packages/kbn-esql-validation-autocomplete/src/validation/esql_validation_meta_tests.json index daf8d7c6de862..7f70b266458f7 100644 --- a/packages/kbn-esql-validation-autocomplete/src/validation/esql_validation_meta_tests.json +++ b/packages/kbn-esql-validation-autocomplete/src/validation/esql_validation_meta_tests.json @@ -8662,7 +8662,8 @@ { "query": "from a_index | enrich `this``is fine`", "error": [ - "SyntaxError: mismatched input '`this``is fine`' expecting ENRICH_POLICY_NAME" + "SyntaxError: extraneous input 'fine`' expecting ", + "Unknown policy [`this``is]" ], "warning": [] }, @@ -11005,6 +11006,13 @@ "error": [], "warning": [] }, + { + "query": "from a_index | eval date_extract(\"SOME_RANDOM_STRING\", now())", + "error": [], + "warning": [ + "Invalid option [\"SOME_RANDOM_STRING\"] for date_extract. Supported options: [\"ALIGNED_DAY_OF_WEEK_IN_MONTH\", \"ALIGNED_DAY_OF_WEEK_IN_YEAR\", \"ALIGNED_WEEK_OF_MONTH\", \"ALIGNED_WEEK_OF_YEAR\", \"AMPM_OF_DAY\", \"CLOCK_HOUR_OF_AMPM\", \"CLOCK_HOUR_OF_DAY\", \"DAY_OF_MONTH\", \"DAY_OF_WEEK\", \"DAY_OF_YEAR\", \"EPOCH_DAY\", \"ERA\", \"HOUR_OF_AMPM\", \"HOUR_OF_DAY\", \"INSTANT_SECONDS\", \"MICRO_OF_DAY\", \"MICRO_OF_SECOND\", \"MILLI_OF_DAY\", \"MILLI_OF_SECOND\", \"MINUTE_OF_DAY\", \"MINUTE_OF_HOUR\", \"MONTH_OF_YEAR\", \"NANO_OF_DAY\", \"NANO_OF_SECOND\", \"OFFSET_SECONDS\", \"PROLEPTIC_MONTH\", \"SECOND_OF_DAY\", \"SECOND_OF_MINUTE\", \"YEAR\", \"YEAR_OF_ERA\"]." + ] + }, { "query": "from a_index | eval var = date_extract(\"ALIGNED_DAY_OF_WEEK_IN_MONTH\", dateField)", "error": [], @@ -11023,7 +11031,6 @@ { "query": "from a_index | eval date_extract(stringField, stringField)", "error": [ - "Argument of [date_extract] must be [chrono_literal], found value [stringField] type [string]", "Argument of [date_extract] must be [date], found value [stringField] type [string]" ], "warning": [] @@ -11043,7 +11050,7 @@ { "query": "row var = date_extract(true, true)", "error": [ - "Argument of [date_extract] must be [chrono_literal], found value [true] type [boolean]", + "Argument of [date_extract] must be [string], found value [true] type [boolean]", "Argument of [date_extract] must be [date], found value [true] type [boolean]" ], "warning": [] @@ -11056,7 +11063,7 @@ { "query": "from a_index | eval date_extract(booleanField, booleanField)", "error": [ - "Argument of [date_extract] must be [chrono_literal], found value [booleanField] type [boolean]", + "Argument of [date_extract] must be [string], found value [booleanField] type [boolean]", "Argument of [date_extract] must be [date], found value [booleanField] type [boolean]" ], "warning": [] @@ -26377,7 +26384,7 @@ { "query": "from ", "error": [ - "SyntaxError: missing INDEX_UNQUOTED_IDENTIFIER at ''" + "SyntaxError: mismatched input '' expecting {UNQUOTED_SOURCE, QUOTED_STRING}" ], "warning": [] }, @@ -26391,6 +26398,16 @@ "error": [], "warning": [] }, + { + "query": "FROM \"index\"", + "error": [], + "warning": [] + }, + { + "query": "FROM \"\"\"index\"\"\"", + "error": [], + "warning": [] + }, { "query": "FrOm index", "error": [], @@ -26539,14 +26556,14 @@ { "query": "from index,", "error": [ - "SyntaxError: missing INDEX_UNQUOTED_IDENTIFIER at ''" + "SyntaxError: mismatched input '' expecting {UNQUOTED_SOURCE, QUOTED_STRING}" ], "warning": [] }, { "query": "FROM index\n, \tother_index\t,\n \t ", "error": [ - "SyntaxError: missing INDEX_UNQUOTED_IDENTIFIER at ''" + "SyntaxError: mismatched input '' expecting {UNQUOTED_SOURCE, QUOTED_STRING}" ], "warning": [] }, @@ -26561,8 +26578,7 @@ { "query": "FROM `index`", "error": [ - "SyntaxError: token recognition error at: '`'", - "SyntaxError: token recognition error at: '`'" + "Unknown index [`index`]" ], "warning": [] }, diff --git a/packages/kbn-esql-validation-autocomplete/src/validation/validation.test.ts b/packages/kbn-esql-validation-autocomplete/src/validation/validation.test.ts index 6c1b66574862c..062e0b9ae78f1 100644 --- a/packages/kbn-esql-validation-autocomplete/src/validation/validation.test.ts +++ b/packages/kbn-esql-validation-autocomplete/src/validation/validation.test.ts @@ -12,7 +12,7 @@ import { ignoreErrorsMap, validateQuery } from './validation'; import { evalFunctionDefinitions } from '../definitions/functions'; import { getFunctionSignatures } from '../definitions/helpers'; import { FunctionDefinition, SupportedFieldType, supportedFieldTypes } from '../definitions/types'; -import { chronoLiterals, timeUnits, timeUnitsToSuggest } from '../definitions/literals'; +import { timeUnits, timeUnitsToSuggest } from '../definitions/literals'; import { statsAggregationFunctionDefinitions } from '../definitions/aggs'; import capitalize from 'lodash/capitalize'; import { camelCase } from 'lodash'; @@ -58,13 +58,9 @@ const nestedFunctions = { }; const literals = { - chrono_literal: chronoLiterals[0].name, time_literal: timeUnitsToSuggest[0].name, }; -function getLiteralType(typeString: 'chrono_literal' | 'time_literal') { - if (typeString === 'chrono_literal') { - return literals[typeString]; - } +function getLiteralType(typeString: 'time_literal') { return `1 ${literals[typeString]}`; } @@ -144,7 +140,7 @@ function getFieldMapping( } if (/literal$/.test(typeString) && useLiterals) { return { - name: getLiteralType(typeString as 'chrono_literal' | 'time_literal'), + name: getLiteralType(typeString as 'time_literal'), type, ...rest, }; @@ -1359,7 +1355,8 @@ describe('validation logic', () => { ]); testErrorsAndWarnings(`from a_index | enrich policy `, []); testErrorsAndWarnings('from a_index | enrich `this``is fine`', [ - "SyntaxError: mismatched input '`this``is fine`' expecting ENRICH_POLICY_NAME", + "SyntaxError: extraneous input 'fine`' expecting ", + 'Unknown policy [`this``is]', ]); testErrorsAndWarnings('from a_index | enrich this is fine', [ "SyntaxError: mismatched input 'is' expecting ", @@ -2609,6 +2606,13 @@ describe('validation logic', () => { describe('date_extract', () => { testErrorsAndWarnings('row var = date_extract("ALIGNED_DAY_OF_WEEK_IN_MONTH", now())', []); testErrorsAndWarnings('row date_extract("ALIGNED_DAY_OF_WEEK_IN_MONTH", now())', []); + testErrorsAndWarnings( + 'from a_index | eval date_extract("SOME_RANDOM_STRING", now())', + [], + [ + 'Invalid option ["SOME_RANDOM_STRING"] for date_extract. Supported options: ["ALIGNED_DAY_OF_WEEK_IN_MONTH", "ALIGNED_DAY_OF_WEEK_IN_YEAR", "ALIGNED_WEEK_OF_MONTH", "ALIGNED_WEEK_OF_YEAR", "AMPM_OF_DAY", "CLOCK_HOUR_OF_AMPM", "CLOCK_HOUR_OF_DAY", "DAY_OF_MONTH", "DAY_OF_WEEK", "DAY_OF_YEAR", "EPOCH_DAY", "ERA", "HOUR_OF_AMPM", "HOUR_OF_DAY", "INSTANT_SECONDS", "MICRO_OF_DAY", "MICRO_OF_SECOND", "MILLI_OF_DAY", "MILLI_OF_SECOND", "MINUTE_OF_DAY", "MINUTE_OF_HOUR", "MONTH_OF_YEAR", "NANO_OF_DAY", "NANO_OF_SECOND", "OFFSET_SECONDS", "PROLEPTIC_MONTH", "SECOND_OF_DAY", "SECOND_OF_MINUTE", "YEAR", "YEAR_OF_ERA"].', + ] + ); testErrorsAndWarnings( 'from a_index | eval var = date_extract("ALIGNED_DAY_OF_WEEK_IN_MONTH", dateField)', @@ -2626,7 +2630,6 @@ describe('validation logic', () => { ); testErrorsAndWarnings('from a_index | eval date_extract(stringField, stringField)', [ - 'Argument of [date_extract] must be [chrono_literal], found value [stringField] type [string]', 'Argument of [date_extract] must be [date], found value [stringField] type [string]', ]); @@ -2641,7 +2644,7 @@ describe('validation logic', () => { ); testErrorsAndWarnings('row var = date_extract(true, true)', [ - 'Argument of [date_extract] must be [chrono_literal], found value [true] type [boolean]', + 'Argument of [date_extract] must be [string], found value [true] type [boolean]', 'Argument of [date_extract] must be [date], found value [true] type [boolean]', ]); @@ -2651,7 +2654,7 @@ describe('validation logic', () => { ); testErrorsAndWarnings('from a_index | eval date_extract(booleanField, booleanField)', [ - 'Argument of [date_extract] must be [chrono_literal], found value [booleanField] type [boolean]', + 'Argument of [date_extract] must be [string], found value [booleanField] type [boolean]', 'Argument of [date_extract] must be [date], found value [booleanField] type [boolean]', ]); testErrorsAndWarnings('from a_index | eval date_extract(null, null)', []); diff --git a/packages/kbn-field-types/src/kbn_field_types.ts b/packages/kbn-field-types/src/kbn_field_types.ts index 7ec22de078230..5059d37da1d0e 100644 --- a/packages/kbn-field-types/src/kbn_field_types.ts +++ b/packages/kbn-field-types/src/kbn_field_types.ts @@ -50,6 +50,10 @@ export const getFilterableKbnTypeNames = (): string[] => registeredKbnTypes.filter((type) => type.filterable).map((type) => type.name); export function esFieldTypeToKibanaFieldType(type: string) { + // 'counter_integer', 'counter_long', 'counter_double'... + if (type.startsWith('counter_')) { + return KBN_FIELD_TYPES.NUMBER; + } switch (type) { case ES_FIELD_TYPES._INDEX: return KBN_FIELD_TYPES.STRING; diff --git a/packages/kbn-field-utils/src/utils/field_name_wildcard_matcher.test.tsx b/packages/kbn-field-utils/src/utils/field_name_wildcard_matcher.test.tsx index 1311d1c5bbc2f..ef9b0572c689d 100644 --- a/packages/kbn-field-utils/src/utils/field_name_wildcard_matcher.test.tsx +++ b/packages/kbn-field-utils/src/utils/field_name_wildcard_matcher.test.tsx @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import { type DataViewField } from '@kbn/data-views-plugin/common'; import { fieldNameWildcardMatcher, getFieldSearchMatchingHighlight, @@ -16,54 +15,107 @@ const name = 'test.this_value.maybe'; describe('fieldNameWildcardMatcher', function () { describe('fieldNameWildcardMatcher()', () => { it('should work correctly with wildcard', async () => { - expect(fieldNameWildcardMatcher({ displayName: 'test' } as DataViewField, 'no')).toBe(false); - expect( - fieldNameWildcardMatcher({ displayName: 'test', name: 'yes' } as DataViewField, 'yes') - ).toBe(true); + expect(fieldNameWildcardMatcher({ displayName: 'test', name: 'test' }, 'no')).toBe(false); + expect(fieldNameWildcardMatcher({ displayName: 'test', name: 'yes' }, 'yes')).toBe(true); const search = 'test*ue'; - expect(fieldNameWildcardMatcher({ displayName: 'test' } as DataViewField, search)).toBe( - false - ); - expect(fieldNameWildcardMatcher({ displayName: 'test.value' } as DataViewField, search)).toBe( - true - ); - expect(fieldNameWildcardMatcher({ name: 'test.this_value' } as DataViewField, search)).toBe( - true - ); - expect(fieldNameWildcardMatcher({ name: 'message.test' } as DataViewField, search)).toBe( - false - ); - expect(fieldNameWildcardMatcher({ name } as DataViewField, search)).toBe(false); - expect(fieldNameWildcardMatcher({ name } as DataViewField, `${search}*`)).toBe(true); - expect(fieldNameWildcardMatcher({ name } as DataViewField, '*value*')).toBe(true); + expect(fieldNameWildcardMatcher({ displayName: 'test', name: 'test' }, search)).toBe(false); + expect( + fieldNameWildcardMatcher({ displayName: 'test.value', name: 'test.value' }, search) + ).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'test.this_value' }, search)).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'message.test' }, search)).toBe(false); + expect(fieldNameWildcardMatcher({ name }, search)).toBe(false); + expect(fieldNameWildcardMatcher({ name }, `${search}*`)).toBe(true); + expect(fieldNameWildcardMatcher({ name }, '*value*')).toBe(true); }); it('should work correctly with spaces', async () => { - expect(fieldNameWildcardMatcher({ name } as DataViewField, 'test maybe ')).toBe(true); - expect(fieldNameWildcardMatcher({ name } as DataViewField, 'test maybe*')).toBe(true); - expect(fieldNameWildcardMatcher({ name } as DataViewField, 'test. this')).toBe(true); - expect(fieldNameWildcardMatcher({ name } as DataViewField, 'this _value be')).toBe(true); - expect(fieldNameWildcardMatcher({ name } as DataViewField, 'test')).toBe(true); - expect(fieldNameWildcardMatcher({ name } as DataViewField, 'this')).toBe(true); - expect(fieldNameWildcardMatcher({ name } as DataViewField, ' value ')).toBe(true); - expect(fieldNameWildcardMatcher({ name } as DataViewField, 'be')).toBe(true); - expect(fieldNameWildcardMatcher({ name } as DataViewField, 'test this here')).toBe(false); - expect(fieldNameWildcardMatcher({ name } as DataViewField, 'test that')).toBe(false); - expect(fieldNameWildcardMatcher({ name } as DataViewField, ' ')).toBe(false); - expect(fieldNameWildcardMatcher({ name: 'geo.location3' } as DataViewField, '3')).toBe(true); - expect(fieldNameWildcardMatcher({ name: 'geo_location3' } as DataViewField, 'geo 3')).toBe( - true - ); + expect(fieldNameWildcardMatcher({ name }, 'test maybe ')).toBe(true); + expect(fieldNameWildcardMatcher({ name }, 'test maybe*')).toBe(true); + expect(fieldNameWildcardMatcher({ name }, 'test. this')).toBe(true); + expect(fieldNameWildcardMatcher({ name }, 'this _value be')).toBe(true); + expect(fieldNameWildcardMatcher({ name }, 'test')).toBe(true); + expect(fieldNameWildcardMatcher({ name }, 'this')).toBe(true); + expect(fieldNameWildcardMatcher({ name }, ' value ')).toBe(true); + expect(fieldNameWildcardMatcher({ name }, 'be')).toBe(true); + expect(fieldNameWildcardMatcher({ name }, 'test this here')).toBe(false); + expect(fieldNameWildcardMatcher({ name }, 'test that')).toBe(false); + expect(fieldNameWildcardMatcher({ name }, ' ')).toBe(false); + expect(fieldNameWildcardMatcher({ name: 'geo.location3' }, '3')).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'geo_location3' }, 'geo 3')).toBe(true); }); it('should be case-insensitive', async () => { - expect(fieldNameWildcardMatcher({ name: 'Test' } as DataViewField, 'test')).toBe(true); - expect(fieldNameWildcardMatcher({ name: 'test' } as DataViewField, 'Test')).toBe(true); - expect(fieldNameWildcardMatcher({ name: 'tesT' } as DataViewField, 'Tes*')).toBe(true); - expect(fieldNameWildcardMatcher({ name: 'tesT' } as DataViewField, 'tes*')).toBe(true); - expect(fieldNameWildcardMatcher({ name: 'tesT' } as DataViewField, 't T')).toBe(true); - expect(fieldNameWildcardMatcher({ name: 'tesT' } as DataViewField, 't t')).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'Test' }, 'test')).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'test' }, 'Test')).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'tesT' }, 'Tes*')).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'tesT' }, 'tes*')).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'tesT' }, 't T')).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'tesT' }, 't t')).toBe(true); + }); + + describe('fuzzy search', () => { + test('only matches strings longer than 3 characters', () => { + expect(fieldNameWildcardMatcher({ name: 'a' }, 'b')).toBe(false); + expect(fieldNameWildcardMatcher({ name: 'ab' }, 'cb')).toBe(false); + expect(fieldNameWildcardMatcher({ name: 'abc' }, 'abb')).toBe(false); + expect(fieldNameWildcardMatcher({ name: 'abcd' }, 'abbd')).toBe(true); + }); + test('is case insensitive', () => { + expect(fieldNameWildcardMatcher({ name: 'abcdefg' }, 'AAbcdef')).toBe(true); + }); + test('tests both displayName and name', () => { + expect(fieldNameWildcardMatcher({ name: 'abcdefg' }, 'aabcdefg')).toBe(true); + expect( + fieldNameWildcardMatcher({ name: 'abcdefg', displayName: 'irrelevantstring' }, 'bbcdefg') + ).toBe(true); + expect( + fieldNameWildcardMatcher({ name: 'irrelevantstring', displayName: 'abcdefg' }, 'bbcdefg') + ).toBe(true); + }); + test('finds matches with a typo at the beginning of the string', () => { + expect(fieldNameWildcardMatcher({ name: 'abcdefghijklmno' }, '.bcdefghijklmno')).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'abcdefghijklmno' }, '.bcde')).toBe(true); + }); + test('finds matches with a typo in the middle of the string', () => { + expect(fieldNameWildcardMatcher({ name: 'abcdefghijklmno' }, 'abcdefghi.klmno')).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'abcdefghijklmno' }, 'ghi.klm')).toBe(true); + }); + test('finds matches with a typo at the end of the string', () => { + expect(fieldNameWildcardMatcher({ name: 'abcdefghijklmno' }, 'abcdefghijklmn.')).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'abcdefghijklmno' }, 'klmn.')).toBe(true); + }); + test('finds matches with an additional character at the beginning of the string', () => { + expect(fieldNameWildcardMatcher({ name: 'abcdefghijklmn' }, '.abcdefghijklmn')).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'abcdefghijklmn' }, '.abcde')).toBe(true); + }); + test('finds matches with an additional character in the middle of the string', () => { + expect(fieldNameWildcardMatcher({ name: 'abcdefghijklmn' }, 'abcdefgh.ijklmn')).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'abcdefghijklmn' }, 'fgh.ijklm')).toBe(true); + }); + test('finds matches with an additional character at the end of the string', () => { + expect(fieldNameWildcardMatcher({ name: 'abcdefghijklmn' }, 'abcdefghijklmn.')).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'abcdefghijklmn' }, 'ghijklmn.')).toBe(true); + }); + test('finds matches with a missing character in the middle of the string', () => { + expect(fieldNameWildcardMatcher({ name: 'abcdefghijklmn' }, 'abcdefgijklmn')).toBe(true); + expect(fieldNameWildcardMatcher({ name: 'abcdefghijklmn' }, 'gijkl')).toBe(true); + }); + test('does not find matches exceeding edit distance 1', () => { + // swapping edit distance = 2 + expect(fieldNameWildcardMatcher({ name: 'abcdefhghijklm' }, 'abdcefhghijklm')).toBe(false); + expect(fieldNameWildcardMatcher({ name: 'abcdefhghijklm' }, 'abdce')).toBe(false); + // 2 char removed + expect(fieldNameWildcardMatcher({ name: 'abcdefhghijklm' }, 'abcfhghijklm')).toBe(false); + expect(fieldNameWildcardMatcher({ name: 'abcdefhghijklm' }, 'abcfhg')).toBe(false); + // 2 chars added + expect(fieldNameWildcardMatcher({ name: 'abcdefhghijklm' }, 'abcfhghijklmmm')).toBe(false); + expect(fieldNameWildcardMatcher({ name: 'abcdefhghijklm' }, 'hijklmmm')).toBe(false); + // 2 typos + expect(fieldNameWildcardMatcher({ name: 'abcdefhghijklm' }, 'cccdefhghijklm')).toBe(false); + expect(fieldNameWildcardMatcher({ name: 'abcdefhghijklm' }, 'cccdefh')).toBe(false); + }); }); }); @@ -74,10 +126,10 @@ describe('fieldNameWildcardMatcher', function () { expect(getFieldSearchMatchingHighlight('test this')).toBe(''); }); - it('should correctly return a full match for a wildcard search', async () => { - expect(getFieldSearchMatchingHighlight('Test this', 'test*')).toBe('Test this'); - expect(getFieldSearchMatchingHighlight('test this', '*this')).toBe('test this'); - expect(getFieldSearchMatchingHighlight('test this', ' te th')).toBe('test this'); + it('should correctly return a match for a wildcard search', async () => { + expect(getFieldSearchMatchingHighlight('Test this', 'test*')).toBe('test'); + expect(getFieldSearchMatchingHighlight('test this', '*this')).toBe(' this'); + expect(getFieldSearchMatchingHighlight('test this', ' te th')).toBe('t th'); }); }); }); diff --git a/packages/kbn-field-utils/src/utils/field_name_wildcard_matcher.ts b/packages/kbn-field-utils/src/utils/field_name_wildcard_matcher.ts index ba06e36e95c9f..472f377ccddae 100644 --- a/packages/kbn-field-utils/src/utils/field_name_wildcard_matcher.ts +++ b/packages/kbn-field-utils/src/utils/field_name_wildcard_matcher.ts @@ -7,6 +7,7 @@ */ import { escapeRegExp, memoize } from 'lodash'; +import { distance } from 'fastest-levenshtein'; const makeRegEx = memoize(function makeRegEx(glob: string) { const trimmedGlob = glob.trim(); @@ -21,7 +22,7 @@ const makeRegEx = memoize(function makeRegEx(glob: string) { globRegex = '.*' + globRegex + '.*'; } - return new RegExp(globRegex.includes('*') ? `^${globRegex}$` : globRegex, 'i'); + return new RegExp(globRegex.includes('*') ? `^${globRegex}$` : globRegex); }); /** @@ -37,11 +38,61 @@ export const fieldNameWildcardMatcher = ( if (!fieldSearchHighlight?.trim()) { return false; } + const searchLower = fieldSearchHighlight.toLowerCase(); + const displayNameLower = field.displayName?.toLowerCase(); + const nameLower = field.name.toLowerCase(); - const regExp = makeRegEx(fieldSearchHighlight); - return (!!field.displayName && regExp.test(field.displayName)) || regExp.test(field.name); + const regExp = makeRegEx(searchLower); + const doesWildcardMatch = + (!!displayNameLower && regExp.test(displayNameLower)) || regExp.test(nameLower); + if (doesWildcardMatch) { + return true; + } + + if (searchLower.length < FUZZY_STRING_MIN_LENGTH) { + return false; + } + return testFuzzySearch({ name: nameLower, displayName: displayNameLower }, searchLower); }; +const FUZZY_STRING_MIN_LENGTH = 4; +const FUZZY_SEARCH_DISTANCE = 1; + +const testFuzzySearch = (field: { name: string; displayName?: string }, searchValue: string) => { + return ( + Boolean(testFuzzySearchForString(field.displayName, searchValue)) || + (field.name !== field.displayName && Boolean(testFuzzySearchForString(field.name, searchValue))) + ); +}; + +const testFuzzySearchForString = (label: string | undefined, searchValue: string) => { + if (!label || label.length < searchValue.length - 2) { + return false; + } + + const substrLength = Math.max( + Math.min(searchValue.length, label.length), + FUZZY_STRING_MIN_LENGTH + ); + + // performance optimization: instead of building the whole matrix, + // only iterate through the strings of the substring length +- 1 character, + // for example for searchValue = 'test' and label = 'test_value', + // we iterate through 'test', 'est_', 'st_v' (and +- character cases too). + const iterationsCount = label.length - substrLength + 1; + for (let i = 0; i <= iterationsCount; i++) { + for (let j = substrLength - 1; j <= substrLength + 1; j++) { + if (compareLevenshtein(searchValue, label.substring(i, j + i))) { + return label.substring(i, j + i); + } + } + } + return false; +}; + +const compareLevenshtein = (str1: string, str2: string) => + distance(str1, str2) <= FUZZY_SEARCH_DISTANCE; + /** * Adapts fieldNameWildcardMatcher to combobox props. * @param field @@ -64,13 +115,15 @@ export function getFieldSearchMatchingHighlight( displayName: string, fieldSearchHighlight?: string ): string { + if (!fieldSearchHighlight) { + return ''; + } const searchHighlight = (fieldSearchHighlight || '').trim(); - if ( - (searchHighlight.includes('*') || searchHighlight.includes(' ')) && - fieldNameWildcardMatcher({ name: displayName }, searchHighlight) - ) { - return displayName; + if (displayName.toLowerCase().indexOf(searchHighlight.toLowerCase()) > -1) { + return searchHighlight; } - - return searchHighlight; + return ( + testFuzzySearchForString(displayName.toLowerCase(), searchHighlight.toLowerCase()) || + displayName + ); } diff --git a/packages/kbn-field-utils/src/utils/get_text_based_column_icon_type.ts b/packages/kbn-field-utils/src/utils/get_text_based_column_icon_type.ts index 0ccad94674208..3c37b9b01c3fb 100644 --- a/packages/kbn-field-utils/src/utils/get_text_based_column_icon_type.ts +++ b/packages/kbn-field-utils/src/utils/get_text_based_column_icon_type.ts @@ -7,6 +7,7 @@ */ import type { DatatableColumnMeta } from '@kbn/expressions-plugin/common'; +import { convertDatatableColumnToDataViewFieldSpec } from '@kbn/data-view-utils'; import { getFieldIconType } from './get_field_icon_type'; export function getTextBasedColumnIconType( @@ -19,10 +20,8 @@ export function getTextBasedColumnIconType( | null ): string | null { return columnMeta && columnMeta.type - ? getFieldIconType({ - name: '', - type: columnMeta.type, - esTypes: columnMeta.esType ? [columnMeta.esType] : [], - }) + ? getFieldIconType( + convertDatatableColumnToDataViewFieldSpec({ id: '', name: '', meta: columnMeta }) + ) : null; } diff --git a/packages/kbn-field-utils/tsconfig.json b/packages/kbn-field-utils/tsconfig.json index 4b75159b5f7fe..9ac5ba7e942bc 100644 --- a/packages/kbn-field-utils/tsconfig.json +++ b/packages/kbn-field-utils/tsconfig.json @@ -10,6 +10,7 @@ "@kbn/react-field", "@kbn/field-types", "@kbn/expressions-plugin", + "@kbn/data-view-utils", ], "exclude": ["target/**/*"] } diff --git a/packages/kbn-grouping/index.tsx b/packages/kbn-grouping/index.tsx index 1b83c314714b7..7dd711b72d015 100644 --- a/packages/kbn-grouping/index.tsx +++ b/packages/kbn-grouping/index.tsx @@ -13,7 +13,7 @@ import type { GroupingAggregation, NamedAggregation, RawBucket, - StatRenderer, + GroupStatsItem, } from './src'; export { getGroupingQuery, isNoneGroup, useGrouping }; @@ -24,5 +24,5 @@ export type { GroupingAggregation, NamedAggregation, RawBucket, - StatRenderer, + GroupStatsItem, }; diff --git a/packages/kbn-grouping/jest.config.js b/packages/kbn-grouping/jest.config.js index d415d4101ad86..80b0183f089c3 100644 --- a/packages/kbn-grouping/jest.config.js +++ b/packages/kbn-grouping/jest.config.js @@ -22,5 +22,5 @@ module.exports = { '!/packages/kbn-grouping/**/translations', '!/packages/kbn-grouping/**/types/*', ], - setupFilesAfterEnv: ['/packages/kbn-grouping/setup_test.ts'], + setupFilesAfterEnv: ['/packages/kbn-grouping/setup_tests.ts'], }; diff --git a/packages/kbn-grouping/setup_tests.ts b/packages/kbn-grouping/setup_tests.ts new file mode 100644 index 0000000000000..bb55d97ec9302 --- /dev/null +++ b/packages/kbn-grouping/setup_tests.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +// eslint-disable-next-line import/no-extraneous-dependencies +import '@testing-library/jest-dom'; diff --git a/packages/kbn-grouping/src/components/accordion_panel/group_stats.test.tsx b/packages/kbn-grouping/src/components/accordion_panel/group_stats.test.tsx index 8ccc1c912b62d..5960a0a65b295 100644 --- a/packages/kbn-grouping/src/components/accordion_panel/group_stats.test.tsx +++ b/packages/kbn-grouping/src/components/accordion_panel/group_stats.test.tsx @@ -16,10 +16,10 @@ const testProps = { groupFilter: [], groupNumber: 0, onTakeActionsOpen, - statRenderers: [ + stats: [ { title: 'Severity', - renderer:

, + component:

, }, { title: "IP's:", badge: { value: 1 } }, { title: 'Rules:', badge: { value: 2 } }, @@ -34,11 +34,12 @@ describe('Group stats', () => { beforeEach(() => { jest.clearAllMocks(); }); + it('renders each stat item', () => { const { getByTestId, queryByTestId } = render(); expect(getByTestId('group-stats')).toBeInTheDocument(); - testProps.statRenderers.forEach(({ title: stat, renderer }) => { - if (renderer != null) { + testProps.stats.forEach(({ title: stat, component }) => { + if (component != null) { expect(getByTestId(`customMetric-${stat}`)).toBeInTheDocument(); expect(queryByTestId(`metric-${stat}`)).not.toBeInTheDocument(); } else { @@ -47,6 +48,7 @@ describe('Group stats', () => { } }); }); + it('when onTakeActionsOpen is defined, call onTakeActionsOpen on popover click', () => { const { getByTestId, queryByTestId } = render(); fireEvent.click(getByTestId('take-action-button')); @@ -55,6 +57,7 @@ describe('Group stats', () => { expect(queryByTestId(actionItem)).not.toBeInTheDocument(); }); }); + it('when onTakeActionsOpen is undefined, render take actions dropdown on popover click', () => { const { getByTestId } = render(); fireEvent.click(getByTestId('take-action-button')); @@ -62,4 +65,16 @@ describe('Group stats', () => { expect(getByTestId(actionItem)).toBeInTheDocument(); }); }); + + it('shows the Take Actions menu when action items are provided', () => { + const { queryByTestId } = render( + []} /> + ); + expect(queryByTestId('take-action-button')).toBeInTheDocument(); + }); + + it('hides the Take Actions menu when no action item is provided', () => { + const { queryByTestId } = render( []} />); + expect(queryByTestId('take-action-button')).not.toBeInTheDocument(); + }); }); diff --git a/packages/kbn-grouping/src/components/accordion_panel/group_stats.tsx b/packages/kbn-grouping/src/components/accordion_panel/group_stats.tsx index 61f40982507b8..87e083fa76255 100644 --- a/packages/kbn-grouping/src/components/accordion_panel/group_stats.tsx +++ b/packages/kbn-grouping/src/components/accordion_panel/group_stats.tsx @@ -15,9 +15,11 @@ import { EuiPopover, EuiToolTip, } from '@elastic/eui'; -import React, { useCallback, useMemo, useState } from 'react'; +import React, { Fragment, useCallback, useMemo, useState } from 'react'; import { Filter } from '@kbn/es-query'; -import { StatRenderer } from '../types'; +import { css } from '@emotion/react'; +import { euiThemeVars } from '@kbn/ui-theme'; +import { GroupStatsItem } from '../types'; import { statsContainerCss } from '../styles'; import { TAKE_ACTION } from '../translations'; @@ -26,38 +28,44 @@ interface GroupStatsProps { groupFilter: Filter[]; groupNumber: number; onTakeActionsOpen?: () => void; - statRenderers?: StatRenderer[]; - takeActionItems: (groupFilters: Filter[], groupNumber: number) => JSX.Element[]; + stats?: GroupStatsItem[]; + takeActionItems?: (groupFilters: Filter[], groupNumber: number) => JSX.Element[]; } +const Separator = () => { + return ( + + ); +}; + const GroupStatsComponent = ({ bucketKey, groupFilter, groupNumber, onTakeActionsOpen, - statRenderers, + stats, takeActionItems: getTakeActionItems, }: GroupStatsProps) => { const [isPopoverOpen, setPopover] = useState(false); - const [takeActionItems, setTakeActionItems] = useState([]); + const takeActionItems = useMemo(() => { + return getTakeActionItems?.(groupFilter, groupNumber) ?? []; + }, [getTakeActionItems, groupFilter, groupNumber]); const onButtonClick = useCallback(() => { - if (!isPopoverOpen && takeActionItems.length === 0) { - setTakeActionItems(getTakeActionItems(groupFilter, groupNumber)); - } return !isPopoverOpen && onTakeActionsOpen ? onTakeActionsOpen() : setPopover(!isPopoverOpen); - }, [ - getTakeActionItems, - groupFilter, - groupNumber, - isPopoverOpen, - onTakeActionsOpen, - takeActionItems.length, - ]); + }, [isPopoverOpen, onTakeActionsOpen]); - const statsComponent = useMemo( + const statsComponents = useMemo( () => - statRenderers?.map((stat) => { + stats?.map((stat) => { const { dataTestSubj, component } = stat.badge != null ? { @@ -73,7 +81,7 @@ const GroupStatsComponent = ({ ), } - : { dataTestSubj: `customMetric-${stat.title}`, component: stat.renderer }; + : { dataTestSubj: `customMetric-${stat.title}`, component: stat.component }; return ( @@ -83,33 +91,34 @@ const GroupStatsComponent = ({ ); - }), - [statRenderers] + }) ?? [], + [stats] ); const takeActionMenu = useMemo( - () => ( - - - {TAKE_ACTION} - - } - closePopover={() => setPopover(false)} - isOpen={isPopoverOpen} - panelPaddingSize="none" - > - - - - ), + () => + takeActionItems.length ? ( + + + {TAKE_ACTION} + + } + closePopover={() => setPopover(false)} + isOpen={isPopoverOpen} + panelPaddingSize="none" + > + + + + ) : null, [isPopoverOpen, onButtonClick, takeActionItems] ); @@ -117,11 +126,15 @@ const GroupStatsComponent = ({ - {statsComponent} - {takeActionMenu} + {[...statsComponents, takeActionMenu].filter(Boolean).map((component, index, { length }) => ( + + {component} + {index < length - 1 && } + + ))} ); }; diff --git a/packages/kbn-grouping/src/components/accordion_panel/index.tsx b/packages/kbn-grouping/src/components/accordion_panel/index.tsx index 60237b2a10780..ae13509b51a9e 100644 --- a/packages/kbn-grouping/src/components/accordion_panel/index.tsx +++ b/packages/kbn-grouping/src/components/accordion_panel/index.tsx @@ -18,7 +18,7 @@ interface GroupPanelProps { extraAction?: React.ReactNode; forceState?: 'open' | 'closed'; groupBucket: GroupingBucket; - groupPanelRenderer?: JSX.Element; + groupPanel?: JSX.Element; groupingLevel?: number; isLoading: boolean; isNullGroup?: boolean; @@ -62,7 +62,7 @@ const GroupPanelComponent = ({ extraAction, forceState, groupBucket, - groupPanelRenderer, + groupPanel, groupingLevel = 0, isLoading, isNullGroup = false, @@ -115,7 +115,7 @@ const GroupPanelComponent = ({ buttonClassName={customAccordionButtonClassName} buttonContent={

- {groupPanelRenderer ?? ( + {groupPanel ?? ( { }); it('Renders a null group and passes the correct filter to take actions and child component', () => { - takeActionItems.mockReturnValue([]); + takeActionItems.mockReturnValue([]); const { getAllByTestId, getByTestId } = render( diff --git a/packages/kbn-grouping/src/components/grouping.tsx b/packages/kbn-grouping/src/components/grouping.tsx index 2b7c0ea4a9dd0..41a64e2cb274c 100644 --- a/packages/kbn-grouping/src/components/grouping.tsx +++ b/packages/kbn-grouping/src/components/grouping.tsx @@ -23,8 +23,8 @@ import { GroupStats } from './accordion_panel/group_stats'; import { EmptyGroupingComponent } from './empty_results_panel'; import { countCss, groupingContainerCss, groupingContainerCssLevel } from './styles'; import { GROUPS_UNIT, NULL_GROUP } from './translations'; -import type { ParsedGroupingAggregation, GroupPanelRenderer } from './types'; -import { GroupingBucket, GroupStatsRenderer, OnGroupToggle } from './types'; +import type { ParsedGroupingAggregation, GroupPanelRenderer, GetGroupStats } from './types'; +import { GroupingBucket, OnGroupToggle } from './types'; import { getTelemetryEvent } from '../telemetry/const'; export interface GroupingProps { @@ -33,7 +33,7 @@ export interface GroupingProps { groupPanelRenderer?: GroupPanelRenderer; groupSelector?: JSX.Element; // list of custom UI components which correspond to your custom rendered metrics aggregations - groupStatsRenderer?: GroupStatsRenderer; + getGroupStats?: GetGroupStats; groupingId: string; groupingLevel?: number; inspectButton?: JSX.Element; @@ -45,7 +45,7 @@ export interface GroupingProps { renderChildComponent: (groupFilter: Filter[]) => React.ReactElement; onGroupClose: () => void; selectedGroup: string; - takeActionItems: (groupFilters: Filter[], groupNumber: number) => JSX.Element[]; + takeActionItems?: (groupFilters: Filter[], groupNumber: number) => JSX.Element[]; tracker?: ( type: UiCounterMetricType, event: string | string[], @@ -59,8 +59,8 @@ const GroupingComponent = ({ activePage, data, groupPanelRenderer, + getGroupStats, groupSelector, - groupStatsRenderer, groupingId, groupingLevel = 0, inspectButton, @@ -124,15 +124,13 @@ const GroupingComponent = ({ ) } groupNumber={groupNumber} - statRenderers={ - groupStatsRenderer && groupStatsRenderer(selectedGroup, groupBucket) - } + stats={getGroupStats && getGroupStats(selectedGroup, groupBucket)} takeActionItems={takeActionItems} /> } forceState={(trigger[groupKey] && trigger[groupKey].state) ?? 'closed'} groupBucket={groupBucket} - groupPanelRenderer={ + groupPanel={ groupPanelRenderer && groupPanelRenderer(selectedGroup, groupBucket, nullGroupMessage, isLoading) } @@ -166,7 +164,7 @@ const GroupingComponent = ({ [ data?.groupByFields?.buckets, groupPanelRenderer, - groupStatsRenderer, + getGroupStats, groupingId, groupingLevel, isLoading, diff --git a/packages/kbn-grouping/src/components/styles.tsx b/packages/kbn-grouping/src/components/styles.tsx index 063c0f271f37f..d65cf8c84e353 100644 --- a/packages/kbn-grouping/src/components/styles.tsx +++ b/packages/kbn-grouping/src/components/styles.tsx @@ -22,9 +22,6 @@ export const countCss = css` export const statsContainerCss = css` font-size: ${euiThemeVars.euiFontSizeXS}; font-weight: ${euiThemeVars.euiFontWeightSemiBold}; - border-right: ${euiThemeVars.euiBorderThin}; - margin-right: 16px; - padding-right: 16px; .smallDot { width: 3px !important; display: inline-block; diff --git a/packages/kbn-grouping/src/components/types.ts b/packages/kbn-grouping/src/components/types.ts index 43a9af13372f7..98822b7c80bc9 100644 --- a/packages/kbn-grouping/src/components/types.ts +++ b/packages/kbn-grouping/src/components/types.ts @@ -62,16 +62,16 @@ export interface BadgeMetric { width?: number; } -export interface StatRenderer { +export interface GroupStatsItem { title: string; - renderer?: JSX.Element; + component?: JSX.Element; badge?: BadgeMetric; } -export type GroupStatsRenderer = ( +export type GetGroupStats = ( selectedGroup: string, fieldBucket: RawBucket -) => StatRenderer[]; +) => GroupStatsItem[]; export type GroupPanelRenderer = ( selectedGroup: string, diff --git a/packages/kbn-grouping/src/hooks/use_grouping.tsx b/packages/kbn-grouping/src/hooks/use_grouping.tsx index af3ae458de285..284343a29d748 100644 --- a/packages/kbn-grouping/src/hooks/use_grouping.tsx +++ b/packages/kbn-grouping/src/hooks/use_grouping.tsx @@ -31,7 +31,7 @@ export interface UseGrouping { */ type StaticGroupingProps = Pick< GroupingProps, - 'groupPanelRenderer' | 'groupStatsRenderer' | 'onGroupToggle' | 'unit' | 'groupsUnit' + 'groupPanelRenderer' | 'getGroupStats' | 'onGroupToggle' | 'unit' | 'groupsUnit' >; /** Type for dynamic grouping component props where T is the consumer `GroupingAggregation` diff --git a/packages/kbn-health-gateway-server/src/kibana/handlers/status.ts b/packages/kbn-health-gateway-server/src/kibana/handlers/status.ts index 51da98dfed0f7..0ce8ccbdd3cf7 100644 --- a/packages/kbn-health-gateway-server/src/kibana/handlers/status.ts +++ b/packages/kbn-health-gateway-server/src/kibana/handlers/status.ts @@ -57,7 +57,7 @@ export class StatusHandler { const body = await this.poll(); const code = StatusHandler.STATUS_CODE[body.status]; - this.logger.debug(`Returning ${code} response with body: ${JSON.stringify(body)}`); + this.logger.debug(() => `Returning ${code} response with body: ${JSON.stringify(body)}`); return toolkit.response(body).type('application/json').code(code); } diff --git a/packages/kbn-lens-embeddable-utils/config_builder/charts/gauge.test.ts b/packages/kbn-lens-embeddable-utils/config_builder/charts/gauge.test.ts index 322bfa2fb2da1..6403ec630a66f 100644 --- a/packages/kbn-lens-embeddable-utils/config_builder/charts/gauge.test.ts +++ b/packages/kbn-lens-embeddable-utils/config_builder/charts/gauge.test.ts @@ -98,6 +98,7 @@ test('generates gauge chart config', async () => { "query": Object { "esql": "from test | count=count()", }, + "timeField": undefined, }, }, }, @@ -189,6 +190,7 @@ test('generates gauge chart config with goal and max', async () => { "query": Object { "esql": "from test | count=count() | eval max=1000 | eval goal=500", }, + "timeField": undefined, }, }, }, diff --git a/packages/kbn-lens-embeddable-utils/config_builder/charts/heatmap.test.ts b/packages/kbn-lens-embeddable-utils/config_builder/charts/heatmap.test.ts index 9c3c2fa2bdb6b..a6ba22ea8de1a 100644 --- a/packages/kbn-lens-embeddable-utils/config_builder/charts/heatmap.test.ts +++ b/packages/kbn-lens-embeddable-utils/config_builder/charts/heatmap.test.ts @@ -116,6 +116,7 @@ test('generates metric chart config', async () => { "query": Object { "esql": "from test | count=count() by @timestamp, category", }, + "timeField": undefined, }, }, }, diff --git a/packages/kbn-lens-embeddable-utils/config_builder/charts/metric.test.ts b/packages/kbn-lens-embeddable-utils/config_builder/charts/metric.test.ts index 052c89a0c56c7..05d89bb95cd84 100644 --- a/packages/kbn-lens-embeddable-utils/config_builder/charts/metric.test.ts +++ b/packages/kbn-lens-embeddable-utils/config_builder/charts/metric.test.ts @@ -108,6 +108,7 @@ test('generates metric chart config', async () => { "query": Object { "esql": "from test | count=count()", }, + "timeField": undefined, }, }, }, diff --git a/packages/kbn-lens-embeddable-utils/config_builder/charts/partition.test.ts b/packages/kbn-lens-embeddable-utils/config_builder/charts/partition.test.ts index 120b3069552d8..2511601b5bab5 100644 --- a/packages/kbn-lens-embeddable-utils/config_builder/charts/partition.test.ts +++ b/packages/kbn-lens-embeddable-utils/config_builder/charts/partition.test.ts @@ -115,6 +115,7 @@ test('generates metric chart config', async () => { "query": Object { "esql": "from test | count=count() by @timestamp, category", }, + "timeField": undefined, }, }, }, diff --git a/packages/kbn-lens-embeddable-utils/config_builder/charts/region_map.test.ts b/packages/kbn-lens-embeddable-utils/config_builder/charts/region_map.test.ts index dc1f37a393fd2..e3a50cc3a07a1 100644 --- a/packages/kbn-lens-embeddable-utils/config_builder/charts/region_map.test.ts +++ b/packages/kbn-lens-embeddable-utils/config_builder/charts/region_map.test.ts @@ -107,6 +107,7 @@ test('generates region map chart config', async () => { "query": Object { "esql": "from test | count=count() by category", }, + "timeField": undefined, }, }, }, diff --git a/packages/kbn-lens-embeddable-utils/config_builder/charts/table.test.ts b/packages/kbn-lens-embeddable-utils/config_builder/charts/table.test.ts index 90c07d4af46b7..3ddbaa79357e1 100644 --- a/packages/kbn-lens-embeddable-utils/config_builder/charts/table.test.ts +++ b/packages/kbn-lens-embeddable-utils/config_builder/charts/table.test.ts @@ -107,6 +107,7 @@ test('generates table config', async () => { "query": Object { "esql": "from test | count=count() by category", }, + "timeField": undefined, }, }, }, diff --git a/packages/kbn-lens-embeddable-utils/config_builder/charts/tag_cloud.test.ts b/packages/kbn-lens-embeddable-utils/config_builder/charts/tag_cloud.test.ts index d7db572bb286a..ff8366f9eeda1 100644 --- a/packages/kbn-lens-embeddable-utils/config_builder/charts/tag_cloud.test.ts +++ b/packages/kbn-lens-embeddable-utils/config_builder/charts/tag_cloud.test.ts @@ -107,6 +107,7 @@ test('generates tag cloud chart config', async () => { "query": Object { "esql": "from test | count=count() by category", }, + "timeField": undefined, }, }, }, @@ -123,8 +124,8 @@ test('generates tag cloud chart config', async () => { "minFontSize": 12, "orientation": "single", "showLabel": true, - "tagAccessor": "category", - "valueAccessor": "count", + "tagAccessor": "metric_formula_accessor_breakdown", + "valueAccessor": "metric_formula_accessor", }, }, "title": "test", diff --git a/packages/kbn-lens-embeddable-utils/config_builder/charts/tag_cloud.ts b/packages/kbn-lens-embeddable-utils/config_builder/charts/tag_cloud.ts index 551dcfe973d3a..55ce8f1fe1a02 100644 --- a/packages/kbn-lens-embeddable-utils/config_builder/charts/tag_cloud.ts +++ b/packages/kbn-lens-embeddable-utils/config_builder/charts/tag_cloud.ts @@ -18,7 +18,6 @@ import { buildDatasourceStates, buildReferences, getAdhocDataviews, - isFormulaDataset, mapToFormula, } from '../utils'; import { getBreakdownColumn, getFormulaColumn, getValueColumn } from '../columns'; @@ -31,18 +30,17 @@ function getAccessorName(type: 'breakdown') { function buildVisualizationState(config: LensTagCloudConfig): TagcloudState { const layer = config; - const isFormula = isFormulaDataset(config.dataset) || isFormulaDataset(layer.dataset); return { layerId: DEFAULT_LAYER_ID, - valueAccessor: !isFormula ? layer.value : ACCESSOR, + valueAccessor: ACCESSOR, maxFontSize: 72, minFontSize: 12, orientation: 'single', showLabel: true, ...(layer.breakdown ? { - tagAccessor: !isFormula ? (layer.breakdown as string) : getAccessorName('breakdown'), + tagAccessor: getAccessorName('breakdown'), } : {}), }; diff --git a/packages/kbn-lens-embeddable-utils/config_builder/charts/xy.test.ts b/packages/kbn-lens-embeddable-utils/config_builder/charts/xy.test.ts index 562c5b0948a48..4af00e3d163bd 100644 --- a/packages/kbn-lens-embeddable-utils/config_builder/charts/xy.test.ts +++ b/packages/kbn-lens-embeddable-utils/config_builder/charts/xy.test.ts @@ -125,6 +125,7 @@ test('generates xy chart config', async () => { "query": Object { "esql": "from test | count=count() by @timestamp", }, + "timeField": undefined, }, }, }, diff --git a/packages/kbn-lens-embeddable-utils/config_builder/config_builder.ts b/packages/kbn-lens-embeddable-utils/config_builder/config_builder.ts index 4a14e20b7aea4..f60a758f49e9e 100644 --- a/packages/kbn-lens-embeddable-utils/config_builder/config_builder.ts +++ b/packages/kbn-lens-embeddable-utils/config_builder/config_builder.ts @@ -49,7 +49,7 @@ export class LensConfigBuilder { async build( config: LensConfig, options: LensConfigOptions = {} - ): Promise { + ): Promise { const { chartType } = config; const chartConfig = await this.charts[chartType](config as any, { formulaAPI: this.formulaAPI, @@ -74,6 +74,6 @@ export class LensConfigBuilder { } as LensEmbeddableInput; } - return chartState; + return chartState as LensAttributes; } } diff --git a/packages/kbn-lens-embeddable-utils/config_builder/types.ts b/packages/kbn-lens-embeddable-utils/config_builder/types.ts index 19683adb4d423..b246d79c6a0b6 100644 --- a/packages/kbn-lens-embeddable-utils/config_builder/types.ts +++ b/packages/kbn-lens-embeddable-utils/config_builder/types.ts @@ -7,7 +7,7 @@ */ import type { FormulaPublicApi, TypedLensByValueInput } from '@kbn/lens-plugin/public'; -import type { Filter, Query } from '@kbn/es-query'; +import type { AggregateQuery, Filter, Query } from '@kbn/es-query'; import type { Datatable } from '@kbn/expressions-plugin/common'; import { DataViewsCommon } from './config_builder'; @@ -95,7 +95,7 @@ export interface LensConfigOptions { /** optional time range override */ timeRange?: TimeRange; filters?: Filter[]; - query?: Query; + query?: Query | AggregateQuery; } export interface LensAxisTitleVisibilityConfig { @@ -208,9 +208,9 @@ export type LensRegionMapConfig = Identity< export interface LensMosaicConfigBase { chartType: 'mosaic'; /** field name to apply breakdown based on field type or full breakdown configuration */ - breakdown: LensBreakdownConfig; + breakdown: LensBreakdownConfig[]; /** field name to apply breakdown based on field type or full breakdown configuration */ - xAxis: LensBreakdownConfig; + xAxis?: LensBreakdownConfig; } export type LensMosaicConfig = Identity; @@ -228,7 +228,7 @@ export type LensTableConfig = Identity; } diff --git a/packages/kbn-lens-embeddable-utils/config_builder/utils.test.ts b/packages/kbn-lens-embeddable-utils/config_builder/utils.test.ts index d7559b7121ae8..480be9c800b56 100644 --- a/packages/kbn-lens-embeddable-utils/config_builder/utils.test.ts +++ b/packages/kbn-lens-embeddable-utils/config_builder/utils.test.ts @@ -208,6 +208,7 @@ describe('buildDatasourceStates', () => { "query": Object { "esql": "from test | limit 10", }, + "timeField": undefined, }, }, }, diff --git a/packages/kbn-lens-embeddable-utils/config_builder/utils.ts b/packages/kbn-lens-embeddable-utils/config_builder/utils.ts index ffd0a40612a7a..ca4114b4df4fe 100644 --- a/packages/kbn-lens-embeddable-utils/config_builder/utils.ts +++ b/packages/kbn-lens-embeddable-utils/config_builder/utils.ts @@ -200,6 +200,7 @@ function buildDatasourceStatesLayer( const newLayer = { index: dataView!.id!, query: { esql: (dataset as LensESQLDataset).esql } as AggregateQuery, + timeField: dataView!.timeFieldName, columns, allColumns: columns, }; diff --git a/packages/kbn-logging-mocks/src/logger.mock.ts b/packages/kbn-logging-mocks/src/logger.mock.ts index 90436fb4516d2..f63f0fa053572 100644 --- a/packages/kbn-logging-mocks/src/logger.mock.ts +++ b/packages/kbn-logging-mocks/src/logger.mock.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { Logger } from '@kbn/logging'; +import type { Logger, LogMeta, LogMessageSource } from '@kbn/logging'; export type MockedLogger = jest.Mocked & { context: string[] }; @@ -43,15 +43,39 @@ const clearLoggerMock = (logger: MockedLogger) => { logger.log.mockClear(); }; +const convertMessageSource = ( + value: [message: LogMessageSource, meta?: LogMeta | undefined] +): [string] | [string, LogMeta | undefined] => { + const message = typeof value[0] === 'function' ? value[0]() : value[0]; + const meta = value[1]; + if (meta) { + return [message, meta]; + } else { + return [message]; + } +}; + +const convertMessageSourceOrError = ( + value: [message: LogMessageSource | Error, meta?: LogMeta | undefined] +): [string | Error] | [string | Error, LogMeta | undefined] => { + const message = typeof value[0] === 'function' ? value[0]() : value[0]; + const meta = value[1]; + if (meta) { + return [message, meta]; + } else { + return [message]; + } +}; + const collectLoggerMock = (logger: MockedLogger) => { return { - debug: logger.debug.mock.calls, - error: logger.error.mock.calls, - fatal: logger.fatal.mock.calls, - info: logger.info.mock.calls, + debug: logger.debug.mock.calls.map(convertMessageSource), + error: logger.error.mock.calls.map(convertMessageSourceOrError), + fatal: logger.fatal.mock.calls.map(convertMessageSourceOrError), + info: logger.info.mock.calls.map(convertMessageSource), log: logger.log.mock.calls, - trace: logger.trace.mock.calls, - warn: logger.warn.mock.calls, + trace: logger.trace.mock.calls.map(convertMessageSource), + warn: logger.warn.mock.calls.map(convertMessageSourceOrError), }; }; diff --git a/packages/kbn-logging/index.ts b/packages/kbn-logging/index.ts index b6915b73a26bc..a7082d9697232 100644 --- a/packages/kbn-logging/index.ts +++ b/packages/kbn-logging/index.ts @@ -9,7 +9,7 @@ export type { LogLevelId } from './src/log_level'; export { LogLevel } from './src/log_level'; export type { LogRecord } from './src/log_record'; -export type { Logger } from './src/logger'; +export type { Logger, LogMessageSource } from './src/logger'; export type { LogMeta } from './src/log_meta'; export type { LoggerFactory } from './src/logger_factory'; export type { Layout } from './src/layout'; diff --git a/packages/kbn-logging/src/logger.ts b/packages/kbn-logging/src/logger.ts index bd31d4c42f805..45f215abaef63 100644 --- a/packages/kbn-logging/src/logger.ts +++ b/packages/kbn-logging/src/logger.ts @@ -10,6 +10,11 @@ import type { LogMeta } from './log_meta'; import type { LogRecord } from './log_record'; import type { LogLevelId } from './log_level'; +/** + * @public + */ +export type LogMessageSource = string | (() => string); + /** * Logger exposes all the necessary methods to log any type of information and * this is the interface used by the logging consumers including plugins. @@ -20,47 +25,74 @@ export interface Logger { /** * Log messages at the most detailed log level * - * @param message - The log message - * @param meta - + * @param message - The log message, or a function returning the log message + * @param meta - The ECS meta to attach to the log entry + * + * @remark If a function is provided for the message, it will only be evaluated if the logger's level is high enough for this level. + * This can be used as an alternative to {@link Logger.isLevelEnabled} to wrap expensive logging operations into a conditional blocks. */ - trace(message: string, meta?: Meta): void; + trace(message: LogMessageSource, meta?: Meta): void; /** * Log messages useful for debugging and interactive investigation - * @param message - The log message - * @param meta - + * + * @param message - The log message, or a function returning the log message + * @param meta - The ECS meta to attach to the log entry + * + * @remark If a function is provided for the message, it will only be evaluated if the logger's level is high enough for this level. + * This can be used as an alternative to {@link Logger.isLevelEnabled} to wrap expensive logging operations into a conditional blocks. */ - debug(message: string, meta?: Meta): void; + debug(message: LogMessageSource, meta?: Meta): void; /** * Logs messages related to general application flow - * @param message - The log message - * @param meta - + * + * @param message - The log message, or a function returning the log message + * @param meta - The ECS meta to attach to the log entry + * + * @remark If a function is provided for the message, it will only be evaluated if the logger's level is high enough for this level. + * This can be used as an alternative to {@link Logger.isLevelEnabled} to wrap expensive logging operations into a conditional blocks. */ - info(message: string, meta?: Meta): void; + info(message: LogMessageSource, meta?: Meta): void; /** * Logs abnormal or unexpected errors or messages - * @param errorOrMessage - An Error object or message string to log - * @param meta - + * + * @param errorOrMessage - An Error object, message string, or function returning the log message + * @param meta - The ECS meta to attach to the log entry + * + * @remark If a function is provided for the message, it will only be evaluated if the logger's level is high enough for this level. + * This can be used as an alternative to {@link Logger.isLevelEnabled} to wrap expensive logging operations into a conditional blocks. */ - warn(errorOrMessage: string | Error, meta?: Meta): void; + warn(errorOrMessage: LogMessageSource | Error, meta?: Meta): void; /** * Logs abnormal or unexpected errors or messages that caused a failure in the application flow * - * @param errorOrMessage - An Error object or message string to log - * @param meta - + * @param errorOrMessage - An Error object, message string, or function returning the log message + * @param meta - The ECS meta to attach to the log entry + * + * @remark If a function is provided for the message, it will only be evaluated if the logger's level is high enough for this level. + * This can be used as an alternative to {@link Logger.isLevelEnabled} to wrap expensive logging operations into a conditional blocks. */ - error(errorOrMessage: string | Error, meta?: Meta): void; + error( + errorOrMessage: LogMessageSource | Error, + meta?: Meta + ): void; /** * Logs abnormal or unexpected errors or messages that caused an unrecoverable failure * - * @param errorOrMessage - An Error object or message string to log - * @param meta - + * @param errorOrMessage - An Error object, message string, or function returning the log message + * @param meta - The ECS meta to attach to the log entry + * + * @remark If a function is provided for the message, it will only be evaluated if the logger's level is high enough for this level. + * This can be used as an alternative to {@link Logger.isLevelEnabled} to wrap expensive logging operations into a conditional blocks. */ - fatal(errorOrMessage: string | Error, meta?: Meta): void; + fatal( + errorOrMessage: LogMessageSource | Error, + meta?: Meta + ): void; /** @internal */ log(record: LogRecord): void; diff --git a/packages/kbn-monaco/src/esql/language.ts b/packages/kbn-monaco/src/esql/language.ts index 4e486a5c24188..7c49da41a996e 100644 --- a/packages/kbn-monaco/src/esql/language.ts +++ b/packages/kbn-monaco/src/esql/language.ts @@ -39,11 +39,13 @@ export const ESQLLang: CustomLangModuleType = { { open: '(', close: ')' }, { open: '[', close: ']' }, { open: `'`, close: `'` }, + { open: '"""', close: '"""' }, { open: '"', close: '"' }, ], surroundingPairs: [ { open: '(', close: ')' }, { open: `'`, close: `'` }, + { open: '"""', close: '"""' }, { open: '"', close: '"' }, ], }, diff --git a/packages/kbn-openapi-generator/src/parser/lib/get_circular_refs.ts b/packages/kbn-openapi-generator/src/parser/lib/get_circular_refs.ts index da9649d5f0c6d..5c1e71170d8c5 100644 --- a/packages/kbn-openapi-generator/src/parser/lib/get_circular_refs.ts +++ b/packages/kbn-openapi-generator/src/parser/lib/get_circular_refs.ts @@ -9,7 +9,8 @@ import type { OpenApiDocument } from '../openapi_types'; import type { PlainObject } from './helpers/plain_object'; import { extractByJsonPointer } from './helpers/extract_by_json_pointer'; -import { findRefs } from './find_refs'; +import { findLocalRefs } from './helpers/find_local_refs'; +import { parseRef } from './helpers/parse_ref'; /** * Extracts circular references from a provided document. @@ -19,7 +20,7 @@ export function getCircularRefs(document: OpenApiDocument): Set { const localRefs = findLocalRefs(document); const circularRefs = new Set(); const resolveLocalRef = (localRef: string): PlainObject => - extractByJsonPointer(document, extractJsonPointer(localRef)); + extractByJsonPointer(document, parseRef(localRef).pointer); // In general references represent a disconnected graph. To find // all references cycles we need to check each reference. @@ -80,26 +81,3 @@ function findCycleHeadRef( return result; } - -/** - * Finds local references - */ -function findLocalRefs(obj: unknown): string[] { - return findRefs(obj).filter((ref) => isLocalRef(ref)); -} - -/** - * Checks whether the provided ref is local. - * Local references start with `#/` - */ -function isLocalRef(ref: string): boolean { - return ref.startsWith('#/'); -} - -/** - * Extracts a JSON Pointer from a local reference - * by getting rid of the leading slash - */ -function extractJsonPointer(ref: string): string { - return ref.substring(1); -} diff --git a/packages/kbn-openapi-generator/src/parser/lib/get_components.ts b/packages/kbn-openapi-generator/src/parser/lib/get_components.ts index 6e98793de1afb..ff2f77aced821 100644 --- a/packages/kbn-openapi-generator/src/parser/lib/get_components.ts +++ b/packages/kbn-openapi-generator/src/parser/lib/get_components.ts @@ -6,12 +6,124 @@ * Side Public License, v 1. */ -import type { OpenApiDocument } from '../openapi_types'; +import type { + OpenApiDocument, + OpenApiComponentsObject, + OpenApiSchemasObject, +} from '../openapi_types'; +import { extractByJsonPointer } from './helpers/extract_by_json_pointer'; +import { findLocalRefs } from './helpers/find_local_refs'; +import { parseRef } from './helpers/parse_ref'; -export function getComponents(parsedSchema: OpenApiDocument) { - if (parsedSchema.components?.['x-codegen-enabled'] === false) { +/** + * Returns document components. + * + * It performs topological sorting of component schemas to enable arbitrary + * schemas definition order. + */ +export function getComponents(document: OpenApiDocument): OpenApiComponentsObject | undefined { + if (document.components?.['x-codegen-enabled'] === false) { return undefined; } - return parsedSchema.components; + if (!document.components) { + return; + } + + const refsAdjList = buildLocalRefsAdjacencyList(document.components); + const sortedSchemaRefs = sortTopologically( + refsAdjList, + Array.from(Object.keys(document.components?.schemas ?? {})) + ); + // Starting from ES2020 functions returning or traversing object properties + // make it in ascending chronological order of property creation. It makes + // it possible to assemble schemas object which will be traversed in + // the right order preserving topological sorting. + const sortedSchemas: OpenApiSchemasObject = {}; + + for (const schemaName of sortedSchemaRefs) { + sortedSchemas[schemaName] = extractByJsonPointer(document, `/components/schemas/${schemaName}`); + } + + return { + ...document.components, + schemas: sortedSchemas, + }; +} + +/** + * References adjacency list with keys as schema name and value + * as a set of schemas the key references to. + */ +type ReferencesAdjacencyList = Map>; + +/** + * Builds a references adjacency list. An adjacency list allow to apply + * any graph algorithms working with adjacency lists. + * See https://en.wikipedia.org/wiki/Adjacency_list + */ +function buildLocalRefsAdjacencyList( + componentsObj: OpenApiComponentsObject +): ReferencesAdjacencyList { + if (!componentsObj.schemas) { + return new Map(); + } + + const adjacencyList: ReferencesAdjacencyList = new Map(); + + for (const [schemaName, schema] of Object.entries(componentsObj.schemas)) { + const dependencies = adjacencyList.get(schemaName); + const dependencySchemaNames = findLocalRefs(schema).map((ref) => parseRef(ref).schemaName); + + if (!dependencies) { + adjacencyList.set(schemaName, new Set(dependencySchemaNames)); + } else { + for (const dependencySchemaName of dependencySchemaNames) { + dependencies.add(dependencySchemaName); + } + } + } + + return adjacencyList; +} + +/** + * Sorts dependent references in topological order. Local dependencies are placed + * before dependent schemas. External references aren't involved. + * See https://en.wikipedia.org/wiki/Topological_sorting + * + * It uses Depth First Search (DFS) variant of topological sort to preserve schemas + * definition order in OpenAPI specification document. Topological sorting doesn't + * define any order for non dependent schemas. Preserving original ordering looks + * like a good option to minimize diffs and have higher result predictability. + * + * @param adjacencyList An adjacency list, e.g. built via buildLocalRefsAdjacencyList + * @param originalOrder A string array having schema names sorted in OpenAPI spec order + * @returns A string array sorting in topological way + */ +function sortTopologically( + adjacencyList: ReferencesAdjacencyList, + originalOrder: string[] +): string[] { + const sortedSchemas: string[] = []; + const visited = new Set(); + const addToSorted = (schemaName: string): void => { + if (visited.has(schemaName)) { + return; + } + + visited.add(schemaName); + + for (const dependencySchemaName of adjacencyList.get(schemaName) ?? []) { + addToSorted(dependencySchemaName); + } + + sortedSchemas.push(schemaName); + }; + + for (const schemaName of originalOrder) { + addToSorted(schemaName); + } + + return sortedSchemas; } diff --git a/packages/kbn-openapi-generator/src/parser/lib/get_imports_map.ts b/packages/kbn-openapi-generator/src/parser/lib/get_imports_map.ts index 634ac82aaae8c..d843bef8456cc 100644 --- a/packages/kbn-openapi-generator/src/parser/lib/get_imports_map.ts +++ b/packages/kbn-openapi-generator/src/parser/lib/get_imports_map.ts @@ -8,7 +8,7 @@ import { uniq } from 'lodash'; import type { OpenApiDocument } from '../openapi_types'; -import { findRefs } from './find_refs'; +import { findRefs } from './helpers/find_refs'; export interface ImportsMap { [importPath: string]: string[]; diff --git a/src/plugins/links/common/embeddable/types.ts b/packages/kbn-openapi-generator/src/parser/lib/helpers/find_local_refs.ts similarity index 60% rename from src/plugins/links/common/embeddable/types.ts rename to packages/kbn-openapi-generator/src/parser/lib/helpers/find_local_refs.ts index b916d34f70840..8dc9c5a5d7b1e 100644 --- a/src/plugins/links/common/embeddable/types.ts +++ b/packages/kbn-openapi-generator/src/parser/lib/helpers/find_local_refs.ts @@ -6,9 +6,12 @@ * Side Public License, v 1. */ -import { EmbeddableStateWithType } from '@kbn/embeddable-plugin/common'; -import { SerializableRecord } from '@kbn/utility-types'; +import { findRefs } from './find_refs'; +import { isLocalRef } from './is_local_ref'; -export type LinksPersistableState = EmbeddableStateWithType & { - attributes: SerializableRecord; -}; +/** + * Finds local references + */ +export function findLocalRefs(obj: unknown): string[] { + return findRefs(obj).filter((ref) => isLocalRef(ref)); +} diff --git a/packages/kbn-openapi-generator/src/parser/lib/find_refs.ts b/packages/kbn-openapi-generator/src/parser/lib/helpers/find_refs.ts similarity index 87% rename from packages/kbn-openapi-generator/src/parser/lib/find_refs.ts rename to packages/kbn-openapi-generator/src/parser/lib/helpers/find_refs.ts index 1829c0a5e7ee2..49965fde840ab 100644 --- a/packages/kbn-openapi-generator/src/parser/lib/find_refs.ts +++ b/packages/kbn-openapi-generator/src/parser/lib/helpers/find_refs.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import { hasRef } from './helpers/has_ref'; -import { traverseObject } from './helpers/traverse_object'; +import { hasRef } from './has_ref'; +import { traverseObject } from './traverse_object'; /** * Traverse the OpenAPI document recursively and find all references diff --git a/packages/kbn-openapi-generator/src/parser/lib/helpers/is_local_ref.ts b/packages/kbn-openapi-generator/src/parser/lib/helpers/is_local_ref.ts new file mode 100644 index 0000000000000..40b1973330236 --- /dev/null +++ b/packages/kbn-openapi-generator/src/parser/lib/helpers/is_local_ref.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/** + * Checks whether the provided ref is local. + * Local references start with `#/` + */ +export function isLocalRef(ref: string): boolean { + return ref.startsWith('#/'); +} diff --git a/packages/kbn-openapi-generator/src/parser/lib/helpers/parse_ref.ts b/packages/kbn-openapi-generator/src/parser/lib/helpers/parse_ref.ts new file mode 100644 index 0000000000000..75ee17951cba2 --- /dev/null +++ b/packages/kbn-openapi-generator/src/parser/lib/helpers/parse_ref.ts @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +interface ParsedRef { + uri: string; + pointer: string; + schemaName: string; +} + +/** + * Parses an OpenAPI reference a.k.a JSON reference + * See https://datatracker.ietf.org/doc/html/draft-pbryan-zyp-json-ref-03 + * + * JSON reference consists of an optional uri and required JSON pointer + * looking like `uri#pointer`. While RFC implies URI usage mostly relative + * paths are used. + * + * An example looks like + * + * ``` + * ../path/to/my/file.schema.yaml#/components/schemas/MySchema + * ``` + * + * This function returns `uri`, JSON `pointer` and + * `schemaName` which is the last part of the JSON pointer. In the example + * above `schemaName` is `MySchema`. + */ +export function parseRef(ref: string): ParsedRef { + if (!ref.includes('#')) { + throw new Error(`Reference parse error: provided ref is not valid "${ref}"`); + } + + const [uri, pointer] = ref.split('#'); + const schemaName = pointer.split('/').at(-1)!; + + return { + uri, + pointer, + schemaName, + }; +} diff --git a/packages/kbn-openapi-generator/src/parser/openapi_types.ts b/packages/kbn-openapi-generator/src/parser/openapi_types.ts index c8b1e4f715345..669d1d9b68764 100644 --- a/packages/kbn-openapi-generator/src/parser/openapi_types.ts +++ b/packages/kbn-openapi-generator/src/parser/openapi_types.ts @@ -16,6 +16,11 @@ interface AdditionalProperties { } export type OpenApiDocument = OpenAPIV3.Document; +export type OpenApiComponentsObject = OpenAPIV3.ComponentsObject; +export type OpenApiSchemasObject = Record< + string, + OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject +>; // Override the OpenAPI types to add the x-codegen-enabled property to the // components object. diff --git a/packages/kbn-openapi-generator/src/template_service/register_helpers.ts b/packages/kbn-openapi-generator/src/template_service/register_helpers.ts index 55f2d9d60f37a..f02f295954465 100644 --- a/packages/kbn-openapi-generator/src/template_service/register_helpers.ts +++ b/packages/kbn-openapi-generator/src/template_service/register_helpers.ts @@ -71,7 +71,7 @@ export function registerHelpers(handlebarsInstance: typeof Handlebars) { }); /** - * Checks whether provided schema is circular or a part of the circular chain. + * Checks whether provided schema is circular or a part of a circular chain. * * It's expected that `context.circularRefs` has been filled by the parser. */ diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 00bcbf6481939..3b7828dc7f67d 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -42,6 +42,7 @@ pageLoadAssetSize: embeddableEnhanced: 22107 enterpriseSearch: 66810 entityManager: 17175 + esql: 37000 esqlDataGrid: 24582 esUiShared: 326654 eventAnnotation: 30000 @@ -156,7 +157,6 @@ pageLoadAssetSize: synthetics: 40958 telemetry: 51957 telemetryManagementSection: 38586 - textBasedLanguages: 37000 threatIntelligence: 44299 timelines: 327300 transform: 41007 diff --git a/packages/kbn-recently-accessed/README.md b/packages/kbn-recently-accessed/README.md new file mode 100644 index 0000000000000..a7579822c9123 --- /dev/null +++ b/packages/kbn-recently-accessed/README.md @@ -0,0 +1,4 @@ +# @kbn/recently-accessed + +The `RecentlyAccessedService` uses browser local storage to manage records of recently accessed objects. +This can be used to make recent items easier for users to find in listing UIs. diff --git a/packages/kbn-recently-accessed/index.ts b/packages/kbn-recently-accessed/index.ts new file mode 100644 index 0000000000000..3b23a548ce946 --- /dev/null +++ b/packages/kbn-recently-accessed/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { + type RecentlyAccessed, + type RecentlyAccessedHistoryItem, + RecentlyAccessedService, +} from './src'; diff --git a/packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/index.ts b/packages/kbn-recently-accessed/jest.config.js similarity index 74% rename from packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/index.ts rename to packages/kbn-recently-accessed/jest.config.js index 4f4cae09d5d3a..1492f7da1fcfe 100644 --- a/packages/kbn-alerts-ui-shared/src/alerts_search_bar/apis/index.ts +++ b/packages/kbn-recently-accessed/jest.config.js @@ -6,6 +6,8 @@ * Side Public License, v 1. */ -export * from './fetch_aad_fields'; -export * from './fetch_alert_fields'; -export * from './fetch_alert_index_names'; +module.exports = { + preset: '@kbn/test', + rootDir: '../..', + roots: ['/packages/kbn-recently-accessed'], +}; diff --git a/packages/kbn-recently-accessed/kibana.jsonc b/packages/kbn-recently-accessed/kibana.jsonc new file mode 100644 index 0000000000000..0ec9917dc6b77 --- /dev/null +++ b/packages/kbn-recently-accessed/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/recently-accessed", + "owner": "@elastic/appex-sharedux" +} diff --git a/packages/kbn-recently-accessed/package.json b/packages/kbn-recently-accessed/package.json new file mode 100644 index 0000000000000..825ccbd8cfdaf --- /dev/null +++ b/packages/kbn-recently-accessed/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/recently-accessed", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/create_log_key.test.ts b/packages/kbn-recently-accessed/src/create_log_key.test.ts similarity index 100% rename from packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/create_log_key.test.ts rename to packages/kbn-recently-accessed/src/create_log_key.test.ts diff --git a/packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/create_log_key.ts b/packages/kbn-recently-accessed/src/create_log_key.ts similarity index 88% rename from packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/create_log_key.ts rename to packages/kbn-recently-accessed/src/create_log_key.ts index a9b0c5cdcf7d4..5a5e8e7cc7ad0 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/create_log_key.ts +++ b/packages/kbn-recently-accessed/src/create_log_key.ts @@ -8,7 +8,7 @@ import { Sha256 } from '@kbn/crypto-browser'; -export async function createLogKey(type: string, optionalIdentifier?: string) { +export function createLogKey(type: string, optionalIdentifier?: string) { const baseKey = `kibana.history.${type}`; if (!optionalIdentifier) { diff --git a/packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/index.ts b/packages/kbn-recently-accessed/src/index.ts similarity index 84% rename from packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/index.ts rename to packages/kbn-recently-accessed/src/index.ts index 2256f60061b87..389b7eca5c1b2 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/index.ts +++ b/packages/kbn-recently-accessed/src/index.ts @@ -7,3 +7,4 @@ */ export { RecentlyAccessedService } from './recently_accessed_service'; +export type { RecentlyAccessed, RecentlyAccessedHistoryItem } from './types'; diff --git a/packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/persisted_log.test.ts b/packages/kbn-recently-accessed/src/persisted_log.test.ts similarity index 100% rename from packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/persisted_log.test.ts rename to packages/kbn-recently-accessed/src/persisted_log.test.ts diff --git a/packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/persisted_log.ts b/packages/kbn-recently-accessed/src/persisted_log.ts similarity index 100% rename from packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/persisted_log.ts rename to packages/kbn-recently-accessed/src/persisted_log.ts diff --git a/packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/recently_accessed_service.test.ts b/packages/kbn-recently-accessed/src/recently_accessed_service.test.ts similarity index 98% rename from packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/recently_accessed_service.test.ts rename to packages/kbn-recently-accessed/src/recently_accessed_service.test.ts index e394f81fab11d..0260949295634 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/recently_accessed_service.test.ts +++ b/packages/kbn-recently-accessed/src/recently_accessed_service.test.ts @@ -54,7 +54,10 @@ describe('RecentlyAccessed#start()', () => { const getStart = async () => { const http = httpServiceMock.createStartContract(); - const recentlyAccessed = await new RecentlyAccessedService().start({ http }); + const recentlyAccessed = await new RecentlyAccessedService().start({ + http, + key: 'recentlyAccessed', + }); return { http, recentlyAccessed }; }; diff --git a/packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/recently_accessed_service.ts b/packages/kbn-recently-accessed/src/recently_accessed_service.ts similarity index 68% rename from packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/recently_accessed_service.ts rename to packages/kbn-recently-accessed/src/recently_accessed_service.ts index ec9a04ab5551c..4df97b556e5b6 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/recently_accessed/recently_accessed_service.ts +++ b/packages/kbn-recently-accessed/src/recently_accessed_service.ts @@ -6,23 +6,20 @@ * Side Public License, v 1. */ -import type { InternalHttpStart } from '@kbn/core-http-browser-internal'; -import type { - ChromeRecentlyAccessed, - ChromeRecentlyAccessedHistoryItem, -} from '@kbn/core-chrome-browser'; +import type { HttpStart } from '@kbn/core-http-browser'; +import type { RecentlyAccessed, RecentlyAccessedHistoryItem } from './types'; import { PersistedLog } from './persisted_log'; import { createLogKey } from './create_log_key'; interface StartDeps { - http: InternalHttpStart; + key: string; + http: Pick; } -/** @internal */ export class RecentlyAccessedService { - async start({ http }: StartDeps): Promise { - const logKey = await createLogKey('recentlyAccessed', http.basePath.get()); - const history = new PersistedLog(logKey, { + start({ http, key }: StartDeps): RecentlyAccessed { + const logKey = createLogKey(key, http.basePath.get()); + const history = new PersistedLog(logKey, { maxLength: 20, isEqual: (oldItem, newItem) => oldItem.id === newItem.id, }); diff --git a/packages/kbn-recently-accessed/src/types.ts b/packages/kbn-recently-accessed/src/types.ts new file mode 100644 index 0000000000000..9b729ffc9ed2c --- /dev/null +++ b/packages/kbn-recently-accessed/src/types.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 { Observable } from 'rxjs'; + +/** @public */ +export interface RecentlyAccessedHistoryItem { + link: string; + label: string; + id: string; +} + +/** + * {@link RecentlyAccessed | APIs} for recently accessed history. + * @public + */ +export interface RecentlyAccessed { + /** + * Adds a new item to the recently accessed history. + * + * @example + * ```js + * chrome.recentlyAccessed.add('/app/map/1234', 'Map 1234', '1234'); + * ``` + * + * @param link a relative URL to the resource (not including the {@link HttpStart.basePath | `http.basePath`}) + * @param label the label to display in the UI + * @param id a unique string used to de-duplicate the recently accessed list. + */ + add(link: string, label: string, id: string): void; + + /** + * Gets an Array of the current recently accessed history. + * + * @example + * ```js + * recentlyAccessed.get().forEach(console.log); + * ``` + */ + get(): RecentlyAccessedHistoryItem[]; + + /** + * Gets an Observable of the array of recently accessed history. + * + * @example + * ```js + * recentlyAccessed.get$().subscribe(console.log); + * ``` + */ + get$(): Observable; +} diff --git a/packages/kbn-recently-accessed/tsconfig.json b/packages/kbn-recently-accessed/tsconfig.json new file mode 100644 index 0000000000000..f6029007a4376 --- /dev/null +++ b/packages/kbn-recently-accessed/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/crypto-browser", + "@kbn/core-http-browser", + "@kbn/core-http-browser-mocks", + ] +} diff --git a/packages/kbn-shared-svg/index.ts b/packages/kbn-shared-svg/index.ts index 215431706ab94..525b3f456fd7e 100644 --- a/packages/kbn-shared-svg/index.ts +++ b/packages/kbn-shared-svg/index.ts @@ -10,5 +10,12 @@ import noResultsIllustrationDark from './src/assets/no_results_dark.svg'; import noResultsIllustrationLight from './src/assets/no_results_light.svg'; import dashboardsLight from './src/assets/dashboards_light.svg'; import dashboardsDark from './src/assets/dashboards_dark.svg'; +import apmLight from './src/assets/oblt_apm_light.svg'; -export { noResultsIllustrationDark, noResultsIllustrationLight, dashboardsLight, dashboardsDark }; +export { + noResultsIllustrationDark, + noResultsIllustrationLight, + dashboardsLight, + dashboardsDark, + apmLight, +}; diff --git a/packages/kbn-shared-svg/src/assets/oblt_apm_light.svg b/packages/kbn-shared-svg/src/assets/oblt_apm_light.svg new file mode 100644 index 0000000000000..b3cd9c0e9c344 --- /dev/null +++ b/packages/kbn-shared-svg/src/assets/oblt_apm_light.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/packages/kbn-test-eui-helpers/src/rtl_helpers.tsx b/packages/kbn-test-eui-helpers/src/rtl_helpers.tsx index e55b61a380bbf..58f0444f8b63f 100644 --- a/packages/kbn-test-eui-helpers/src/rtl_helpers.tsx +++ b/packages/kbn-test-eui-helpers/src/rtl_helpers.tsx @@ -53,7 +53,7 @@ export class EuiButtonGroupTestHarness { } /** - * Returns selected value of button group + * Returns selected option of button group */ public get selected() { return within(this.#buttonGroup).getByRole('button', { pressed: true }); @@ -136,3 +136,59 @@ export class EuiSuperDatePickerTestHarness { userEvent.click(screen.getByRole('button', { name: 'Refresh' })); } } + +export class EuiSelectTestHarness { + #testId: string; + + /** + * Returns select or throws + */ + get #selectEl() { + return screen.getByTestId(this.#testId); + } + + constructor(testId: string) { + this.#testId = testId; + } + + /** + * Returns `data-test-subj` of select + */ + public get testId() { + return this.#testId; + } + + /** + * Returns button select if found, otherwise `null` + */ + public get self() { + return screen.queryByTestId(this.#testId); + } + + /** + * Returns all options of select + */ + public get options(): HTMLOptionElement[] { + return within(this.#selectEl).getAllByRole('option'); + } + + /** + * Returns selected option + */ + public get selected() { + return (this.#selectEl as HTMLSelectElement).value; + } + + /** + * Select option by value + */ + public select(optionName: string | RegExp) { + const option = this.options.find((o) => o.value === optionName)?.value; + + if (!option) { + throw new Error(`Option [${optionName}] not found`); + } + + fireEvent.change(this.#selectEl, { target: { value: option } }); + } +} diff --git a/packages/kbn-test/src/mocha/junit_report_generation.js b/packages/kbn-test/src/mocha/junit_report_generation.js index fcf31672d7996..99a5079e7b26e 100644 --- a/packages/kbn-test/src/mocha/junit_report_generation.js +++ b/packages/kbn-test/src/mocha/junit_report_generation.js @@ -94,7 +94,12 @@ export function setupJUnitReportGeneration(runner, options = {}) { .map((node) => ({ skipped: true, node })); // cache codeowners for quicker lookup - const reversedCodeowners = getPathsWithOwnersReversed(); + let reversedCodeowners = []; + try { + reversedCodeowners = getPathsWithOwnersReversed(); + } catch { + /* no-op */ + } const commandLine = prettifyCommandLine(process.argv); diff --git a/packages/kbn-text-based-editor/src/esql_documentation_sections.tsx b/packages/kbn-text-based-editor/src/esql_documentation_sections.tsx index df32875a33665..fae00e8e8d1b0 100644 --- a/packages/kbn-text-based-editor/src/esql_documentation_sections.tsx +++ b/packages/kbn-text-based-editor/src/esql_documentation_sections.tsx @@ -3755,26 +3755,26 @@ export const functions = { // Do not edit manually... automatically generated by scripts/generate_esql_docs.ts { label: i18n.translate( - 'textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.top_list', + 'textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.top', { - defaultMessage: 'TOP_LIST', + defaultMessage: 'TOP', } ), description: ( - ### TOP_LIST + ### TOP Collects the top values for a field. Includes repeated values. \`\`\` FROM employees - | STATS top_salaries = TOP_LIST(salary, 3, "desc"), top_salary = MAX(salary) + | STATS top_salaries = TOP(salary, 3, "desc"), top_salary = MAX(salary) \`\`\` `, description: diff --git a/packages/kbn-ui-shared-deps-npm/BUILD.bazel b/packages/kbn-ui-shared-deps-npm/BUILD.bazel index f2ff64942a993..937cbe0c2a8ef 100644 --- a/packages/kbn-ui-shared-deps-npm/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-npm/BUILD.bazel @@ -47,6 +47,7 @@ RUNTIME_DEPS = [ "@npm//@tanstack/react-query-devtools", "@npm//classnames", "@npm//fflate", + "@npm//fastest-levenshtein", "@npm//history", "@npm//jquery", "@npm//lodash", diff --git a/packages/kbn-ui-shared-deps-npm/webpack.config.js b/packages/kbn-ui-shared-deps-npm/webpack.config.js index 24085109d0d56..294bffdaaa833 100644 --- a/packages/kbn-ui-shared-deps-npm/webpack.config.js +++ b/packages/kbn-ui-shared-deps-npm/webpack.config.js @@ -77,6 +77,7 @@ module.exports = (_, argv) => { '@tanstack/react-query-devtools', 'classnames', 'fflate', + 'fastest-levenshtein', 'history', 'io-ts', 'jquery', diff --git a/packages/kbn-ui-shared-deps-src/BUILD.bazel b/packages/kbn-ui-shared-deps-src/BUILD.bazel index 3d7dd87020047..cd723a8ed6401 100644 --- a/packages/kbn-ui-shared-deps-src/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-src/BUILD.bazel @@ -28,6 +28,7 @@ webpack_cli( "//packages/kbn-monaco", "//packages/kbn-datemath", "//packages/kbn-analytics", + "//packages/kbn-crypto-browser", "//packages/kbn-es-query", "//packages/kbn-search-errors", "//packages/kbn-std", diff --git a/packages/kbn-ui-shared-deps-src/src/definitions.js b/packages/kbn-ui-shared-deps-src/src/definitions.js index b2b38e131fb80..6f7bff397d320 100644 --- a/packages/kbn-ui-shared-deps-src/src/definitions.js +++ b/packages/kbn-ui-shared-deps-src/src/definitions.js @@ -61,6 +61,7 @@ const externals = { redux: '__kbnSharedDeps__.Redux', immer: '__kbnSharedDeps__.Immer', reselect: '__kbnSharedDeps__.Reselect', + 'fastest-levenshtein': '__kbnSharedDeps__.FastestLevenshtein', /** * big deps which are locked to a single version @@ -88,6 +89,7 @@ const externals = { tslib: '__kbnSharedDeps__.TsLib', uuid: '__kbnSharedDeps__.Uuid', '@kbn/analytics': '__kbnSharedDeps__.KbnAnalytics', + '@kbn/crypto-browser': '__kbnSharedDeps__.KbnCryptoBrowser', '@kbn/es-query': '__kbnSharedDeps__.KbnEsQuery', '@kbn/search-errors': '__kbnSharedDeps__.KbnSearchErrors', '@kbn/std': '__kbnSharedDeps__.KbnStd', diff --git a/packages/kbn-ui-shared-deps-src/src/entry.js b/packages/kbn-ui-shared-deps-src/src/entry.js index 1d0e88ef0efd8..5347952978780 100644 --- a/packages/kbn-ui-shared-deps-src/src/entry.js +++ b/packages/kbn-ui-shared-deps-src/src/entry.js @@ -31,6 +31,7 @@ export const ReactRouter = require('react-router'); export const ReactRouterDom = require('react-router-dom'); export const ReactRouterDomV5Compat = require('react-router-dom-v5-compat'); export const StyledComponents = require('styled-components'); +export const FastestLevenshtein = require('fastest-levenshtein'); Moment.tz.load(require('moment-timezone/data/packed/latest.json')); @@ -60,6 +61,7 @@ export const Fflate = { unzlibSync, strFromU8 }; export const TsLib = require('tslib'); export const Uuid = require('uuid'); export const KbnAnalytics = require('@kbn/analytics'); +export const KbnCryptoBrowser = require('@kbn/crypto-browser'); export const KbnEsQuery = require('@kbn/es-query'); export const KbnSearchErrors = require('@kbn/search-errors'); export const KbnStd = require('@kbn/std'); diff --git a/packages/kbn-unified-data-table/src/components/compare_documents/hooks/use_comparison_fields.ts b/packages/kbn-unified-data-table/src/components/compare_documents/hooks/use_comparison_fields.ts index 611397145b555..b1653c8e26336 100644 --- a/packages/kbn-unified-data-table/src/components/compare_documents/hooks/use_comparison_fields.ts +++ b/packages/kbn-unified-data-table/src/components/compare_documents/hooks/use_comparison_fields.ts @@ -12,7 +12,7 @@ import { AdditionalFieldGroups, convertFieldsToFallbackFields } from '@kbn/unifi import { isEqual } from 'lodash'; import { useMemo } from 'react'; -export const MAX_COMPARISON_FIELDS = 100; +export const MAX_COMPARISON_FIELDS = 250; export interface UseComparisonFieldsProps { dataView: DataView; diff --git a/packages/kbn-unified-data-table/src/components/data_table.tsx b/packages/kbn-unified-data-table/src/components/data_table.tsx index 1262619401ab6..07755e0e65769 100644 --- a/packages/kbn-unified-data-table/src/components/data_table.tsx +++ b/packages/kbn-unified-data-table/src/components/data_table.tsx @@ -828,6 +828,12 @@ export const UnifiedDataTable = ({ const sorting = useMemo(() => { if (isSortEnabled) { + // in ES|QL mode, sorting is disabled when in Document view + // ideally we want the @timestamp column to be sortable server side + // but it needs discussion before moving forward like this + if (isPlainRecord && !columns.length) { + return undefined; + } return { columns: sortingColumns, onSort: onTableSort, @@ -837,7 +843,7 @@ export const UnifiedDataTable = ({ columns: sortingColumns, onSort: () => {}, }; - }, [isSortEnabled, sortingColumns, onTableSort]); + }, [isSortEnabled, sortingColumns, isPlainRecord, columns.length, onTableSort]); const canSetExpandedDoc = Boolean(setExpandedDoc && !!renderDocumentView); diff --git a/packages/kbn-unified-field-list/src/components/field_list_filters/field_name_search.test.tsx b/packages/kbn-unified-field-list/src/components/field_list_filters/field_name_search.test.tsx index 12780a111fae0..52858ba292812 100644 --- a/packages/kbn-unified-field-list/src/components/field_list_filters/field_name_search.test.tsx +++ b/packages/kbn-unified-field-list/src/components/field_list_filters/field_name_search.test.tsx @@ -6,48 +6,55 @@ * Side Public License, v 1. */ -import React from 'react'; -import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { act } from 'react-dom/test-utils'; +import React, { useState } from 'react'; +import userEvent from '@testing-library/user-event'; +import { render, screen } from '@testing-library/react'; import { FieldNameSearch, type FieldNameSearchProps } from './field_name_search'; describe('UnifiedFieldList ', () => { - it('should render correctly', async () => { + beforeAll(() => { + jest.useFakeTimers(); + }); + afterAll(() => { + jest.useRealTimers(); + }); + + it('should render correctly', () => { const props: FieldNameSearchProps = { nameFilter: '', onChange: jest.fn(), screenReaderDescriptionId: 'htmlId', 'data-test-subj': 'searchInput', }; - const wrapper = mountWithIntl(); - expect(wrapper.find('input').prop('aria-describedby')).toBe('htmlId'); - - act(() => { - wrapper.find('input').simulate('change', { - target: { value: 'hi' }, - }); - }); - - expect(props.onChange).toBeCalledWith('hi'); + render(); + const input = screen.getByRole('searchbox', { name: 'Search field names' }); + expect(input).toHaveAttribute('aria-describedby', 'htmlId'); + userEvent.type(input, 'hey'); + jest.advanceTimersByTime(256); + expect(props.onChange).toHaveBeenCalledWith('hey'); + expect(props.onChange).toBeCalledTimes(1); }); - it('should update correctly', async () => { - const props: FieldNameSearchProps = { - nameFilter: 'this', - onChange: jest.fn(), - screenReaderDescriptionId: 'htmlId', - 'data-test-subj': 'searchInput', + it('should accept the updates from the top', () => { + const FieldNameSearchWithWrapper = ({ defaultNameFilter = '' }) => { + const [nameFilter, setNameFilter] = useState(defaultNameFilter); + const props: FieldNameSearchProps = { + nameFilter, + onChange: jest.fn(), + screenReaderDescriptionId: 'htmlId', + 'data-test-subj': 'searchInput', + }; + return ( +
+ + +
+ ); }; - const wrapper = mountWithIntl(); - - expect(wrapper.find('input').prop('value')).toBe('this'); - - wrapper.setProps({ - nameFilter: 'that', - }); - - expect(wrapper.find('input').prop('value')).toBe('that'); - - expect(props.onChange).not.toBeCalled(); + render(); + expect(screen.getByRole('searchbox')).toHaveValue('this'); + const button = screen.getByRole('button', { name: 'update nameFilter' }); + userEvent.click(button); + expect(screen.getByRole('searchbox')).toHaveValue('that'); }); }); diff --git a/packages/kbn-unified-field-list/src/components/field_list_filters/field_name_search.tsx b/packages/kbn-unified-field-list/src/components/field_list_filters/field_name_search.tsx index faf146adfd831..02ea451e5276c 100644 --- a/packages/kbn-unified-field-list/src/components/field_list_filters/field_name_search.tsx +++ b/packages/kbn-unified-field-list/src/components/field_list_filters/field_name_search.tsx @@ -9,6 +9,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiFieldSearch, type EuiFieldSearchProps } from '@elastic/eui'; +import { useDebouncedValue } from '@kbn/visualization-utils'; /** * Props for FieldNameSearch component @@ -45,15 +46,22 @@ export const FieldNameSearch: React.FC = ({ description: 'Search the list of fields in the data view for the provided text', }); + const { inputValue, handleInputChange } = useDebouncedValue({ + onChange, + value: nameFilter, + }); + return ( onChange(event.target.value)} + onChange={(e) => { + handleInputChange(e.target.value); + }} placeholder={searchPlaceholder} - value={nameFilter} + value={inputValue} append={append} compressed={compressed} /> diff --git a/packages/kbn-unified-field-list/src/components/field_list_grouped/field_list_grouped.test.tsx b/packages/kbn-unified-field-list/src/components/field_list_grouped/field_list_grouped.test.tsx index 6744fb92db152..60076ece91c7b 100644 --- a/packages/kbn-unified-field-list/src/components/field_list_grouped/field_list_grouped.test.tsx +++ b/packages/kbn-unified-field-list/src/components/field_list_grouped/field_list_grouped.test.tsx @@ -22,6 +22,15 @@ import { FieldsAccordion } from './fields_accordion'; import { NoFieldsCallout } from './no_fields_callout'; import { useGroupedFields, type GroupedFieldsParams } from '../../hooks/use_grouped_fields'; +jest.mock('lodash', () => { + const original = jest.requireActual('lodash'); + + return { + ...original, + debounce: (fn: unknown) => fn, + }; +}); + describe('UnifiedFieldList FieldListGrouped + useGroupedFields()', () => { let defaultProps: FieldListGroupedProps; let mockedServices: GroupedFieldsParams['services']; diff --git a/packages/kbn-unified-field-list/src/hooks/use_field_filters.test.tsx b/packages/kbn-unified-field-list/src/hooks/use_field_filters.test.tsx index 8e86535f0bb85..17d937b270d86 100644 --- a/packages/kbn-unified-field-list/src/hooks/use_field_filters.test.tsx +++ b/packages/kbn-unified-field-list/src/hooks/use_field_filters.test.tsx @@ -63,7 +63,9 @@ describe('UnifiedFieldList useFieldFilters()', () => { expect(result.current.fieldSearchHighlight).toBe('time'); expect(result.current.onFilterField).toBeDefined(); - expect(result.current.onFilterField!({ displayName: 'time test' } as DataViewField)).toBe(true); + expect( + result.current.onFilterField!({ displayName: 'time test', name: '' } as DataViewField) + ).toBe(true); expect(result.current.onFilterField!(dataView.getFieldByName('@timestamp')!)).toBe(true); expect(result.current.onFilterField!(dataView.getFieldByName('bytes')!)).toBe(false); }); @@ -86,14 +88,46 @@ describe('UnifiedFieldList useFieldFilters()', () => { expect(result.current.fieldSearchHighlight).toBe('message*me1'); expect(result.current.onFilterField).toBeDefined(); - expect(result.current.onFilterField!({ displayName: 'test' } as DataViewField)).toBe(false); - expect(result.current.onFilterField!({ displayName: 'message' } as DataViewField)).toBe(false); - expect(result.current.onFilterField!({ displayName: 'message.name1' } as DataViewField)).toBe( - true + expect(result.current.onFilterField!({ displayName: 'test', name: '' } as DataViewField)).toBe( + false ); + expect( + result.current.onFilterField!({ displayName: 'message', name: '' } as DataViewField) + ).toBe(false); + expect( + result.current.onFilterField!({ displayName: 'message.name1', name: '' } as DataViewField) + ).toBe(true); expect(result.current.onFilterField!({ name: 'messagename10' } as DataViewField)).toBe(false); expect(result.current.onFilterField!({ name: 'message.test' } as DataViewField)).toBe(false); }); + it('should update correctly on search by name with a typo', async () => { + const props: FieldFiltersParams = { + allFields: dataView.fields, + services: mockedServices, + }; + const { result } = renderHook(useFieldFilters, { + initialProps: props, + }); + + expect(result.current.fieldSearchHighlight).toBe(''); + expect(result.current.onFilterField).toBeUndefined(); + + act(() => { + result.current.fieldListFiltersProps.onChangeNameFilter('messsge'); + }); + + expect(result.current.fieldSearchHighlight).toBe('messsge'); + expect(result.current.onFilterField).toBeDefined(); + expect(result.current.onFilterField!({ displayName: 'test', name: '' } as DataViewField)).toBe( + false + ); + expect( + result.current.onFilterField!({ displayName: 'message', name: '' } as DataViewField) + ).toBe(true); + expect( + result.current.onFilterField!({ displayName: 'message.name1', name: '' } as DataViewField) + ).toBe(true); + }); it('should update correctly on filter by type', async () => { const props: FieldFiltersParams = { diff --git a/packages/kbn-visualization-ui-components/components/debounced_input.tsx b/packages/kbn-visualization-ui-components/components/debounced_input.tsx index e892cba9e8022..2a21513dc2c0b 100644 --- a/packages/kbn-visualization-ui-components/components/debounced_input.tsx +++ b/packages/kbn-visualization-ui-components/components/debounced_input.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiFieldText, EuiFieldTextProps } from '@elastic/eui'; -import { useDebouncedValue } from './debounced_value'; +import { useDebouncedValue } from '@kbn/visualization-utils'; type Props = { value: string; diff --git a/packages/kbn-visualization-ui-components/components/index.ts b/packages/kbn-visualization-ui-components/components/index.ts index bdd2c4aa3504b..d92d30659d0b8 100644 --- a/packages/kbn-visualization-ui-components/components/index.ts +++ b/packages/kbn-visualization-ui-components/components/index.ts @@ -12,8 +12,6 @@ export * from './name_input'; export * from './debounced_input'; -export * from './debounced_value'; - export * from './color_picker'; export * from './icon_select'; diff --git a/packages/kbn-visualization-ui-components/components/query_input/query_input.tsx b/packages/kbn-visualization-ui-components/components/query_input/query_input.tsx index 72acfe40b5a64..e1f5046c2f51e 100644 --- a/packages/kbn-visualization-ui-components/components/query_input/query_input.tsx +++ b/packages/kbn-visualization-ui-components/components/query_input/query_input.tsx @@ -21,7 +21,7 @@ import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { IUiSettingsClient } from '@kbn/core-ui-settings-browser'; import type { NotificationsStart } from '@kbn/core-notifications-browser'; import type { DocLinksStart } from '@kbn/core-doc-links-browser'; -import { useDebouncedValue } from '../debounced_value'; +import { useDebouncedValue } from '@kbn/visualization-utils'; export interface QueryInputServices { http: HttpStart; diff --git a/packages/kbn-visualization-ui-components/index.ts b/packages/kbn-visualization-ui-components/index.ts index 5a51c27af5e7b..239849da05a50 100644 --- a/packages/kbn-visualization-ui-components/index.ts +++ b/packages/kbn-visualization-ui-components/index.ts @@ -10,7 +10,6 @@ export { FieldPicker, NameInput, DebouncedInput, - useDebouncedValue, ColorPicker, IconSelect, IconSelectSetting, diff --git a/packages/kbn-visualization-utils/index.ts b/packages/kbn-visualization-utils/index.ts index 8298260320564..8de992247fe79 100644 --- a/packages/kbn-visualization-utils/index.ts +++ b/packages/kbn-visualization-utils/index.ts @@ -9,3 +9,4 @@ export { getTimeZone } from './src/get_timezone'; export { getLensAttributesFromSuggestion } from './src/get_lens_attributes'; export { TooltipWrapper } from './src/tooltip_wrapper'; +export { useDebouncedValue } from './src/debounced_value'; diff --git a/packages/kbn-visualization-ui-components/components/debounced_value.test.ts b/packages/kbn-visualization-utils/src/debounced_value.test.ts similarity index 63% rename from packages/kbn-visualization-ui-components/components/debounced_value.test.ts rename to packages/kbn-visualization-utils/src/debounced_value.test.ts index ddff83ea66157..8ec60010f84c6 100644 --- a/packages/kbn-visualization-ui-components/components/debounced_value.test.ts +++ b/packages/kbn-visualization-utils/src/debounced_value.test.ts @@ -9,16 +9,15 @@ import { act, renderHook } from '@testing-library/react-hooks'; import { useDebouncedValue } from './debounced_value'; -jest.mock('lodash', () => { - const original = jest.requireActual('lodash'); +describe('useDebouncedValue', () => { + beforeAll(() => { + jest.useFakeTimers(); + }); - return { - ...original, - debounce: (fn: unknown) => fn, - }; -}); + afterAll(() => { + jest.useRealTimers(); + }); -describe('useDebouncedValue', () => { it('should update upstream value changes', () => { const onChangeMock = jest.fn(); const { result } = renderHook(() => useDebouncedValue({ value: 'a', onChange: onChangeMock })); @@ -26,6 +25,8 @@ describe('useDebouncedValue', () => { act(() => { result.current.handleInputChange('b'); }); + expect(onChangeMock).not.toHaveBeenCalled(); + jest.advanceTimersByTime(256); expect(onChangeMock).toHaveBeenCalledWith('b'); }); @@ -37,7 +38,8 @@ describe('useDebouncedValue', () => { act(() => { result.current.handleInputChange(''); }); - + expect(onChangeMock).not.toHaveBeenCalled(); + jest.advanceTimersByTime(256); expect(onChangeMock).toHaveBeenCalledWith('a'); }); @@ -50,7 +52,23 @@ describe('useDebouncedValue', () => { act(() => { result.current.handleInputChange(''); }); - + expect(onChangeMock).not.toHaveBeenCalled(); + jest.advanceTimersByTime(256); expect(onChangeMock).toHaveBeenCalledWith(''); }); + it('custom wait time is respected', () => { + const onChangeMock = jest.fn(); + const { result } = renderHook(() => + useDebouncedValue({ value: 'a', onChange: onChangeMock }, { wait: 500 }) + ); + + act(() => { + result.current.handleInputChange('b'); + }); + expect(onChangeMock).not.toHaveBeenCalled(); + jest.advanceTimersByTime(256); + expect(onChangeMock).not.toHaveBeenCalled(); + jest.advanceTimersByTime(244); // sums to 500 + expect(onChangeMock).toHaveBeenCalledWith('b'); + }); }); diff --git a/packages/kbn-visualization-ui-components/components/debounced_value.ts b/packages/kbn-visualization-utils/src/debounced_value.ts similarity index 90% rename from packages/kbn-visualization-ui-components/components/debounced_value.ts rename to packages/kbn-visualization-utils/src/debounced_value.ts index 2321ee72817f3..8fce0ffbdaeb6 100644 --- a/packages/kbn-visualization-ui-components/components/debounced_value.ts +++ b/packages/kbn-visualization-utils/src/debounced_value.ts @@ -9,13 +9,13 @@ import { useState, useMemo, useEffect, useRef } from 'react'; import { debounce } from 'lodash'; +const DEFAULT_TIMEOUT = 256; /** * Debounces value changes and updates inputValue on root state changes if no debounced changes * are in flight because the user is currently modifying the value. * * * allowFalsyValue: update upstream with all falsy values but null or undefined - * - * When testing this function mock the "debounce" function in lodash (see this module test for an example) + * * wait: debounce timeout */ export const useDebouncedValue = ( @@ -28,7 +28,9 @@ export const useDebouncedValue = ( value: T; defaultValue?: T; }, - { allowFalsyValue }: { allowFalsyValue?: boolean } = {} + { allowFalsyValue, wait = DEFAULT_TIMEOUT }: { allowFalsyValue?: boolean; wait?: number } = { + wait: DEFAULT_TIMEOUT, + } ) => { const [inputValue, setInputValue] = useState(value); const unflushedChanges = useRef(false); @@ -45,8 +47,8 @@ export const useDebouncedValue = ( // do not reset unflushed flag right away, wait a bit for upstream to pick it up flushChangesTimeout.current = setTimeout(() => { unflushedChanges.current = false; - }, 256); - }, 256); + }, wait); + }, wait); return (val: T) => { if (flushChangesTimeout.current) { clearTimeout(flushChangesTimeout.current); @@ -54,7 +56,7 @@ export const useDebouncedValue = ( unflushedChanges.current = true; callback(val); }; - }, [onChange]); + }, [onChange, wait]); useEffect(() => { if (!unflushedChanges.current && value !== inputValue) { diff --git a/packages/presentation/presentation_publishing/index.ts b/packages/presentation/presentation_publishing/index.ts index 669baa06f677f..8d90462c8a1bd 100644 --- a/packages/presentation/presentation_publishing/index.ts +++ b/packages/presentation/presentation_publishing/index.ts @@ -85,6 +85,7 @@ export { export { apiHasUniqueId, type HasUniqueId } from './interfaces/has_uuid'; export { apiPublishesBlockingError, + hasBlockingError, type PublishesBlockingError, } from './interfaces/publishes_blocking_error'; export { diff --git a/packages/presentation/presentation_publishing/interfaces/publishes_blocking_error.ts b/packages/presentation/presentation_publishing/interfaces/publishes_blocking_error.ts index 68bea175bce8c..90a86b20c9566 100644 --- a/packages/presentation/presentation_publishing/interfaces/publishes_blocking_error.ts +++ b/packages/presentation/presentation_publishing/interfaces/publishes_blocking_error.ts @@ -17,3 +17,7 @@ export const apiPublishesBlockingError = ( ): unknownApi is PublishesBlockingError => { return Boolean(unknownApi && (unknownApi as PublishesBlockingError)?.blockingError !== undefined); }; + +export function hasBlockingError(api: unknown) { + return apiPublishesBlockingError(api) && api.blockingError?.value !== undefined; +} diff --git a/scripts/dev_docs.sh b/scripts/dev_docs.sh index 202d3d84df5ff..17ccd0287f09b 100755 --- a/scripts/dev_docs.sh +++ b/scripts/dev_docs.sh @@ -88,9 +88,12 @@ module.exports = { ], "nav": { "structure": [ - "nav-elastic-developer-guide", - "nav-kibana-team", - "nav-kibana-dev" + { + collection: 'Elastic Developer Guide', + navs: ['nav-elastic-developer-guide'], + }, + { collection: 'Kibana Team', navs: ['nav-kibana-team'] }, + { collection: 'Kibana Developer Guide', navs: ['nav-kibana-dev'] }, ], "default": "nav-kibana-dev" } diff --git a/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts b/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts index 732685c732ff7..51c06947d224b 100644 --- a/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts +++ b/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts @@ -88,7 +88,7 @@ describe('checking migration metadata changes on all registered SO types', () => "endpoint:unified-user-artifact-manifest": "71c7fcb52c658b21ea2800a6b6a76972ae1c776e", "endpoint:user-artifact-manifest": "1c3533161811a58772e30cdc77bac4631da3ef2b", "enterprise_search_telemetry": "9ac912e1417fc8681e0cd383775382117c9e3d3d", - "entity-definition": "33fe0194bd896f0bfe479d55f6de20f8ba1d7713", + "entity-definition": "331a2ba0ee9f24936ef049683549c8af7e46f03a", "entity-discovery-api-key": "c267a65c69171d1804362155c1378365f5acef88", "epm-packages": "8042d4a1522f6c4e6f5486e791b3ffe3a22f88fd", "epm-packages-assets": "7a3e58efd9a14191d0d1a00b8aaed30a145fd0b1", @@ -168,6 +168,7 @@ describe('checking migration metadata changes on all registered SO types', () => "uptime-dynamic-settings": "b6756ff71d6b5258971b1c8fd433d167affbde52", "uptime-synthetics-api-key": "7ae976a461248f9dbd8442af14a179bdbc229eca", "url": "c923a4a5002a09c0080c9095e958f07d518e6704", + "usage-counter": "1690e9b642393c467e560fd14dd317dea24a14ee", "usage-counters": "48782b3bcb6b5a23ba6f2bfe3a380d835e68890a", "visualization": "93a3e73994ad836fe2b1dccbe208238f41f63da0", "workplace_search_telemetry": "52b32b47ee576f554ac77cb1d5896dfbcfe9a1fb", diff --git a/src/core/server/integration_tests/elasticsearch/user_agent.test.ts b/src/core/server/integration_tests/elasticsearch/user_agent.test.ts new file mode 100644 index 0000000000000..b864e3f330308 --- /dev/null +++ b/src/core/server/integration_tests/elasticsearch/user_agent.test.ts @@ -0,0 +1,76 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { esTestConfig } from '@kbn/test'; +import * as http from 'http'; +import { loggerMock } from '@kbn/logging-mocks'; +import { Root } from '@kbn/core-root-server-internal'; +import { + PRODUCT_RESPONSE_HEADER, + USER_AGENT_HEADER, + configureClient, + AgentManager, +} from '@kbn/core-elasticsearch-client-server-internal'; +import { configSchema, ElasticsearchConfig } from '@kbn/core-elasticsearch-server-internal'; + +function createFakeElasticsearchServer(hook: (req: http.IncomingMessage) => void) { + const server = http.createServer((req, res) => { + hook(req); + res.writeHead(200, undefined, { [PRODUCT_RESPONSE_HEADER]: 'Elasticsearch' }); + res.write('{}'); + res.end(); + }); + server.listen(esTestConfig.getPort()); + + return server; +} + +describe('ES Client - custom user-agent', () => { + let esServer: http.Server; + let kibanaServer: Root; + + afterAll(async () => { + try { + await kibanaServer?.shutdown(); + } catch (e) { + // trap + } + try { + await new Promise((resolve, reject) => + esServer.close((err) => (err ? reject(err) : resolve())) + ); + } catch (e) { + // trap + } + }); + + test('should send a custom user-agent header matching the expected format', async () => { + const kibanaVersion = '8.42.9'; + const logger = loggerMock.create(); + const rawConfig = configSchema.validate({ + hosts: [`${esTestConfig.getUrl()}`], + }); + const config = new ElasticsearchConfig(rawConfig); + const agentFactoryProvider = new AgentManager(logger, { dnsCacheTtlInSeconds: 0 }); + const esClient = configureClient(config, { + type: 'foo', + logger, + kibanaVersion, + agentFactoryProvider, + }); + + let userAgentHeader: string | undefined; + esServer = createFakeElasticsearchServer((res) => { + userAgentHeader = res.headers[USER_AGENT_HEADER]; + }); + + await esClient.ping(); + + expect(userAgentHeader).toEqual(`Kibana/${kibanaVersion}`); + }); +}); diff --git a/src/core/server/integration_tests/elasticsearch/version_compatibility.test.ts b/src/core/server/integration_tests/elasticsearch/version_compatibility.test.ts index eb6cc767d5817..bfd7575d58283 100644 --- a/src/core/server/integration_tests/elasticsearch/version_compatibility.test.ts +++ b/src/core/server/integration_tests/elasticsearch/version_compatibility.test.ts @@ -91,7 +91,8 @@ describe('Version Compatibility', () => { await expect(startServers({ customKibanaVersion: previousMinor() })).resolves.toBeUndefined(); }); - it('should flag the incompatibility on version mismatch (ES is previous minor)', async () => { + // FLAKY: https://github.com/elastic/kibana/issues/171289 + it.skip('should flag the incompatibility on version mismatch (ES is previous minor)', async () => { const found$ = new Subject(); consoleSpy.mockImplementation((str) => { if (str.includes('is incompatible')) { diff --git a/src/core/server/integration_tests/http/http2_protocol.test.ts b/src/core/server/integration_tests/http/http2_protocol.test.ts index f76076de81d43..b1db89a023230 100644 --- a/src/core/server/integration_tests/http/http2_protocol.test.ts +++ b/src/core/server/integration_tests/http/http2_protocol.test.ts @@ -17,12 +17,14 @@ import { config as httpConfig, cspConfig, externalUrlConfig, + permissionsPolicyConfig, } from '@kbn/core-http-server-internal'; import { mockCoreContext } from '@kbn/core-base-server-mocks'; import type { Logger } from '@kbn/logging'; const CSP_CONFIG = cspConfig.schema.validate({}); const EXTERNAL_URL_CONFIG = externalUrlConfig.schema.validate({}); +const PERMISSIONS_POLICY_CONFIG = permissionsPolicyConfig.schema.validate({}); describe('Http2 - Smoke tests', () => { let server: HttpServer; @@ -56,7 +58,7 @@ describe('Http2 - Smoke tests', () => { }, shutdownTimeout: '5s', }); - config = new HttpConfig(rawConfig, CSP_CONFIG, EXTERNAL_URL_CONFIG); + config = new HttpConfig(rawConfig, CSP_CONFIG, EXTERNAL_URL_CONFIG, PERMISSIONS_POLICY_CONFIG); server = new HttpServer(coreContext, 'tests', of(config.shutdownTimeout)); }); diff --git a/src/core/server/integration_tests/http/set_tls_config.test.ts b/src/core/server/integration_tests/http/set_tls_config.test.ts index 4966ecafce411..e0c30efafc109 100644 --- a/src/core/server/integration_tests/http/set_tls_config.test.ts +++ b/src/core/server/integration_tests/http/set_tls_config.test.ts @@ -14,12 +14,14 @@ import { config as httpConfig, cspConfig, externalUrlConfig, + permissionsPolicyConfig, } from '@kbn/core-http-server-internal'; import { flattenCertificateChain, fetchPeerCertificate, isServerTLS } from './tls_utils'; describe('setTlsConfig', () => { const CSP_CONFIG = cspConfig.schema.validate({}); const EXTERNAL_URL_CONFIG = externalUrlConfig.schema.validate({}); + const PERMISSIONS_POLICY_CONFIG = permissionsPolicyConfig.schema.validate({}); beforeAll(() => { process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; @@ -39,7 +41,12 @@ describe('setTlsConfig', () => { }, shutdownTimeout: '1s', }); - const firstConfig = new HttpConfig(rawHttpConfig, CSP_CONFIG, EXTERNAL_URL_CONFIG); + const firstConfig = new HttpConfig( + rawHttpConfig, + CSP_CONFIG, + EXTERNAL_URL_CONFIG, + PERMISSIONS_POLICY_CONFIG + ); const serverOptions = getServerOptions(firstConfig); const server = createServer(serverOptions); @@ -85,7 +92,12 @@ describe('setTlsConfig', () => { shutdownTimeout: '1s', }); - const secondConfig = new HttpConfig(secondRawConfig, CSP_CONFIG, EXTERNAL_URL_CONFIG); + const secondConfig = new HttpConfig( + secondRawConfig, + CSP_CONFIG, + EXTERNAL_URL_CONFIG, + PERMISSIONS_POLICY_CONFIG + ); setTlsConfig(server, secondConfig.ssl); diff --git a/src/core/server/integration_tests/http/tls_config_reload.test.ts b/src/core/server/integration_tests/http/tls_config_reload.test.ts index ad2c530faae52..030b22e2f497c 100644 --- a/src/core/server/integration_tests/http/tls_config_reload.test.ts +++ b/src/core/server/integration_tests/http/tls_config_reload.test.ts @@ -17,6 +17,7 @@ import { config as httpConfig, cspConfig, externalUrlConfig, + permissionsPolicyConfig, } from '@kbn/core-http-server-internal'; import { isServerTLS, flattenCertificateChain, fetchPeerCertificate } from './tls_utils'; import { mockCoreContext } from '@kbn/core-base-server-mocks'; @@ -24,6 +25,7 @@ import type { Logger } from '@kbn/logging'; const CSP_CONFIG = cspConfig.schema.validate({}); const EXTERNAL_URL_CONFIG = externalUrlConfig.schema.validate({}); +const PERMISSIONS_POLICY_CONFIG = permissionsPolicyConfig.schema.validate({}); const enhanceWithContext = (fn: (...args: any[]) => any) => fn.bind(null, {}); describe('HttpServer - TLS config', () => { @@ -54,7 +56,12 @@ describe('HttpServer - TLS config', () => { }, shutdownTimeout: '1s', }); - const firstConfig = new HttpConfig(rawHttpConfig, CSP_CONFIG, EXTERNAL_URL_CONFIG); + const firstConfig = new HttpConfig( + rawHttpConfig, + CSP_CONFIG, + EXTERNAL_URL_CONFIG, + PERMISSIONS_POLICY_CONFIG + ); const config$ = new BehaviorSubject(firstConfig); @@ -109,7 +116,12 @@ describe('HttpServer - TLS config', () => { shutdownTimeout: '1s', }); - const secondConfig = new HttpConfig(secondRawConfig, CSP_CONFIG, EXTERNAL_URL_CONFIG); + const secondConfig = new HttpConfig( + secondRawConfig, + CSP_CONFIG, + EXTERNAL_URL_CONFIG, + PERMISSIONS_POLICY_CONFIG + ); config$.next(secondConfig); const secondCertificate = await fetchPeerCertificate(firstConfig.host, firstConfig.port); diff --git a/src/core/server/integration_tests/saved_objects/migrations/group1/7_13_0_failed_action_tasks.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group1/7_13_0_failed_action_tasks.test.ts index 89478ea377f6c..16e0043062a63 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group1/7_13_0_failed_action_tasks.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group1/7_13_0_failed_action_tasks.test.ts @@ -57,8 +57,6 @@ describe('migration from 7.13 to 7.14+ with many failed action_tasks', () => { if (esServer) { await esServer.stop(); } - - await new Promise((resolve) => setTimeout(resolve, 10000)); }); const getCounts = async ( diff --git a/src/core/server/integration_tests/saved_objects/migrations/group1/7_13_0_unknown_types.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group1/7_13_0_unknown_types.test.ts index 6b06337a367db..d9c4f0d7f33ae 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group1/7_13_0_unknown_types.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group1/7_13_0_unknown_types.test.ts @@ -58,8 +58,6 @@ describe('migration v2', () => { if (esServer) { await esServer.stop(); } - - await new Promise((resolve) => setTimeout(resolve, 10000)); }); describe('when `discardUnknownObjects` does not match current kibana version', () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/batch_size_bytes.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group2/batch_size_bytes.test.ts index bea50cf32ce35..e6c3ad412e746 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group2/batch_size_bytes.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group2/batch_size_bytes.test.ts @@ -89,8 +89,6 @@ describe('migration v2', () => { if (esServer) { await esServer.stop(); } - - await new Promise((resolve) => setTimeout(resolve, 10000)); }); it('completes the migration even when a full batch would exceed ES http.max_content_length', async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/batch_size_bytes_exceeds_es_content_length.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group2/batch_size_bytes_exceeds_es_content_length.test.ts index 95baed313bd8c..4cdc89006c983 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group2/batch_size_bytes_exceeds_es_content_length.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group2/batch_size_bytes_exceeds_es_content_length.test.ts @@ -58,8 +58,6 @@ describe('migration v2', () => { if (esServer) { await esServer.stop(); } - - await new Promise((resolve) => setTimeout(resolve, 10000)); }); it('fails with a descriptive message when maxBatchSizeBytes exceeds ES http.max_content_length', async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/check_target_mappings.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group2/check_target_mappings.test.ts index 9a89ecb13d71b..600a00e24e9fd 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group2/check_target_mappings.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group2/check_target_mappings.test.ts @@ -17,7 +17,6 @@ import { createTestServers, type TestElasticsearchUtils, } from '@kbn/core-test-helpers-kbn-server'; -import { delay } from '../test_utils'; const logFilePath = Path.join(__dirname, 'check_target_mappings.log'); @@ -33,7 +32,6 @@ describe('migration v2 - CHECK_TARGET_MAPPINGS', () => { afterEach(async () => { await root?.shutdown(); await esServer?.stop(); - await delay(10); }); it('is not run for new installations', async () => { @@ -80,7 +78,6 @@ describe('migration v2 - CHECK_TARGET_MAPPINGS', () => { // stop Kibana and remove logs await root.shutdown(); - await delay(10); await fs.unlink(logFilePath).catch(() => {}); root = createRoot(); @@ -122,7 +119,7 @@ describe('migration v2 - CHECK_TARGET_MAPPINGS', () => { // Check for migration steps present in the logs logs = await fs.readFile(logFilePath, 'utf-8'); - expect(logs).not.toMatch('CREATE_NEW_TARGET'); + expect(logs).not.toMatch('[.kibana] CREATE_NEW_TARGET'); expect(logs).toMatch('CHECK_TARGET_MAPPINGS -> UPDATE_TARGET_MAPPINGS_PROPERTIES'); expect(logs).toMatch( 'UPDATE_TARGET_MAPPINGS_PROPERTIES -> UPDATE_TARGET_MAPPINGS_PROPERTIES_WAIT_FOR_TASK' diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/cleanup.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group2/cleanup.test.ts index 7f04f37589f69..7c93c1477cf4a 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group2/cleanup.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group2/cleanup.test.ts @@ -13,7 +13,7 @@ import JSON5 from 'json5'; import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import { SavedObjectsType } from '@kbn/core-saved-objects-server'; import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; -import { getMigrationDocLink, delay } from '../test_utils'; +import { getMigrationDocLink } from '../test_utils'; import { clearLog, currentVersion, @@ -71,7 +71,6 @@ describe('migration v2', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); }); diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/collects_corrupt_docs.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group2/collects_corrupt_docs.test.ts index 45b28e8ac3082..dbc5ea193ad56 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group2/collects_corrupt_docs.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group2/collects_corrupt_docs.test.ts @@ -42,8 +42,6 @@ describe('migration v2 with corrupt saved object documents', () => { if (esServer) { await esServer.stop(); } - - await new Promise((resolve) => setTimeout(resolve, 10000)); }); it('collects corrupt saved object documents across batches', async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/corrupt_outdated_docs.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group2/corrupt_outdated_docs.test.ts index 384cdcbfa8abd..728625003637e 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group2/corrupt_outdated_docs.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group2/corrupt_outdated_docs.test.ts @@ -40,8 +40,6 @@ describe('migration v2 with corrupt saved object documents', () => { if (esServer) { await esServer.stop(); } - - await new Promise((resolve) => setTimeout(resolve, 10000)); }); it.skip('collects corrupt saved object documents across batches', async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/multiple_kibana_nodes.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group2/multiple_kibana_nodes.test.ts index 65fc3830ae069..d82863f01928c 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group2/multiple_kibana_nodes.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group2/multiple_kibana_nodes.test.ts @@ -106,7 +106,8 @@ async function createRoot({ logFileName }: CreateRootConfig) { // suite is very long, the 10mins default can cause timeouts jest.setTimeout(15 * 60 * 1000); -describe('migration v2', () => { +// FLAKY: https://github.com/elastic/kibana/issues/156117 +describe.skip('migration v2', () => { let esServer: TestElasticsearchUtils; let rootA: Root; let rootB: Root; @@ -170,7 +171,6 @@ describe('migration v2', () => { if (esServer) { await esServer.stop(); - await delay(10000); } }); diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/outdated_docs.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group2/outdated_docs.test.ts index 79a76c72adefc..e7579a7ce4a91 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group2/outdated_docs.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group2/outdated_docs.test.ts @@ -41,8 +41,6 @@ describe('migration v2', () => { if (esServer) { await esServer.stop(); } - - await new Promise((resolve) => setTimeout(resolve, 10000)); }); it('migrates the documents to the highest version', async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/deferred_migrations.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group3/deferred_migrations.test.ts index 8a40466ee2588..41c9501d7e6b2 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/deferred_migrations.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group3/deferred_migrations.test.ts @@ -12,7 +12,6 @@ import type { SavedObjectsType, SavedObjectUnsanitizedDoc, } from '@kbn/core-saved-objects-server'; -import { delay } from '../test_utils'; import '../jest_matchers'; import { @@ -36,7 +35,6 @@ describe('deferred migrations', () => { afterAll(async () => { await server?.stop(); - await delay(10); }); beforeEach(async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/migration_from_older_v1.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group3/migration_from_older_v1.test.ts index d32c2f0902b4e..45ffbb709854c 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/migration_from_older_v1.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group3/migration_from_older_v1.test.ts @@ -170,8 +170,6 @@ describe('migrating from 7.3.0-xpack which used v1 migrations', () => { if (esServer) { await esServer.stop(); } - - await new Promise((resolve) => setTimeout(resolve, 10000)); }; beforeAll(async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts index e4350c431977b..73e31881b0a91 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts @@ -103,10 +103,6 @@ describe('migration v2', () => { await removeLogFile(); }); - afterAll(async () => { - await new Promise((resolve) => setTimeout(resolve, 10000)); - }); - afterEach(async () => { if (root) { await root.shutdown(); diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/read_batch_size.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group3/read_batch_size.test.ts index 0fce643975c53..3a91a8477d4e5 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/read_batch_size.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group3/read_batch_size.test.ts @@ -13,7 +13,6 @@ import { createRootWithCorePlugins, type TestElasticsearchUtils, } from '@kbn/core-test-helpers-kbn-server'; -import { delay } from '../test_utils'; import { startElasticsearch } from '../kibana_migrator_test_kit'; const logFilePath = Path.join(__dirname, 'read_batch_size.log'); @@ -33,7 +32,6 @@ describe('migration v2 - read batch size', () => { afterEach(async () => { await root?.shutdown(); await esServer?.stop(); - await delay(10); }); it('reduces the read batchSize in half if a batch exceeds maxReadBatchSizeBytes', async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/rewriting_id.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group3/rewriting_id.test.ts index 6079469cf4982..70768bd3f7009 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/rewriting_id.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group3/rewriting_id.test.ts @@ -108,8 +108,6 @@ describe('migration v2', () => { if (esServer) { await esServer.stop(); } - - await new Promise((resolve) => setTimeout(resolve, 10000)); }); it('rewrites id deterministically for SO with namespaceType: "multiple" and "multiple-isolated"', async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/skip_migration.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group3/skip_migration.test.ts index e24c50d2cb4c9..54ac46754acc4 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/skip_migration.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group3/skip_migration.test.ts @@ -71,8 +71,6 @@ describe('starting with `migration.skip: true` when indices are up to date', () if (esServer) { await esServer.stop(); } - - await new Promise((resolve) => setTimeout(resolve, 10000)); }); it('starts and display the correct service status', async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts index a137b905f07a7..2228b19956bb3 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts @@ -146,7 +146,8 @@ const previouslyRegisteredTypes = [ 'synthetics-dynamic-settings', 'uptime-synthetics-api-key', 'url', - 'usage-counters', + 'usage-counter', // added in 8.16.0: richer mappings, located in .kibana_usage_counters + 'usage-counters', // deprecated in favor of 'usage-counter' 'visualization', 'workplace_search_telemetry', ].sort(); diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/wait_for_migration_completion.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group3/wait_for_migration_completion.test.ts index 459cfc921badf..266e821abf7e3 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/wait_for_migration_completion.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group3/wait_for_migration_completion.test.ts @@ -40,8 +40,6 @@ describe('migration with waitForCompletion=true', () => { if (esServer) { await esServer.stop(); } - - await new Promise((resolve) => setTimeout(resolve, 10000)); }); it('waits for another instance to complete the migration', async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group4/v2_md5_to_mv.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group4/v2_md5_to_mv.test.ts index 4e1cb4d06e38f..1277370f45835 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group4/v2_md5_to_mv.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group4/v2_md5_to_mv.test.ts @@ -19,7 +19,7 @@ import { readLog, startElasticsearch, } from '../kibana_migrator_test_kit'; -import { delay, createType } from '../test_utils'; +import { createType } from '../test_utils'; import '../jest_matchers'; const logFilePath = Path.join(__dirname, 'v2_md5_to_mv.test.log'); @@ -270,6 +270,5 @@ describe('V2 algorithm', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); }); diff --git a/src/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_same_stack_version.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_same_stack_version.test.ts index bfc105ee7d160..ba4a19de81741 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_same_stack_version.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_same_stack_version.test.ts @@ -14,7 +14,7 @@ import { SavedObjectsBulkCreateObject } from '@kbn/core-saved-objects-api-server import { modelVersionToVirtualVersion } from '@kbn/core-saved-objects-base-server-internal'; import '../jest_matchers'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, createType, parseLogFile } from '../test_utils'; +import { createType, parseLogFile } from '../test_utils'; import { getBaseMigratorParams } from '../fixtures/zdt_base.fixtures'; const logFilePath = Path.join(__dirname, 'v2_with_mv_same_stack_version.test.log'); @@ -31,7 +31,6 @@ describe('V2 algorithm - using model versions - upgrade without stack version in afterAll(async () => { await esServer?.stop(); - await delay(10); }); const getTestModelVersionType = ({ beforeUpgrade }: { beforeUpgrade: boolean }) => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_stack_version_bump.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_stack_version_bump.test.ts index 7a5d8a686f084..f24dc6fd427fe 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_stack_version_bump.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_stack_version_bump.test.ts @@ -14,7 +14,7 @@ import { SavedObjectsBulkCreateObject } from '@kbn/core-saved-objects-api-server import { modelVersionToVirtualVersion } from '@kbn/core-saved-objects-base-server-internal'; import '../jest_matchers'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, createType, parseLogFile } from '../test_utils'; +import { createType, parseLogFile } from '../test_utils'; import { getBaseMigratorParams } from '../fixtures/zdt_base.fixtures'; const logFilePath = Path.join(__dirname, 'v2_with_mv_stack_version_bump.test.log'); @@ -31,7 +31,6 @@ describe('V2 algorithm - using model versions - stack version bump scenario', () afterAll(async () => { await esServer?.stop(); - await delay(10); }); const getTestSwitchType = ({ beforeUpgrade }: { beforeUpgrade: boolean }) => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group5/active_delete.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group5/active_delete.test.ts index d950129dac69a..cd1a98fa3ee57 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group5/active_delete.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group5/active_delete.test.ts @@ -22,7 +22,6 @@ import { getIncompatibleMappingsMigrator, getNonDeprecatedMappingsMigrator, } from '../kibana_migrator_test_kit'; -import { delay } from '../test_utils'; describe('when upgrading to a new stack version', () => { let esServer: TestElasticsearchUtils['es']; @@ -34,7 +33,6 @@ describe('when upgrading to a new stack version', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); describe('if the mappings match (diffMappings() === false)', () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group5/active_delete_multiple_instances.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group5/active_delete_multiple_instances.test.ts index e297b39847f10..e0233cccb3fb7 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group5/active_delete_multiple_instances.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group5/active_delete_multiple_instances.test.ts @@ -23,7 +23,6 @@ import { startElasticsearch, } from '../kibana_migrator_test_kit'; import { baselineTypes } from './active_delete.fixtures'; -import { delay } from '../test_utils'; import { createBaselineArchive } from '../kibana_migrator_archive_utils'; const PARALLEL_MIGRATORS = 6; @@ -146,7 +145,6 @@ describe('multiple migrator instances running in parallel', () => { afterAll(async () => { // await esClient?.indices.delete({ index: `${kibanaIndex}_${currentVersion}_001` }); await esServer?.stop(); - await delay(10); }); const getAggregatedTypesCount = async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/group5/dot_kibana_split.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group5/dot_kibana_split.test.ts index c4c56442c23f8..ba164e223be55 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group5/dot_kibana_split.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group5/dot_kibana_split.test.ts @@ -173,135 +173,15 @@ describe('split .kibana index into multiple system indices', () => { }) ); - expect(indicesInfo[`.kibana_${currentVersion}_001`].mappings?._meta?.indexTypesMap) - .toMatchInlineSnapshot(` - Object { - ".kibana": Array [ - "action", - "action_task_params", - "ad_hoc_run_params", - "alert", - "api_key_pending_invalidation", - "apm-custom-dashboards", - "apm-indices", - "apm-server-schema", - "apm-service-group", - "apm-telemetry", - "app_search_telemetry", - "application_usage_daily", - "application_usage_totals", - "canvas-element", - "canvas-workpad-template", - "cases", - "cases-comments", - "cases-configure", - "cases-connector-mappings", - "cases-rules", - "cases-telemetry", - "cases-user-actions", - "cloud-security-posture-settings", - "config", - "config-global", - "connector_token", - "core-usage-stats", - "csp-rule-template", - "endpoint:unified-user-artifact-manifest", - "endpoint:user-artifact-manifest", - "enterprise_search_telemetry", - "entity-definition", - "entity-discovery-api-key", - "epm-packages", - "epm-packages-assets", - "event-annotation-group", - "event_loop_delays_daily", - "exception-list", - "exception-list-agnostic", - "file", - "file-upload-usage-collection-telemetry", - "fileShare", - "fleet-fleet-server-host", - "fleet-message-signing-keys", - "fleet-preconfiguration-deletion-record", - "fleet-proxy", - "fleet-setup-lock", - "fleet-uninstall-tokens", - "graph-workspace", - "guided-onboarding-guide-state", - "guided-onboarding-plugin-state", - "index-pattern", - "infra-custom-dashboards", - "infrastructure-monitoring-log-view", - "infrastructure-ui-source", - "ingest-agent-policies", - "ingest-download-sources", - "ingest-outputs", - "ingest-package-policies", - "ingest_manager_settings", - "inventory-view", - "kql-telemetry", - "legacy-url-alias", - "lens", - "lens-ui-telemetry", - "links", - "maintenance-window", - "map", - "metrics-data-source", - "metrics-explorer-view", - "ml-job", - "ml-module", - "ml-trained-model", - "monitoring-telemetry", - "observability-onboarding-state", - "osquery-manager-usage-metric", - "osquery-pack", - "osquery-pack-asset", - "osquery-saved-query", - "policy-settings-protection-updates-note", - "query", - "risk-engine-configuration", - "rules-settings", - "sample-data-telemetry", - "search-session", - "search-telemetry", - "security-rule", - "security-solution-signals-migration", - "siem-detection-engine-rule-actions", - "siem-ui-timeline", - "siem-ui-timeline-note", - "siem-ui-timeline-pinned-event", - "slo", - "slo-settings", - "space", - "spaces-usage-stats", - "synthetics-dynamic-settings", - "synthetics-monitor", - "synthetics-param", - "synthetics-privates-locations", - "tag", - "telemetry", - "threshold-explorer-view", - "ui-metric", - "upgrade-assistant-ml-upgrade-operation", - "upgrade-assistant-reindex-operation", - "uptime-dynamic-settings", - "uptime-synthetics-api-key", - "url", - "usage-counters", - "workplace_search_telemetry", - ], - ".kibana_so_search": Array [ - "search", - ], - ".kibana_so_ui": Array [ - "canvas-workpad", - "dashboard", - "visualization", - ], - ".kibana_task_manager": Array [ - "task", - ], - } - `); + const typesMap = indicesInfo[`.kibana_${currentVersion}_001`].mappings?._meta?.indexTypesMap; + + expect(Array.isArray(typesMap['.kibana'])).toEqual(true); + expect(typesMap['.kibana'].length > 50).toEqual(true); + expect(typesMap['.kibana'].includes('action')).toEqual(true); + expect(typesMap['.kibana'].includes('cases')).toEqual(true); + expect(typesMap['.kibana_so_search']).toEqual(['search']); + expect(typesMap['.kibana_so_ui']).toEqual(['canvas-workpad', 'dashboard', 'visualization']); + expect(typesMap['.kibana_task_manager']).toEqual(['task']); const logs = await parseLogFile(logFilePathFirstRun); @@ -506,6 +386,7 @@ describe('split .kibana index into multiple system indices', () => { '.kibana_task_manager': { task: 5, }, + '.kibana_usage_counters': {}, }); }); diff --git a/src/core/server/integration_tests/saved_objects/migrations/group5/skip_reindex.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group5/skip_reindex.test.ts index 4d244314d3acb..b93f96671d96f 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group5/skip_reindex.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group5/skip_reindex.test.ts @@ -20,7 +20,6 @@ import { startElasticsearch, KibanaMigratorTestKit, } from '../kibana_migrator_test_kit'; -import { delay } from '../test_utils'; describe('when migrating to a new version', () => { let esServer: TestElasticsearchUtils['es']; @@ -144,6 +143,5 @@ describe('when migrating to a new version', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); }); diff --git a/src/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/basic_document_migration.ts b/src/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/basic_document_migration.ts index 0c43a40478d03..9e3d01dd0ecec 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/basic_document_migration.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/basic_document_migration.ts @@ -11,7 +11,7 @@ import { range, sortBy } from 'lodash'; import { SavedObjectsBulkCreateObject } from '@kbn/core-saved-objects-api-server'; import '../../jest_matchers'; import { getKibanaMigratorTestKit } from '../../kibana_migrator_test_kit'; -import { delay, parseLogFile } from '../../test_utils'; +import { parseLogFile } from '../../test_utils'; import { EsRunner, EsServer } from '../../test_types'; import { getBaseMigratorParams, @@ -35,7 +35,6 @@ export function createBasicDocumentsMigrationTest({ afterAll(async () => { await esServer?.stop(); - await delay(10); }); const createBaseline = async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/standard_workflow.ts b/src/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/standard_workflow.ts index b22e522d1d2c1..f0709e8720ce7 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/standard_workflow.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/standard_workflow.ts @@ -11,7 +11,7 @@ import { range } from 'lodash'; import { SavedObjectsBulkCreateObject } from '@kbn/core-saved-objects-api-server'; import '../../jest_matchers'; import { getKibanaMigratorTestKit } from '../../kibana_migrator_test_kit'; -import { delay, parseLogFile } from '../../test_utils'; +import { parseLogFile } from '../../test_utils'; import { EsRunner, EsServer } from '../../test_types'; import { getBaseMigratorParams, @@ -36,7 +36,6 @@ export function createStandardWorkflowTest({ afterAll(async () => { await esServer?.stop(); - await delay(10); }); const createBaseline = async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/basic_downgrade.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/basic_downgrade.test.ts index 8968fe7bac408..c541f57a6111a 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/basic_downgrade.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/basic_downgrade.test.ts @@ -13,7 +13,7 @@ import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import { SavedObjectsBulkCreateObject } from '@kbn/core-saved-objects-api-server'; import '../jest_matchers'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, parseLogFile, createType } from '../test_utils'; +import { parseLogFile, createType } from '../test_utils'; import { getBaseMigratorParams } from '../fixtures/zdt_base.fixtures'; export const logFilePath = Path.join(__dirname, 'basic_downgrade.test.log'); @@ -28,7 +28,6 @@ describe('ZDT upgrades - basic downgrade', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); const typeV1 = createType({ diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/conversion_failures.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/conversion_failures.test.ts index 05f8f30edacc6..b9821dc62442b 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/conversion_failures.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/conversion_failures.test.ts @@ -13,7 +13,7 @@ import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import { SavedObjectsBulkCreateObject } from '@kbn/core-saved-objects-api-server'; import '../jest_matchers'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, parseLogFile } from '../test_utils'; +import { parseLogFile } from '../test_utils'; import { getBaseMigratorParams, getSampleAType, @@ -31,7 +31,6 @@ describe('ZDT upgrades - encountering conversion failures', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); beforeEach(async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/create_index.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/create_index.test.ts index f0b049b8307db..6f12311009e21 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/create_index.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/create_index.test.ts @@ -11,7 +11,7 @@ import fs from 'fs/promises'; import '../jest_matchers'; import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, parseLogFile } from '../test_utils'; +import { parseLogFile } from '../test_utils'; import { getBaseMigratorParams, getFooType, getBarType } from '../fixtures/zdt_base.fixtures'; export const logFilePath = Path.join(__dirname, 'create_index.test.log'); @@ -26,7 +26,6 @@ describe('ZDT upgrades - running on a fresh cluster', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); it('create the index with the correct mappings and meta', async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/document_cleanup.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/document_cleanup.test.ts index ab707f792fbe9..e0341915c7dd3 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/document_cleanup.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/document_cleanup.test.ts @@ -13,7 +13,6 @@ import { SearchResponse } from '@elastic/elasticsearch/lib/api/types'; import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import { SavedObjectsBulkCreateObject } from '@kbn/core-saved-objects-api-server'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay } from '../test_utils'; import { getBaseMigratorParams, getDeletedType, @@ -35,7 +34,6 @@ describe('ZDT upgrades - document cleanup', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); const createBaseline = async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/mapping_version_conflict.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/mapping_version_conflict.test.ts index 7b0658fbd977e..a19db9811462c 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/mapping_version_conflict.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/mapping_version_conflict.test.ts @@ -11,7 +11,7 @@ import fs from 'fs/promises'; import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import '../jest_matchers'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, parseLogFile } from '../test_utils'; +import { parseLogFile } from '../test_utils'; import { getBaseMigratorParams, getFooType, @@ -33,7 +33,6 @@ describe('ZDT upgrades - mapping model version conflict', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); const createBaseline = async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/rerun_same_version.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/rerun_same_version.test.ts index 398a133bf990a..6c4d8688450bf 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/rerun_same_version.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/rerun_same_version.test.ts @@ -11,7 +11,7 @@ import fs from 'fs/promises'; import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import '../jest_matchers'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, parseLogFile } from '../test_utils'; +import { parseLogFile } from '../test_utils'; import { getBaseMigratorParams, getFooType, getBarType } from '../fixtures/zdt_base.fixtures'; export const logFilePath = Path.join(__dirname, 'rerun_same_version.test.log'); @@ -26,7 +26,6 @@ describe('ZDT upgrades - rerun migration on same version', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); const createBaseline = async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/update_mappings.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/update_mappings.test.ts index c51c712f34452..82ff0a1c0d5ec 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/update_mappings.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/update_mappings.test.ts @@ -11,7 +11,7 @@ import fs from 'fs/promises'; import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import '../jest_matchers'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, parseLogFile } from '../test_utils'; +import { parseLogFile } from '../test_utils'; import { getBaseMigratorParams, getFooType, @@ -31,7 +31,6 @@ describe('ZDT upgrades - basic mapping update', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); const createBaseline = async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/outdated_doc_query.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_2/outdated_doc_query.test.ts index cc901b56f3818..f403fe6c3579a 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/outdated_doc_query.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_2/outdated_doc_query.test.ts @@ -12,7 +12,7 @@ import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import '../jest_matchers'; import { SavedObjectsModelVersionMap, SavedObject } from '@kbn/core-saved-objects-server'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, createType } from '../test_utils'; +import { createType } from '../test_utils'; import { getBaseMigratorParams } from '../fixtures/zdt_base.fixtures'; import { SavedObjectsSerializer, @@ -114,7 +114,6 @@ describe('getOutdatedDocumentsQuery', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); it('creates a query returning the expected documents', async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/root_field_addition.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_2/root_field_addition.test.ts index 47f853187b18f..1ce530a9c46c1 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/root_field_addition.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_2/root_field_addition.test.ts @@ -27,7 +27,7 @@ import fs from 'fs/promises'; import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import '../jest_matchers'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, parseLogFile } from '../test_utils'; +import { parseLogFile } from '../test_utils'; import { getBaseMigratorParams, getFooType } from '../fixtures/zdt_base.fixtures'; export const logFilePath = Path.join(__dirname, 'root_field_addition.test.log'); @@ -42,7 +42,6 @@ describe('ZDT upgrades - introducing new root fields', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); const baseMappings = { diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/type_addition.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_2/type_addition.test.ts index 61697df6ecef6..770fade1d436c 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/type_addition.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_2/type_addition.test.ts @@ -11,7 +11,7 @@ import fs from 'fs/promises'; import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import '../jest_matchers'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, parseLogFile } from '../test_utils'; +import { parseLogFile } from '../test_utils'; import { getBaseMigratorParams, getFooType, getBarType } from '../fixtures/zdt_base.fixtures'; export const logFilePath = Path.join(__dirname, 'type_addition.test.log'); @@ -26,7 +26,6 @@ describe('ZDT upgrades - introducing a new SO type', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); const createBaseline = async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_partial_failure.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_partial_failure.test.ts index 0cfebd3d8514b..fb3c11e68299f 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_partial_failure.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_partial_failure.test.ts @@ -13,7 +13,7 @@ import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import { SavedObjectsBulkCreateObject } from '@kbn/core-saved-objects-api-server'; import '../jest_matchers'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, parseLogFile, createType } from '../test_utils'; +import { parseLogFile, createType } from '../test_utils'; import { getBaseMigratorParams, noopMigration } from '../fixtures/zdt_base.fixtures'; const logFilePath = Path.join(__dirname, 'v2_to_zdt_partial_failure.test.log'); @@ -28,7 +28,6 @@ describe('ZDT with v2 compat - recovering from partially migrated state', () => afterAll(async () => { await esServer?.stop(); - await delay(10); }); const typeBefore = createType({ diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_switch.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_switch.test.ts index 4a92a9d14eef4..dfbe0aeba8866 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_switch.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_switch.test.ts @@ -18,7 +18,7 @@ import { startElasticsearch, currentVersion, } from '../kibana_migrator_test_kit'; -import { delay, parseLogFile } from '../test_utils'; +import { parseLogFile } from '../test_utils'; import { getBaseMigratorParams, getSampleAType } from '../fixtures/zdt_base.fixtures'; export const logFilePath = Path.join(__dirname, 'v2_to_zdt_switch.test.log'); @@ -35,7 +35,6 @@ describe('ZDT upgrades - switching from v2 algorithm', () => { afterEach(async () => { await esServer?.stop(); - await delay(10); }); const createBaseline = async ({ diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/basic_document_migration.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/basic_document_migration.test.ts index c71ca527f1270..5bd16f0110c63 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/basic_document_migration.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/basic_document_migration.test.ts @@ -13,7 +13,7 @@ import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import { SavedObjectsBulkCreateObject } from '@kbn/core-saved-objects-api-server'; import '../jest_matchers'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, parseLogFile } from '../test_utils'; +import { parseLogFile } from '../test_utils'; import { getBaseMigratorParams, getSampleAType, @@ -32,7 +32,6 @@ describe('ZDT with v2 compat - basic document migration', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); const createBaseline = async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/create_index.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/create_index.test.ts index 6f1b8257ddb26..d9f76907087be 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/create_index.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/create_index.test.ts @@ -11,7 +11,7 @@ import fs from 'fs/promises'; import '../jest_matchers'; import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, parseLogFile } from '../test_utils'; +import { parseLogFile } from '../test_utils'; import { getBaseMigratorParams, getFooType, getLegacyType } from '../fixtures/zdt_base.fixtures'; const logFilePath = Path.join(__dirname, 'create_index.test.log'); @@ -26,7 +26,6 @@ describe('ZDT with v2 compat - running on a fresh cluster', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); it('create the index with the correct mappings and meta', async () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/switch_to_model_version.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/switch_to_model_version.test.ts index 1aa65bc1cdd02..fa72c8f1edae8 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/switch_to_model_version.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/switch_to_model_version.test.ts @@ -13,7 +13,7 @@ import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import { SavedObjectsBulkCreateObject } from '@kbn/core-saved-objects-api-server'; import '../jest_matchers'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, parseLogFile, createType } from '../test_utils'; +import { parseLogFile, createType } from '../test_utils'; import { getBaseMigratorParams, noopMigration } from '../fixtures/zdt_base.fixtures'; const logFilePath = Path.join(__dirname, 'switch_to_model_version.test.log'); @@ -28,7 +28,6 @@ describe('ZDT with v2 compat - type switching from migration to model version', afterAll(async () => { await esServer?.stop(); - await delay(10); }); const typeBefore = createType({ diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/update_mappings.test.ts b/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/update_mappings.test.ts index 0c4956105fc78..9f3e58d6812fa 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/update_mappings.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/update_mappings.test.ts @@ -11,7 +11,7 @@ import fs from 'fs/promises'; import { type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server'; import '../jest_matchers'; import { getKibanaMigratorTestKit, startElasticsearch } from '../kibana_migrator_test_kit'; -import { delay, parseLogFile } from '../test_utils'; +import { parseLogFile } from '../test_utils'; import { getBaseMigratorParams, getFooType, @@ -32,7 +32,6 @@ describe('ZDT with v2 compat - basic mapping update', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); const createBaseline = async () => { diff --git a/src/core/server/integration_tests/saved_objects/service/lib/bulk_update.test.ts b/src/core/server/integration_tests/saved_objects/service/lib/bulk_update.test.ts index 98af19ec5c9d0..4cd661add5053 100644 --- a/src/core/server/integration_tests/saved_objects/service/lib/bulk_update.test.ts +++ b/src/core/server/integration_tests/saved_objects/service/lib/bulk_update.test.ts @@ -17,7 +17,6 @@ import { getKibanaMigratorTestKit, startElasticsearch, } from '../../migrations/kibana_migrator_test_kit'; -import { delay } from '../../migrations/test_utils'; import { getBaseMigratorParams } from '../../migrations/fixtures/zdt_base.fixtures'; export const logFilePath = Path.join(__dirname, 'bulk_update.test.log'); @@ -32,7 +31,6 @@ describe('SOR - bulk_update API', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); const getCrossVersionType = (version: 'v1' | 'v2'): SavedObjectsType => { diff --git a/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts b/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts index 035da58c60fa1..0a75e27da0830 100644 --- a/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts +++ b/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts @@ -9,7 +9,7 @@ import Hapi from '@hapi/hapi'; import h2o2 from '@hapi/h2o2'; import { URL } from 'url'; -import { SavedObject, ALL_SAVED_OBJECT_INDICES } from '@kbn/core-saved-objects-server'; +import type { SavedObject } from '@kbn/core-saved-objects-server'; import type { ISavedObjectsRepository } from '@kbn/core-saved-objects-api-server'; import type { InternalCoreSetup, InternalCoreStart } from '@kbn/core-lifecycle-server-internal'; import { Root } from '@kbn/core-root-server-internal'; @@ -18,7 +18,6 @@ import { createTestServers, type TestElasticsearchUtils, } from '@kbn/core-test-helpers-kbn-server'; -import { kibanaPackageJson as pkg } from '@kbn/repo-info'; import { declareGetRoute, declareDeleteRoute, @@ -32,7 +31,8 @@ import { declarePassthroughRoute, declareIndexRoute, setProxyInterrupt, - allCombinationsPermutations, + getVersionedKibanaIndex, + getIndicesWithNamespaceAwareTypes, } from './repository_with_proxy_utils'; let esServer: TestElasticsearchUtils; @@ -93,29 +93,40 @@ describe('404s from proxies', () => { ? parseInt(process.env.TEST_PROXY_SERVER_PORT, 10) : 5698; + // Setup kibana configured to use proxy as ES backend + root = createRootWithCorePlugins({ + elasticsearch: { + hosts: [`http://${esHostname}:${proxyPort}`], + }, + migrations: { + skip: false, + }, + }); + await root.preboot(); + const setup = await root.setup(); + registerSOTypes(setup); + // Setup custom hapi hapiServer with h2o2 plugin for proxying hapiServer = Hapi.server({ port: proxyPort, }); + const mainIndex = getVersionedKibanaIndex(); await hapiServer.register(h2o2); // register specific routes to modify the response and a catch-all to relay the request/response as-is + declareGetRoute(hapiServer, esHostname, esPort, mainIndex); + declareDeleteRoute(hapiServer, esHostname, esPort, mainIndex); + declarePostUpdateRoute(hapiServer, esHostname, esPort, mainIndex); - allCombinationsPermutations( - ALL_SAVED_OBJECT_INDICES.map((indexPattern) => `${indexPattern}_${pkg.version}`) - ) - .map((indices) => indices.join(',')) - .forEach((kbnIndexPath) => { - declareGetRoute(hapiServer, esHostname, esPort, kbnIndexPath); - declareDeleteRoute(hapiServer, esHostname, esPort, kbnIndexPath); - declarePostUpdateRoute(hapiServer, esHostname, esPort, kbnIndexPath); - - declareGetSearchRoute(hapiServer, esHostname, esPort, kbnIndexPath); - declarePostSearchRoute(hapiServer, esHostname, esPort, kbnIndexPath); - declarePostPitRoute(hapiServer, esHostname, esPort, kbnIndexPath); - declarePostUpdateByQueryRoute(hapiServer, esHostname, esPort, kbnIndexPath); - declareIndexRoute(hapiServer, esHostname, esPort, kbnIndexPath); - }); + declareGetSearchRoute(hapiServer, esHostname, esPort, mainIndex); + declarePostSearchRoute(hapiServer, esHostname, esPort, mainIndex); + declarePostPitRoute(hapiServer, esHostname, esPort, mainIndex); + declareIndexRoute(hapiServer, esHostname, esPort, mainIndex); + + // the deleteByNamespace performs an updateByQuery under the hood. + // It targets all SO indices that have namespace-aware types + const nsIndices = getIndicesWithNamespaceAwareTypes(setup.savedObjects.getTypeRegistry()); + declarePostUpdateByQueryRoute(hapiServer, esHostname, esPort, nsIndices); // register index-agnostic routes declarePostBulkRoute(hapiServer, esHostname, esPort); @@ -124,19 +135,6 @@ describe('404s from proxies', () => { await hapiServer.start(); - // Setup kibana configured to use proxy as ES backend - root = createRootWithCorePlugins({ - elasticsearch: { - hosts: [`http://${esHostname}:${proxyPort}`], - }, - migrations: { - skip: false, - }, - }); - await root.preboot(); - const setup = await root.setup(); - registerSOTypes(setup); - start = await root.start(); }); diff --git a/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy_utils.ts b/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy_utils.ts index 6f40d19f609d9..8419d4865c5c7 100644 --- a/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy_utils.ts +++ b/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy_utils.ts @@ -6,7 +6,13 @@ * Side Public License, v 1. */ import Hapi from '@hapi/hapi'; -import { IncomingMessage } from 'http'; +import type { IncomingMessage } from 'http'; +import { LEGACY_URL_ALIAS_TYPE } from '@kbn/core-saved-objects-base-server-internal'; +import { + type ISavedObjectTypeRegistry, + MAIN_SAVED_OBJECT_INDEX, +} from '@kbn/core-saved-objects-server'; +import { kibanaPackageJson as pkg } from '@kbn/repo-info'; // proxy setup const defaultProxyOptions = (hostname: string, port: string) => ({ @@ -304,21 +310,32 @@ export const declarePassthroughRoute = (hapiServer: Hapi.Server, hostname: strin }, }); -export function allCombinationsPermutations(collection: T[]): T[][] { - const recur = (subcollection: T[], size: number): T[][] => { - if (size <= 0) { - return [[]]; - } - const permutations: T[][] = []; - subcollection.forEach((value, index, array) => { - array = array.slice(); - array.splice(index, 1); - recur(array, size - 1).forEach((permutation) => { - permutation.unshift(value); - permutations.push(permutation); - }); - }); - return permutations; - }; - return collection.map((_, n) => recur(collection, n + 1)).flat(); -} +/** + * Obtain the versioned Kibana index, tipically used by the Elasticsearch client + * e.g. .kibana_8.15.0 + * @returns string + */ +export const getVersionedKibanaIndex = (): string => { + return `${MAIN_SAVED_OBJECT_INDEX}_${pkg.version}`; +}; + +/** + * Obtain a comma separated list of all SO indices that contain namespace-aware SO types + * inspired on delete_by_namespace.ts + * + * @param registry The SO type registry to query registered types + * @returns string + */ +export const getIndicesWithNamespaceAwareTypes = (registry: ISavedObjectTypeRegistry): string => { + const allTypes = registry.getAllTypes(); + const unique = (array: string[]) => [...new Set(array)]; + + return unique( + [ + ...allTypes + .filter((type) => !registry.isNamespaceAgnostic(type.name)) + .map(({ name }) => name), + LEGACY_URL_ALIAS_TYPE, + ].map((type) => `${registry.getIndex(type) || MAIN_SAVED_OBJECT_INDEX}_${pkg.version}`) + ).join(','); +}; diff --git a/src/core/server/integration_tests/saved_objects/service/lib/update.test.ts b/src/core/server/integration_tests/saved_objects/service/lib/update.test.ts index f9205086ceb2e..b4c9c912f7331 100644 --- a/src/core/server/integration_tests/saved_objects/service/lib/update.test.ts +++ b/src/core/server/integration_tests/saved_objects/service/lib/update.test.ts @@ -17,7 +17,6 @@ import { getKibanaMigratorTestKit, startElasticsearch, } from '../../migrations/kibana_migrator_test_kit'; -import { delay } from '../../migrations/test_utils'; import { getBaseMigratorParams } from '../../migrations/fixtures/zdt_base.fixtures'; export const logFilePath = Path.join(__dirname, 'update.test.log'); @@ -93,7 +92,6 @@ describe('SOR - update API', () => { afterAll(async () => { await esServer?.stop(); - await delay(10); }); const setup = async () => { diff --git a/src/core/server/integration_tests/saved_objects/validation/validator.test.ts b/src/core/server/integration_tests/saved_objects/validation/validator.test.ts index a0dc22440f1df..4f79a8618df02 100644 --- a/src/core/server/integration_tests/saved_objects/validation/validator.test.ts +++ b/src/core/server/integration_tests/saved_objects/validation/validator.test.ts @@ -164,8 +164,6 @@ describe.skip('validates saved object types when a schema is provided', () => { if (esServer) { await esServer.stop(); } - - await new Promise((resolve) => setTimeout(resolve, 10000)); }); it('does nothing when no schema is provided', async () => { 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 10fcbe6d06d6a..75237f0ea3594 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 @@ -40,6 +40,7 @@ kibana_vars=( csp.report_uri csp.report_to csp.report_only.form_action + permissionsPolicy.report_to data.autocomplete.valueSuggestions.terminateAfter data.autocomplete.valueSuggestions.timeout data.search.asyncSearch.waitForCompletion diff --git a/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile b/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile index ecb93cfd50792..a8daba08d37b4 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile +++ b/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile @@ -12,7 +12,7 @@ FROM {{{baseImageName}}} AS builder {{#ubi}} -RUN microdnf install -y findutils tar gzip +RUN microdnf install -y findutils tar gzip{{#fips}} perl make gcc{{/fips}} {{/ubi}} {{#ubuntu}} RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl @@ -37,6 +37,30 @@ WORKDIR /usr/share/kibana RUN tar \ --strip-components=1 \ -zxf /tmp/kibana.tar.gz + +{{#fips}} +# OpenSSL requires specific versions that are FIPS certified. +# +# See: +# https://github.com/openssl/openssl/blob/openssl-3.0/README-FIPS.md +# https://www.openssl.org/docs/man3.0/man7/fips_module.html +RUN set -e ; \ + OPENSSL_VERSION='3.0.8'; \ + OPENSSL_PATH=/usr/share/kibana/openssl ; \ + mkdir "${OPENSSL_PATH}"; \ + curl --retry 8 -S -L -O "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" ; \ + curl --retry 8 -S -L -O "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz.sha256" ; \ + echo "$(cat openssl-${OPENSSL_VERSION}.tar.gz.sha256) openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -c ; \ + tar -zxf "openssl-${OPENSSL_VERSION}.tar.gz" ; \ + rm -rf openssl-${OPENSSL_VERSION}.tar* ; \ + cd "/usr/share/kibana/openssl-${OPENSSL_VERSION}" ; \ + ./Configure --prefix="${OPENSSL_PATH}" --openssldir="${OPENSSL_PATH}/ssl" --libdir="${OPENSSL_PATH}/lib" enable-fips; \ + make -j $(nproc) > /dev/null ; \ + make install > /dev/null ; \ + rm -rf "/usr/share/kibana/openssl-${OPENSSL_VERSION}" ; \ + chown -R 1000:0 "${OPENSSL_PATH}"; + +{{/fips}} # Ensure that group permissions are the same as user permissions. # This will help when relying on GID-0 to run Kibana, rather than UID-1000. # OpenShift does this, for example. @@ -90,7 +114,7 @@ EXPOSE 5601 RUN for iter in {1..10}; do \ microdnf update --setopt=tsflags=nodocs -y && \ microdnf install --setopt=tsflags=nodocs -y \ - fontconfig freetype shadow-utils nss findutils {{#fips}}perl make gcc tar {{/fips}}&& \ + fontconfig freetype shadow-utils nss findutils && \ microdnf clean all && exit_code=0 && break || exit_code=$? && echo "microdnf error: retry $iter in 10s" && \ sleep 10; \ done; \ @@ -127,30 +151,6 @@ RUN fc-cache -v WORKDIR /usr/share/kibana {{#fips}} -# OpenSSL requires specific versions that are FIPS certified. Further, the FIPS modules -# need to be compiled on the machine to pass its own self validation on startup. -# -# See: -# https://github.com/openssl/openssl/blob/openssl-3.0/README-FIPS.md -# https://www.openssl.org/docs/man3.0/man7/fips_module.html - -# Ideally we would handle this in the builder step, but OpenSSL requires linking of many submodules. -RUN set -e ; \ - OPENSSL_VERSION='3.0.8'; \ - OPENSSL_PATH=/usr/share/kibana/openssl ; \ - mkdir "${OPENSSL_PATH}"; \ - curl --retry 8 -S -L -O "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" ; \ - curl --retry 8 -S -L -O "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz.sha256" ; \ - echo "$(cat openssl-${OPENSSL_VERSION}.tar.gz.sha256) openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -c ; \ - tar -zxf "openssl-${OPENSSL_VERSION}.tar.gz" ; \ - rm -rf openssl-${OPENSSL_VERSION}.tar* ; \ - cd "/usr/share/kibana/openssl-${OPENSSL_VERSION}" ; \ - ./Configure --prefix="${OPENSSL_PATH}" --openssldir="${OPENSSL_PATH}/ssl" --libdir="${OPENSSL_PATH}/lib" enable-fips; \ - make -j $(nproc) > /dev/null ; \ - make install > /dev/null ; \ - rm -rf "/usr/share/kibana/openssl-${OPENSSL_VERSION}" ; \ - chown -R 1000:0 "${OPENSSL_PATH}"; - # Enable FIPS for Kibana only. In the future we can override OS wide with ENV OPENSSL_CONF RUN /usr/bin/echo -e '\n--enable-fips' >> config/node.options RUN /usr/bin/echo '--openssl-config=/usr/share/kibana/config/nodejs.cnf' >> config/node.options diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index fabd250b29137..b4b215797aa24 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -85,7 +85,7 @@ export const PER_PACKAGE_ALLOWED_LICENSES = { export const LICENSE_OVERRIDES = { 'jsts@1.6.2': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts '@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint - '@elastic/ems-client@8.5.1': ['Elastic License 2.0'], + '@elastic/ems-client@8.5.3': ['Elastic License 2.0'], '@elastic/eui@95.2.0': ['SSPL-1.0 OR Elastic License 2.0'], 'language-subtag-registry@0.3.21': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry 'buffers@0.1.1': ['MIT'], // license in importing module https://www.npmjs.com/package/binary diff --git a/src/plugins/bfetch/server/ui_settings.ts b/src/plugins/bfetch/server/ui_settings.ts index 697864bec1c59..0dede79980d93 100644 --- a/src/plugins/bfetch/server/ui_settings.ts +++ b/src/plugins/bfetch/server/ui_settings.ts @@ -23,6 +23,12 @@ export function getUiSettings(): Record> { 'Disables requests batching. This increases number of HTTP requests from Kibana, but allows to debug requests individually.', }), schema: schema.boolean(), + deprecation: { + message: i18n.translate('bfetch.advancedSettings.disableBfetchDeprecation', { + defaultMessage: 'This setting is deprecated and will be removed in Kibana 9.0.', + }), + docLinksKey: 'generalSettings', + }, category: [], requiresPageReload: true, }, @@ -36,6 +42,12 @@ export function getUiSettings(): Record> { 'Disable batch compression. This allows you to debug individual requests, but increases response size.', }), schema: schema.boolean(), + deprecation: { + message: i18n.translate('bfetch.advancedSettings.disableBfetchCompressionDeprecation', { + defaultMessage: 'This setting is deprecated and will be removed in Kibana 9.0.', + }), + docLinksKey: 'generalSettings', + }, category: [], requiresPageReload: true, }, diff --git a/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.test.ts b/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.test.ts index abfa37dd8df6e..88568b1c231cb 100644 --- a/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.test.ts +++ b/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.test.ts @@ -25,6 +25,10 @@ describe('interpreter/functions#metricVis', () => { progressDirection: 'horizontal', maxCols: 1, inspectorTableId: 'random-id', + titlesTextAlign: 'left', + valuesTextAlign: 'right', + iconAlign: 'left', + valueFontSize: 'default', }; it('should pass over overrides from variables', async () => { 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 db1e0cf5cea5f..c40af033ceab9 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 @@ -77,6 +77,30 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({ 'The direction the progress bar should grow. Must be provided to render a progress bar.', }), }, + titlesTextAlign: { + types: ['string'], + help: i18n.translate('expressionMetricVis.function.titlesTextAlign.help', { + defaultMessage: 'The alignment of the Title and Subtitle.', + }), + }, + valuesTextAlign: { + types: ['string'], + help: i18n.translate('expressionMetricVis.function.valuesTextAlign.help', { + defaultMessage: 'The alignment of the Primary and Secondary Metric.', + }), + }, + iconAlign: { + types: ['string'], + help: i18n.translate('expressionMetricVis.function.iconAlign.help', { + defaultMessage: 'The alignment of icon.', + }), + }, + valueFontSize: { + types: ['string', 'number'], + help: i18n.translate('expressionMetricVis.function.valueFontSize.help', { + defaultMessage: 'The value font size.', + }), + }, color: { types: ['string'], help: i18n.translate('expressionMetricVis.function.color.help', { @@ -189,6 +213,10 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({ icon: args.icon, palette: args.palette?.params, progressDirection: args.progressDirection, + titlesTextAlign: args.titlesTextAlign, + valuesTextAlign: args.valuesTextAlign, + iconAlign: args.iconAlign, + valueFontSize: args.valueFontSize, maxCols: args.maxCols, minTiles: args.minTiles, trends: args.trendline?.trends, diff --git a/src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts b/src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts index 28199c684ea15..7e7438aa3d8ad 100644 --- a/src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts +++ b/src/plugins/chart_expressions/expression_metric/common/types/expression_functions.ts @@ -7,7 +7,7 @@ */ import type { PaletteOutput } from '@kbn/coloring'; -import { LayoutDirection, MetricWTrend } from '@elastic/charts'; +import { LayoutDirection, MetricStyle, MetricWTrend } from '@elastic/charts'; import { $Values } from '@kbn/utility-types'; import { Datatable, @@ -38,6 +38,10 @@ export interface MetricArguments { subtitle?: string; secondaryPrefix?: string; progressDirection?: LayoutDirection; + titlesTextAlign: MetricStyle['titlesTextAlign']; + valuesTextAlign: MetricStyle['valuesTextAlign']; + iconAlign: MetricStyle['iconAlign']; + valueFontSize: MetricStyle['valueFontSize']; color?: string; icon?: string; palette?: PaletteOutput; diff --git a/src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts b/src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts index b9a43af0752b2..083f464670d89 100644 --- a/src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts +++ b/src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts @@ -8,7 +8,7 @@ import { ExpressionValueVisDimension } from '@kbn/visualizations-plugin/common'; import { CustomPaletteState } from '@kbn/charts-plugin/common'; -import { LayoutDirection } from '@elastic/charts'; +import { LayoutDirection, MetricStyle } from '@elastic/charts'; import { TrendlineResult } from './expression_functions'; export const visType = 'metric'; @@ -27,6 +27,10 @@ export interface MetricVisParam { icon?: string; palette?: CustomPaletteState; progressDirection?: LayoutDirection; + titlesTextAlign: MetricStyle['titlesTextAlign']; + valuesTextAlign: MetricStyle['valuesTextAlign']; + iconAlign: MetricStyle['iconAlign']; + valueFontSize: MetricStyle['valueFontSize']; maxCols: number; minTiles?: number; trends?: TrendlineResult['trends']; 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 ed57f38ec886f..3687113d9aee0 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 @@ -23,7 +23,7 @@ import { SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; import { SerializableRecord } from '@kbn/utility-types'; import type { IUiSettingsClient } from '@kbn/core/public'; import { CustomPaletteState } from '@kbn/charts-plugin/common/expressions/palette/types'; -import { DimensionsVisParam } from '../../common'; +import { DimensionsVisParam, MetricVisParam } from '../../common'; import { euiThemeVars } from '@kbn/ui-theme'; import { DEFAULT_TRENDLINE_NAME } from '../../common/constants'; import faker from 'faker'; @@ -73,6 +73,15 @@ const dayOfWeekColumnId = 'col-0-0'; const basePriceColumnId = 'col-1-1'; const minPriceColumnId = 'col-2-2'; +const defaultMetricParams: MetricVisParam = { + progressDirection: 'vertical', + maxCols: 5, + titlesTextAlign: 'left', + valuesTextAlign: 'right', + iconAlign: 'left', + valueFontSize: 'default', +}; + const table: Datatable = { type: 'datatable', columns: [ @@ -217,8 +226,7 @@ describe('MetricVisComponent', function () { describe('single metric', () => { const config: Props['config'] = { metric: { - progressDirection: 'vertical', - maxCols: 5, + ...defaultMetricParams, icon: 'empty', }, dimensions: { @@ -397,13 +405,67 @@ describe('MetricVisComponent', function () { expect(tileConfig.trend).toEqual(trends[DEFAULT_TRENDLINE_NAME]); expect(tileConfig.trendShape).toEqual('area'); }); + + it('should display multi-values non-numeric values formatted and without quotes', () => { + const newTable: Datatable = { + ...table, + // change the format id for the columns + columns: table.columns.map((column) => + [basePriceColumnId, minPriceColumnId].includes(column.id) + ? { + ...column, + meta: { ...column.meta, params: { id: 'text' } }, + } + : column + ), + rows: table.rows.map((row) => ({ + ...row, + [basePriceColumnId]: [String(row[basePriceColumnId]), String(100)], + [minPriceColumnId]: [String(row[minPriceColumnId]), String(10)], + })), + }; + const component = shallow(); + + const [[visConfig]] = component.find(Metric).props().data!; + + expect(visConfig!.value).toMatchInlineSnapshot( + ` + Array [ + "text-28.984375", + "text-100", + ] + ` + ); + }); + + it('should display multi-values numeric values formatted and without quotes', () => { + const newTable = { + ...table, + rows: table.rows.map((row) => ({ + ...row, + [basePriceColumnId]: [row[basePriceColumnId], 100], + [minPriceColumnId]: [row[minPriceColumnId], 10], + })), + }; + const component = shallow(); + + const [[visConfig]] = component.find(Metric).props().data!; + + expect(visConfig!.value).toMatchInlineSnapshot( + ` + Array [ + "number-28.984375", + "number-100", + ] + ` + ); + }); }); describe('metric grid', () => { const config: Props['config'] = { metric: { - progressDirection: 'vertical', - maxCols: 5, + ...defaultMetricParams, }, dimensions: { metric: basePriceColumnId, @@ -856,8 +918,7 @@ describe('MetricVisComponent', function () { data={table} config={{ metric: { - progressDirection: 'vertical', - maxCols: 5, + ...defaultMetricParams, }, dimensions: { metric: basePriceColumnId, @@ -911,8 +972,7 @@ describe('MetricVisComponent', function () { { const config: Props['config'] = { metric: { - progressDirection: 'vertical', - maxCols: 5, + ...defaultMetricParams, }, dimensions: { metric: '1', @@ -1416,8 +1468,7 @@ describe('MetricVisComponent', function () { = { title: String(title), subtitle, icon: config.metric?.icon ? getIcon(config.metric?.icon) : undefined, extra: renderSecondaryMetric(data.columns, row, config), color: config.metric.color ?? defaultColor, }; - return nonNumericMetric; + return Array.isArray(value) + ? { ...nonNumericMetricBase, value: value.map((v) => formatPrimaryMetric(v)) } + : { ...nonNumericMetricBase, value: formatPrimaryMetric(value) }; } const baseMetric: MetricWNumber = { @@ -335,6 +336,10 @@ export const MetricVis = ({ barBackground: euiThemeVars.euiColorLightShade, emptyBackground: euiThemeVars.euiColorEmptyShade, blendingBackground: euiThemeVars.euiColorEmptyShade, + titlesTextAlign: config.metric.titlesTextAlign, + valuesTextAlign: config.metric.valuesTextAlign, + iconAlign: config.metric.iconAlign, + valueFontSize: config.metric.valueFontSize, }, }, ...(Array.isArray(settingsThemeOverrides) diff --git a/src/plugins/console/server/routes/api/console/autocomplete_entities/index.ts b/src/plugins/console/server/routes/api/console/autocomplete_entities/index.ts index 2d19de0a56e74..677e4b93797c6 100644 --- a/src/plugins/console/server/routes/api/console/autocomplete_entities/index.ts +++ b/src/plugins/console/server/routes/api/console/autocomplete_entities/index.ts @@ -16,7 +16,7 @@ const MAX_RESPONSE_SIZE = 10 * 1024 * 1024; // 10MB const getMappings = async (settings: SettingsToRetrieve, esClient: IScopedClusterClient) => { if (settings.fields && settings.fieldsIndices) { - const mappings = await esClient.asInternalUser.indices.getMapping( + const mappings = await esClient.asCurrentUser.indices.getMapping( { index: settings.fieldsIndices, }, @@ -33,7 +33,7 @@ const getMappings = async (settings: SettingsToRetrieve, esClient: IScopedCluste const getAliases = async (settings: SettingsToRetrieve, esClient: IScopedClusterClient) => { if (settings.indices) { - const aliases = await esClient.asInternalUser.indices.getAlias(); + const aliases = await esClient.asCurrentUser.indices.getAlias(); return aliases; } // If the user doesn't want autocomplete suggestions, then clear any that exist. @@ -42,7 +42,7 @@ const getAliases = async (settings: SettingsToRetrieve, esClient: IScopedCluster const getDataStreams = async (settings: SettingsToRetrieve, esClient: IScopedClusterClient) => { if (settings.dataStreams) { - const dataStreams = await esClient.asInternalUser.indices.getDataStream(); + const dataStreams = await esClient.asCurrentUser.indices.getDataStream(); return dataStreams; } // If the user doesn't want autocomplete suggestions, then clear any that exist. @@ -51,7 +51,7 @@ const getDataStreams = async (settings: SettingsToRetrieve, esClient: IScopedClu const getLegacyTemplates = async (settings: SettingsToRetrieve, esClient: IScopedClusterClient) => { if (settings.templates) { - const legacyTemplates = await esClient.asInternalUser.indices.getTemplate(); + const legacyTemplates = await esClient.asCurrentUser.indices.getTemplate(); return legacyTemplates; } // If the user doesn't want autocomplete suggestions, then clear any that exist. @@ -60,7 +60,7 @@ const getLegacyTemplates = async (settings: SettingsToRetrieve, esClient: IScope const getIndexTemplates = async (settings: SettingsToRetrieve, esClient: IScopedClusterClient) => { if (settings.templates) { - const indexTemplates = await esClient.asInternalUser.indices.getIndexTemplate(); + const indexTemplates = await esClient.asCurrentUser.indices.getIndexTemplate(); return indexTemplates; } // If the user doesn't want autocomplete suggestions, then clear any that exist. @@ -72,7 +72,7 @@ const getComponentTemplates = async ( esClient: IScopedClusterClient ) => { if (settings.templates) { - const componentTemplates = await esClient.asInternalUser.cluster.getComponentTemplate(); + const componentTemplates = await esClient.asCurrentUser.cluster.getComponentTemplate(); return componentTemplates; } // If the user doesn't want autocomplete suggestions, then clear any that exist. diff --git a/src/plugins/dashboard/kibana.jsonc b/src/plugins/dashboard/kibana.jsonc index 1c7689e09cf9f..2bf60cde55ef0 100644 --- a/src/plugins/dashboard/kibana.jsonc +++ b/src/plugins/dashboard/kibana.jsonc @@ -34,7 +34,8 @@ "usageCollection", "taskManager", "serverless", - "noDataPage" + "noDataPage", + "observabilityAIAssistant" ], "requiredBundles": [ "kibanaReact", diff --git a/src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx b/src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx index 320887bbf551c..2fa3ad16f7823 100644 --- a/src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx +++ b/src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx @@ -42,6 +42,7 @@ import { loadDashboardHistoryLocationState } from './locator/load_dashboard_hist import type { DashboardCreationOptions } from '../dashboard_container/embeddable/dashboard_container_factory'; import { DashboardTopNav } from '../dashboard_top_nav'; import { DashboardTabTitleSetter } from './tab_title_setter/dashboard_tab_title_setter'; +import { useObservabilityAIAssistantContext } from './hooks/use_observability_ai_assistant_context'; export interface DashboardAppProps { history: History; @@ -82,13 +83,21 @@ export function DashboardApp({ embeddable: { getStateTransfer }, notifications: { toasts }, settings: { uiSettings }, - data: { search }, + data: { search, dataViews }, customBranding, share: { url }, + observabilityAIAssistant, } = pluginServices.getServices(); const showPlainSpinner = useObservable(customBranding.hasCustomBranding$, false); const { scopedHistory: getScopedHistory } = useDashboardMountContext(); + useObservabilityAIAssistantContext({ + observabilityAIAssistant: observabilityAIAssistant.start, + dashboardAPI, + search, + dataViews, + }); + useExecutionContext(executionContext, { type: 'application', page: 'app', diff --git a/src/plugins/dashboard/public/dashboard_app/hooks/use_observability_ai_assistant_context.tsx b/src/plugins/dashboard/public/dashboard_app/hooks/use_observability_ai_assistant_context.tsx new file mode 100644 index 0000000000000..04340b040c5ca --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_app/hooks/use_observability_ai_assistant_context.tsx @@ -0,0 +1,386 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { ObservabilityAIAssistantPublicStart } from '@kbn/observability-ai-assistant-plugin/public'; +import { useEffect } from 'react'; +import type { Embeddable } from '@kbn/embeddable-plugin/public'; +import { getESQLQueryColumns } from '@kbn/esql-utils'; +import type { ISearchStart } from '@kbn/data-plugin/public'; +import { + LensConfigBuilder, + type LensConfig, + type LensMetricConfig, + type LensPieConfig, + type LensGaugeConfig, + type LensXYConfig, + type LensHeatmapConfig, + type LensMosaicConfig, + type LensRegionMapConfig, + type LensTableConfig, + type LensTagCloudConfig, + type LensTreeMapConfig, + LensDataset, +} from '@kbn/lens-embeddable-utils/config_builder'; +import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; +import { LensEmbeddableInput } from '@kbn/lens-plugin/public'; +import type { AwaitingDashboardAPI } from '../../dashboard_container'; + +const chartTypes = [ + 'xy', + 'pie', + 'heatmap', + 'metric', + 'gauge', + 'donut', + 'mosaic', + 'regionmap', + 'table', + 'tagcloud', + 'treemap', +] as const; + +export function useObservabilityAIAssistantContext({ + observabilityAIAssistant, + dashboardAPI, + search, + dataViews, +}: { + observabilityAIAssistant: ObservabilityAIAssistantPublicStart | undefined; + dashboardAPI: AwaitingDashboardAPI; + search: ISearchStart; + dataViews: DataViewsPublicPluginStart; +}) { + useEffect(() => { + if (!observabilityAIAssistant) { + return; + } + + const { + service: { setScreenContext }, + createScreenContextAction, + } = observabilityAIAssistant; + + return setScreenContext({ + screenDescription: + 'The user is looking at the dashboard app. Here they can add visualizations to a dashboard and save them', + actions: dashboardAPI + ? [ + createScreenContextAction( + { + name: 'add_to_dashboard', + description: + 'Add an ES|QL visualization to the current dashboard. Pick a single chart type, and based on the chart type, the corresponding key for `layers`. E.g., when you select type:metric, fill in only layers.metric.', + parameters: { + type: 'object', + properties: { + esql: { + type: 'object', + properties: { + query: { + type: 'string', + description: + 'The ES|QL query for this visualization. Use the "query" function to generate ES|QL first and then add it here.', + }, + }, + required: ['query'], + }, + type: { + type: 'string', + description: 'The type of chart', + enum: chartTypes, + }, + layers: { + type: 'object', + properties: { + xy: { + type: 'object', + properties: { + xAxis: { + type: 'string', + }, + yAxis: { + type: 'string', + }, + type: { + type: 'string', + enum: ['line', 'bar', 'area'], + }, + }, + }, + donut: { + type: 'object', + properties: { + breakdown: { + type: 'string', + }, + }, + }, + metric: { + type: 'object', + }, + gauge: { + type: 'object', + }, + pie: { + type: 'object', + properties: { + breakdown: { + type: 'string', + }, + }, + }, + heatmap: { + type: 'object', + properties: { + xAxis: { + type: 'string', + }, + breakdown: { + type: 'string', + }, + }, + required: ['xAxis'], + }, + mosaic: { + type: 'object', + properties: { + breakdown: { + type: 'string', + }, + }, + required: ['breakdown'], + }, + regionmap: { + type: 'object', + properties: { + breakdown: { + type: 'string', + }, + }, + required: ['breakdown'], + }, + table: { + type: 'object', + }, + tagcloud: { + type: 'object', + properties: { + breakdown: { + type: 'string', + }, + }, + required: ['breakdown'], + }, + treemap: { + type: 'object', + properties: { + breakdown: { + type: 'string', + }, + }, + }, + }, + }, + title: { + type: 'string', + description: 'An optional title for the visualization.', + }, + }, + required: ['esql', 'type'], + } as const, + }, + async ({ args, signal }) => { + const { + title = '', + type: chartType = 'xy', + layers, + esql: { query }, + } = args; + + const [columns] = await Promise.all([ + getESQLQueryColumns({ + esqlQuery: query, + search: search.search, + signal, + }), + ]); + + const configBuilder = new LensConfigBuilder(dataViews); + + let config: LensConfig; + + const firstMetricColumn = columns.find( + (column) => column.meta.type === 'number' + )?.id; + + const dataset: LensDataset = { + esql: query, + }; + + switch (chartType) { + default: + case 'xy': + const xyConfig: LensXYConfig = { + chartType: 'xy', + layers: [ + { + seriesType: layers?.xy?.type || 'line', + type: 'series', + xAxis: layers?.xy?.xAxis || '@timestamp', + yAxis: [ + { + value: layers?.xy?.yAxis || firstMetricColumn!, + }, + ], + }, + ], + dataset, + title, + }; + config = xyConfig; + break; + + case 'donut': + const donutConfig: LensPieConfig = { + chartType, + title, + value: firstMetricColumn!, + breakdown: [layers?.donut?.breakdown!], + dataset, + }; + config = donutConfig; + break; + + case 'pie': + const pieConfig: LensPieConfig = { + chartType, + title, + value: firstMetricColumn!, + breakdown: [layers?.pie?.breakdown!], + dataset, + }; + config = pieConfig; + break; + + case 'metric': + const metricConfig: LensMetricConfig = { + chartType, + title, + value: firstMetricColumn!, + dataset, + }; + config = metricConfig; + break; + + case 'gauge': + const gaugeConfig: LensGaugeConfig = { + chartType, + title, + value: firstMetricColumn!, + dataset, + }; + config = gaugeConfig; + + break; + + case 'heatmap': + const heatmapConfig: LensHeatmapConfig = { + chartType, + title, + value: firstMetricColumn!, + breakdown: layers?.heatmap?.breakdown, + xAxis: layers?.heatmap?.xAxis || '@timestamp', + dataset, + }; + config = heatmapConfig; + break; + + case 'mosaic': + const mosaicConfig: LensMosaicConfig = { + chartType, + title, + value: firstMetricColumn!, + breakdown: [layers?.mosaic?.breakdown || '@timestamp'], + dataset, + }; + config = mosaicConfig; + break; + + case 'regionmap': + const regionMapConfig: LensRegionMapConfig = { + chartType, + title, + value: firstMetricColumn!, + breakdown: layers?.regionmap?.breakdown!, + dataset, + }; + config = regionMapConfig; + break; + + case 'table': + const tableConfig: LensTableConfig = { + chartType, + title, + value: firstMetricColumn!, + dataset, + }; + config = tableConfig; + break; + + case 'tagcloud': + const tagCloudConfig: LensTagCloudConfig = { + chartType, + title, + value: firstMetricColumn!, + breakdown: layers?.tagcloud?.breakdown!, + dataset, + }; + config = tagCloudConfig; + break; + + case 'treemap': + const treeMapConfig: LensTreeMapConfig = { + chartType, + title, + value: firstMetricColumn!, + breakdown: [layers?.treemap?.breakdown || '@timestamp'], + dataset, + }; + config = treeMapConfig; + break; + } + + const embeddableInput = (await configBuilder.build(config, { + embeddable: true, + query: dataset, + })) as LensEmbeddableInput; + + return dashboardAPI + .addNewPanel({ + panelType: 'lens', + initialState: embeddableInput, + }) + .then(() => { + return { + content: 'Visualization successfully added to dashboard', + }; + }) + .catch((error) => { + return { + content: { + error, + }, + }; + }); + } + ), + ] + : [], + }); + }, [observabilityAIAssistant, dashboardAPI, search, dataViews]); +} diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.test.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.test.ts index e3a321f2355df..b9d2ff286023d 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.test.ts +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.test.ts @@ -497,12 +497,11 @@ test('creates new embeddable with specified size if size is provided', async () expect(dashboard!.getState().explicitInput.panels.new_panel.gridData.h).toBe(1); }); -test('creates a control group from the control group factory and waits for it to be initialized', async () => { +test('creates a control group from the control group factory', async () => { const mockControlGroupContainer = { destroy: jest.fn(), render: jest.fn(), updateInput: jest.fn(), - untilInitialized: jest.fn(), getInput: jest.fn().mockReturnValue({}), getInput$: jest.fn().mockReturnValue(new Observable()), getOutput: jest.fn().mockReturnValue({}), @@ -532,7 +531,6 @@ test('creates a control group from the control group factory and waits for it to undefined, { lastSavedInput: expect.objectContaining({ controlStyle: 'oneLine' }) } ); - expect(mockControlGroupContainer.untilInitialized).toHaveBeenCalled(); }); /* diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.ts index 32b21f0cf1c1e..26435c31a0d2c 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.ts +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.ts @@ -502,7 +502,6 @@ export const initializeDashboard = async ({ dashboardContainer.controlGroup = controlGroup; startSyncingDashboardControlGroup.bind(dashboardContainer)(); }); - await controlGroup.untilInitialized(); } // -------------------------------------------------------------------------------------- diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx b/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx index 45f3b2535ff6d..06e1039497f8b 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx @@ -498,11 +498,19 @@ export class DashboardContainer if (reactEmbeddableRegistryHasKey(panelPackage.panelType)) { const newId = v4(); + const getCustomPlacementSettingFunc = await getDashboardPanelPlacementSetting( + panelPackage.panelType + ); + + const customPlacementSettings = getCustomPlacementSettingFunc + ? await getCustomPlacementSettingFunc(panelPackage.initialState) + : {}; + const placementSettings = { width: DEFAULT_PANEL_WIDTH, height: DEFAULT_PANEL_HEIGHT, strategy: PanelPlacementStrategy.findTopLeftMostOpenSpace, - ...getDashboardPanelPlacementSetting(panelPackage.panelType)?.(panelPackage.initialState), + ...customPlacementSettings, }; const { width, height, strategy } = placementSettings; diff --git a/src/plugins/dashboard/public/dashboard_container/panel_placement/panel_placement_registry.ts b/src/plugins/dashboard/public/dashboard_container/panel_placement/panel_placement_registry.ts index 98fab7c662506..7e3036593f1d1 100644 --- a/src/plugins/dashboard/public/dashboard_container/panel_placement/panel_placement_registry.ts +++ b/src/plugins/dashboard/public/dashboard_container/panel_placement/panel_placement_registry.ts @@ -11,14 +11,14 @@ import { panelPlacementStrings } from '../_dashboard_container_strings'; const registry = new Map>(); -export const registerDashboardPanelPlacementSetting = ( +export const registerDashboardPanelPlacementSetting = ( embeddableType: string, - getPanelPlacementSettings: GetPanelPlacementSettings + getPanelPlacementSettings: GetPanelPlacementSettings ) => { if (registry.has(embeddableType)) { throw new Error(panelPlacementStrings.getPanelPlacementSettingsExistsError(embeddableType)); } - registry.set(embeddableType, getPanelPlacementSettings); + registry.set(embeddableType, getPanelPlacementSettings as GetPanelPlacementSettings); }; export const getDashboardPanelPlacementSetting = (embeddableType: string) => { diff --git a/src/plugins/dashboard/public/dashboard_container/panel_placement/types.ts b/src/plugins/dashboard/public/dashboard_container/panel_placement/types.ts index 54b490e004fac..0c70ba6c553a4 100644 --- a/src/plugins/dashboard/public/dashboard_container/panel_placement/types.ts +++ b/src/plugins/dashboard/public/dashboard_container/panel_placement/types.ts @@ -7,6 +7,7 @@ */ import { EmbeddableInput } from '@kbn/embeddable-plugin/public'; +import { MaybePromise } from '@kbn/utility-types'; import { DashboardPanelState } from '../../../common'; import { GridData } from '../../../common/content_management'; import { PanelPlacementStrategy } from '../../dashboard_constants'; @@ -40,4 +41,4 @@ export interface IProvidesLegacyPanelPlacementSettings< export type GetPanelPlacementSettings = ( serializedState?: SerializedState -) => PanelPlacementSettings; +) => MaybePromise; diff --git a/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.test.tsx b/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.test.tsx index b2493454d4da2..da9783676cba3 100644 --- a/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.test.tsx +++ b/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.test.tsx @@ -157,6 +157,7 @@ describe('useDashboardListingTable', () => { showActivityView: true, }, createdByEnabled: true, + recentlyAccessed: expect.objectContaining({ get: expect.any(Function) }), }; expect(tableListViewTableProps).toEqual(expectedProps); diff --git a/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.tsx b/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.tsx index 659e5e43930ea..097fc5ea6d866 100644 --- a/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.tsx +++ b/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.tsx @@ -100,6 +100,7 @@ export const useDashboardListingTable = ({ checkForDuplicateDashboardTitle, }, notifications: { toasts }, + dashboardRecentlyAccessed, } = pluginServices.getServices(); const { getEntityName, getTableListTitle, getEntityNamePlural } = dashboardListingTableStrings; @@ -302,6 +303,7 @@ export const useDashboardListingTable = ({ title, urlStateEnabled, createdByEnabled: true, + recentlyAccessed: dashboardRecentlyAccessed, }), [ contentEditorValidators, @@ -324,6 +326,7 @@ export const useDashboardListingTable = ({ title, updateItemMeta, urlStateEnabled, + dashboardRecentlyAccessed, ] ); diff --git a/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx b/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx index d3e0ac3459049..6cef6ab1871f4 100644 --- a/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx +++ b/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx @@ -83,6 +83,7 @@ export function InternalDashboardTopNav({ embeddable: { getStateTransfer }, initializerContext: { allowByValueEmbeddables }, dashboardCapabilities: { saveQuery: allowSaveQuery, showWriteControls }, + dashboardRecentlyAccessed, } = pluginServices.getServices(); const isLabsEnabled = uiSettings.get(UI_SETTINGS.ENABLE_LABS_UI); const { setHeaderActionMenu, onAppLeave } = useDashboardMountContext(); @@ -143,6 +144,11 @@ export function InternalDashboardTopNav({ title, lastSavedId ); + dashboardRecentlyAccessed.add( + getFullEditPath(lastSavedId, viewMode === ViewMode.EDIT), + title, + lastSavedId + ); } return () => subscription.unsubscribe(); }, [ @@ -152,6 +158,7 @@ export function InternalDashboardTopNav({ lastSavedId, viewMode, title, + dashboardRecentlyAccessed, ]); /** diff --git a/src/plugins/dashboard/public/plugin.tsx b/src/plugins/dashboard/public/plugin.tsx index c2838187d5eca..a3e5d24b9b7f2 100644 --- a/src/plugins/dashboard/public/plugin.tsx +++ b/src/plugins/dashboard/public/plugin.tsx @@ -52,6 +52,10 @@ import type { UrlForwardingSetup, UrlForwardingStart } from '@kbn/url-forwarding import type { SavedObjectTaggingOssPluginStart } from '@kbn/saved-objects-tagging-oss-plugin/public'; import type { ServerlessPluginStart } from '@kbn/serverless/public'; import type { NoDataPagePluginStart } from '@kbn/no-data-page-plugin/public'; +import type { + ObservabilityAIAssistantPublicSetup, + ObservabilityAIAssistantPublicStart, +} from '@kbn/observability-ai-assistant-plugin/public'; import { CustomBrandingStart } from '@kbn/core-custom-branding-browser'; import { SavedObjectsManagementPluginStart } from '@kbn/saved-objects-management-plugin/public'; @@ -87,6 +91,7 @@ export interface DashboardSetupDependencies { uiActions: UiActionsSetup; urlForwarding: UrlForwardingSetup; unifiedSearch: UnifiedSearchPublicPluginStart; + observabilityAIAssistant?: ObservabilityAIAssistantPublicSetup; } export interface DashboardStartDependencies { @@ -110,6 +115,7 @@ export interface DashboardStartDependencies { customBranding: CustomBrandingStart; serverless?: ServerlessPluginStart; noDataPage?: NoDataPagePluginStart; + observabilityAIAssistant?: ObservabilityAIAssistantPublicStart; } export interface DashboardSetup { @@ -120,9 +126,9 @@ export interface DashboardStart { locator?: DashboardAppLocator; dashboardFeatureFlagConfig: DashboardFeatureFlagConfig; findDashboardsService: () => Promise; - registerDashboardPanelPlacementSetting: ( + registerDashboardPanelPlacementSetting: ( embeddableType: string, - getPanelPlacementSettings: GetPanelPlacementSettings + getPanelPlacementSettings: GetPanelPlacementSettings ) => void; } diff --git a/src/plugins/dashboard/public/services/dashboard_recently_accessed/dashboard_recently_accessed.stub.ts b/src/plugins/dashboard/public/services/dashboard_recently_accessed/dashboard_recently_accessed.stub.ts new file mode 100644 index 0000000000000..32f17f01d0e06 --- /dev/null +++ b/src/plugins/dashboard/public/services/dashboard_recently_accessed/dashboard_recently_accessed.stub.ts @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginServiceFactory } from '@kbn/presentation-util-plugin/public'; +import { DashboardRecentlyAccessedService } from './types'; + +type DashboardRecentlyAccessedServiceFactory = + PluginServiceFactory; + +export const dashboardRecentlyAccessedServiceFactory: DashboardRecentlyAccessedServiceFactory = + () => { + return { + add: jest.fn(), + get: jest.fn(), + get$: jest.fn(), + }; + }; diff --git a/src/plugins/dashboard/public/services/dashboard_recently_accessed/dashboard_recently_accessed.ts b/src/plugins/dashboard/public/services/dashboard_recently_accessed/dashboard_recently_accessed.ts new file mode 100644 index 0000000000000..8a80544aacad4 --- /dev/null +++ b/src/plugins/dashboard/public/services/dashboard_recently_accessed/dashboard_recently_accessed.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { RecentlyAccessedService } from '@kbn/recently-accessed'; +import type { KibanaPluginServiceFactory } from '@kbn/presentation-util-plugin/public'; + +import { DashboardHTTPService } from '../http/types'; +import { DashboardStartDependencies } from '../../plugin'; +import { DashboardRecentlyAccessedService } from './types'; + +interface DashboardRecentlyAccessedRequiredServices { + http: DashboardHTTPService; +} + +export type DashboardBackupServiceFactory = KibanaPluginServiceFactory< + DashboardRecentlyAccessedService, + DashboardStartDependencies, + DashboardRecentlyAccessedRequiredServices +>; + +export const dashboardRecentlyAccessedFactory: DashboardBackupServiceFactory = ( + core, + requiredServices +) => { + const { http } = requiredServices; + return new RecentlyAccessedService().start({ http, key: 'dashboardRecentlyAccessed' }); +}; diff --git a/src/plugins/dashboard/public/services/dashboard_recently_accessed/types.ts b/src/plugins/dashboard/public/services/dashboard_recently_accessed/types.ts new file mode 100644 index 0000000000000..0b27bfe89aa63 --- /dev/null +++ b/src/plugins/dashboard/public/services/dashboard_recently_accessed/types.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { RecentlyAccessed } from '@kbn/recently-accessed'; + +export type DashboardRecentlyAccessedService = RecentlyAccessed; diff --git a/src/plugins/dashboard/public/services/observability_ai_assistant/observability_ai_assistant_service.stub.ts b/src/plugins/dashboard/public/services/observability_ai_assistant/observability_ai_assistant_service.stub.ts new file mode 100644 index 0000000000000..089ac9c6afc6b --- /dev/null +++ b/src/plugins/dashboard/public/services/observability_ai_assistant/observability_ai_assistant_service.stub.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { PluginServiceFactory } from '@kbn/presentation-util-plugin/public'; +import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock'; +import { ObservabilityAIAssistantService } from './types'; + +type ObservabilityAIAssistantServiceFactory = PluginServiceFactory; + +export const observabilityAIAssistantServiceStubFactory: ObservabilityAIAssistantServiceFactory = + () => { + const pluginMock = observabilityAIAssistantPluginMock.createStartContract(); + return { + start: pluginMock, + }; + }; diff --git a/src/plugins/dashboard/public/services/observability_ai_assistant/observability_ai_assistant_service.ts b/src/plugins/dashboard/public/services/observability_ai_assistant/observability_ai_assistant_service.ts new file mode 100644 index 0000000000000..81d1a23854638 --- /dev/null +++ b/src/plugins/dashboard/public/services/observability_ai_assistant/observability_ai_assistant_service.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { KibanaPluginServiceFactory } from '@kbn/presentation-util-plugin/public'; +import type { DashboardStartDependencies } from '../../plugin'; +import type { ObservabilityAIAssistantService } from './types'; + +export type ObservabilityAIAssistantServiceFactory = KibanaPluginServiceFactory< + ObservabilityAIAssistantService, + DashboardStartDependencies +>; +export const observabilityAIAssistantServiceFactory: ObservabilityAIAssistantServiceFactory = ({ + startPlugins, +}) => { + return startPlugins.observabilityAIAssistant + ? { start: startPlugins.observabilityAIAssistant } + : {}; +}; diff --git a/src/plugins/dashboard/public/services/observability_ai_assistant/types.ts b/src/plugins/dashboard/public/services/observability_ai_assistant/types.ts new file mode 100644 index 0000000000000..342f461024066 --- /dev/null +++ b/src/plugins/dashboard/public/services/observability_ai_assistant/types.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { ObservabilityAIAssistantPublicStart } from '@kbn/observability-ai-assistant-plugin/public'; + +export interface ObservabilityAIAssistantService { + start?: ObservabilityAIAssistantPublicStart; +} diff --git a/src/plugins/dashboard/public/services/plugin_services.stub.ts b/src/plugins/dashboard/public/services/plugin_services.stub.ts index e6898ebe6e921..59c78ac9685b4 100644 --- a/src/plugins/dashboard/public/services/plugin_services.stub.ts +++ b/src/plugins/dashboard/public/services/plugin_services.stub.ts @@ -44,8 +44,10 @@ import { savedObjectsManagementServiceFactory } from './saved_objects_management import { contentManagementServiceFactory } from './content_management/content_management_service.stub'; import { serverlessServiceFactory } from './serverless/serverless_service.stub'; import { userProfileServiceFactory } from './user_profile/user_profile_service.stub'; +import { observabilityAIAssistantServiceStubFactory } from './observability_ai_assistant/observability_ai_assistant_service.stub'; import { noDataPageServiceFactory } from './no_data_page/no_data_page_service.stub'; import { uiActionsServiceFactory } from './ui_actions/ui_actions_service.stub'; +import { dashboardRecentlyAccessedServiceFactory } from './dashboard_recently_accessed/dashboard_recently_accessed.stub'; export const providers: PluginServiceProviders = { dashboardContentManagement: new PluginServiceProvider(dashboardContentManagementServiceFactory), @@ -80,6 +82,8 @@ export const providers: PluginServiceProviders = { noDataPage: new PluginServiceProvider(noDataPageServiceFactory), uiActions: new PluginServiceProvider(uiActionsServiceFactory), userProfile: new PluginServiceProvider(userProfileServiceFactory), + observabilityAIAssistant: new PluginServiceProvider(observabilityAIAssistantServiceStubFactory), + dashboardRecentlyAccessed: new PluginServiceProvider(dashboardRecentlyAccessedServiceFactory), }; export const registry = new PluginServiceRegistry(providers); diff --git a/src/plugins/dashboard/public/services/plugin_services.ts b/src/plugins/dashboard/public/services/plugin_services.ts index ef9a195cfd7cf..b46c261fa6507 100644 --- a/src/plugins/dashboard/public/services/plugin_services.ts +++ b/src/plugins/dashboard/public/services/plugin_services.ts @@ -46,7 +46,9 @@ import { contentManagementServiceFactory } from './content_management/content_ma import { serverlessServiceFactory } from './serverless/serverless_service'; import { noDataPageServiceFactory } from './no_data_page/no_data_page_service'; import { uiActionsServiceFactory } from './ui_actions/ui_actions_service'; +import { observabilityAIAssistantServiceFactory } from './observability_ai_assistant/observability_ai_assistant_service'; import { userProfileServiceFactory } from './user_profile/user_profile_service'; +import { dashboardRecentlyAccessedFactory } from './dashboard_recently_accessed/dashboard_recently_accessed'; const providers: PluginServiceProviders = { dashboardContentManagement: new PluginServiceProvider(dashboardContentManagementServiceFactory, [ @@ -93,7 +95,9 @@ const providers: PluginServiceProviders(); diff --git a/src/plugins/dashboard/public/services/types.ts b/src/plugins/dashboard/public/services/types.ts index 8a44eef93a26a..bb0a8d8d6914d 100644 --- a/src/plugins/dashboard/public/services/types.ts +++ b/src/plugins/dashboard/public/services/types.ts @@ -41,7 +41,9 @@ import { DashboardVisualizationsService } from './visualizations/types'; import { DashboardServerlessService } from './serverless/types'; import { NoDataPageService } from './no_data_page/types'; import { DashboardUiActionsService } from './ui_actions/types'; +import { ObservabilityAIAssistantService } from './observability_ai_assistant/types'; import { DashboardUserProfileService } from './user_profile/types'; +import { DashboardRecentlyAccessedService } from './dashboard_recently_accessed/types'; export type DashboardPluginServiceParams = KibanaPluginServiceParams & { initContext: PluginInitializerContext; // need a custom type so that initContext is a required parameter for initializerContext @@ -79,5 +81,7 @@ export interface DashboardServices { serverless: DashboardServerlessService; // TODO: make this optional in follow up noDataPage: NoDataPageService; uiActions: DashboardUiActionsService; + observabilityAIAssistant: ObservabilityAIAssistantService; // TODO: make this optional in follow up userProfile: DashboardUserProfileService; + dashboardRecentlyAccessed: DashboardRecentlyAccessedService; } diff --git a/src/plugins/dashboard/tsconfig.json b/src/plugins/dashboard/tsconfig.json index f906809c7888e..a29aa10853035 100644 --- a/src/plugins/dashboard/tsconfig.json +++ b/src/plugins/dashboard/tsconfig.json @@ -79,6 +79,11 @@ "@kbn/core-user-profile-browser-mocks", "@kbn/react-kibana-context-render", "@kbn/core-i18n-browser-mocks", + "@kbn/observability-ai-assistant-plugin", + "@kbn/esql-utils", + "@kbn/lens-embeddable-utils", + "@kbn/lens-plugin", + "@kbn/recently-accessed", ], "exclude": ["target/**/*"] } diff --git a/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts b/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts index 5ad9d2a6617be..9db01189ff66d 100644 --- a/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts @@ -44,7 +44,7 @@ export const eqlSearchStrategyProvider = ( }, search: ({ id, ...request }, options: IAsyncSearchOptions, { esClient, uiSettingsClient }) => { - logger.debug(`_eql/search ${JSON.stringify(request.params) || id}`); + logger.debug(() => `_eql/search ${JSON.stringify(request.params) || id}`); const client = esClient.asCurrentUser.eql; diff --git a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts index bd7aaa4656737..8c5a8ad204a72 100644 --- a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts @@ -204,7 +204,7 @@ export const enhancedEsSearchStrategyProvider = ( * @throws `KbnSearchError` */ search: (request, options: IAsyncSearchOptions, deps) => { - logger.debug(`search ${JSON.stringify(request.params) || request.id}`); + logger.debug(() => `search ${JSON.stringify(request.params) || request.id}`); if (request.indexType === DataViewType.ROLLUP && deps.rollupsEnabled) { return from(rollupSearch(request, options, deps)); diff --git a/src/plugins/data/server/search/strategies/esql_async_search/esql_async_search_strategy.ts b/src/plugins/data/server/search/strategies/esql_async_search/esql_async_search_strategy.ts index a58572f078bfc..a204b6ca69cca 100644 --- a/src/plugins/data/server/search/strategies/esql_async_search/esql_async_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/esql_async_search/esql_async_search_strategy.ts @@ -134,7 +134,7 @@ export const esqlAsyncSearchStrategyProvider = ( * @throws `KbnSearchError` */ search: (request, options: IAsyncSearchOptions, deps) => { - logger.debug(`search ${JSON.stringify(request) || request.id}`); + logger.debug(() => `search ${JSON.stringify(request) || request.id}`); return asyncSearch(request, options, deps); }, diff --git a/src/plugins/data/server/search/strategies/sql_search/sql_search_strategy.ts b/src/plugins/data/server/search/strategies/sql_search/sql_search_strategy.ts index bd4442afa1aba..55ed1bfecb995 100644 --- a/src/plugins/data/server/search/strategies/sql_search/sql_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/sql_search/sql_search_strategy.ts @@ -120,7 +120,7 @@ export const sqlSearchStrategyProvider = ( * @throws `KbnSearchError` */ search: (request, options: IAsyncSearchOptions, deps) => { - logger.debug(`sql search: search request=${JSON.stringify(request)}`); + logger.debug(() => `sql search: search request=${JSON.stringify(request)}`); return asyncSearch(request, options, deps); }, diff --git a/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx b/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx index 2f7e21bb3157f..98897ed4472de 100644 --- a/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx +++ b/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx @@ -53,7 +53,7 @@ import { SubmittingType, AdvancedParamsContent, PreviewPanel, - RollupBetaWarning, + RollupDeprecatedWarning, } from '.'; import { editDataViewModal } from './confirm_modals/edit_data_view_changed_modal'; import { DataViewEditorService } from '../data_view_editor_service'; @@ -92,7 +92,7 @@ const IndexPatternEditorFlyoutContentComponent = ({ dataViewEditorService, }: Props) => { const { - services: { application, dataViews, uiSettings, overlays }, + services: { application, dataViews, uiSettings, overlays, docLinks }, } = useKibana(); const canSave = dataViews.getCanSaveSync(); @@ -227,7 +227,7 @@ const IndexPatternEditorFlyoutContentComponent = ({ {type === INDEX_PATTERN_TYPE.ROLLUP ? ( - + ) : ( diff --git a/src/plugins/data_view_editor/public/components/index.ts b/src/plugins/data_view_editor/public/components/index.ts index 20bb30a3ed11f..dde1646662858 100644 --- a/src/plugins/data_view_editor/public/components/index.ts +++ b/src/plugins/data_view_editor/public/components/index.ts @@ -17,4 +17,4 @@ export { PreviewPanel } from './preview_panel'; export { LoadingIndices } from './loading_indices'; export { Footer, SubmittingType } from './footer'; export { AdvancedParamsContent } from './advanced_params_content'; -export { RollupBetaWarning } from './rollup_beta_warning'; +export { RollupDeprecatedWarning } from './rollup_deprecated_warning'; diff --git a/src/plugins/data_view_editor/public/components/rollup_beta_warning/rollup_beta_warning.tsx b/src/plugins/data_view_editor/public/components/rollup_beta_warning/rollup_beta_warning.tsx deleted file mode 100644 index 15fa8d626e4a1..0000000000000 --- a/src/plugins/data_view_editor/public/components/rollup_beta_warning/rollup_beta_warning.tsx +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React from 'react'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; - -import { EuiCallOut } from '@elastic/eui'; - -const rollupBetaWarningTitle = i18n.translate( - 'indexPatternEditor.rollupIndexPattern.warning.title', - { - defaultMessage: 'Beta feature', - } -); - -export const RollupBetaWarning = () => ( - -

- -

-

- -

-
-); diff --git a/src/plugins/links/common/embeddable/index.ts b/src/plugins/data_view_editor/public/components/rollup_deprecated_warning/index.ts similarity index 83% rename from src/plugins/links/common/embeddable/index.ts rename to src/plugins/data_view_editor/public/components/rollup_deprecated_warning/index.ts index c526b0bf9bff8..b27a5f0e2ce1d 100644 --- a/src/plugins/links/common/embeddable/index.ts +++ b/src/plugins/data_view_editor/public/components/rollup_deprecated_warning/index.ts @@ -6,5 +6,4 @@ * Side Public License, v 1. */ -export { inject } from './inject'; -export { extract } from './extract'; +export { RollupDeprecatedWarning } from './rollup_deprecated_warning'; diff --git a/src/plugins/data_view_editor/public/components/rollup_deprecated_warning/rollup_deprecated_warning.tsx b/src/plugins/data_view_editor/public/components/rollup_deprecated_warning/rollup_deprecated_warning.tsx new file mode 100644 index 0000000000000..c3cdb435556d8 --- /dev/null +++ b/src/plugins/data_view_editor/public/components/rollup_deprecated_warning/rollup_deprecated_warning.tsx @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; + +import { EuiCallOut, EuiLink } from '@elastic/eui'; +import { DocLinksStart } from '@kbn/core/public'; + +interface RollupDeprecatedWarningProps { + docLinksService: DocLinksStart; +} + +const rollupBetaWarningTitle = i18n.translate( + 'indexPatternEditor.rollupIndexPattern.deprecationWarning.title', + { + defaultMessage: 'Deprecated in 8.11.0', + } +); + +export const RollupDeprecatedWarning = ({ docLinksService }: RollupDeprecatedWarningProps) => ( + + + {i18n.translate( + 'indexPatternEditor.rollupDataView.deprecationWarning.downsamplingLink', + { + defaultMessage: 'Downsampling', + } + )} + + ), + }} + /> + +); diff --git a/src/plugins/data_views/docs/openapi/bundled.json b/src/plugins/data_views/docs/openapi/bundled.json index 28893b86cef3f..5f2506c46e609 100644 --- a/src/plugins/data_views/docs/openapi/bundled.json +++ b/src/plugins/data_views/docs/openapi/bundled.json @@ -1036,7 +1036,7 @@ "post": { "summary": "Update data view fields metadata in the default space", "operationId": "updateFieldsMetadataDefault", - "description": "Update fields presentation metadata such as count, customLabel and format. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value.\n", + "description": "Update fields presentation metadata such as count, customLabel, customDescription, and format. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value.\n", "tags": [ "data views" ], @@ -2786,11 +2786,16 @@ } }, "update_field_metadata_request": { - "summary": "Set popularity count for field foo.", + "summary": "Update multiple metadata fields.", "value": { "fields": { - "foo": { - "count": 123 + "field1": { + "count": 123, + "customLabel": "Field 1 label" + }, + "field2": { + "customLabel": "Field 2 label", + "customDescription": "Field 2 description" } } } @@ -3465,7 +3470,22 @@ }, "fieldattrs": { "type": "object", - "description": "A map of field attributes by field name." + "description": "A map of field attributes by field name.", + "properties": { + "count": { + "type": "integer", + "description": "Popularity count for the field." + }, + "customDescription": { + "type": "string", + "description": "Custom description for the field.", + "maxLength": 300 + }, + "customLabel": { + "type": "string", + "description": "Custom label for the field." + } + } }, "fieldformats": { "type": "object", @@ -3532,7 +3552,10 @@ "$ref": "#/components/schemas/allownoindex" }, "fieldAttrs": { - "$ref": "#/components/schemas/fieldattrs" + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/fieldattrs" + } }, "fieldFormats": { "$ref": "#/components/schemas/fieldformats" @@ -3591,7 +3614,10 @@ "$ref": "#/components/schemas/allownoindex" }, "fieldAttrs": { - "$ref": "#/components/schemas/fieldattrs" + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/fieldattrs" + } }, "fieldFormats": { "$ref": "#/components/schemas/fieldformats" diff --git a/src/plugins/data_views/docs/openapi/bundled.yaml b/src/plugins/data_views/docs/openapi/bundled.yaml index dee19e6b1d67b..810f379b272e6 100644 --- a/src/plugins/data_views/docs/openapi/bundled.yaml +++ b/src/plugins/data_views/docs/openapi/bundled.yaml @@ -646,7 +646,7 @@ paths: summary: Update data view fields metadata in the default space operationId: updateFieldsMetadataDefault description: | - Update fields presentation metadata such as count, customLabel and format. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value. + Update fields presentation metadata such as count, customLabel, customDescription, and format. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value. tags: - data views parameters: @@ -1966,11 +1966,15 @@ components: data_view_id: ff959d40-b880-11e8-a6d9-e546fe2bba5f force: true update_field_metadata_request: - summary: Set popularity count for field foo. + summary: Update multiple metadata fields. value: fields: - foo: + field1: count: 123 + customLabel: Field 1 label + field2: + customLabel: Field 2 label + customDescription: Field 2 description create_runtime_field_request: summary: Create a runtime field. value: @@ -2507,6 +2511,17 @@ components: fieldattrs: type: object description: A map of field attributes by field name. + properties: + count: + type: integer + description: Popularity count for the field. + customDescription: + type: string + description: Custom description for the field. + maxLength: 300 + customLabel: + type: string + description: Custom label for the field. fieldformats: type: object description: A map of field formats by field name. @@ -2556,7 +2571,9 @@ components: allowNoIndex: $ref: '#/components/schemas/allownoindex' fieldAttrs: - $ref: '#/components/schemas/fieldattrs' + type: object + additionalProperties: + $ref: '#/components/schemas/fieldattrs' fieldFormats: $ref: '#/components/schemas/fieldformats' fields: @@ -2596,7 +2613,9 @@ components: allowNoIndex: $ref: '#/components/schemas/allownoindex' fieldAttrs: - $ref: '#/components/schemas/fieldattrs' + type: object + additionalProperties: + $ref: '#/components/schemas/fieldattrs' fieldFormats: $ref: '#/components/schemas/fieldformats' fields: diff --git a/src/plugins/data_views/docs/openapi/components/examples/update_field_metadata_request.yaml b/src/plugins/data_views/docs/openapi/components/examples/update_field_metadata_request.yaml index ffa1eba13150f..e16e7e4d38dcb 100644 --- a/src/plugins/data_views/docs/openapi/components/examples/update_field_metadata_request.yaml +++ b/src/plugins/data_views/docs/openapi/components/examples/update_field_metadata_request.yaml @@ -1,9 +1,14 @@ -summary: Set popularity count for field foo. +summary: Update metadata for multiple fields. value: { "fields": { - "foo": { - "count": 123 + "field1": { + "count": 123, + "customLabel": "Field 1 label" + }, + "field2": { + "customLabel": "Field 2 label", + "customDescription": "Field 2 description" } } } \ No newline at end of file diff --git a/src/plugins/data_views/docs/openapi/components/schemas/create_data_view_request_object.yaml b/src/plugins/data_views/docs/openapi/components/schemas/create_data_view_request_object.yaml index ff2c34ed6d9ad..9ac5e0ddd796a 100644 --- a/src/plugins/data_views/docs/openapi/components/schemas/create_data_view_request_object.yaml +++ b/src/plugins/data_views/docs/openapi/components/schemas/create_data_view_request_object.yaml @@ -12,7 +12,9 @@ properties: allowNoIndex: $ref: 'allownoindex.yaml' fieldAttrs: - $ref: 'fieldattrs.yaml' + type: object + additionalProperties: + $ref: 'fieldattrs.yaml' fieldFormats: $ref: 'fieldformats.yaml' fields: diff --git a/src/plugins/data_views/docs/openapi/components/schemas/data_view_response_object.yaml b/src/plugins/data_views/docs/openapi/components/schemas/data_view_response_object.yaml index 9d3c67201896b..f850c2f7c565e 100644 --- a/src/plugins/data_views/docs/openapi/components/schemas/data_view_response_object.yaml +++ b/src/plugins/data_views/docs/openapi/components/schemas/data_view_response_object.yaml @@ -7,7 +7,9 @@ properties: allowNoIndex: $ref: 'allownoindex.yaml' fieldAttrs: - $ref: 'fieldattrs.yaml' + type: object + additionalProperties: + $ref: 'fieldattrs.yaml' fieldFormats: $ref: 'fieldformats.yaml' fields: diff --git a/src/plugins/data_views/docs/openapi/components/schemas/fieldattrs.yaml b/src/plugins/data_views/docs/openapi/components/schemas/fieldattrs.yaml index ede637d538a92..6d0cecd6b43b5 100644 --- a/src/plugins/data_views/docs/openapi/components/schemas/fieldattrs.yaml +++ b/src/plugins/data_views/docs/openapi/components/schemas/fieldattrs.yaml @@ -1,2 +1,13 @@ type: object -description: A map of field attributes by field name. \ No newline at end of file +description: A map of field attributes by field name. +properties: + count: + type: integer + description: Popularity count for the field. + customDescription: + type: string + description: Custom description for the field. + maxLength: 300 + customLabel: + type: string + description: Custom label for the field. \ No newline at end of file diff --git a/src/plugins/data_views/docs/openapi/paths/api@data_views@data_view@{viewid}@fields.yaml b/src/plugins/data_views/docs/openapi/paths/api@data_views@data_view@{viewid}@fields.yaml index 58dd10b88b5d3..3c2526c073513 100644 --- a/src/plugins/data_views/docs/openapi/paths/api@data_views@data_view@{viewid}@fields.yaml +++ b/src/plugins/data_views/docs/openapi/paths/api@data_views@data_view@{viewid}@fields.yaml @@ -2,7 +2,7 @@ post: summary: Update data view fields metadata in the default space operationId: updateFieldsMetadataDefault description: > - Update fields presentation metadata such as count, customLabel and format. + Update fields presentation metadata such as count, customLabel, customDescription, and format. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value. tags: - data views diff --git a/src/plugins/discover/public/application/context/services/__snapshots__/context.predecessors.test.ts.snap b/src/plugins/discover/public/application/context/services/__snapshots__/context.predecessors.test.ts.snap new file mode 100644 index 0000000000000..972df33dfa37d --- /dev/null +++ b/src/plugins/discover/public/application/context/services/__snapshots__/context.predecessors.test.ts.snap @@ -0,0 +1,274 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`context predecessors function fetchPredecessors should perform multiple queries until the expected hit count is returned 1`] = ` +Array [ + Array [ + "index", + Object { + "fields": Object { + "getByName": [MockFunction] { + "calls": Array [ + Array [ + "@timestamp", + ], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + ], + }, + }, + "id": "DATA_VIEW_ID", + "isTimeNanosBased": [Function], + "popularizeField": [Function], + "timeFieldName": "@timestamp", + }, + ], + Array [ + "filter", + Array [], + ], + Array [ + "trackTotalHits", + false, + ], + Array [ + "size", + 3, + ], + Array [ + "query", + Object { + "language": "lucene", + "query": Object { + "bool": Object { + "must": Object { + "constant_score": Object { + "filter": Object { + "range": Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "gte": "1972-09-27T00:00:00.000Z", + "lte": "1972-09-28T00:00:00.000Z", + }, + }, + }, + }, + }, + "must_not": Object { + "ids": Object { + "values": Array [ + "test", + ], + }, + }, + }, + }, + }, + ], + Array [ + "searchAfter", + Array [ + "1972-09-27T00:00:00.000Z", + 0, + ], + ], + Array [ + "sort", + Array [ + Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "order": "asc", + }, + }, + Object { + "_doc": "asc", + }, + ], + ], + Array [ + "version", + true, + ], + Array [ + "size", + 2, + ], + Array [ + "query", + Object { + "language": "lucene", + "query": Object { + "bool": Object { + "must": Object { + "constant_score": Object { + "filter": Object { + "range": Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "gte": "1972-09-28T00:00:00.000Z", + "lte": "1972-10-04T00:00:00.000Z", + }, + }, + }, + }, + }, + "must_not": Object { + "ids": Object { + "values": Array [ + "test", + ], + }, + }, + }, + }, + }, + ], + Array [ + "searchAfter", + Array [ + "1972-09-27T00:00:00.000Z", + 0, + ], + ], + Array [ + "sort", + Array [ + Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "order": "asc", + }, + }, + Object { + "_doc": "asc", + }, + ], + ], + Array [ + "version", + true, + ], + Array [ + "size", + 2, + ], + Array [ + "query", + Object { + "language": "lucene", + "query": Object { + "bool": Object { + "must": Object { + "constant_score": Object { + "filter": Object { + "range": Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "gte": "1972-10-04T00:00:00.000Z", + "lte": "1972-10-27T00:00:00.000Z", + }, + }, + }, + }, + }, + "must_not": Object { + "ids": Object { + "values": Array [ + "test", + ], + }, + }, + }, + }, + }, + ], + Array [ + "searchAfter", + Array [ + "1972-09-27T00:00:00.000Z", + 0, + ], + ], + Array [ + "sort", + Array [ + Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "order": "asc", + }, + }, + Object { + "_doc": "asc", + }, + ], + ], + Array [ + "version", + true, + ], + Array [ + "size", + 2, + ], + Array [ + "query", + Object { + "language": "lucene", + "query": Object { + "bool": Object { + "must": Object { + "constant_score": Object { + "filter": Object { + "range": Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "gte": "1972-10-27T00:00:00.000Z", + "lte": "1973-09-27T00:00:00.000Z", + }, + }, + }, + }, + }, + "must_not": Object { + "ids": Object { + "values": Array [ + "test", + ], + }, + }, + }, + }, + }, + ], + Array [ + "searchAfter", + Array [ + "1972-09-27T00:00:00.000Z", + 0, + ], + ], + Array [ + "sort", + Array [ + Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "order": "asc", + }, + }, + Object { + "_doc": "asc", + }, + ], + ], + Array [ + "version", + true, + ], +] +`; diff --git a/src/plugins/discover/public/application/context/services/__snapshots__/context.successors.test.ts.snap b/src/plugins/discover/public/application/context/services/__snapshots__/context.successors.test.ts.snap new file mode 100644 index 0000000000000..1f8623595b707 --- /dev/null +++ b/src/plugins/discover/public/application/context/services/__snapshots__/context.successors.test.ts.snap @@ -0,0 +1,274 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`context successors function fetchSuccessors should perform multiple queries until the expected hit count is returned 1`] = ` +Array [ + Array [ + "index", + Object { + "fields": Object { + "getByName": [MockFunction] { + "calls": Array [ + Array [ + "@timestamp", + ], + ], + "results": Array [ + Object { + "type": "return", + "value": undefined, + }, + ], + }, + }, + "id": "DATA_VIEW_ID", + "isTimeNanosBased": [Function], + "popularizeField": [Function], + "timeFieldName": "@timestamp", + }, + ], + Array [ + "filter", + Array [], + ], + Array [ + "trackTotalHits", + false, + ], + Array [ + "size", + 4, + ], + Array [ + "query", + Object { + "language": "lucene", + "query": Object { + "bool": Object { + "must": Object { + "constant_score": Object { + "filter": Object { + "range": Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "gte": "1978-03-19T00:00:00.000Z", + "lte": "1978-03-20T00:00:00.000Z", + }, + }, + }, + }, + }, + "must_not": Object { + "ids": Object { + "values": Array [ + "1", + ], + }, + }, + }, + }, + }, + ], + Array [ + "searchAfter", + Array [ + "1978-03-20T00:00:00.000Z", + 0, + ], + ], + Array [ + "sort", + Array [ + Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "order": "desc", + }, + }, + Object { + "_doc": "desc", + }, + ], + ], + Array [ + "version", + true, + ], + Array [ + "size", + 1, + ], + Array [ + "query", + Object { + "language": "lucene", + "query": Object { + "bool": Object { + "must": Object { + "constant_score": Object { + "filter": Object { + "range": Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "gte": "1978-03-13T00:00:00.000Z", + "lte": "1978-03-19T00:00:00.000Z", + }, + }, + }, + }, + }, + "must_not": Object { + "ids": Object { + "values": Array [ + "1", + ], + }, + }, + }, + }, + }, + ], + Array [ + "searchAfter", + Array [ + "1978-03-19T23:59:59.998Z", + 0, + ], + ], + Array [ + "sort", + Array [ + Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "order": "desc", + }, + }, + Object { + "_doc": "desc", + }, + ], + ], + Array [ + "version", + true, + ], + Array [ + "size", + 1, + ], + Array [ + "query", + Object { + "language": "lucene", + "query": Object { + "bool": Object { + "must": Object { + "constant_score": Object { + "filter": Object { + "range": Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "gte": "1978-02-18T00:00:00.000Z", + "lte": "1978-03-13T00:00:00.000Z", + }, + }, + }, + }, + }, + "must_not": Object { + "ids": Object { + "values": Array [ + "1", + ], + }, + }, + }, + }, + }, + ], + Array [ + "searchAfter", + Array [ + "1978-03-19T23:59:59.998Z", + 0, + ], + ], + Array [ + "sort", + Array [ + Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "order": "desc", + }, + }, + Object { + "_doc": "desc", + }, + ], + ], + Array [ + "version", + true, + ], + Array [ + "size", + 1, + ], + Array [ + "query", + Object { + "language": "lucene", + "query": Object { + "bool": Object { + "must": Object { + "constant_score": Object { + "filter": Object { + "range": Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "gte": "1977-03-20T00:00:00.000Z", + "lte": "1978-02-18T00:00:00.000Z", + }, + }, + }, + }, + }, + "must_not": Object { + "ids": Object { + "values": Array [ + "1", + ], + }, + }, + }, + }, + }, + ], + Array [ + "searchAfter", + Array [ + "1978-03-19T23:59:59.998Z", + 0, + ], + ], + Array [ + "sort", + Array [ + Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "order": "desc", + }, + }, + Object { + "_doc": "desc", + }, + ], + ], + Array [ + "version", + true, + ], +] +`; diff --git a/src/plugins/discover/public/application/context/services/_stubs.ts b/src/plugins/discover/public/application/context/services/_stubs.ts index 0122d325fd98d..8df5710f72020 100644 --- a/src/plugins/discover/public/application/context/services/_stubs.ts +++ b/src/plugins/discover/public/application/context/services/_stubs.ts @@ -44,10 +44,13 @@ export function createSearchSourceStub(hits: EsHitRecord[], timeField?: string) const searchSourceStub: any = { _stubHits: hits, _stubTimeField: timeField, - _createStubHit: (timestamp: number, tiebreaker = 0) => ({ - [searchSourceStub._stubTimeField]: timestamp, - sort: [timestamp, tiebreaker], - }), + _createStubHit: (timestamp: number, tiebreaker = 0) => { + const value = new Date(timestamp).toISOString(); + return { + [searchSourceStub._stubTimeField]: value, + sort: [value, tiebreaker], + }; + }, setParent: sinon.spy(() => searchSourceStub), setField: sinon.spy(() => searchSourceStub), removeField: sinon.spy(() => searchSourceStub), @@ -74,13 +77,13 @@ export function createContextSearchSourceStub(timeFieldName: string) { const sortDirection = lastSort[0][timeField].order; const sortFunction = sortDirection === 'asc' - ? (first: SortHit, second: SortHit) => first[timeField] - second[timeField] - : (first: SortHit, second: SortHit) => second[timeField] - first[timeField]; + ? (first: SortHit, second: SortHit) => (first[timeField] < second[timeField] ? -1 : 1) + : (first: SortHit, second: SortHit) => (second[timeField] < first[timeField] ? -1 : 1); const filteredHits = searchSourceStub._stubHits .filter( (hit: SortHit) => - moment(hit[timeField]).isSameOrAfter(timeRange.gte) && - moment(hit[timeField]).isSameOrBefore(timeRange.lte) + moment(hit[timeField]).isSameOrAfter(moment(timeRange.gte)) && + moment(hit[timeField]).isSameOrBefore(moment(timeRange.lte)) ) .sort(sortFunction); diff --git a/src/plugins/discover/public/application/context/services/context.predecessors.test.ts b/src/plugins/discover/public/application/context/services/context.predecessors.test.ts index 6ade7624c2bf9..8e96d3807e7b5 100644 --- a/src/plugins/discover/public/application/context/services/context.predecessors.test.ts +++ b/src/plugins/discover/public/application/context/services/context.predecessors.test.ts @@ -34,7 +34,6 @@ describe('context predecessors', function () { let dataPluginMock: DataPublicPluginStart; let fetchPredecessors: ( timeValIso: string, - timeValNr: number, tieBreakerField: string, tieBreakerValue: number, size: number @@ -42,18 +41,20 @@ describe('context predecessors', function () { // eslint-disable-next-line @typescript-eslint/no-explicit-any let mockSearchSource: any; - const dataView = { - id: 'DATA_VIEW_ID', - timeFieldName: '@timestamp', - isTimeNanosBased: () => false, - popularizeField: () => {}, - fields: { - getByName: jest.fn(), - }, - } as unknown as DataView; + let dataView: DataView; describe('function fetchPredecessors', function () { beforeEach(() => { + dataView = { + id: 'DATA_VIEW_ID', + timeFieldName: '@timestamp', + isTimeNanosBased: () => false, + popularizeField: () => {}, + fields: { + getByName: jest.fn(), + }, + } as unknown as DataView; + mockSearchSource = createContextSearchSourceStub('@timestamp'); dataPluginMock = { search: { @@ -63,14 +64,14 @@ describe('context predecessors', function () { }, } as unknown as DataPublicPluginStart; - fetchPredecessors = (timeValIso, timeValNr, tieBreakerField, tieBreakerValue, size = 10) => { + fetchPredecessors = (timeValIso, tieBreakerField, tieBreakerValue, size = 10) => { const anchor = buildDataTableRecord( { _id: 'test', _source: { [dataView.timeFieldName!]: timeValIso, }, - sort: [timeValNr, tieBreakerValue], + sort: [timeValIso, tieBreakerValue], } as EsHitRecord, dataView, true @@ -100,17 +101,15 @@ describe('context predecessors', function () { mockSearchSource._createStubHit(MS_PER_DAY * 1000), ]; - return fetchPredecessors(ANCHOR_TIMESTAMP_3000, MS_PER_DAY * 3000, '_doc', 0, 3).then( - ({ rows }) => { - expect(mockSearchSource.fetch$.calledOnce).toBe(true); - expect(rows).toEqual( - buildDataTableRecordList({ - records: mockSearchSource._stubHits.slice(0, 3), - dataView, - }) - ); - } - ); + return fetchPredecessors(ANCHOR_TIMESTAMP_3000, '_doc', 0, 3).then(({ rows }) => { + expect(mockSearchSource.fetch$.calledOnce).toBe(true); + expect(rows).toEqual( + buildDataTableRecordList({ + records: mockSearchSource._stubHits.slice(0, 3), + dataView, + }) + ); + }); }); it('should perform multiple queries with the last being unrestricted when too few hits are returned', function () { @@ -122,30 +121,28 @@ describe('context predecessors', function () { mockSearchSource._createStubHit(MS_PER_DAY * 2990), ]; - return fetchPredecessors(ANCHOR_TIMESTAMP_3000, MS_PER_DAY * 3000, '_doc', 0, 6).then( - ({ rows }) => { - const intervals: Timestamp[] = mockSearchSource.setField.args - .filter(([property]: string) => property === 'query') - .map(([, { query }]: [string, { query: Query }]) => - get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp']) - ); - - expect( - intervals.every(({ gte, lte }) => (gte && lte ? moment(gte).isBefore(lte) : true)) - ).toBe(true); - // should have started at the given time - expect(intervals[0].gte).toEqual(moment(MS_PER_DAY * 3000).toISOString()); - // should have ended with a half-open interval - expect(Object.keys(last(intervals) ?? {})).toEqual(['format', 'gte']); - expect(intervals.length).toBeGreaterThan(1); - expect(rows).toEqual( - buildDataTableRecordList({ - records: mockSearchSource._stubHits.slice(0, 3), - dataView, - }) + return fetchPredecessors(ANCHOR_TIMESTAMP_3000, '_doc', 0, 6).then(({ rows }) => { + const intervals: Timestamp[] = mockSearchSource.setField.args + .filter(([property]: string) => property === 'query') + .map(([, { query }]: [string, { query: Query }]) => + get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp']) ); - } - ); + + expect( + intervals.every(({ gte, lte }) => (gte && lte ? moment(gte).isBefore(lte) : true)) + ).toBe(true); + // should have started at the given time + expect(intervals[0].gte).toEqual(moment(MS_PER_DAY * 3000).toISOString()); + // should have ended with a half-open interval + expect(Object.keys(last(intervals) ?? {})).toEqual(['format', 'gte']); + expect(intervals.length).toBeGreaterThan(1); + expect(rows).toEqual( + buildDataTableRecordList({ + records: mockSearchSource._stubHits.slice(0, 3), + dataView, + }) + ); + }); }); it('should perform multiple queries until the expected hit count is returned', function () { @@ -156,47 +153,38 @@ describe('context predecessors', function () { mockSearchSource._createStubHit(MS_PER_DAY * 1000), ]; - return fetchPredecessors(ANCHOR_TIMESTAMP_1000, MS_PER_DAY * 1000, '_doc', 0, 3).then( - ({ rows }) => { - const intervals: Timestamp[] = mockSearchSource.setField.args - .filter(([property]: string) => property === 'query') - .map(([, { query }]: [string, { query: Query }]) => { - return get(query, [ - 'bool', - 'must', - 'constant_score', - 'filter', - 'range', - '@timestamp', - ]); - }); + return fetchPredecessors(ANCHOR_TIMESTAMP_1000, '_doc', 0, 3).then(({ rows }) => { + expect(mockSearchSource.setField.args).toMatchSnapshot(); - // should have started at the given time - expect(intervals[0].gte).toEqual(moment(MS_PER_DAY * 1000).toISOString()); - // should have stopped before reaching MS_PER_DAY * 1700 - expect(moment(last(intervals)?.lte).valueOf()).toBeLessThan(MS_PER_DAY * 1700); - expect(intervals.length).toBeGreaterThan(1); + const intervals: Timestamp[] = mockSearchSource.setField.args + .filter(([property]: string) => property === 'query') + .map(([, { query }]: [string, { query: Query }]) => { + return get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp']); + }); - expect(rows).toEqual( - buildDataTableRecordList({ - records: mockSearchSource._stubHits.slice(-3), - dataView, - }) - ); - } - ); + // should have started at the given time + expect(intervals[0].gte).toEqual(moment(MS_PER_DAY * 1000).toISOString()); + // should have stopped before reaching MS_PER_DAY * 1700 + expect(moment(last(intervals)?.lte).valueOf()).toBeLessThan(MS_PER_DAY * 1700); + expect(intervals.length).toBeGreaterThan(1); + + expect(rows).toEqual( + buildDataTableRecordList({ + records: mockSearchSource._stubHits.slice(-3), + dataView, + }) + ); + }); }); it('should return an empty array when no hits were found', function () { - return fetchPredecessors(ANCHOR_TIMESTAMP_3, MS_PER_DAY * 3, '_doc', 0, 3).then( - ({ rows }) => { - expect(rows).toEqual([]); - } - ); + return fetchPredecessors(ANCHOR_TIMESTAMP_3, '_doc', 0, 3).then(({ rows }) => { + expect(rows).toEqual([]); + }); }); it('should configure the SearchSource to not inherit from the implicit root', function () { - return fetchPredecessors(ANCHOR_TIMESTAMP_3, MS_PER_DAY * 3, '_doc', 0, 3).then(() => { + return fetchPredecessors(ANCHOR_TIMESTAMP_3, '_doc', 0, 3).then(() => { const setParentSpy = mockSearchSource.setParent; expect(setParentSpy.alwaysCalledWith(undefined)).toBe(true); expect(setParentSpy.called).toBe(true); @@ -204,7 +192,7 @@ describe('context predecessors', function () { }); it('should set the tiebreaker sort order to the opposite as the time field', function () { - return fetchPredecessors(ANCHOR_TIMESTAMP, MS_PER_DAY, '_doc', 0, 3).then(() => { + return fetchPredecessors(ANCHOR_TIMESTAMP, '_doc', 0, 3).then(() => { expect( mockSearchSource.setField.calledWith('sort', [ { '@timestamp': { order: 'asc', format: 'strict_date_optional_time' } }, @@ -227,14 +215,14 @@ describe('context predecessors', function () { }, } as unknown as DataPublicPluginStart; - fetchPredecessors = (timeValIso, timeValNr, tieBreakerField, tieBreakerValue, size = 10) => { + fetchPredecessors = (timeValIso, tieBreakerField, tieBreakerValue, size = 10) => { const anchor = buildDataTableRecord( { _id: 'test', _source: { [dataView.timeFieldName!]: timeValIso, }, - sort: [timeValNr, tieBreakerValue], + sort: [timeValIso, tieBreakerValue], } as EsHitRecord, dataView, true @@ -264,21 +252,19 @@ describe('context predecessors', function () { mockSearchSource._createStubHit(MS_PER_DAY * 1000), ]; - return fetchPredecessors(ANCHOR_TIMESTAMP_3000, MS_PER_DAY * 3000, '_doc', 0, 3).then( - ({ rows }) => { - const setFieldsSpy = mockSearchSource.setField.withArgs('fields'); - const removeFieldsSpy = mockSearchSource.removeField.withArgs('fieldsFromSource'); - expect(mockSearchSource.fetch$.calledOnce).toBe(true); - expect(removeFieldsSpy.calledOnce).toBe(true); - expect(setFieldsSpy.calledOnce).toBe(true); - expect(rows).toEqual( - buildDataTableRecordList({ - records: mockSearchSource._stubHits.slice(0, 3), - dataView, - }) - ); - } - ); + return fetchPredecessors(ANCHOR_TIMESTAMP_3000, '_doc', 0, 3).then(({ rows }) => { + const setFieldsSpy = mockSearchSource.setField.withArgs('fields'); + const removeFieldsSpy = mockSearchSource.removeField.withArgs('fieldsFromSource'); + expect(mockSearchSource.fetch$.calledOnce).toBe(true); + expect(removeFieldsSpy.calledOnce).toBe(true); + expect(setFieldsSpy.calledOnce).toBe(true); + expect(rows).toEqual( + buildDataTableRecordList({ + records: mockSearchSource._stubHits.slice(0, 3), + dataView, + }) + ); + }); }); }); }); diff --git a/src/plugins/discover/public/application/context/services/context.successors.test.ts b/src/plugins/discover/public/application/context/services/context.successors.test.ts index 39cc05bd76571..fb480c0b4e873 100644 --- a/src/plugins/discover/public/application/context/services/context.successors.test.ts +++ b/src/plugins/discover/public/application/context/services/context.successors.test.ts @@ -32,7 +32,6 @@ interface Timestamp { describe('context successors', function () { let fetchSuccessors: ( timeValIso: string, - timeValNr: number, tieBreakerField: string, tieBreakerValue: number, size: number @@ -40,18 +39,20 @@ describe('context successors', function () { let dataPluginMock: DataPublicPluginStart; // eslint-disable-next-line @typescript-eslint/no-explicit-any let mockSearchSource: any; - const dataView = { - id: 'DATA_VIEW_ID', - timeFieldName: '@timestamp', - isTimeNanosBased: () => false, - popularizeField: () => {}, - fields: { - getByName: jest.fn(), - }, - } as unknown as DataView; + let dataView: DataView; describe('function fetchSuccessors', function () { beforeEach(() => { + dataView = { + id: 'DATA_VIEW_ID', + timeFieldName: '@timestamp', + isTimeNanosBased: () => false, + popularizeField: () => {}, + fields: { + getByName: jest.fn(), + }, + } as unknown as DataView; + mockSearchSource = createContextSearchSourceStub('@timestamp'); dataPluginMock = { @@ -62,7 +63,7 @@ describe('context successors', function () { }, } as unknown as DataPublicPluginStart; - fetchSuccessors = (timeValIso, timeValNr, tieBreakerField, tieBreakerValue, size) => { + fetchSuccessors = (timeValIso, tieBreakerField, tieBreakerValue, size) => { const anchor = buildDataTableRecord( { _index: 't', @@ -70,7 +71,7 @@ describe('context successors', function () { _source: { [dataView.timeFieldName!]: timeValIso, }, - sort: [timeValNr, tieBreakerValue], + sort: [timeValIso, tieBreakerValue], }, dataView, true @@ -100,17 +101,15 @@ describe('context successors', function () { mockSearchSource._createStubHit(MS_PER_DAY * 3000 - 2), ]; - return fetchSuccessors(ANCHOR_TIMESTAMP_3000, MS_PER_DAY * 3000, '_doc', 0, 3).then( - ({ rows }) => { - expect(mockSearchSource.fetch$.calledOnce).toBe(true); - expect(rows).toEqual( - buildDataTableRecordList({ - records: mockSearchSource._stubHits.slice(-3), - dataView, - }) - ); - } - ); + return fetchSuccessors(ANCHOR_TIMESTAMP_3000, '_doc', 0, 3).then(({ rows }) => { + expect(mockSearchSource.fetch$.calledOnce).toBe(true); + expect(rows).toEqual( + buildDataTableRecordList({ + records: mockSearchSource._stubHits.slice(-3), + dataView, + }) + ); + }); }); it('should perform multiple queries with the last being unrestricted when too few hits are returned', function () { @@ -122,30 +121,28 @@ describe('context successors', function () { mockSearchSource._createStubHit(MS_PER_DAY * 2990), ]; - return fetchSuccessors(ANCHOR_TIMESTAMP_3000, MS_PER_DAY * 3000, '_doc', 0, 6).then( - ({ rows }) => { - const intervals: Timestamp[] = mockSearchSource.setField.args - .filter(([property]: [string]) => property === 'query') - .map(([, { query }]: [string, { query: Query }]) => - get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp']) - ); - - expect( - intervals.every(({ gte, lte }) => (gte && lte ? moment(gte).isBefore(lte) : true)) - ).toBe(true); - // should have started at the given time - expect(intervals[0].lte).toEqual(moment(MS_PER_DAY * 3000).toISOString()); - // should have ended with a half-open interval - expect(Object.keys(last(intervals) ?? {})).toEqual(['format', 'lte']); - expect(intervals.length).toBeGreaterThan(1); - expect(rows).toEqual( - buildDataTableRecordList({ - records: mockSearchSource._stubHits.slice(-3), - dataView, - }) + return fetchSuccessors(ANCHOR_TIMESTAMP_3000, '_doc', 0, 6).then(({ rows }) => { + const intervals: Timestamp[] = mockSearchSource.setField.args + .filter(([property]: [string]) => property === 'query') + .map(([, { query }]: [string, { query: Query }]) => + get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp']) ); - } - ); + + expect( + intervals.every(({ gte, lte }) => (gte && lte ? moment(gte).isBefore(lte) : true)) + ).toBe(true); + // should have started at the given time + expect(intervals[0].lte).toEqual(moment(MS_PER_DAY * 3000).toISOString()); + // should have ended with a half-open interval + expect(Object.keys(last(intervals) ?? {})).toEqual(['format', 'lte']); + expect(intervals.length).toBeGreaterThan(1); + expect(rows).toEqual( + buildDataTableRecordList({ + records: mockSearchSource._stubHits.slice(-3), + dataView, + }) + ); + }); }); it('should perform multiple queries until the expected hit count is returned', function () { @@ -158,37 +155,37 @@ describe('context successors', function () { mockSearchSource._createStubHit(MS_PER_DAY * 1000), ]; - return fetchSuccessors(ANCHOR_TIMESTAMP_3000, MS_PER_DAY * 3000, '_doc', 0, 4).then( - ({ rows }) => { - const intervals: Timestamp[] = mockSearchSource.setField.args - .filter(([property]: [string]) => property === 'query') - .map(([, { query }]: [string, { query: Query }]) => - get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp']) - ); - - // should have started at the given time - expect(intervals[0].lte).toEqual(moment(MS_PER_DAY * 3000).toISOString()); - // should have stopped before reaching MS_PER_DAY * 2200 - expect(moment(last(intervals)?.gte).valueOf()).toBeGreaterThan(MS_PER_DAY * 2200); - expect(intervals.length).toBeGreaterThan(1); - expect(rows).toEqual( - buildDataTableRecordList({ - records: mockSearchSource._stubHits.slice(0, 4), - dataView, - }) + return fetchSuccessors(ANCHOR_TIMESTAMP_3000, '_doc', 0, 4).then(({ rows }) => { + expect(mockSearchSource.setField.args).toMatchSnapshot(); + + const intervals: Timestamp[] = mockSearchSource.setField.args + .filter(([property]: [string]) => property === 'query') + .map(([, { query }]: [string, { query: Query }]) => + get(query, ['bool', 'must', 'constant_score', 'filter', 'range', '@timestamp']) ); - } - ); + + // should have started at the given time + expect(intervals[0].lte).toEqual(moment(MS_PER_DAY * 3000).toISOString()); + // should have stopped before reaching MS_PER_DAY * 2200 + expect(moment(last(intervals)?.gte).valueOf()).toBeGreaterThan(MS_PER_DAY * 2200); + expect(intervals.length).toBeGreaterThan(1); + expect(rows).toEqual( + buildDataTableRecordList({ + records: mockSearchSource._stubHits.slice(0, 4), + dataView, + }) + ); + }); }); it('should return an empty array when no hits were found', function () { - return fetchSuccessors(ANCHOR_TIMESTAMP_3, MS_PER_DAY * 3, '_doc', 0, 3).then(({ rows }) => { + return fetchSuccessors(ANCHOR_TIMESTAMP_3, '_doc', 0, 3).then(({ rows }) => { expect(rows).toEqual([]); }); }); it('should configure the SearchSource to not inherit from the implicit root', function () { - return fetchSuccessors(ANCHOR_TIMESTAMP_3, MS_PER_DAY * 3, '_doc', 0, 3).then(() => { + return fetchSuccessors(ANCHOR_TIMESTAMP_3, '_doc', 0, 3).then(() => { const setParentSpy = mockSearchSource.setParent; expect(setParentSpy.alwaysCalledWith(undefined)).toBe(true); expect(setParentSpy.called).toBe(true); @@ -196,7 +193,7 @@ describe('context successors', function () { }); it('should set the tiebreaker sort order to the same as the time field', function () { - return fetchSuccessors(ANCHOR_TIMESTAMP, MS_PER_DAY, '_doc', 0, 3).then(() => { + return fetchSuccessors(ANCHOR_TIMESTAMP, '_doc', 0, 3).then(() => { expect( mockSearchSource.setField.calledWith('sort', [ { '@timestamp': { order: SortDirection.desc, format: 'strict_date_optional_time' } }, @@ -219,7 +216,7 @@ describe('context successors', function () { }, } as unknown as DataPublicPluginStart; - fetchSuccessors = (timeValIso, timeValNr, tieBreakerField, tieBreakerValue, size) => { + fetchSuccessors = (timeValIso, tieBreakerField, tieBreakerValue, size) => { const anchor = buildDataTableRecord( { _id: '1', @@ -227,7 +224,7 @@ describe('context successors', function () { _source: { [dataView.timeFieldName!]: timeValIso, }, - sort: [timeValNr, tieBreakerValue], + sort: [timeValIso, tieBreakerValue], }, dataView, true @@ -257,7 +254,7 @@ describe('context successors', function () { mockSearchSource._createStubHit(MS_PER_DAY * 3000 - 2), ]; - return fetchSuccessors(ANCHOR_TIMESTAMP_3000, MS_PER_DAY * 3000, '_doc', 0, 3).then( + return fetchSuccessors(ANCHOR_TIMESTAMP_3000, '_doc', 0, 3).then( ({ rows, interceptedWarnings }) => { expect(mockSearchSource.fetch$.calledOnce).toBe(true); expect(rows).toEqual( @@ -291,7 +288,7 @@ describe('context successors', function () { }, } as unknown as DataPublicPluginStart; - fetchSuccessors = (timeValIso, timeValNr, tieBreakerField, tieBreakerValue, size) => { + fetchSuccessors = (timeValIso, tieBreakerField, tieBreakerValue, size) => { const anchor = buildDataTableRecord( { _id: '1', @@ -299,7 +296,7 @@ describe('context successors', function () { _source: { [dataView.timeFieldName!]: timeValIso, }, - sort: [timeValNr, tieBreakerValue], + sort: [timeValIso, tieBreakerValue], }, dataView, true @@ -332,7 +329,7 @@ describe('context successors', function () { mockSearchSource._createStubHit(MS_PER_DAY * 3000 - 2), ]; - return fetchSuccessors(ANCHOR_TIMESTAMP_3000, MS_PER_DAY * 3000, '_doc', 0, 3).then( + return fetchSuccessors(ANCHOR_TIMESTAMP_3000, '_doc', 0, 3).then( ({ rows, interceptedWarnings }) => { expect(mockSearchSource.fetch$.calledOnce).toBe(true); expect(rows).toEqual( diff --git a/src/plugins/discover/public/application/context/services/context.ts b/src/plugins/discover/public/application/context/services/context.ts index a4df96fe0bdbb..b375e3cce75f6 100644 --- a/src/plugins/discover/public/application/context/services/context.ts +++ b/src/plugins/discover/public/application/context/services/context.ts @@ -71,10 +71,11 @@ export async function fetchSurroundingDocs( const anchorRaw = anchor.raw!; const nanos = dataView.isTimeNanosBased() ? extractNanos(anchorRaw.fields?.[timeField][0]) : ''; - const timeValueMillis = - nanos !== '' ? convertIsoToMillis(anchorRaw.fields?.[timeField][0]) : anchorRaw.sort?.[0]; + const timeValueMillis = convertIsoToMillis( + nanos !== '' ? anchorRaw.fields?.[timeField][0] : anchorRaw.sort?.[0] + ); - const intervals = generateIntervals(LOOKUP_OFFSETS, timeValueMillis as number, type, sortDir); + const intervals = generateIntervals(LOOKUP_OFFSETS, timeValueMillis, type, sortDir); let rows: DataTableRecord[] = []; let interceptedWarnings: SearchResponseWarning[] = []; diff --git a/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx b/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx index bf48c0bb83cf4..800b143213227 100644 --- a/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx +++ b/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx @@ -56,7 +56,12 @@ export const FieldStatisticsTable = React.memo((props: FieldStatisticsTableProps } = props; const visibleFields = useMemo( - () => convertFieldsToFallbackFields({ fields: columns, additionalFieldGroups }), + () => + convertFieldsToFallbackFields({ + // `discover:searchFieldsFromSource` adds `_source` to the columns, but we should exclude it for Field Statistics + fields: columns.filter((col) => col !== '_source'), + additionalFieldGroups, + }), [additionalFieldGroups, columns] ); const allFallbackFields = useMemo( diff --git a/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx b/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx index caba229e9137a..9e061beffc4fc 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx @@ -277,7 +277,8 @@ function DiscoverDocumentsComponent({ <> col !== '_source')} /> diff --git a/src/plugins/discover/public/application/main/components/layout/discover_histogram_layout.test.tsx b/src/plugins/discover/public/application/main/components/layout/discover_histogram_layout.test.tsx index d23dfbe4359eb..646eb9171dd05 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_histogram_layout.test.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_histogram_layout.test.tsx @@ -13,7 +13,6 @@ import type { DataView } from '@kbn/data-views-plugin/common'; import { esHitsMock } from '@kbn/discover-utils/src/__mocks__'; import { savedSearchMockWithTimeField } from '../../../../__mocks__/saved_search'; import { - AvailableFields$, DataDocuments$, DataMain$, DataTotalHits$, @@ -93,11 +92,6 @@ const mountComponent = async ({ result: esHitsMock.map((esHit) => buildDataTableRecord(esHit, dataView)), }) as DataDocuments$; - const availableFields$ = new BehaviorSubject({ - fetchStatus: FetchStatus.COMPLETE, - fields: [] as string[], - }) as AvailableFields$; - const totalHits$ = new BehaviorSubject({ fetchStatus: FetchStatus.COMPLETE, result: Number(esHitsMock.length), @@ -107,7 +101,6 @@ const mountComponent = async ({ main$, documents$, totalHits$, - availableFields$, }; const session = getSessionServiceMock(); diff --git a/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx b/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx index cf3fd26a10d66..b6bf9ba4f4a94 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx @@ -21,7 +21,6 @@ import { import type { DataView } from '@kbn/data-views-plugin/public'; import { dataViewWithTimefieldMock } from '../../../../__mocks__/data_view_with_timefield'; import { - AvailableFields$, DataDocuments$, DataMain$, DataTotalHits$, @@ -83,11 +82,6 @@ async function mountComponent( result: esHitsMock.map((esHit) => buildDataTableRecord(esHit, dataView)), }) as DataDocuments$; - const availableFields$ = new BehaviorSubject({ - fetchStatus: FetchStatus.COMPLETE, - fields: [] as string[], - }) as AvailableFields$; - const totalHits$ = new BehaviorSubject({ fetchStatus: FetchStatus.COMPLETE, result: Number(esHitsMock.length), @@ -97,7 +91,6 @@ async function mountComponent( main$, documents$, totalHits$, - availableFields$, }; const session = getSessionServiceMock(); diff --git a/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx b/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx index 0d94041738f54..d4798089e09ee 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx @@ -389,7 +389,6 @@ export function DiscoverLayout({ stateContainer }: DiscoverLayoutProps) { trackUiMetric={trackUiMetric} onFieldEdited={onFieldEdited} onDataViewCreated={stateContainer.actions.onDataViewCreated} - availableFields$={stateContainer.dataState.data$.availableFields$} sidebarToggleState$={sidebarToggleState$} /> } diff --git a/src/plugins/discover/public/application/main/components/layout/discover_main_content.test.tsx b/src/plugins/discover/public/application/main/components/layout/discover_main_content.test.tsx index 343ceae3ed995..43d8694bd4653 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_main_content.test.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_main_content.test.tsx @@ -14,7 +14,6 @@ import { mountWithIntl } from '@kbn/test-jest-helpers'; import { DataView } from '@kbn/data-plugin/common'; import { dataViewMock, esHitsMock } from '@kbn/discover-utils/src/__mocks__'; import { - AvailableFields$, DataDocuments$, DataMain$, DataTotalHits$, @@ -75,11 +74,6 @@ const mountComponent = async ({ result: esHitsMock.map((esHit) => buildDataTableRecord(esHit, dataViewMock)), }) as DataDocuments$; - const availableFields$ = new BehaviorSubject({ - fetchStatus: FetchStatus.COMPLETE, - fields: [] as string[], - }) as AvailableFields$; - const totalHits$ = new BehaviorSubject({ fetchStatus: FetchStatus.COMPLETE, result: Number(esHitsMock.length), @@ -90,7 +84,6 @@ const mountComponent = async ({ main$, documents$, totalHits$, - availableFields$, }; stateContainer.dataState.data$ = savedSearchData$; const dataView = stateContainer.savedSearchState diff --git a/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.ts b/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.ts index 385dd432dc3c1..3814bd93fa636 100644 --- a/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.ts +++ b/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.ts @@ -246,6 +246,7 @@ export const useDiscoverHistogram = ({ useEffect(() => { if (!isEsqlMode) { + setIsSuggestionLoading(false); return; } diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.test.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.test.tsx index e9c48128838fb..b7b52630f45d9 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.test.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.test.tsx @@ -20,10 +20,7 @@ import { } from './discover_sidebar_responsive'; import { DiscoverServices } from '../../../../build_services'; import { FetchStatus, SidebarToggleState } from '../../../types'; -import { - AvailableFields$, - DataDocuments$, -} from '../../state_management/discover_data_state_container'; +import { DataDocuments$ } from '../../state_management/discover_data_state_container'; import { stubLogstashDataView } from '@kbn/data-plugin/common/stubs'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock'; @@ -69,6 +66,15 @@ jest.mock('../../../../customizations', () => ({ }), })); +jest.mock('lodash', () => { + const original = jest.requireActual('lodash'); + + return { + ...original, + debounce: (fn: unknown) => fn, + }; +}); + jest.mock('@kbn/unified-field-list/src/services/field_stats', () => ({ loadFieldStats: jest.fn().mockResolvedValue({ totalDocuments: 1624, @@ -154,10 +160,6 @@ function getCompProps(options?: { hits?: DataTableRecord[] }): DiscoverSidebarRe fetchStatus: FetchStatus.COMPLETE, result: hits, }) as DataDocuments$, - availableFields$: new BehaviorSubject({ - fetchStatus: FetchStatus.COMPLETE, - fields: [] as string[], - }) as AvailableFields$, onChangeDataView: jest.fn(), onAddFilter: jest.fn(), onAddField: jest.fn(), @@ -311,11 +313,6 @@ describe('discover responsive sidebar', function () { expect(unmappedFieldsCount.exists()).toBe(false); expect(mockCalcFieldCounts.mock.calls.length).toBe(1); - expect(props.availableFields$.getValue()).toEqual({ - fetchStatus: 'complete', - fields: ['extension'], - }); - expect(findTestSubject(comp, 'fieldListGrouped__ariaDescription').text()).toBe( '1 selected field. 4 popular fields. 3 available fields. 20 empty fields. 2 meta fields.' ); @@ -374,11 +371,6 @@ describe('discover responsive sidebar', function () { expect(metaFieldsCount.text()).toBe('2'); expect(unmappedFieldsCount.exists()).toBe(false); - expect(propsWithoutColumns.availableFields$.getValue()).toEqual({ - fetchStatus: 'complete', - fields: ['bytes', 'extension', '_id', 'phpmemory'], - }); - expect(findTestSubject(compWithoutSelected, 'fieldListGrouped__ariaDescription').text()).toBe( '4 popular fields. 3 available fields. 20 empty fields. 2 meta fields.' ); diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx index 23778ada7566a..187a946892d1f 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx @@ -23,10 +23,7 @@ import { } from '@kbn/unified-field-list'; import { PLUGIN_ID } from '../../../../../common'; import { useDiscoverServices } from '../../../../hooks/use_discover_services'; -import { - AvailableFields$, - DataDocuments$, -} from '../../state_management/discover_data_state_container'; +import { DataDocuments$ } from '../../state_management/discover_data_state_container'; import { calcFieldCounts } from '../../utils/calc_field_counts'; import { FetchStatus, SidebarToggleState } from '../../../types'; import { DISCOVER_TOUR_STEP_ANCHOR_IDS } from '../../../../components/discover_tour'; @@ -129,10 +126,6 @@ export interface DiscoverSidebarResponsiveProps { * callback to execute on create dataview */ onDataViewCreated: (dataView: DataView) => void; - /** - * list of available fields fetched from ES - */ - availableFields$: AvailableFields$; /** * For customization and testing purposes */ @@ -291,20 +284,6 @@ export function DiscoverSidebarResponsive(props: DiscoverSidebarResponsiveProps) }, []); const { dataViewEditor } = services; - const { availableFields$ } = props; - - useEffect(() => { - // For an external embeddable like the Field stats - // it is useful to know what fields are populated in the docs fetched - // or what fields are selected by the user - - const availableFields = - props.columns.length > 0 ? props.columns : Object.keys(sidebarState.fieldCounts || {}); - availableFields$.next({ - fetchStatus: FetchStatus.COMPLETE, - fields: availableFields, - }); - }, [selectedDataView, sidebarState.fieldCounts, props.columns, availableFields$]); const canEditDataView = Boolean(dataViewEditor?.userPermissions.editDataView()) || diff --git a/src/plugins/discover/public/application/main/components/sidebar/lib/get_field_list.ts b/src/plugins/discover/public/application/main/components/sidebar/lib/get_field_list.ts index 99d911dd14f61..36a07faaef80d 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/lib/get_field_list.ts +++ b/src/plugins/discover/public/application/main/components/sidebar/lib/get_field_list.ts @@ -8,6 +8,7 @@ import { difference } from 'lodash'; import { type DataView, DataViewField } from '@kbn/data-views-plugin/public'; +import { convertDatatableColumnToDataViewFieldSpec } from '@kbn/data-view-utils'; import type { DatatableColumn } from '@kbn/expressions-plugin/common'; import { fieldWildcardFilter } from '@kbn/kibana-utils-plugin/public'; import { isNestedFieldParent } from '@kbn/discover-utils'; @@ -66,14 +67,6 @@ export function getEsqlQueryFieldList(esqlQueryColumns?: DatatableColumn[]): Dat return []; } return esqlQueryColumns.map( - (column) => - new DataViewField({ - name: column.name, - type: column.meta?.type ?? 'unknown', - esTypes: column.meta?.esType ? [column.meta?.esType] : undefined, - searchable: true, - aggregatable: false, - isNull: Boolean(column?.isNull), - }) + (column) => new DataViewField(convertDatatableColumnToDataViewFieldSpec(column)) ); } diff --git a/src/plugins/discover/public/application/main/data_fetching/fetch_all.test.ts b/src/plugins/discover/public/application/main/data_fetching/fetch_all.test.ts index d6999c2200436..864c44fd6ce09 100644 --- a/src/plugins/discover/public/application/main/data_fetching/fetch_all.test.ts +++ b/src/plugins/discover/public/application/main/data_fetching/fetch_all.test.ts @@ -14,7 +14,6 @@ import { savedSearchMock } from '../../../__mocks__/saved_search'; import { discoverServiceMock } from '../../../__mocks__/services'; import { fetchAll, fetchMoreDocuments } from './fetch_all'; import { - DataAvailableFieldsMsg, DataDocumentsMsg, DataMainMsg, DataTotalHitsMsg, @@ -59,9 +58,6 @@ describe('test fetchAll', () => { main$: new BehaviorSubject({ fetchStatus: FetchStatus.UNINITIALIZED }), documents$: new BehaviorSubject({ fetchStatus: FetchStatus.UNINITIALIZED }), totalHits$: new BehaviorSubject({ fetchStatus: FetchStatus.UNINITIALIZED }), - availableFields$: new BehaviorSubject({ - fetchStatus: FetchStatus.UNINITIALIZED, - }), }; searchSource = savedSearchMock.searchSource.createChild(); diff --git a/src/plugins/discover/public/application/main/state_management/discover_data_state_container.ts b/src/plugins/discover/public/application/main/state_management/discover_data_state_container.ts index aaa1f6c15c0f4..d467d965f012d 100644 --- a/src/plugins/discover/public/application/main/state_management/discover_data_state_container.ts +++ b/src/plugins/discover/public/application/main/state_management/discover_data_state_container.ts @@ -33,13 +33,11 @@ export interface SavedSearchData { main$: DataMain$; documents$: DataDocuments$; totalHits$: DataTotalHits$; - availableFields$: AvailableFields$; } export type DataMain$ = BehaviorSubject; export type DataDocuments$ = BehaviorSubject; export type DataTotalHits$ = BehaviorSubject; -export type AvailableFields$ = BehaviorSubject; export type DataFetch$ = Observable<{ options: { reset: boolean; @@ -180,7 +178,6 @@ export function getDataStateContainer({ main$: new BehaviorSubject(initialState), documents$: new BehaviorSubject(initialState), totalHits$: new BehaviorSubject(initialState), - availableFields$: new BehaviorSubject(initialState), }; let autoRefreshDone: AutoRefreshDoneFn | undefined; diff --git a/src/plugins/discover/public/application/main/state_management/discover_saved_search_container.test.ts b/src/plugins/discover/public/application/main/state_management/discover_saved_search_container.test.ts index 3ce4c969bbd3f..927b9e60baf1e 100644 --- a/src/plugins/discover/public/application/main/state_management/discover_saved_search_container.test.ts +++ b/src/plugins/discover/public/application/main/state_management/discover_saved_search_container.test.ts @@ -14,6 +14,8 @@ import { dataViewMock } from '@kbn/discover-utils/src/__mocks__'; import { dataViewComplexMock } from '../../../__mocks__/data_view_complex'; import { getDiscoverGlobalStateContainer } from './discover_global_state_container'; import { createKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; +import { VIEW_MODE } from '../../../../common/constants'; +import { createSearchSourceMock } from '@kbn/data-plugin/common/search/search_source/mocks'; describe('DiscoverSavedSearchContainer', () => { const savedSearch = savedSearchMock; @@ -232,4 +234,57 @@ describe('DiscoverSavedSearchContainer', () => { expect(savedSearchContainer.getHasChanged$().getValue()).toBe(false); }); }); + + describe('isEqualSavedSearch', () => { + it('should return true for equal saved searches', () => { + const savedSearch1 = savedSearchMock; + const savedSearch2 = { ...savedSearchMock }; + expect(isEqualSavedSearch(savedSearch1, savedSearch2)).toBe(true); + }); + + it('should return false for different saved searches', () => { + const savedSearch1 = savedSearchMock; + const savedSearch2 = { ...savedSearchMock, title: 'New title' }; + expect(isEqualSavedSearch(savedSearch1, savedSearch2)).toBe(false); + }); + + it('should return true for saved searches with equal default values of viewMode and false otherwise', () => { + const savedSearch1 = { ...savedSearchMock, viewMode: undefined }; + const savedSearch2 = { ...savedSearchMock, viewMode: VIEW_MODE.DOCUMENT_LEVEL }; + const savedSearch3 = { ...savedSearchMock, viewMode: VIEW_MODE.AGGREGATED_LEVEL }; + expect(isEqualSavedSearch(savedSearch1, savedSearch2)).toBe(true); + expect(isEqualSavedSearch(savedSearch2, savedSearch1)).toBe(true); + expect(isEqualSavedSearch(savedSearch1, savedSearch3)).toBe(false); + expect(isEqualSavedSearch(savedSearch2, savedSearch3)).toBe(false); + }); + + it('should return true for saved searches with equal default values of breakdownField and false otherwise', () => { + const savedSearch1 = { ...savedSearchMock, breakdownField: undefined }; + const savedSearch2 = { ...savedSearchMock, breakdownField: '' }; + const savedSearch3 = { ...savedSearchMock, breakdownField: 'test' }; + expect(isEqualSavedSearch(savedSearch1, savedSearch2)).toBe(true); + expect(isEqualSavedSearch(savedSearch2, savedSearch1)).toBe(true); + expect(isEqualSavedSearch(savedSearch1, savedSearch3)).toBe(false); + expect(isEqualSavedSearch(savedSearch2, savedSearch3)).toBe(false); + }); + + it('should check searchSource fields', () => { + const savedSearch1 = { + ...savedSearchMock, + searchSource: createSearchSourceMock({ + index: savedSearchMock.searchSource.getField('index'), + }), + }; + const savedSearch2 = { + ...savedSearchMock, + searchSource: createSearchSourceMock({ + index: savedSearchMock.searchSource.getField('index'), + }), + }; + expect(isEqualSavedSearch(savedSearch1, savedSearch1)).toBe(true); + expect(isEqualSavedSearch(savedSearch1, savedSearch2)).toBe(true); + savedSearch2.searchSource.setField('query', { language: 'lucene', query: 'test' }); + expect(isEqualSavedSearch(savedSearch1, savedSearch2)).toBe(false); + }); + }); }); diff --git a/src/plugins/discover/public/application/main/state_management/discover_saved_search_container.ts b/src/plugins/discover/public/application/main/state_management/discover_saved_search_container.ts index c6a380cad98e2..8d3975b5bfef5 100644 --- a/src/plugins/discover/public/application/main/state_management/discover_saved_search_container.ts +++ b/src/plugins/discover/public/application/main/state_management/discover_saved_search_container.ts @@ -341,12 +341,7 @@ export function isEqualSavedSearch(savedSearchPrev: SavedSearch, savedSearchNext const prevValue = getSavedSearchFieldForComparison(prevSavedSearch, key); const nextValue = getSavedSearchFieldForComparison(nextSavedSearchWithoutSearchSource, key); - const isSame = - isEqual(prevValue, nextValue) || - // By default, viewMode: undefined is equivalent to documents view - // So they should be treated as same - (key === 'viewMode' && - (prevValue ?? VIEW_MODE.DOCUMENT_LEVEL) === (nextValue ?? VIEW_MODE.DOCUMENT_LEVEL)); + const isSame = isEqual(prevValue, nextValue); if (!isSame) { addLog('[savedSearch] difference between initial and changed version', { @@ -412,6 +407,12 @@ function getSavedSearchFieldForComparison( return savedSearch.breakdownField || ''; // ignore the difference between an empty string and undefined } + if (fieldName === 'viewMode') { + // By default, viewMode: undefined is equivalent to documents view + // So they should be treated as same + return savedSearch.viewMode ?? VIEW_MODE.DOCUMENT_LEVEL; + } + return savedSearch[fieldName]; } diff --git a/src/plugins/discover/public/application/main/state_management/utils/build_state_subscribe.test.ts b/src/plugins/discover/public/application/main/state_management/utils/build_state_subscribe.test.ts index 1a487c5bb3bcb..50ee8b0c74fe7 100644 --- a/src/plugins/discover/public/application/main/state_management/utils/build_state_subscribe.test.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/build_state_subscribe.test.ts @@ -11,7 +11,8 @@ import { FetchStatus } from '../../../types'; import { dataViewComplexMock } from '../../../../__mocks__/data_view_complex'; import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock'; import { discoverServiceMock } from '../../../../__mocks__/services'; -import { createDataViewDataSource } from '../../../../../common/data_sources'; +import { createDataViewDataSource, DataSourceType } from '../../../../../common/data_sources'; +import { VIEW_MODE } from '@kbn/saved-search-plugin/common'; describe('buildStateSubscribe', () => { const savedSearch = savedSearchMock; @@ -19,6 +20,7 @@ describe('buildStateSubscribe', () => { stateContainer.dataState.refetch$.next = jest.fn(); stateContainer.dataState.reset = jest.fn(); stateContainer.actions.setDataView = jest.fn(); + stateContainer.savedSearchState.update = jest.fn(); const getSubscribeFn = () => { return buildStateSubscribe({ @@ -51,6 +53,20 @@ describe('buildStateSubscribe', () => { expect(stateContainer.dataState.refetch$.next).not.toHaveBeenCalled(); }); + it('should not call refetch$ if viewMode changes', async () => { + await getSubscribeFn()({ + ...stateContainer.appState.getState(), + dataSource: { + type: DataSourceType.Esql, + }, + viewMode: VIEW_MODE.AGGREGATED_LEVEL, + }); + + expect(stateContainer.dataState.refetch$.next).not.toHaveBeenCalled(); + expect(stateContainer.dataState.reset).not.toHaveBeenCalled(); + expect(stateContainer.savedSearchState.update).toHaveBeenCalled(); + }); + it('should call refetch$ if the chart is hidden', async () => { await getSubscribeFn()({ hideChart: true }); diff --git a/src/plugins/discover/public/application/main/state_management/utils/build_state_subscribe.ts b/src/plugins/discover/public/application/main/state_management/utils/build_state_subscribe.ts index 5c71311377595..865992187089a 100644 --- a/src/plugins/discover/public/application/main/state_management/utils/build_state_subscribe.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/build_state_subscribe.ts @@ -55,12 +55,14 @@ export const buildStateSubscribe = const isEsqlMode = isDataSourceType(nextState.dataSource, DataSourceType.Esql); const queryChanged = !isEqual(nextQuery, prevQuery) || !isEqual(nextQuery, prevState.query); - if ( - isEsqlMode && - isEqualState(prevState, nextState, ['dataSource', 'viewMode']) && - !queryChanged - ) { - // When there's a switch from data view to es|ql, this just leads to a cleanup of index and viewMode + if (isEsqlMode && prevState.viewMode !== nextState.viewMode && !queryChanged) { + savedSearchState.update({ nextState }); + addLog('[appstate] subscribe $fetch ignored for es|ql', { prevState, nextState }); + return; + } + + if (isEsqlMode && isEqualState(prevState, nextState, ['dataSource']) && !queryChanged) { + // When there's a switch from data view to es|ql, this just leads to a cleanup of index // And there's no subsequent action in this function required addLog('[appstate] subscribe update ignored for es|ql', { prevState, nextState }); return; diff --git a/src/plugins/discover/public/context_awareness/profile_providers/example_data_source_profile/profile.tsx b/src/plugins/discover/public/context_awareness/profile_providers/example_data_source_profile/profile.tsx index 080c2ffed222b..6b705b00c1ba1 100644 --- a/src/plugins/discover/public/context_awareness/profile_providers/example_data_source_profile/profile.tsx +++ b/src/plugins/discover/public/context_awareness/profile_providers/example_data_source_profile/profile.tsx @@ -52,6 +52,17 @@ export const exampleDataSourceProfileProvider: DataSourceProfileProvider = { ); }, }), + getDocViewer: (prev) => (params) => { + const recordId = params.record.id; + const prevValue = prev(params); + return { + title: `Record #${recordId}`, + docViewsRegistry: (registry) => { + registry.enableById('doc_view_logs_overview'); + return prevValue.docViewsRegistry(registry); + }, + }; + }, }, resolve: (params) => { let indexPattern: string | undefined; 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 d71410d884d27..e754975ecd543 100644 --- a/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx +++ b/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx @@ -20,7 +20,6 @@ import { EmbeddableInput, SavedObjectEmbeddableInput, isSavedObjectEmbeddableInput, - EmbeddableFactoryNotFoundError, EmbeddableFactory, } from '..'; @@ -74,9 +73,7 @@ export class AttributeService< ) { if (getEmbeddableFactory) { const factory = getEmbeddableFactory(this.type); - if (!factory) { - throw new EmbeddableFactoryNotFoundError(this.type); - } + this.embeddableFactory = factory; } } diff --git a/src/plugins/embeddable/public/lib/embeddable_placement/embeddable_placement_registry.ts b/src/plugins/embeddable/public/lib/embeddable_placement/embeddable_placement_registry.ts new file mode 100644 index 0000000000000..82891d2c982b7 --- /dev/null +++ b/src/plugins/embeddable/public/lib/embeddable_placement/embeddable_placement_registry.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. + */ + +type GetPanelPlacementSettings = (serializedState: StateType) => { + width?: number; + height?: number; + strategy?: string; +}; + +const registry: Map> = new Map(); + +export const registerEmbeddablePlacementStrategy = ( + panelType: string, + getPanelPlacementSettings: GetPanelPlacementSettings +) => { + if (registry.has(panelType)) { + throw new Error(`Embeddable placement for embeddable type ${panelType} already exists`); + } + + registry.set(panelType, getPanelPlacementSettings); +}; + +export const getEmbeddablePlacementStrategy = (panelType: string) => { + return registry.get(panelType); +}; diff --git a/src/plugins/esql/.i18nrc.json b/src/plugins/esql/.i18nrc.json new file mode 100755 index 0000000000000..fce2490c832cf --- /dev/null +++ b/src/plugins/esql/.i18nrc.json @@ -0,0 +1,6 @@ +{ + "prefix": "esql", + "paths": { + "esql": "." + } +} diff --git a/src/plugins/text_based_languages/README.md b/src/plugins/esql/README.md similarity index 86% rename from src/plugins/text_based_languages/README.md rename to src/plugins/esql/README.md index 42d3375220682..05a7406e06a3b 100644 --- a/src/plugins/text_based_languages/README.md +++ b/src/plugins/esql/README.md @@ -1,4 +1,4 @@ -# @kbn/text-based-languages +# @kbn/esql ## Component properties The editor accepts the following properties: @@ -11,8 +11,8 @@ The editor accepts the following properties: - isLoading: As the editor is not responsible for the data fetching request, the consumer could update this property when the data are being fetched. If this property is defined, the query history component will be rendered ``` -To use it on your application, you need to add the textBasedLanguages to your requiredBundles and the @kbn/text-based-languages to your tsconfig.json and use the component like that: -import { TextBasedLangEditor } from '@kbn/text-based-languages/public'; +To use it on your application, you need to add the textBasedLanguages to your requiredBundles and the @kbn/esql to your tsconfig.json and use the component like that: +import { TextBasedLangEditor } from '@kbn/esql/public'; /src/plugins/text_based_languages'], - coverageDirectory: '/target/kibana-coverage/jest/src/plugins/text_based_languages', + roots: ['/src/plugins/esql'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/esql', coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '/src/plugins/text_based_languages/{common,public,server}/**/*.{js,ts,tsx}', - ], + collectCoverageFrom: ['/src/plugins/esql/{common,public,server}/**/*.{js,ts,tsx}'], setupFiles: ['jest-canvas-mock'], }; diff --git a/src/plugins/text_based_languages/kibana.jsonc b/src/plugins/esql/kibana.jsonc similarity index 82% rename from src/plugins/text_based_languages/kibana.jsonc rename to src/plugins/esql/kibana.jsonc index 5bed408add15a..797b9066e46ae 100644 --- a/src/plugins/text_based_languages/kibana.jsonc +++ b/src/plugins/esql/kibana.jsonc @@ -1,9 +1,9 @@ { "type": "plugin", - "id": "@kbn/text-based-languages", + "id": "@kbn/esql", "owner": "@elastic/kibana-esql", "plugin": { - "id": "textBasedLanguages", + "id": "esql", "server": true, "browser": true, "optionalPlugins": [ diff --git a/src/plugins/text_based_languages/package.json b/src/plugins/esql/package.json similarity index 70% rename from src/plugins/text_based_languages/package.json rename to src/plugins/esql/package.json index a13edb1990192..fe166ce25a71b 100644 --- a/src/plugins/text_based_languages/package.json +++ b/src/plugins/esql/package.json @@ -1,5 +1,5 @@ { - "name": "@kbn/text-based-languages", + "name": "@kbn/esql", "private": true, "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0" diff --git a/src/plugins/text_based_languages/public/create_editor.tsx b/src/plugins/esql/public/create_editor.tsx similarity index 100% rename from src/plugins/text_based_languages/public/create_editor.tsx rename to src/plugins/esql/public/create_editor.tsx diff --git a/src/plugins/text_based_languages/public/index.ts b/src/plugins/esql/public/index.ts similarity index 76% rename from src/plugins/text_based_languages/public/index.ts rename to src/plugins/esql/public/index.ts index 697e1d0e1d319..8e797ed591fca 100644 --- a/src/plugins/text_based_languages/public/index.ts +++ b/src/plugins/esql/public/index.ts @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -import { TextBasedLanguagesPlugin } from './plugin'; +import { EsqlPlugin } from './plugin'; export type { TextBasedLanguagesEditorProps } from '@kbn/text-based-editor'; -export type { TextBasedLanguagesPluginStart } from './types'; +export type { EsqlPluginStart } from './types'; export { TextBasedLangEditor } from './create_editor'; export function plugin() { - return new TextBasedLanguagesPlugin(); + return new EsqlPlugin(); } diff --git a/src/plugins/text_based_languages/public/kibana_services.ts b/src/plugins/esql/public/kibana_services.ts similarity index 100% rename from src/plugins/text_based_languages/public/kibana_services.ts rename to src/plugins/esql/public/kibana_services.ts diff --git a/src/plugins/text_based_languages/public/plugin.ts b/src/plugins/esql/public/plugin.ts similarity index 83% rename from src/plugins/text_based_languages/public/plugin.ts rename to src/plugins/esql/public/plugin.ts index 841641c8fce25..5b78a0b48dc2b 100755 --- a/src/plugins/text_based_languages/public/plugin.ts +++ b/src/plugins/esql/public/plugin.ts @@ -19,22 +19,22 @@ import { } from './triggers'; import { setKibanaServices } from './kibana_services'; -interface TextBasedLanguagesPluginStart { +interface EsqlPluginStart { dataViews: DataViewsPublicPluginStart; expressions: ExpressionsStart; uiActions: UiActionsStart; data: DataPublicPluginStart; } -interface TextBasedLanguagesPluginSetup { +interface EsqlPluginSetup { indexManagement: IndexManagementPluginSetup; uiActions: UiActionsSetup; } -export class TextBasedLanguagesPlugin implements Plugin<{}, void> { +export class EsqlPlugin implements Plugin<{}, void> { private indexManagement?: IndexManagementPluginSetup; - public setup(_: CoreSetup, { indexManagement, uiActions }: TextBasedLanguagesPluginSetup) { + public setup(_: CoreSetup, { indexManagement, uiActions }: EsqlPluginSetup) { this.indexManagement = indexManagement; uiActions.registerTrigger(updateESQLQueryTrigger); @@ -44,7 +44,7 @@ export class TextBasedLanguagesPlugin implements Plugin<{}, void> { public start( core: CoreStart, - { dataViews, expressions, data, uiActions }: TextBasedLanguagesPluginStart + { dataViews, expressions, data, uiActions }: EsqlPluginStart ): void { const appendESQLAction = new UpdateESQLQueryAction(data); uiActions.addTriggerAction(UPDATE_ESQL_QUERY_TRIGGER, appendESQLAction); diff --git a/src/plugins/text_based_languages/public/triggers/index.ts b/src/plugins/esql/public/triggers/index.ts similarity index 100% rename from src/plugins/text_based_languages/public/triggers/index.ts rename to src/plugins/esql/public/triggers/index.ts diff --git a/src/plugins/text_based_languages/public/triggers/update_esql_query_actions.test.ts b/src/plugins/esql/public/triggers/update_esql_query_actions.test.ts similarity index 100% rename from src/plugins/text_based_languages/public/triggers/update_esql_query_actions.test.ts rename to src/plugins/esql/public/triggers/update_esql_query_actions.test.ts diff --git a/src/plugins/text_based_languages/public/triggers/update_esql_query_actions.ts b/src/plugins/esql/public/triggers/update_esql_query_actions.ts similarity index 95% rename from src/plugins/text_based_languages/public/triggers/update_esql_query_actions.ts rename to src/plugins/esql/public/triggers/update_esql_query_actions.ts index 4aa7b015b366b..798ac803d3e3b 100644 --- a/src/plugins/text_based_languages/public/triggers/update_esql_query_actions.ts +++ b/src/plugins/esql/public/triggers/update_esql_query_actions.ts @@ -25,7 +25,7 @@ export class UpdateESQLQueryAction implements Action { constructor(protected readonly data: DataPublicPluginStart) {} public getDisplayName(): string { - return i18n.translate('textBasedLanguages.updateESQLQueryLabel', { + return i18n.translate('esql.updateESQLQueryLabel', { defaultMessage: 'Update the ES|QL query in the editor', }); } diff --git a/src/plugins/text_based_languages/public/triggers/update_esql_query_helpers.ts b/src/plugins/esql/public/triggers/update_esql_query_helpers.ts similarity index 100% rename from src/plugins/text_based_languages/public/triggers/update_esql_query_helpers.ts rename to src/plugins/esql/public/triggers/update_esql_query_helpers.ts diff --git a/src/plugins/text_based_languages/public/triggers/update_esql_query_trigger.ts b/src/plugins/esql/public/triggers/update_esql_query_trigger.ts similarity index 80% rename from src/plugins/text_based_languages/public/triggers/update_esql_query_trigger.ts rename to src/plugins/esql/public/triggers/update_esql_query_trigger.ts index 13164647607ef..79feddcd42c0c 100644 --- a/src/plugins/text_based_languages/public/triggers/update_esql_query_trigger.ts +++ b/src/plugins/esql/public/triggers/update_esql_query_trigger.ts @@ -13,10 +13,10 @@ export const UPDATE_ESQL_QUERY_TRIGGER = 'UPDATE_ESQL_QUERY_TRIGGER'; export const updateESQLQueryTrigger: Trigger = { id: UPDATE_ESQL_QUERY_TRIGGER, - title: i18n.translate('textBasedLanguages.triggers.updateEsqlQueryTrigger', { + title: i18n.translate('esql.triggers.updateEsqlQueryTrigger', { defaultMessage: 'Update ES|QL query', }), - description: i18n.translate('textBasedLanguages.triggers.updateEsqlQueryTriggerDescription', { + description: i18n.translate('esql.triggers.updateEsqlQueryTriggerDescription', { defaultMessage: 'Update ES|QL query with a new one', }), }; diff --git a/src/plugins/text_based_languages/public/types.ts b/src/plugins/esql/public/types.ts similarity index 90% rename from src/plugins/text_based_languages/public/types.ts rename to src/plugins/esql/public/types.ts index c2dd5249d3d19..ef28bddc3c458 100644 --- a/src/plugins/text_based_languages/public/types.ts +++ b/src/plugins/esql/public/types.ts @@ -7,6 +7,6 @@ */ import { TextBasedLanguagesEditorProps } from '@kbn/text-based-editor'; -export interface TextBasedLanguagesPluginStart { +export interface EsqlPluginStart { Editor: React.ComponentType; } diff --git a/src/plugins/text_based_languages/server/index.ts b/src/plugins/esql/server/index.ts similarity index 76% rename from src/plugins/text_based_languages/server/index.ts rename to src/plugins/esql/server/index.ts index bca404b161bf8..fa0a0cec5bdbe 100644 --- a/src/plugins/text_based_languages/server/index.ts +++ b/src/plugins/esql/server/index.ts @@ -7,6 +7,6 @@ */ export const plugin = async () => { - const { TextBasedLanguagesServerPlugin } = await import('./plugin'); - return new TextBasedLanguagesServerPlugin(); + const { EsqlServerPlugin } = await import('./plugin'); + return new EsqlServerPlugin(); }; diff --git a/src/plugins/text_based_languages/server/plugin.ts b/src/plugins/esql/server/plugin.ts similarity index 91% rename from src/plugins/text_based_languages/server/plugin.ts rename to src/plugins/esql/server/plugin.ts index 95a341a467cc5..416c1dacc04e5 100644 --- a/src/plugins/text_based_languages/server/plugin.ts +++ b/src/plugins/esql/server/plugin.ts @@ -9,7 +9,7 @@ import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/server'; import { getUiSettings } from './ui_settings'; -export class TextBasedLanguagesServerPlugin implements Plugin { +export class EsqlServerPlugin implements Plugin { public setup(core: CoreSetup) { core.uiSettings.register(getUiSettings()); return {}; diff --git a/src/plugins/text_based_languages/server/ui_settings.ts b/src/plugins/esql/server/ui_settings.ts similarity index 82% rename from src/plugins/text_based_languages/server/ui_settings.ts rename to src/plugins/esql/server/ui_settings.ts index 32717b0d2cb8c..9c43fdf55cc25 100644 --- a/src/plugins/text_based_languages/server/ui_settings.ts +++ b/src/plugins/esql/server/ui_settings.ts @@ -14,17 +14,17 @@ import { ENABLE_ESQL } from '@kbn/esql-utils'; export const getUiSettings: () => Record = () => ({ [ENABLE_ESQL]: { - name: i18n.translate('textBasedLanguages.advancedSettings.enableESQLTitle', { + name: i18n.translate('esql.advancedSettings.enableESQLTitle', { defaultMessage: 'Enable ES|QL', }), value: true, - description: i18n.translate('textBasedLanguages.advancedSettings.enableESQLDescription', { + description: i18n.translate('esql.advancedSettings.enableESQLDescription', { defaultMessage: 'This setting enables ES|QL in Kibana. By switching it off you will hide the ES|QL user interface from various applications. However, users will be able to access existing ES|QL saved searches, visualizations, etc. If you have feedback on this experience please reach out to us on {link}', values: { link: `` + - i18n.translate('textBasedLanguages.advancedSettings.enableESQL.discussLinkText', { + i18n.translate('esql.advancedSettings.enableESQL.discussLinkText', { defaultMessage: 'https://ela.st/esql-feedback', }) + '', diff --git a/src/plugins/text_based_languages/tsconfig.json b/src/plugins/esql/tsconfig.json similarity index 100% rename from src/plugins/text_based_languages/tsconfig.json rename to src/plugins/esql/tsconfig.json diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts index 4ffe9d483a1a4..8d6343337f152 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts @@ -135,7 +135,7 @@ export const applicationUsageSchema = { canvas: commonSchema, enterpriseSearch: commonSchema, enterpriseSearchContent: commonSchema, - enterpriseSearchInferenceEndpoints: commonSchema, + enterpriseSearchRelevance: commonSchema, enterpriseSearchAnalytics: commonSchema, enterpriseSearchApplications: commonSchema, enterpriseSearchAISearch: commonSchema, diff --git a/src/plugins/kibana_usage_collection/server/collectors/common/__fixtures__/counters_saved_objects.ts b/src/plugins/kibana_usage_collection/server/collectors/common/__fixtures__/counters_saved_objects.ts new file mode 100644 index 0000000000000..cf9e9c361117a --- /dev/null +++ b/src/plugins/kibana_usage_collection/server/collectors/common/__fixtures__/counters_saved_objects.ts @@ -0,0 +1,166 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { UsageCountersSavedObject } from '@kbn/usage-collection-plugin/server'; + +export const rawServerCounters: UsageCountersSavedObject[] = [ + { + type: 'usage-counter', + id: 'myApp:my_event:count:server:20210409', + attributes: { + domainId: 'myApp', + counterName: 'my_event', + counterType: 'count', + source: 'server', + count: 1, + }, + references: [], + coreMigrationVersion: '8.0.0', + updated_at: '2021-04-09T08:17:57.693Z', + }, + { + type: 'usage-counter', + id: 'Kibana_home:intersecting_event:loaded:server:20201023', + attributes: { + domainId: 'Kibana_home', + counterName: 'intersecting_event', + counterType: 'loaded', + source: 'server', + count: 60, + }, + references: [], + coreMigrationVersion: '8.0.0', + updated_at: '2020-10-23T11:27:57.067Z', + }, + { + type: 'usage-counter', + id: 'myApp:my_event_4457914848544:count:server:20210409', + attributes: { + domainId: 'myApp', + counterName: 'my_event_4457914848544', + counterType: 'count', + source: 'server', + count: 0, + }, + references: [], + coreMigrationVersion: '8.0.0', + updated_at: '2021-04-09T08:18:03.030Z', + }, + { + type: 'usage-counter', + id: 'myApp:my_event_malformed:count:server:20210409', + attributes: { + domainId: 'myApp', + counterName: 'my_event_malformed', + counterType: 'count', + source: 'server', + // @ts-expect-error + count: 'malformed', + }, + references: [], + coreMigrationVersion: '8.0.0', + updated_at: '2021-04-09T08:18:03.030Z', + }, + { + type: 'usage-counter', + id: 'myApp:my_event_4457914848544_2:count:server:20210409', + attributes: { + domainId: 'myApp', + counterName: 'my_event_4457914848544_2', + counterType: 'count', + source: 'server', + count: 8, + }, + references: [], + coreMigrationVersion: '8.0.0', + updated_at: '2021-04-09T08:18:03.031Z', + }, + { + type: 'usage-counter', + id: 'myApp:only_reported_in_usage_counters:count:server:20210409', + attributes: { + domainId: 'myApp', + counterName: 'only_reported_in_usage_counters', + counterType: 'count', + source: 'server', + count: 1, + }, + references: [], + coreMigrationVersion: '8.0.0', + updated_at: '2021-04-09T08:18:03.031Z', + }, + { + type: 'usage-counter', + id: 'myApp:namespaced_counter:count:server:20240627:first', + namespaces: ['first'], + attributes: { + domainId: 'myApp', + counterName: 'namespaced_counter', + counterType: 'count', + source: 'server', + count: 1, + }, + references: [], + coreMigrationVersion: '8.0.0', + updated_at: '2024-06-27T08:18:03.031Z', + }, + { + type: 'usage-counter', + id: 'myApp:namespaced_counter:count:server:20240627:second', + namespaces: ['second'], + attributes: { + domainId: 'myApp', + counterName: 'namespaced_counter', + counterType: 'count', + source: 'server', + count: 2, + }, + references: [], + coreMigrationVersion: '8.0.0', + updated_at: '2024-06-27T09:18:03.031Z', + }, + { + type: 'usage-counter', + id: 'myApp:namespaced_counter:count:server:20240627:third', + namespaces: ['third'], + attributes: { + domainId: 'myApp', + counterName: 'namespaced_counter', + counterType: 'count', + source: 'server', + count: 3, + }, + references: [], + coreMigrationVersion: '8.0.0', + updated_at: '2024-06-27T10:18:03.031Z', + }, + { + type: 'usage-counter', + id: 'myApp:namespaced_counter:count:server:20240627:default', + namespaces: ['default'], + attributes: { + domainId: 'myApp', + counterName: 'namespaced_counter', + counterType: 'count', + source: 'server', + count: 10, + }, + references: [], + coreMigrationVersion: '8.0.0', + updated_at: '2024-06-27T11:18:03.031Z', + }, +]; + +export const rawUiCounters: UsageCountersSavedObject[] = rawServerCounters.map((counter) => ({ + ...counter, + id: counter.id.replace(':server:', ':ui:'), + attributes: { + ...counter.attributes, + source: 'ui', + }, +})); diff --git a/src/plugins/kibana_usage_collection/server/collectors/common/counters.test.ts b/src/plugins/kibana_usage_collection/server/collectors/common/counters.test.ts new file mode 100644 index 0000000000000..dfc701cfa555a --- /dev/null +++ b/src/plugins/kibana_usage_collection/server/collectors/common/counters.test.ts @@ -0,0 +1,188 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { loggingSystemMock, savedObjectsClientMock } from '@kbn/core/server/mocks'; +import { transformRawCounter, createCounterFetcher } from './counters'; +import { rawServerCounters, rawUiCounters } from './__fixtures__/counters_saved_objects'; + +const mockLogger = loggingSystemMock.create(); + +describe('transformRawCounter', () => { + it('transforms usage counters savedObject raw entries', () => { + const result = rawServerCounters.map(transformRawCounter); + expect(result).toMatchInlineSnapshot(` + Array [ + Object { + "counterName": "my_event", + "counterType": "count", + "domainId": "myApp", + "fromTimestamp": "2021-04-09T00:00:00Z", + "lastUpdatedAt": "2021-04-09T08:17:57.693Z", + "total": 1, + }, + Object { + "counterName": "intersecting_event", + "counterType": "loaded", + "domainId": "Kibana_home", + "fromTimestamp": "2020-10-23T00:00:00Z", + "lastUpdatedAt": "2020-10-23T11:27:57.067Z", + "total": 60, + }, + undefined, + undefined, + Object { + "counterName": "my_event_4457914848544_2", + "counterType": "count", + "domainId": "myApp", + "fromTimestamp": "2021-04-09T00:00:00Z", + "lastUpdatedAt": "2021-04-09T08:18:03.031Z", + "total": 8, + }, + Object { + "counterName": "only_reported_in_usage_counters", + "counterType": "count", + "domainId": "myApp", + "fromTimestamp": "2021-04-09T00:00:00Z", + "lastUpdatedAt": "2021-04-09T08:18:03.031Z", + "total": 1, + }, + Object { + "counterName": "namespaced_counter", + "counterType": "count", + "domainId": "myApp", + "fromTimestamp": "2024-06-27T00:00:00Z", + "lastUpdatedAt": "2024-06-27T08:18:03.031Z", + "total": 1, + }, + Object { + "counterName": "namespaced_counter", + "counterType": "count", + "domainId": "myApp", + "fromTimestamp": "2024-06-27T00:00:00Z", + "lastUpdatedAt": "2024-06-27T09:18:03.031Z", + "total": 2, + }, + Object { + "counterName": "namespaced_counter", + "counterType": "count", + "domainId": "myApp", + "fromTimestamp": "2024-06-27T00:00:00Z", + "lastUpdatedAt": "2024-06-27T10:18:03.031Z", + "total": 3, + }, + Object { + "counterName": "namespaced_counter", + "counterType": "count", + "domainId": "myApp", + "fromTimestamp": "2024-06-27T00:00:00Z", + "lastUpdatedAt": "2024-06-27T11:18:03.031Z", + "total": 10, + }, + ] + `); + }); +}); + +describe('createCounterFetcher', () => { + const soClientMock = savedObjectsClientMock.create(); + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('returns saved objects only from a given source', async () => { + // @ts-expect-error incomplete mock implementation + soClientMock.find.mockImplementation(async ({ type, filter }) => { + if (type !== 'usage-counter') { + throw new Error(`unexpected type ${type}`); + } + + if (filter === 'counter.attributes.source: server') { + return { saved_objects: rawServerCounters }; + } else if (filter === 'counter.attributes.source: ui') { + return { saved_objects: rawUiCounters }; + } + + throw new Error(`unexpected filter ${filter}`); + }); + + const fetch = createCounterFetcher( + mockLogger.get(), + 'counter.attributes.source: server', + (dailyEvents) => ({ + dailyEvents, + }) + ); + // @ts-expect-error incomplete mock implementation + const { dailyEvents } = await fetch({ soClient: soClientMock }); + expect(dailyEvents).toHaveLength(5); + const intersectingEntry = dailyEvents.find( + ({ counterName, fromTimestamp }) => + counterName === 'intersecting_event' && fromTimestamp === '2020-10-23T00:00:00Z' + ); + + const onlyFromUICountersEntry = dailyEvents.find( + ({ counterName }) => counterName === 'only_reported_in_ui_counters' + ); + + const onlyFromUsageCountersEntry = dailyEvents.find( + ({ counterName }) => counterName === 'only_reported_in_usage_counters' + ); + + const invalidCountEntry = dailyEvents.find( + ({ counterName }) => counterName === 'my_event_malformed' + ); + + const zeroCountEntry = dailyEvents.find( + ({ counterName }) => counterName === 'my_event_4457914848544' + ); + + const nonUiCountersEntry = dailyEvents.find( + ({ counterName }) => counterName === 'some_event_name' + ); + + const namespacedCounterEntry = dailyEvents.find( + ({ counterName }) => counterName === 'namespaced_counter' + ); + + expect(invalidCountEntry).toBe(undefined); + expect(nonUiCountersEntry).toBe(undefined); + expect(zeroCountEntry).toBe(undefined); + expect(onlyFromUICountersEntry).toBe(undefined); + expect(onlyFromUsageCountersEntry).toMatchInlineSnapshot(` + Object { + "counterName": "only_reported_in_usage_counters", + "counterType": "count", + "domainId": "myApp", + "fromTimestamp": "2021-04-09T00:00:00Z", + "lastUpdatedAt": "2021-04-09T08:18:03.031Z", + "total": 1, + } + `); + expect(intersectingEntry).toMatchInlineSnapshot(` + Object { + "counterName": "intersecting_event", + "counterType": "loaded", + "domainId": "Kibana_home", + "fromTimestamp": "2020-10-23T00:00:00Z", + "lastUpdatedAt": "2020-10-23T11:27:57.067Z", + "total": 60, + } + `); + // we sum counters from all namespaces: 1 + 2 + 3 + 10 + expect(namespacedCounterEntry).toMatchInlineSnapshot(` + Object { + "counterName": "namespaced_counter", + "counterType": "count", + "domainId": "myApp", + "fromTimestamp": "2024-06-27T00:00:00Z", + "lastUpdatedAt": "2024-06-27T11:18:03.031Z", + "total": 16, + } + `); + }); +}); diff --git a/src/plugins/kibana_usage_collection/server/collectors/common/counters.ts b/src/plugins/kibana_usage_collection/server/collectors/common/counters.ts new file mode 100644 index 0000000000000..f20e57ab47664 --- /dev/null +++ b/src/plugins/kibana_usage_collection/server/collectors/common/counters.ts @@ -0,0 +1,102 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import moment from 'moment'; +import { Logger } from '@kbn/logging'; +import { + CollectorFetchContext, + UsageCountersSavedObject, + UsageCountersSavedObjectAttributes, + USAGE_COUNTERS_SAVED_OBJECT_TYPE, +} from '@kbn/usage-collection-plugin/server'; + +export interface CounterEvent { + domainId: string; + counterName: string; + counterType: string; + lastUpdatedAt: string; + fromTimestamp: string; + total: number; +} + +export function createCounterFetcher( + logger: Logger, + filter: string, + transform: (counters: CounterEvent[]) => T +) { + return async ({ soClient }: CollectorFetchContext) => { + const finder = soClient.createPointInTimeFinder({ + type: USAGE_COUNTERS_SAVED_OBJECT_TYPE, + namespaces: ['*'], + fields: ['count', 'counterName', 'counterType', 'domainId'], + filter, + perPage: 100, + }); + + const dailyEvents: CounterEvent[] = []; + + for await (const { saved_objects: rawUsageCounters } of finder.find()) { + rawUsageCounters.forEach((raw) => { + try { + const event = transformRawCounter(raw); + if (event) { + dailyEvents.push(event); + } + } catch (err) { + // swallow error; allows sending successfully transformed objects. + logger.debug('Error collecting usage-counter details: ' + err.message); + } + }); + } + + return transform(mergeCounters(dailyEvents)); + }; +} + +export function transformRawCounter( + rawCounter: UsageCountersSavedObject +): CounterEvent | undefined { + const { + attributes: { domainId, counterType, counterName, count }, + updated_at: lastUpdatedAt, + } = rawCounter; + + if (typeof count !== 'number' || count < 1) { + return; + } + + const fromTimestamp = moment(lastUpdatedAt).utc().startOf('day').format(); + + return { + domainId, + counterType, + counterName, + lastUpdatedAt: lastUpdatedAt!, + fromTimestamp, + total: count, + }; +} + +function mergeCounters(counters: CounterEvent[]): CounterEvent[] { + const mergedCounters = counters.reduce((acc, counter) => { + const { domainId, counterType, counterName, fromTimestamp } = counter; + const key = `${domainId}:${counterType}:${counterName}:${fromTimestamp}`; + + const existingCounter = acc[key]; + if (!existingCounter) { + acc[key] = counter; + return acc; + } else { + acc[key].total = existingCounter.total + counter.total; + acc[key].lastUpdatedAt = counter.lastUpdatedAt; + } + return acc; + }, {} as Record); + + return Object.values(mergedCounters); +} diff --git a/src/plugins/kibana_usage_collection/server/collectors/common/saved_objects.test.ts b/src/plugins/kibana_usage_collection/server/collectors/common/saved_objects.test.ts new file mode 100644 index 0000000000000..173f332c9f391 --- /dev/null +++ b/src/plugins/kibana_usage_collection/server/collectors/common/saved_objects.test.ts @@ -0,0 +1,76 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import moment from 'moment'; +import type { SavedObjectsFindResult } from '@kbn/core/server'; +import { + type UsageCountersSavedObjectAttributes, + USAGE_COUNTERS_SAVED_OBJECT_TYPE, +} from '@kbn/usage-collection-plugin/server'; + +import { isSavedObjectOlderThan } from './saved_objects'; + +export const createMockSavedObjectDoc = ( + updatedAt: moment.Moment, + id: string, + namespace?: string +) => + ({ + id, + type: USAGE_COUNTERS_SAVED_OBJECT_TYPE, + ...(namespace && { namespaces: [namespace] }), + attributes: { + count: 3, + counterName: 'testName', + counterType: 'count', + domainId: 'testDomain', + source: 'server', + }, + references: [], + updated_at: updatedAt.format(), + version: 'WzI5LDFd', + score: 0, + } as SavedObjectsFindResult); + +describe('isSavedObjectOlderThan', () => { + it(`returns true if doc is older than x days`, () => { + const numberOfDays = 1; + const startDate = moment().format(); + const doc = createMockSavedObjectDoc(moment().subtract(2, 'days'), 'some-id'); + const result = isSavedObjectOlderThan({ + numberOfDays, + startDate, + doc, + }); + expect(result).toBe(true); + }); + + it(`returns false if doc is exactly x days old`, () => { + const numberOfDays = 1; + const startDate = moment().format(); + const doc = createMockSavedObjectDoc(moment().subtract(1, 'days'), 'some-id'); + const result = isSavedObjectOlderThan({ + numberOfDays, + startDate, + doc, + }); + expect(result).toBe(false); + }); + + it(`returns false if doc is younger than x days`, () => { + const numberOfDays = 2; + const startDate = moment().format(); + const doc = createMockSavedObjectDoc(moment().subtract(1, 'days'), 'some-id'); + const result = isSavedObjectOlderThan({ + numberOfDays, + startDate, + doc, + }); + expect(result).toBe(false); + }); +}); diff --git a/src/plugins/kibana_usage_collection/server/collectors/common/saved_objects.ts b/src/plugins/kibana_usage_collection/server/collectors/common/saved_objects.ts new file mode 100644 index 0000000000000..7b42b528b266b --- /dev/null +++ b/src/plugins/kibana_usage_collection/server/collectors/common/saved_objects.ts @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import moment from 'moment'; +import { SavedObject } from '@kbn/core-saved-objects-api-server'; + +export function isSavedObjectOlderThan({ + numberOfDays, + startDate, + doc, +}: { + numberOfDays: number; + startDate: moment.Moment | string | number; + doc: Pick; +}): boolean { + const { updated_at: updatedAt } = doc; + const today = moment(startDate).startOf('day'); + const updateDay = moment(updatedAt).startOf('day'); + + const diffInDays = today.diff(updateDay, 'days'); + if (diffInDays > numberOfDays) { + return true; + } + + return false; +} diff --git a/src/plugins/kibana_usage_collection/server/collectors/ui_counters/__fixtures__/usage_counter_saved_objects.ts b/src/plugins/kibana_usage_collection/server/collectors/ui_counters/__fixtures__/usage_counter_saved_objects.ts deleted file mode 100644 index 4516e5174d402..0000000000000 --- a/src/plugins/kibana_usage_collection/server/collectors/ui_counters/__fixtures__/usage_counter_saved_objects.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { UsageCountersSavedObject } from '@kbn/usage-collection-plugin/server'; - -export const rawUsageCounters: UsageCountersSavedObject[] = [ - { - type: 'usage-counters', - id: 'uiCounter:09042021:count:myApp:my_event', - attributes: { - count: 1, - counterName: 'myApp:my_event', - counterType: 'count', - domainId: 'uiCounter', - }, - references: [], - coreMigrationVersion: '8.0.0', - updated_at: '2021-04-09T08:17:57.693Z', - }, - { - type: 'usage-counters', - id: 'uiCounter:23102020:loaded:Kibana_home:intersecting_event', - attributes: { - count: 60, - counterName: 'Kibana_home:intersecting_event', - counterType: 'loaded', - domainId: 'uiCounter', - }, - references: [], - coreMigrationVersion: '8.0.0', - updated_at: '2020-10-23T11:27:57.067Z', - }, - { - type: 'usage-counters', - id: 'uiCounter:09042021:count:myApp:my_event_4457914848544', - attributes: { - count: 0, - counterName: 'myApp:my_event_4457914848544', - counterType: 'count', - domainId: 'uiCounter', - }, - references: [], - coreMigrationVersion: '8.0.0', - updated_at: '2021-04-09T08:18:03.030Z', - }, - { - type: 'usage-counters', - id: 'uiCounter:09042021:count:myApp:my_event_malformed', - attributes: { - // @ts-expect-error - count: 'malformed', - counterName: 'myApp:my_event_malformed', - counterType: 'count', - domainId: 'uiCounter', - }, - references: [], - coreMigrationVersion: '8.0.0', - updated_at: '2021-04-09T08:18:03.030Z', - }, - { - type: 'usage-counters', - id: 'anotherDomainId:09042021:count:some_event_name', - attributes: { - count: 4, - counterName: 'some_event_name', - counterType: 'count', - domainId: 'anotherDomainId', - }, - references: [], - coreMigrationVersion: '8.0.0', - updated_at: '2021-04-09T08:18:03.030Z', - }, - { - type: 'usage-counters', - id: 'uiCounter:09042021:count:myApp:my_event_4457914848544_2', - attributes: { - count: 8, - counterName: 'myApp:my_event_4457914848544_2', - counterType: 'count', - domainId: 'uiCounter', - }, - references: [], - coreMigrationVersion: '8.0.0', - updated_at: '2021-04-09T08:18:03.031Z', - }, - { - type: 'usage-counters', - id: 'uiCounter:09042021:count:myApp:only_reported_in_usage_counters', - attributes: { - count: 1, - counterName: 'myApp:only_reported_in_usage_counters', - counterType: 'count', - domainId: 'uiCounter', - }, - references: [], - coreMigrationVersion: '8.0.0', - updated_at: '2021-04-09T08:18:03.031Z', - }, -]; diff --git a/src/plugins/kibana_usage_collection/server/collectors/ui_counters/register_ui_counters_collector.test.ts b/src/plugins/kibana_usage_collection/server/collectors/ui_counters/register_ui_counters_collector.test.ts index 0e84df3325d3d..6d35f5baf4046 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/ui_counters/register_ui_counters_collector.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/ui_counters/register_ui_counters_collector.test.ts @@ -6,124 +6,49 @@ * Side Public License, v 1. */ -import { transformRawUsageCounterObject, fetchUiCounters } from './register_ui_counters_collector'; -import { rawUsageCounters } from './__fixtures__/usage_counter_saved_objects'; -import { savedObjectsClientMock } from '@kbn/core/server/mocks'; -import { USAGE_COUNTERS_SAVED_OBJECT_TYPE } from '@kbn/usage-collection-plugin/server'; - -describe('transformRawUsageCounterObject', () => { - it('transforms usage counters savedObject raw entries', () => { - const result = rawUsageCounters.map(transformRawUsageCounterObject); - expect(result).toMatchInlineSnapshot(` - Array [ - Object { - "appName": "myApp", - "counterType": "count", - "eventName": "my_event", - "fromTimestamp": "2021-04-09T00:00:00Z", - "lastUpdatedAt": "2021-04-09T08:17:57.693Z", - "total": 1, - }, - Object { - "appName": "Kibana_home", - "counterType": "loaded", - "eventName": "intersecting_event", - "fromTimestamp": "2020-10-23T00:00:00Z", - "lastUpdatedAt": "2020-10-23T11:27:57.067Z", - "total": 60, +import type { CounterEvent } from '../common/counters'; +import { toDailyEvents } from './register_ui_counters_collector'; + +describe('toDailyEvents', () => { + it('adapts counter events to have the expected UI properties', () => { + const counters: CounterEvent[] = [ + { + domainId: 'dashboards', + counterType: 'loaded', + counterName: 'lens', + lastUpdatedAt: '2024-06-19T12:03:25.795Z', + fromTimestamp: '2024-06-19T00:00:00Z', + total: 18, + }, + { + domainId: 'dashboards', + counterType: 'updated', + counterName: 'lens', + lastUpdatedAt: '2024-06-19T14:13:25.795Z', + fromTimestamp: '2024-06-19T00:00:00Z', + total: 4, + }, + ]; + + expect(toDailyEvents(counters)).toEqual({ + dailyEvents: [ + { + appName: 'dashboards', + counterType: 'loaded', + eventName: 'lens', + lastUpdatedAt: '2024-06-19T12:03:25.795Z', + fromTimestamp: '2024-06-19T00:00:00Z', + total: 18, }, - undefined, - undefined, - undefined, - Object { - "appName": "myApp", - "counterType": "count", - "eventName": "my_event_4457914848544_2", - "fromTimestamp": "2021-04-09T00:00:00Z", - "lastUpdatedAt": "2021-04-09T08:18:03.031Z", - "total": 8, + { + appName: 'dashboards', + counterType: 'updated', + eventName: 'lens', + lastUpdatedAt: '2024-06-19T14:13:25.795Z', + fromTimestamp: '2024-06-19T00:00:00Z', + total: 4, }, - Object { - "appName": "myApp", - "counterType": "count", - "eventName": "only_reported_in_usage_counters", - "fromTimestamp": "2021-04-09T00:00:00Z", - "lastUpdatedAt": "2021-04-09T08:18:03.031Z", - "total": 1, - }, - ] - `); - }); -}); - -describe('fetchUiCounters', () => { - const soClientMock = savedObjectsClientMock.create(); - beforeEach(() => { - jest.clearAllMocks(); - }); - - it('returns saved objects only from usage_counters saved objects', async () => { - // @ts-expect-error incomplete mock implementation - soClientMock.find.mockImplementation(async ({ type }) => { - switch (type) { - case USAGE_COUNTERS_SAVED_OBJECT_TYPE: - return { saved_objects: rawUsageCounters }; - default: - throw new Error(`unexpected type ${type}`); - } + ], }); - - // @ts-expect-error incomplete mock implementation - const { dailyEvents } = await fetchUiCounters({ - soClient: soClientMock, - }); - expect(dailyEvents).toHaveLength(4); - const intersectingEntry = dailyEvents.find( - ({ eventName, fromTimestamp }) => - eventName === 'intersecting_event' && fromTimestamp === '2020-10-23T00:00:00Z' - ); - - const onlyFromUICountersEntry = dailyEvents.find( - ({ eventName }) => eventName === 'only_reported_in_ui_counters' - ); - - const onlyFromUsageCountersEntry = dailyEvents.find( - ({ eventName }) => eventName === 'only_reported_in_usage_counters' - ); - - const invalidCountEntry = dailyEvents.find( - ({ eventName }) => eventName === 'my_event_malformed' - ); - - const zeroCountEntry = dailyEvents.find( - ({ eventName }) => eventName === 'my_event_4457914848544' - ); - - const nonUiCountersEntry = dailyEvents.find(({ eventName }) => eventName === 'some_event_name'); - - expect(invalidCountEntry).toBe(undefined); - expect(nonUiCountersEntry).toBe(undefined); - expect(zeroCountEntry).toBe(undefined); - expect(onlyFromUICountersEntry).toBe(undefined); - expect(onlyFromUsageCountersEntry).toMatchInlineSnapshot(` - Object { - "appName": "myApp", - "counterType": "count", - "eventName": "only_reported_in_usage_counters", - "fromTimestamp": "2021-04-09T00:00:00Z", - "lastUpdatedAt": "2021-04-09T08:18:03.031Z", - "total": 1, - } - `); - expect(intersectingEntry).toMatchInlineSnapshot(` - Object { - "appName": "Kibana_home", - "counterType": "loaded", - "eventName": "intersecting_event", - "fromTimestamp": "2020-10-23T00:00:00Z", - "lastUpdatedAt": "2020-10-23T11:27:57.067Z", - "total": 60, - } - `); }); }); diff --git a/src/plugins/kibana_usage_collection/server/collectors/ui_counters/register_ui_counters_collector.ts b/src/plugins/kibana_usage_collection/server/collectors/ui_counters/register_ui_counters_collector.ts index 77212225cc14c..024d3b7a9f562 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/ui_counters/register_ui_counters_collector.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/ui_counters/register_ui_counters_collector.ts @@ -6,24 +6,20 @@ * Side Public License, v 1. */ -import moment from 'moment'; - +import type { Logger } from '@kbn/logging'; +import { UsageCounters } from '@kbn/usage-collection-plugin/common'; import { - CollectorFetchContext, - UsageCollectionSetup, + type UsageCollectionSetup, USAGE_COUNTERS_SAVED_OBJECT_TYPE, - UsageCountersSavedObject, - UsageCountersSavedObjectAttributes, } from '@kbn/usage-collection-plugin/server'; - -import { deserializeUiCounterName } from '@kbn/usage-collection-plugin/common/ui_counters'; +import { type CounterEvent, createCounterFetcher } from '../common/counters'; interface UiCounterEvent { appName: string; eventName: string; - lastUpdatedAt?: string; - fromTimestamp?: string; counterType: string; + lastUpdatedAt: string; + fromTimestamp: string; total: number; } @@ -31,58 +27,13 @@ export interface UiUsageCounters { dailyEvents: UiCounterEvent[]; } -export function transformRawUsageCounterObject( - rawUsageCounter: UsageCountersSavedObject -): UiCounterEvent | undefined { - const { - attributes: { count, counterName, counterType, domainId }, - updated_at: lastUpdatedAt, - } = rawUsageCounter; - - if (domainId !== 'uiCounter' || typeof count !== 'number' || count < 1) { - return; - } - - const fromTimestamp = moment(lastUpdatedAt).utc().startOf('day').format(); - const { appName, eventName } = deserializeUiCounterName(counterName); - - return { - appName, - eventName, - lastUpdatedAt, - fromTimestamp, - counterType, - total: count, - }; -} - -export async function fetchUiCounters({ soClient }: CollectorFetchContext) { - const finder = soClient.createPointInTimeFinder({ - type: USAGE_COUNTERS_SAVED_OBJECT_TYPE, - fields: ['count', 'counterName', 'counterType', 'domainId'], - filter: `${USAGE_COUNTERS_SAVED_OBJECT_TYPE}.attributes.domainId: uiCounter`, - perPage: 1000, - }); - - const dailyEvents: UiCounterEvent[] = []; - - for await (const { saved_objects: rawUsageCounters } of finder.find()) { - rawUsageCounters.forEach((raw) => { - try { - const event = transformRawUsageCounterObject(raw); - if (event) { - dailyEvents.push(event); - } - } catch (_) { - // swallow error; allows sending successfully transformed objects. - } - }); - } +const UI: UsageCounters.v1.CounterEventSource = 'ui'; +const UI_COUNTERS_FILTER = `${USAGE_COUNTERS_SAVED_OBJECT_TYPE}.attributes.source: ${UI}`; - return { dailyEvents }; -} - -export function registerUiCountersUsageCollector(usageCollection: UsageCollectionSetup) { +export function registerUiCountersUsageCollector( + usageCollection: UsageCollectionSetup, + logger: Logger +) { const collector = usageCollection.makeUsageCollector({ type: 'ui_counters', schema: { @@ -105,7 +56,10 @@ export function registerUiCountersUsageCollector(usageCollection: UsageCollectio type: 'date', _meta: { description: 'Time at which the metric was captured.' }, }, - counterType: { type: 'keyword', _meta: { description: 'The type of counter used.' } }, + counterType: { + type: 'keyword', + _meta: { description: 'The type of counter used.' }, + }, total: { type: 'integer', _meta: { description: 'The total number of times the event happened.' }, @@ -113,9 +67,24 @@ export function registerUiCountersUsageCollector(usageCollection: UsageCollectio }, }, }, - fetch: fetchUiCounters, + fetch: createCounterFetcher(logger, UI_COUNTERS_FILTER, toDailyEvents), isReady: () => true, }); usageCollection.registerCollector(collector); } + +export function toDailyEvents(counters: CounterEvent[]) { + return { + dailyEvents: counters.map(toUiCounter), + }; +} + +function toUiCounter(counter: CounterEvent): UiCounterEvent { + const { domainId: appName, counterName: eventName, ...props } = counter; + return { + appName, + eventName, + ...props, + }; +} diff --git a/src/plugins/kibana_usage_collection/server/collectors/usage_counters/__fixtures__/usage_counter_saved_objects.ts b/src/plugins/kibana_usage_collection/server/collectors/usage_counters/__fixtures__/usage_counter_saved_objects.ts deleted file mode 100644 index 344d36542646d..0000000000000 --- a/src/plugins/kibana_usage_collection/server/collectors/usage_counters/__fixtures__/usage_counter_saved_objects.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { UsageCountersSavedObject } from '@kbn/usage-collection-plugin/server'; - -export const rawUsageCounters: UsageCountersSavedObject[] = [ - { - type: 'usage-counters', - id: 'uiCounter:09042021:count:myApp:my_event', - attributes: { - count: 13, - counterName: 'my_event', - counterType: 'count', - domainId: 'uiCounter', - }, - references: [], - coreMigrationVersion: '8.0.0', - updated_at: '2021-04-09T08:18:03.030Z', - }, - { - type: 'usage-counters', - id: 'anotherDomainId:09042021:count:some_event_name', - attributes: { - count: 4, - counterName: 'some_event_name', - counterType: 'count', - domainId: 'anotherDomainId', - }, - references: [], - coreMigrationVersion: '8.0.0', - updated_at: '2021-04-09T08:18:03.030Z', - }, - { - type: 'usage-counters', - id: 'anotherDomainId:09042021:count:some_event_name', - attributes: { - count: 4, - counterName: 'some_event_name', - counterType: 'count', - domainId: 'anotherDomainId', - }, - references: [], - coreMigrationVersion: '8.0.0', - updated_at: '2021-04-11T08:18:03.030Z', - }, - { - type: 'usage-counters', - id: 'anotherDomainId2:09042021:count:some_event_name', - attributes: { - count: 1, - counterName: 'some_event_name', - counterType: 'count', - domainId: 'anotherDomainId2', - }, - references: [], - coreMigrationVersion: '8.0.0', - updated_at: '2021-04-20T08:18:03.030Z', - }, - { - type: 'usage-counters', - id: 'anotherDomainId2:09042021:count:malformed_event', - attributes: { - // @ts-expect-error - count: 'malformed', - counterName: 'malformed_event', - counterType: 'count', - domainId: 'anotherDomainId2', - }, - references: [], - coreMigrationVersion: '8.0.0', - updated_at: '2021-04-20T08:18:03.030Z', - }, - { - type: 'usage-counters', - id: 'anotherDomainId2:09042021:custom_type:some_event_name', - attributes: { - count: 3, - counterName: 'some_event_name', - counterType: 'custom_type', - domainId: 'anotherDomainId2', - }, - references: [], - coreMigrationVersion: '8.0.0', - updated_at: '2021-04-20T08:18:03.030Z', - }, - { - type: 'usage-counters', - id: 'anotherDomainId3:09042021:custom_type:zero_count', - attributes: { - count: 0, - counterName: 'zero_count', - counterType: 'custom_type', - domainId: 'anotherDomainId3', - }, - references: [], - coreMigrationVersion: '8.0.0', - updated_at: '2021-04-20T08:18:03.030Z', - }, -]; diff --git a/src/plugins/kibana_usage_collection/server/collectors/usage_counters/integration_tests/rollups.test.ts b/src/plugins/kibana_usage_collection/server/collectors/usage_counters/integration_tests/rollups.test.ts new file mode 100644 index 0000000000000..bde078e234fb3 --- /dev/null +++ b/src/plugins/kibana_usage_collection/server/collectors/usage_counters/integration_tests/rollups.test.ts @@ -0,0 +1,226 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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'; + +/** + * Mocking methods that are used to retrieve current time. This allows: + * 1) introducing OLD counters that can be rolled up + * 2) Removing flakiness for tests that are executed on a 2 day span (close to midnight) + * getCurrentTime => used by `SOR.incrementCounter` to determine 'updated_at' + * isSavedObjectOlderThan => used by `rollUsageCountersIndices` to determine if a counter is beyond the retention period + */ +jest.mock('@kbn/core-saved-objects-api-server-internal/src/lib/apis/utils', () => ({ + ...jest.requireActual('@kbn/core-saved-objects-api-server-internal/src/lib/apis/utils'), + getCurrentTime: jest.fn(), +})); + +jest.mock('../../common/saved_objects', () => ({ + ...jest.requireActual('../../common/saved_objects'), + isSavedObjectOlderThan: jest.fn(), +})); + +import { getCurrentTime } from '@kbn/core-saved-objects-api-server-internal/src/lib/apis/utils'; +import type { Logger, ISavedObjectsRepository, SavedObject } from '@kbn/core/server'; +import { + type TestElasticsearchUtils, + type TestKibanaUtils, + createTestServers, + createRootWithCorePlugins, +} from '@kbn/core-test-helpers-kbn-server'; + +import { + serializeCounterKey, + type UsageCountersSavedObjectAttributes, + USAGE_COUNTERS_SAVED_OBJECT_TYPE, +} from '@kbn/usage-collection-plugin/server'; +import { rollUsageCountersIndices } from '../rollups/rollups'; +import { USAGE_COUNTERS_KEEP_DOCS_FOR_DAYS } from '../rollups/constants'; +import { isSavedObjectOlderThan } from '../../common/saved_objects'; + +const getCurrentTimeMock = getCurrentTime as jest.MockedFunction; +const isSavedObjectOlderThanMock = isSavedObjectOlderThan as jest.MockedFunction< + typeof isSavedObjectOlderThan +>; + +const NOW = '2024-06-30T10:00:00.000Z'; +const OLD = moment(NOW).subtract(USAGE_COUNTERS_KEEP_DOCS_FOR_DAYS + 1, 'days'); +const RECENT = moment(NOW).subtract(USAGE_COUNTERS_KEEP_DOCS_FOR_DAYS - 1, 'days'); +const OLD_YMD = OLD.format('YYYYMMDD'); +const RECENT_YMD = RECENT.format('YYYYMMDD'); +const OLD_ISO = OLD.toISOString(); +const RECENT_ISO = RECENT.toISOString(); + +const ALL_COUNTERS = [ + `domain1:a:count:server:${OLD_YMD}:default`, + `domain1:a:count:server:${RECENT_YMD}:default`, + `domain1:b:count:server:${OLD_YMD}:one`, + `domain1:b:count:server:${OLD_YMD}:two`, + `domain1:b:count:server:${RECENT_YMD}:one`, + `domain1:b:count:server:${RECENT_YMD}:two`, + `domain2:a:count:server:${OLD_YMD}:default`, + `domain2:a:count:server:${RECENT_YMD}:default`, + `domain2:c:count:server:${RECENT_YMD}:default`, +]; + +const RECENT_COUNTERS = ALL_COUNTERS.filter((key) => key.includes(RECENT_YMD)); + +describe('usage-counters', () => { + let esServer: TestElasticsearchUtils; + let root: TestKibanaUtils['root']; + let internalRepository: ISavedObjectsRepository; + let logger: Logger; + + beforeAll(async () => { + const { startES } = createTestServers({ + adjustTimeout: (t: number) => jest.setTimeout(t), + }); + + esServer = await startES(); + root = createRootWithCorePlugins(); + + await root.preboot(); + await root.setup(); + const start = await root.start(); + + logger = root.logger.get('test daily rollups'); + internalRepository = start.savedObjects.createInternalRepository([ + USAGE_COUNTERS_SAVED_OBJECT_TYPE, + ]); + + // insert a bunch of usage counters in multiple namespaces + await createTestCounters(internalRepository); + }); + + it('deletes documents older that the retention period, from all namespaces', async () => { + // check that all documents are there + const beforeRollup = await internalRepository.find({ + type: USAGE_COUNTERS_SAVED_OBJECT_TYPE, + namespaces: ['*'], + }); + expect( + beforeRollup.saved_objects + .map(({ attributes, updated_at: updatedAt, namespaces }) => + serializeCounterKey({ ...attributes, date: updatedAt, namespace: namespaces?.[0] }) + ) + .sort() + ).toEqual(ALL_COUNTERS); + + // run the rollup logic + isSavedObjectOlderThanMock.mockImplementation(({ doc }) => doc.updated_at === OLD_ISO); + await rollUsageCountersIndices(logger, internalRepository); + + // check only recent counters are present + const afterRollup = await internalRepository.find({ + type: USAGE_COUNTERS_SAVED_OBJECT_TYPE, + namespaces: ['*'], + }); + expect( + afterRollup.saved_objects + .map(({ attributes, updated_at: updatedAt, namespaces }) => + serializeCounterKey({ ...attributes, date: updatedAt, namespace: namespaces?.[0] }) + ) + .sort() + ).toEqual(RECENT_COUNTERS); + }); + + afterAll(async () => { + await esServer.stop(); + await root.shutdown(); + }); +}); + +async function createTestCounters(internalRepository: ISavedObjectsRepository) { + await createCounters(internalRepository, OLD_ISO, [ + // domainId, counterName, counterType, source, count, namespace? + ['domain1', 'a', 'count', 'server', 28], + ['domain1', 'b', 'count', 'server', 29, 'one'], + ['domain1', 'b', 'count', 'server', 30, 'two'], + ['domain2', 'a', 'count', 'server', 31], + ]); + + await createCounters(internalRepository, RECENT_ISO, [ + // domainId, counterName, counterType, source, count, namespace? + ['domain1', 'a', 'count', 'server', 32], + ['domain1', 'b', 'count', 'server', 33, 'one'], + ['domain1', 'b', 'count', 'server', 34, 'two'], + ['domain2', 'a', 'count', 'server', 35], + ['domain2', 'c', 'count', 'server', 36], + ]); +} + +// domainId, counterName, counterType, source, count, namespace? +type CounterAttributes = [string, string, string, 'ui' | 'server', number, string?]; + +async function createCounters( + internalRepository: ISavedObjectsRepository, + isoDate: string, + countersAttributes: CounterAttributes[] +) { + // tamper SO `updated_at` + getCurrentTimeMock.mockReturnValue(isoDate); + + await Promise.all( + countersAttributes + .map((attrs) => createCounter(isoDate, ...attrs)) + .map((counter) => incrementCounter(internalRepository, counter)) + ); +} + +function createCounter( + date: string, + domainId: string, + counterName: string, + counterType: string, + source: 'server' | 'ui', + count: number, + namespace?: string +): SavedObject { + const id = serializeCounterKey({ + domainId, + counterName, + counterType, + namespace, + source, + date, + }); + return { + type: USAGE_COUNTERS_SAVED_OBJECT_TYPE, + id, + ...(namespace && { namespaces: [namespace] }), + attributes: { + domainId, + counterName, + counterType, + source, + count, + }, + references: [], + }; +} + +async function incrementCounter( + internalRepository: ISavedObjectsRepository, + counter: SavedObject +) { + const namespace = counter.namespaces?.[0]; + return await internalRepository.incrementCounter( + USAGE_COUNTERS_SAVED_OBJECT_TYPE, + counter.id, + [{ fieldName: 'count', incrementBy: counter.attributes.count }], + { + ...(namespace && { namespace }), + upsertAttributes: { + domainId: counter.attributes.domainId, + counterName: counter.attributes.counterName, + counterType: counter.attributes.counterType, + source: counter.attributes.source, + }, + } + ); +} diff --git a/src/plugins/kibana_usage_collection/server/collectors/usage_counters/register_usage_counters_collector.test.ts b/src/plugins/kibana_usage_collection/server/collectors/usage_counters/register_usage_counters_collector.test.ts index 945eb007fe23f..2412fbe2a9279 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/usage_counters/register_usage_counters_collector.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/usage_counters/register_usage_counters_collector.test.ts @@ -6,50 +6,49 @@ * Side Public License, v 1. */ -import { transformRawCounter } from './register_usage_counters_collector'; -import { rawUsageCounters } from './__fixtures__/usage_counter_saved_objects'; +import type { CounterEvent } from '../common/counters'; +import { toDailyEvents } from './register_usage_counters_collector'; -describe('transformRawCounter', () => { - it('transforms saved object raw entries', () => { - const result = rawUsageCounters.map(transformRawCounter); - expect(result).toMatchInlineSnapshot(` - Array [ - undefined, - Object { - "counterName": "some_event_name", - "counterType": "count", - "domainId": "anotherDomainId", - "fromTimestamp": "2021-04-09T00:00:00Z", - "lastUpdatedAt": "2021-04-09T08:18:03.030Z", - "total": 4, - }, - Object { - "counterName": "some_event_name", - "counterType": "count", - "domainId": "anotherDomainId", - "fromTimestamp": "2021-04-11T00:00:00Z", - "lastUpdatedAt": "2021-04-11T08:18:03.030Z", - "total": 4, - }, - Object { - "counterName": "some_event_name", - "counterType": "count", - "domainId": "anotherDomainId2", - "fromTimestamp": "2021-04-20T00:00:00Z", - "lastUpdatedAt": "2021-04-20T08:18:03.030Z", - "total": 1, +describe('toDailyEvents', () => { + it('adapts counter events to have the expected UI properties', () => { + const counters: CounterEvent[] = [ + { + domainId: 'foo', + counterType: 'bar', + counterName: 'count', + lastUpdatedAt: '2024-06-19T12:03:25.795Z', + fromTimestamp: '2024-06-19T00:00:00Z', + total: 18, + }, + { + domainId: 'foo', + counterType: 'baz', + counterName: 'count', + lastUpdatedAt: '2024-06-19T14:13:25.795Z', + fromTimestamp: '2024-06-19T00:00:00Z', + total: 4, + }, + ]; + + expect(toDailyEvents(counters)).toEqual({ + dailyEvents: [ + { + domainId: 'foo', + counterType: 'bar', + counterName: 'count', + lastUpdatedAt: '2024-06-19T12:03:25.795Z', + fromTimestamp: '2024-06-19T00:00:00Z', + total: 18, }, - undefined, - Object { - "counterName": "some_event_name", - "counterType": "custom_type", - "domainId": "anotherDomainId2", - "fromTimestamp": "2021-04-20T00:00:00Z", - "lastUpdatedAt": "2021-04-20T08:18:03.030Z", - "total": 3, + { + domainId: 'foo', + counterType: 'baz', + counterName: 'count', + lastUpdatedAt: '2024-06-19T14:13:25.795Z', + fromTimestamp: '2024-06-19T00:00:00Z', + total: 4, }, - undefined, - ] - `); + ], + }); }); }); diff --git a/src/plugins/kibana_usage_collection/server/collectors/usage_counters/register_usage_counters_collector.ts b/src/plugins/kibana_usage_collection/server/collectors/usage_counters/register_usage_counters_collector.ts index 807f0189a4dd0..bd06615e8eb30 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/usage_counters/register_usage_counters_collector.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/usage_counters/register_usage_counters_collector.ts @@ -6,52 +6,25 @@ * Side Public License, v 1. */ -import moment from 'moment'; +import type { Logger } from '@kbn/logging'; +import { UsageCounters } from '@kbn/usage-collection-plugin/common'; import { - CollectorFetchContext, - UsageCollectionSetup, + type UsageCollectionSetup, USAGE_COUNTERS_SAVED_OBJECT_TYPE, - UsageCountersSavedObject, - UsageCountersSavedObjectAttributes, } from '@kbn/usage-collection-plugin/server'; - -interface UsageCounterEvent { - domainId: string; - counterName: string; - counterType: string; - lastUpdatedAt?: string; - fromTimestamp?: string; - total: number; -} +import { type CounterEvent, createCounterFetcher } from '../common/counters'; export interface UsageCounters { - dailyEvents: UsageCounterEvent[]; + dailyEvents: CounterEvent[]; } -export function transformRawCounter( - rawUsageCounter: UsageCountersSavedObject -): UsageCounterEvent | undefined { - const { - attributes: { count, counterName, counterType, domainId }, - updated_at: lastUpdatedAt, - } = rawUsageCounter; - const fromTimestamp = moment(lastUpdatedAt).utc().startOf('day').format(); - - if (domainId === 'uiCounter' || typeof count !== 'number' || count < 1) { - return; - } - - return { - domainId, - counterName, - counterType, - lastUpdatedAt, - fromTimestamp, - total: count, - }; -} +const SERVER: UsageCounters.v1.CounterEventSource = 'server'; +const SERVER_COUNTERS_FILTER = `${USAGE_COUNTERS_SAVED_OBJECT_TYPE}.attributes.source: ${SERVER}`; -export function registerUsageCountersUsageCollector(usageCollection: UsageCollectionSetup) { +export function registerUsageCountersUsageCollector( + usageCollection: UsageCollectionSetup, + logger: Logger +) { const collector = usageCollection.makeUsageCollector({ type: 'usage_counters', schema: { @@ -85,33 +58,15 @@ export function registerUsageCountersUsageCollector(usageCollection: UsageCollec }, }, }, - fetch: async ({ soClient }: CollectorFetchContext) => { - const finder = soClient.createPointInTimeFinder({ - type: USAGE_COUNTERS_SAVED_OBJECT_TYPE, - fields: ['count', 'counterName', 'counterType', 'domainId'], - filter: `NOT ${USAGE_COUNTERS_SAVED_OBJECT_TYPE}.attributes.domainId: uiCounter`, - perPage: 1000, - }); - - const dailyEvents: UsageCounterEvent[] = []; - - for await (const { saved_objects: rawUsageCounters } of finder.find()) { - rawUsageCounters.forEach((rawUsageCounter) => { - try { - const event = transformRawCounter(rawUsageCounter); - if (event) { - dailyEvents.push(event); - } - } catch (_) { - // swallow error; allows sending successfully transformed objects. - } - }); - } - - return { dailyEvents }; - }, + fetch: createCounterFetcher(logger, SERVER_COUNTERS_FILTER, toDailyEvents), isReady: () => true, }); usageCollection.registerCollector(collector); } + +export function toDailyEvents(counters: CounterEvent[]) { + return { + dailyEvents: counters, + }; +} diff --git a/src/plugins/kibana_usage_collection/server/collectors/usage_counters/rollups/rollups.test.ts b/src/plugins/kibana_usage_collection/server/collectors/usage_counters/rollups/rollups.test.ts index 4397468244a1f..37c68021c9c73 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/usage_counters/rollups/rollups.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/usage_counters/rollups/rollups.test.ts @@ -7,70 +7,11 @@ */ import moment from 'moment'; -import { isSavedObjectOlderThan, rollUsageCountersIndices } from './rollups'; import { savedObjectsRepositoryMock, loggingSystemMock } from '@kbn/core/server/mocks'; -import { SavedObjectsFindResult } from '@kbn/core/server'; - -import { - UsageCountersSavedObjectAttributes, - USAGE_COUNTERS_SAVED_OBJECT_TYPE, -} from '@kbn/usage-collection-plugin/server'; - +import { USAGE_COUNTERS_SAVED_OBJECT_TYPE } from '@kbn/usage-collection-plugin/server'; import { USAGE_COUNTERS_KEEP_DOCS_FOR_DAYS } from './constants'; - -const createMockSavedObjectDoc = (updatedAt: moment.Moment, id: string) => - ({ - id, - type: 'usage-counter', - attributes: { - count: 3, - counterName: 'testName', - counterType: 'count', - domainId: 'testDomain', - }, - references: [], - updated_at: updatedAt.format(), - version: 'WzI5LDFd', - score: 0, - } as SavedObjectsFindResult); - -describe('isSavedObjectOlderThan', () => { - it(`returns true if doc is older than x days`, () => { - const numberOfDays = 1; - const startDate = moment().format(); - const doc = createMockSavedObjectDoc(moment().subtract(2, 'days'), 'some-id'); - const result = isSavedObjectOlderThan({ - numberOfDays, - startDate, - doc, - }); - expect(result).toBe(true); - }); - - it(`returns false if doc is exactly x days old`, () => { - const numberOfDays = 1; - const startDate = moment().format(); - const doc = createMockSavedObjectDoc(moment().subtract(1, 'days'), 'some-id'); - const result = isSavedObjectOlderThan({ - numberOfDays, - startDate, - doc, - }); - expect(result).toBe(false); - }); - - it(`returns false if doc is younger than x days`, () => { - const numberOfDays = 2; - const startDate = moment().format(); - const doc = createMockSavedObjectDoc(moment().subtract(1, 'days'), 'some-id'); - const result = isSavedObjectOlderThan({ - numberOfDays, - startDate, - doc, - }); - expect(result).toBe(false); - }); -}); +import { createMockSavedObjectDoc } from '../../common/saved_objects.test'; +import { rollUsageCountersIndices } from './rollups'; describe('rollUsageCountersIndices', () => { let logger: ReturnType; @@ -106,7 +47,7 @@ describe('rollUsageCountersIndices', () => { createMockSavedObjectDoc(moment().subtract(5, 'days'), 'doc-id-1'), createMockSavedObjectDoc(moment().subtract(9, 'days'), 'doc-id-1'), createMockSavedObjectDoc(moment().subtract(1, 'days'), 'doc-id-2'), - createMockSavedObjectDoc(moment().subtract(6, 'days'), 'doc-id-3'), + createMockSavedObjectDoc(moment().subtract(6, 'days'), 'doc-id-3', 'secondary'), ]; savedObjectClient.find.mockImplementation(async ({ type, page = 1, perPage = 10 }) => { @@ -128,7 +69,8 @@ describe('rollUsageCountersIndices', () => { expect(savedObjectClient.delete).toHaveBeenNthCalledWith( 2, USAGE_COUNTERS_SAVED_OBJECT_TYPE, - 'doc-id-3' + 'doc-id-3', + { namespace: 'secondary' } ); expect(logger.warn).toHaveBeenCalledTimes(0); }); diff --git a/src/plugins/kibana_usage_collection/server/collectors/usage_counters/rollups/rollups.ts b/src/plugins/kibana_usage_collection/server/collectors/usage_counters/rollups/rollups.ts index 621b40fb21e9c..a8cdfd92372d7 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/usage_counters/rollups/rollups.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/usage_counters/rollups/rollups.ts @@ -6,35 +6,15 @@ * Side Public License, v 1. */ -import type { ISavedObjectsRepository, Logger } from '@kbn/core/server'; import moment from 'moment'; +import type { ISavedObjectsRepository, Logger } from '@kbn/core/server'; import { - UsageCountersSavedObject, + type UsageCountersSavedObject, USAGE_COUNTERS_SAVED_OBJECT_TYPE, } from '@kbn/usage-collection-plugin/server'; import { USAGE_COUNTERS_KEEP_DOCS_FOR_DAYS } from './constants'; - -export function isSavedObjectOlderThan({ - numberOfDays, - startDate, - doc, -}: { - numberOfDays: number; - startDate: moment.Moment | string | number; - doc: Pick; -}): boolean { - const { updated_at: updatedAt } = doc; - const today = moment(startDate).startOf('day'); - const updateDay = moment(updatedAt).startOf('day'); - - const diffInDays = today.diff(updateDay, 'days'); - if (diffInDays > numberOfDays) { - return true; - } - - return false; -} +import { isSavedObjectOlderThan } from '../../common/saved_objects'; export async function rollUsageCountersIndices( logger: Logger, @@ -50,6 +30,7 @@ export async function rollUsageCountersIndices( const { saved_objects: rawUiCounterDocs } = await savedObjectsClient.find({ type: USAGE_COUNTERS_SAVED_OBJECT_TYPE, + namespaces: ['*'], perPage: 1000, // Process 1000 at a time as a compromise of speed and overload }); @@ -62,7 +43,11 @@ export async function rollUsageCountersIndices( ); return await Promise.all( - docsToDelete.map(({ id }) => savedObjectsClient.delete(USAGE_COUNTERS_SAVED_OBJECT_TYPE, id)) + docsToDelete.map(({ id, type, namespaces }) => + namespaces?.[0] + ? savedObjectsClient.delete(type, id, { namespace: namespaces[0] }) + : savedObjectsClient.delete(type, id) + ) ); } catch (err) { logger.warn(`Failed to rollup Usage Counters saved objects.`); diff --git a/src/plugins/kibana_usage_collection/server/ebt_counters/register_ebt_counters.test.ts b/src/plugins/kibana_usage_collection/server/ebt_counters/register_ebt_counters.test.ts index a2ac2366c0b3e..018e179042254 100644 --- a/src/plugins/kibana_usage_collection/server/ebt_counters/register_ebt_counters.test.ts +++ b/src/plugins/kibana_usage_collection/server/ebt_counters/register_ebt_counters.test.ts @@ -42,15 +42,17 @@ describe('registerEbtCounters', () => { code: 'test-code', count: 1, }); - expect(usageCollection.getUsageCounterByType).toHaveBeenCalledTimes(1); - expect(usageCollection.getUsageCounterByType).toHaveBeenCalledWith('ebt_counters.test-shipper'); + expect(usageCollection.getUsageCounterByDomainId).toHaveBeenCalledTimes(1); + expect(usageCollection.getUsageCounterByDomainId).toHaveBeenCalledWith( + 'ebt_counters.test-shipper' + ); expect(usageCollection.createUsageCounter).toHaveBeenCalledTimes(1); expect(usageCollection.createUsageCounter).toHaveBeenCalledWith('ebt_counters.test-shipper'); }); test('it reuses the usageCounter when it already exists', () => { const incrementCounterMock = jest.fn(); - usageCollection.getUsageCounterByType.mockReturnValue({ + usageCollection.getUsageCounterByDomainId.mockReturnValue({ incrementCounter: incrementCounterMock, }); registerEbtCounters(core.analytics, usageCollection); @@ -62,8 +64,10 @@ describe('registerEbtCounters', () => { code: 'test-code', count: 1, }); - expect(usageCollection.getUsageCounterByType).toHaveBeenCalledTimes(1); - expect(usageCollection.getUsageCounterByType).toHaveBeenCalledWith('ebt_counters.test-shipper'); + expect(usageCollection.getUsageCounterByDomainId).toHaveBeenCalledTimes(1); + expect(usageCollection.getUsageCounterByDomainId).toHaveBeenCalledWith( + 'ebt_counters.test-shipper' + ); expect(usageCollection.createUsageCounter).toHaveBeenCalledTimes(0); expect(incrementCounterMock).toHaveBeenCalledTimes(1); expect(incrementCounterMock).toHaveBeenCalledWith({ diff --git a/src/plugins/kibana_usage_collection/server/ebt_counters/register_ebt_counters.ts b/src/plugins/kibana_usage_collection/server/ebt_counters/register_ebt_counters.ts index ed2100dccf929..b075b198ce496 100644 --- a/src/plugins/kibana_usage_collection/server/ebt_counters/register_ebt_counters.ts +++ b/src/plugins/kibana_usage_collection/server/ebt_counters/register_ebt_counters.ts @@ -18,7 +18,7 @@ export function registerEbtCounters( // We create one counter per source ('client'|). const domainId = `ebt_counters.${source}`; const usageCounter = - usageCollection.getUsageCounterByType(domainId) ?? + usageCollection.getUsageCounterByDomainId(domainId) ?? usageCollection.createUsageCounter(domainId); usageCounter.incrementCounter({ diff --git a/src/plugins/kibana_usage_collection/server/plugin.ts b/src/plugins/kibana_usage_collection/server/plugin.ts index ff38116c1de44..e2b88b8881f66 100644 --- a/src/plugins/kibana_usage_collection/server/plugin.ts +++ b/src/plugins/kibana_usage_collection/server/plugin.ts @@ -72,7 +72,6 @@ export class KibanaUsageCollectionPlugin implements Plugin { public setup(coreSetup: CoreSetup, { usageCollection }: KibanaUsageCollectionPluginsDepsSetup) { registerEbtCounters(coreSetup.analytics, usageCollection); - usageCollection.createUsageCounter('uiCounters'); this.eventLoopUsageCounter = usageCollection.createUsageCounter('eventLoop'); coreSetup.coreUsageData.registerUsageCounter(usageCollection.createUsageCounter('core')); this.registerUsageCollectors( @@ -127,14 +126,14 @@ export class KibanaUsageCollectionPlugin implements Plugin { const getUiSettingsClient = () => this.uiSettingsClient; const getCoreUsageDataService = () => this.coreUsageData!; - registerUiCountersUsageCollector(usageCollection); + registerUiCountersUsageCollector(usageCollection, this.logger); registerUsageCountersRollups( this.logger.get('usage-counters-rollup'), getSavedObjectsClient, pluginStop$ ); - registerUsageCountersUsageCollector(usageCollection); + registerUsageCountersUsageCollector(usageCollection, this.logger); registerOpsStatsCollector(usageCollection, metric$); diff --git a/src/plugins/kibana_usage_collection/tsconfig.json b/src/plugins/kibana_usage_collection/tsconfig.json index 2fb915d541052..84e9a38f3e970 100644 --- a/src/plugins/kibana_usage_collection/tsconfig.json +++ b/src/plugins/kibana_usage_collection/tsconfig.json @@ -18,6 +18,7 @@ "@kbn/core-test-helpers-kbn-server", "@kbn/core-usage-data-server", "@kbn/core-saved-objects-api-server", + "@kbn/core-saved-objects-api-server-internal", ], "exclude": [ "target/**/*", diff --git a/src/plugins/links/common/constants.ts b/src/plugins/links/common/constants.ts index eeba785bf21cd..fa3eadce5a456 100644 --- a/src/plugins/links/common/constants.ts +++ b/src/plugins/links/common/constants.ts @@ -17,3 +17,7 @@ export const APP_ICON = 'link'; export const APP_NAME = i18n.translate('links.visTypeAlias.title', { defaultMessage: 'Links', }); + +export const DISPLAY_NAME = i18n.translate('links.displayName', { + defaultMessage: 'links', +}); diff --git a/src/plugins/links/common/content_management/v1/types.ts b/src/plugins/links/common/content_management/v1/types.ts index 880bcbc67dd1d..774d76a6553bd 100644 --- a/src/plugins/links/common/content_management/v1/types.ts +++ b/src/plugins/links/common/content_management/v1/types.ts @@ -24,7 +24,7 @@ import { export type LinksCrudTypes = ContentManagementCrudTypes< LinksContentType, - LinksAttributes, + Omit & { title: string }, // saved object attributes always have a title Pick, Pick, { @@ -60,7 +60,7 @@ export type LinksLayoutType = typeof LINKS_HORIZONTAL_LAYOUT | typeof LINKS_VERT // eslint-disable-next-line @typescript-eslint/consistent-type-definitions export type LinksAttributes = { - title: string; + title?: string; description?: string; links?: Link[]; layout?: LinksLayoutType; diff --git a/src/plugins/links/common/embeddable/extract.test.ts b/src/plugins/links/common/embeddable/extract.test.ts deleted file mode 100644 index 8653a3d650d70..0000000000000 --- a/src/plugins/links/common/embeddable/extract.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 { extract } from './extract'; - -test('Should return original state and empty references with by-reference embeddable state', () => { - const linksByReferenceInput = { - id: '2192e502-0ec7-4316-82fb-c9bbf78525c4', - type: 'links', - }; - - expect(extract!(linksByReferenceInput)).toEqual({ - state: linksByReferenceInput, - references: [], - }); -}); - -test('Should update state with refNames with by-value embeddable state', () => { - const linksByValueInput = { - id: '8d62c3f0-c61f-4c09-ac24-9b8ee4320e20', - attributes: { - links: [ - { - type: 'dashboardLink', - id: 'fc7b8c70-2eb9-40b2-936d-457d1721a438', - destination: 'elastic_agent-1a4e7280-6b5e-11ed-98de-67bdecd21824', - order: 0, - }, - ], - layout: 'horizontal', - }, - type: 'links', - }; - - expect(extract!(linksByValueInput)).toEqual({ - references: [ - { - name: 'link_fc7b8c70-2eb9-40b2-936d-457d1721a438_dashboard', - type: 'dashboard', - id: 'elastic_agent-1a4e7280-6b5e-11ed-98de-67bdecd21824', - }, - ], - state: { - id: '8d62c3f0-c61f-4c09-ac24-9b8ee4320e20', - attributes: { - links: [ - { - type: 'dashboardLink', - id: 'fc7b8c70-2eb9-40b2-936d-457d1721a438', - destinationRefName: 'link_fc7b8c70-2eb9-40b2-936d-457d1721a438_dashboard', - order: 0, - }, - ], - layout: 'horizontal', - }, - type: 'links', - }, - }); -}); diff --git a/src/plugins/links/common/embeddable/extract.ts b/src/plugins/links/common/embeddable/extract.ts deleted file mode 100644 index 5fe842e4316b1..0000000000000 --- a/src/plugins/links/common/embeddable/extract.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { EmbeddableRegistryDefinition } from '@kbn/embeddable-plugin/common'; -import type { LinksAttributes } from '../content_management'; -import { extractReferences } from '../persistable_state'; -import { LinksPersistableState } from './types'; - -export const extract: EmbeddableRegistryDefinition['extract'] = (state) => { - const typedState = state as LinksPersistableState; - - // by-reference embeddable - if (!('attributes' in typedState) || typedState.attributes === undefined) { - // No references to extract for by-reference embeddable since all references are stored with by-reference saved object - return { state, references: [] }; - } - - // by-value embeddable - const { attributes, references } = extractReferences({ - attributes: typedState.attributes as unknown as LinksAttributes, - }); - - return { - state: { - ...state, - attributes, - }, - references, - }; -}; diff --git a/src/plugins/links/common/embeddable/inject.test.ts b/src/plugins/links/common/embeddable/inject.test.ts deleted file mode 100644 index 4fdef93f8e3a9..0000000000000 --- a/src/plugins/links/common/embeddable/inject.test.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { inject } from './inject'; - -test('Should return original state with by-reference embeddable state', () => { - const linksByReferenceInput = { - id: 'ea40fd4e-216c-49a7-917f-f733c8a2c817', - type: 'links', - }; - - const references = [ - { - name: 'panel_ea40fd4e-216c-49a7-917f-f733c8a2c817', - type: 'links', - id: '7f92d7d0-8e5f-11ec-9477-312c8a6de896', - }, - ]; - - expect(inject!(linksByReferenceInput, references)).toEqual(linksByReferenceInput); -}); - -test('Should inject refNames with by-value embeddable state', () => { - const linksByValueInput = { - id: 'c3937cf9-29be-43df-a4af-a4df742d7d35', - attributes: { - links: [ - { - type: 'dashboardLink', - id: 'fc7b8c70-2eb9-40b2-936d-457d1721a438', - destinationRefName: 'link_fc7b8c70-2eb9-40b2-936d-457d1721a438_dashboard', - order: 0, - }, - ], - layout: 'horizontal', - }, - type: 'links', - }; - const references = [ - { - name: 'link_fc7b8c70-2eb9-40b2-936d-457d1721a438_dashboard', - type: 'dashboard', - id: 'elastic_agent-1a4e7280-6b5e-11ed-98de-67bdecd21824', - }, - ]; - - expect(inject!(linksByValueInput, references)).toEqual({ - id: 'c3937cf9-29be-43df-a4af-a4df742d7d35', - attributes: { - links: [ - { - type: 'dashboardLink', - id: 'fc7b8c70-2eb9-40b2-936d-457d1721a438', - destination: 'elastic_agent-1a4e7280-6b5e-11ed-98de-67bdecd21824', - order: 0, - }, - ], - layout: 'horizontal', - }, - type: 'links', - }); -}); diff --git a/src/plugins/links/common/embeddable/inject.ts b/src/plugins/links/common/embeddable/inject.ts deleted file mode 100644 index 134a508406361..0000000000000 --- a/src/plugins/links/common/embeddable/inject.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 { EmbeddableRegistryDefinition } from '@kbn/embeddable-plugin/common'; -import { LinksAttributes } from '../content_management'; -import { injectReferences } from '../persistable_state'; -import { LinksPersistableState } from './types'; - -export const inject: EmbeddableRegistryDefinition['inject'] = (state, references) => { - const typedState = state as LinksPersistableState; - - // by-reference embeddable - if (!('attributes' in typedState) || typedState.attributes === undefined) { - return typedState; - } - - // by-value embeddable - try { - const { attributes: attributesWithInjectedIds } = injectReferences({ - attributes: typedState.attributes as unknown as LinksAttributes, - references, - }); - - return { - ...typedState, - attributes: attributesWithInjectedIds, - }; - } catch (error) { - // inject exception prevents entire dashboard from display - // Instead of throwing, swallow error and let dashboard display - // Errors will surface in links panel. - // Users can then manually edit links to resolve any problems. - return typedState; - } -}; diff --git a/src/plugins/links/common/index.ts b/src/plugins/links/common/index.ts index 9cb4fc42124aa..85bb10e1da790 100644 --- a/src/plugins/links/common/index.ts +++ b/src/plugins/links/common/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export { APP_ICON, APP_NAME, CONTENT_ID, LATEST_VERSION } from './constants'; +export { APP_ICON, APP_NAME, CONTENT_ID, DISPLAY_NAME, LATEST_VERSION } from './constants'; diff --git a/src/plugins/links/common/mocks.tsx b/src/plugins/links/common/mocks.tsx deleted file mode 100644 index 299f9edcacdc4..0000000000000 --- a/src/plugins/links/common/mocks.tsx +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { buildMockDashboard } from '@kbn/dashboard-plugin/public/mocks'; -import { DashboardContainerInput } from '@kbn/dashboard-plugin/common'; -import { LinksByValueInput } from '../public/embeddable/types'; -import { LinksFactoryDefinition } from '../public'; -import { LinksAttributes } from './content_management'; - -jest.mock('../public/services/attribute_service', () => { - return { - getLinksAttributeService: jest.fn(() => { - return { - saveMethod: jest.fn(), - unwrapMethod: jest.fn(), - checkForDuplicateTitle: jest.fn(), - unwrapAttributes: jest.fn((attributes: LinksByValueInput) => Promise.resolve(attributes)), - wrapAttributes: jest.fn((attributes: LinksAttributes) => Promise.resolve(attributes)), - }; - }), - }; -}); - -export const mockLinksInput = (partial?: Partial): LinksByValueInput => ({ - id: 'mocked_links_panel', - attributes: { - title: 'mocked_links', - }, - ...(partial ?? {}), -}); - -export const mockLinksPanel = async ({ - explicitInput, - dashboardExplicitInput, -}: { - explicitInput?: Partial; - dashboardExplicitInput?: Partial; -}) => { - const dashboardContainer = buildMockDashboard({ - overrides: dashboardExplicitInput, - savedObjectId: '123', - }); - const linksFactoryStub = new LinksFactoryDefinition(); - - const links = await linksFactoryStub.create(mockLinksInput(explicitInput), dashboardContainer); - - return links; -}; diff --git a/src/plugins/links/kibana.jsonc b/src/plugins/links/kibana.jsonc index a058db8a03ce2..4aed94ab56751 100644 --- a/src/plugins/links/kibana.jsonc +++ b/src/plugins/links/kibana.jsonc @@ -14,6 +14,7 @@ "kibanaReact", "kibanaUtils", "presentationUtil", + "uiActions", "uiActionsEnhanced", "visualizations" ], diff --git a/src/plugins/links/public/actions/create_links_panel_action.ts b/src/plugins/links/public/actions/create_links_panel_action.ts new file mode 100644 index 0000000000000..c5b78fe1e318b --- /dev/null +++ b/src/plugins/links/public/actions/create_links_panel_action.ts @@ -0,0 +1,52 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { apiIsPresentationContainer } from '@kbn/presentation-containers'; +import { EmbeddableApiContext } from '@kbn/presentation-publishing'; +import { ADD_PANEL_TRIGGER, IncompatibleActionError } from '@kbn/ui-actions-plugin/public'; +import { COMMON_EMBEDDABLE_GROUPING } from '@kbn/embeddable-plugin/public'; +import { APP_ICON, APP_NAME, CONTENT_ID } from '../../common'; +import { uiActions } from '../services/kibana_services'; +import { serializeLinksAttributes } from '../lib/serialize_attributes'; +import { LinksSerializedState } from '../types'; + +const ADD_LINKS_PANEL_ACTION_ID = 'create_links_panel'; + +export const registerCreateLinksPanelAction = () => { + uiActions.registerAction({ + id: ADD_LINKS_PANEL_ACTION_ID, + getIconType: () => APP_ICON, + order: 10, + isCompatible: async ({ embeddable }) => { + return apiIsPresentationContainer(embeddable); + }, + execute: async ({ embeddable }) => { + if (!apiIsPresentationContainer(embeddable)) { + throw new IncompatibleActionError(); + } + const { openEditorFlyout } = await import('../editor/open_editor_flyout'); + const runtimeState = await openEditorFlyout({ + parentDashboard: embeddable, + }); + if (!runtimeState) return; + + const initialState: LinksSerializedState = runtimeState.savedObjectId + ? { savedObjectId: runtimeState.savedObjectId } + : // We should not extract the references when passing initialState to addNewPanel + serializeLinksAttributes(runtimeState, false); + + await embeddable.addNewPanel({ + panelType: CONTENT_ID, + initialState, + }); + }, + grouping: [COMMON_EMBEDDABLE_GROUPING.annotation], + getDisplayName: () => APP_NAME, + }); + uiActions.attachAction(ADD_PANEL_TRIGGER, ADD_LINKS_PANEL_ACTION_ID); +}; diff --git a/src/plugins/links/public/components/dashboard_link/dashboard_link_component.test.tsx b/src/plugins/links/public/components/dashboard_link/dashboard_link_component.test.tsx index 84e358fdb381c..1ce99eeaf7e1e 100644 --- a/src/plugins/links/public/components/dashboard_link/dashboard_link_component.test.tsx +++ b/src/plugins/links/public/components/dashboard_link/dashboard_link_component.test.tsx @@ -8,79 +8,51 @@ import React from 'react'; -import { getDashboardLocatorParamsFromEmbeddable } from '@kbn/dashboard-plugin/public'; -import type { DashboardContainer } from '@kbn/dashboard-plugin/public/dashboard_container'; import { DEFAULT_DASHBOARD_DRILLDOWN_OPTIONS } from '@kbn/presentation-util-plugin/public'; -import { createEvent, fireEvent, render, screen, waitFor, within } from '@testing-library/react'; +import { createEvent, fireEvent, render, screen, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { LINKS_VERTICAL_LAYOUT } from '../../../common/content_management'; -import { mockLinksPanel } from '../../../common/mocks'; -import { LinksContext, LinksEmbeddable } from '../../embeddable/links_embeddable'; import { DashboardLinkComponent } from './dashboard_link_component'; import { DashboardLinkStrings } from './dashboard_link_strings'; -import { fetchDashboard } from './dashboard_link_tools'; +import { getMockLinksParentApi } from '../../mocks'; +import { ResolvedLink } from '../../types'; +import { BehaviorSubject } from 'rxjs'; +import { AggregateQuery, Filter, Query, TimeRange } from '@kbn/es-query'; -jest.mock('./dashboard_link_tools'); - -jest.mock('@kbn/dashboard-plugin/public', () => { - const originalModule = jest.requireActual('@kbn/dashboard-plugin/public'); - return { - __esModule: true, - ...originalModule, - getDashboardLocatorParamsFromEmbeddable: jest.fn(), +function createMockLinksParent({ + initialQuery, + initialFilters, +}: { + initialQuery?: Query | AggregateQuery; + initialFilters?: Filter[]; +}) { + const parent = { + ...getMockLinksParentApi({ savedObjectId: '456' }), + locator: { + getRedirectUrl: jest.fn().mockReturnValue('https://my-kibana.com/dashboard/123'), + navigate: jest.fn(), + }, + getSerializedStateForChild: jest.fn(), + query$: new BehaviorSubject(initialQuery), + filters$: new BehaviorSubject(initialFilters ?? []), }; -}); + return parent; +} describe('Dashboard link component', () => { - const mockDashboards = [ - { - id: '456', - status: 'success', - attributes: { - title: 'another dashboard', - description: 'something awesome', - panelsJSON: [], - timeRestore: false, - version: '1', - }, - }, - { - id: '123', - status: 'success', - attributes: { - title: 'current dashboard', - description: '', - panelsJSON: [], - timeRestore: false, - version: '1', - }, - }, - ]; - - const defaultLinkInfo = { - destination: '456', - order: 1, + const resolvedLink: ResolvedLink = { id: 'foo', - type: 'dashboardLink' as const, + order: 0, + type: 'dashboardLink', + label: '', + destination: '456', + title: 'Dashboard 1', + description: 'Dashboard 1 description', }; - const onLoading = jest.fn(); - const onRender = jest.fn(); - - let linksEmbeddable: LinksEmbeddable; - let dashboardContainer: DashboardContainer; beforeEach(async () => { window.open = jest.fn(); - (fetchDashboard as jest.Mock).mockResolvedValue(mockDashboards[0]); - linksEmbeddable = await mockLinksPanel({ - dashboardExplicitInput: mockDashboards[1].attributes, - }); - dashboardContainer = linksEmbeddable.parent as DashboardContainer; - dashboardContainer.locator = { - getRedirectUrl: jest.fn().mockReturnValue('https://my-kibana.com/dashboard/123'), - navigate: jest.fn(), - }; }); afterEach(() => { @@ -88,25 +60,18 @@ describe('Dashboard link component', () => { }); test('by default uses navigate to open in same tab', async () => { + const parentApi = createMockLinksParent({}); render( - - - + ); - await waitFor(() => expect(onLoading).toHaveBeenCalledTimes(1)); - await waitFor(() => expect(fetchDashboard).toHaveBeenCalledTimes(1)); - expect(fetchDashboard).toHaveBeenCalledWith(defaultLinkInfo.destination); - await waitFor(() => expect(onRender).toHaveBeenCalledTimes(1)); - // renders dashboard title - const link = await screen.findByTestId('dashboardLink--foo'); - expect(link).toHaveTextContent('another dashboard'); + const link = screen.getByTestId('dashboardLink--foo'); + expect(link).toHaveTextContent('Dashboard 1'); // does not render external link icon const externalIcon = within(link).queryByText('External link'); @@ -114,27 +79,27 @@ describe('Dashboard link component', () => { // calls `navigate` on click userEvent.click(link); - expect(dashboardContainer.locator?.getRedirectUrl).toBeCalledWith({ + expect(parentApi.locator?.getRedirectUrl).toBeCalledWith({ dashboardId: '456', + filters: [], + timeRange: { + from: 'now-15m', + to: 'now', + }, }); - expect(dashboardContainer.locator?.navigate).toBeCalledTimes(1); + expect(parentApi.locator?.navigate).toBeCalledTimes(1); }); test('modified click does not trigger event.preventDefault', async () => { + const parentApi = createMockLinksParent({}); render( - - - + ); - await waitFor(() => expect(onLoading).toHaveBeenCalledTimes(1)); - await waitFor(() => expect(fetchDashboard).toHaveBeenCalledTimes(1)); - await waitFor(() => expect(onRender).toHaveBeenCalledTimes(1)); - const link = await screen.findByTestId('dashboardLink--foo'); + const link = screen.getByTestId('dashboardLink--foo'); const clickEvent = createEvent.click(link, { ctrlKey: true }); const preventDefault = jest.spyOn(clickEvent, 'preventDefault'); fireEvent(link, clickEvent); @@ -142,159 +107,281 @@ describe('Dashboard link component', () => { }); test('openInNewTab uses window.open, not navigateToApp, and renders external icon', async () => { - const linkInfo = { - ...defaultLinkInfo, - options: { ...DEFAULT_DASHBOARD_DRILLDOWN_OPTIONS, openInNewTab: true }, - }; + const parentApi = createMockLinksParent({}); render( - - - + ); - await waitFor(() => expect(onLoading).toHaveBeenCalledTimes(1)); - await waitFor(() => expect(fetchDashboard).toHaveBeenCalledTimes(1)); - expect(fetchDashboard).toHaveBeenCalledWith(linkInfo.destination); - await waitFor(() => expect(onRender).toHaveBeenCalledTimes(1)); - const link = await screen.findByTestId('dashboardLink--foo'); + const link = screen.getByTestId('dashboardLink--foo'); expect(link).toBeInTheDocument(); - // external link icon is rendered const externalIcon = within(link).getByText('External link'); expect(externalIcon?.getAttribute('data-euiicon-type')).toBe('popout'); // calls `window.open` userEvent.click(link); - expect(dashboardContainer.locator?.navigate).toBeCalledTimes(0); + expect(parentApi.locator?.navigate).toBeCalledTimes(0); expect(window.open).toHaveBeenCalledWith('https://my-kibana.com/dashboard/123', '_blank'); }); - test('passes linkOptions to getDashboardLocatorParamsFromEmbeddable', async () => { - const linkInfo = { - ...defaultLinkInfo, - options: { - ...DEFAULT_DASHBOARD_DRILLDOWN_OPTIONS, - useCurrentFilters: false, - useCurrentTimeRange: false, - useCurrentDateRange: false, + test('passes query, filters, and timeRange to locator.getRedirectUrl by default', async () => { + const initialFilters = [ + { + query: { match_phrase: { foo: 'bar' } }, + meta: { alias: null, disabled: false, negate: false }, }, - }; + ]; + const initialQuery = { query: 'fiddlesticks: "*"', language: 'lucene' }; + const parentApi = createMockLinksParent({ + initialQuery, + initialFilters, + }); + + parentApi.timeRange$ = new BehaviorSubject({ + from: 'now-7d', + to: 'now', + }); + + render( + + ); + expect(parentApi.locator?.getRedirectUrl).toBeCalledWith({ + dashboardId: '456', + timeRange: { from: 'now-7d', to: 'now' }, + filters: initialFilters, + query: initialQuery, + }); + }); + + test('does not pass timeRange to locator.getRedirectUrl if useCurrentDateRange is false', async () => { + const initialFilters = [ + { + query: { match_phrase: { foo: 'bar' } }, + meta: { alias: null, disabled: false, negate: false }, + }, + ]; + const initialQuery = { query: 'fiddlesticks: "*"', language: 'lucene' }; + const parentApi = createMockLinksParent({ + initialQuery, + initialFilters, + }); + + parentApi.timeRange$ = new BehaviorSubject({ + from: 'now-7d', + to: 'now', + }); + render( - - - + ); - await waitFor(() => expect(onLoading).toHaveBeenCalledTimes(1)); - await waitFor(() => expect(fetchDashboard).toHaveBeenCalledTimes(1)); - expect(getDashboardLocatorParamsFromEmbeddable).toHaveBeenCalledWith( - linksEmbeddable, - linkInfo.options + expect(parentApi.locator?.getRedirectUrl).toBeCalledWith({ + dashboardId: '456', + filters: initialFilters, + query: initialQuery, + }); + }); + + test('does not pass filters or query to locator.getRedirectUrl if useCurrentFilters is false', async () => { + const initialFilters = [ + { + query: { match_phrase: { foo: 'bar' } }, + meta: { alias: null, disabled: false, negate: false }, + }, + ]; + const initialQuery = { query: 'fiddlesticks: "*"', language: 'lucene' }; + const parentApi = createMockLinksParent({ + initialQuery, + initialFilters, + }); + + parentApi.timeRange$ = new BehaviorSubject({ + from: 'now-7d', + to: 'now', + }); + + render( + ); - await waitFor(() => expect(onRender).toHaveBeenCalledTimes(1)); + expect(parentApi.locator?.getRedirectUrl).toBeCalledWith({ + dashboardId: '456', + timeRange: { from: 'now-7d', to: 'now' }, + filters: [], + }); }); test('shows an error when fetchDashboard fails', async () => { - (fetchDashboard as jest.Mock).mockRejectedValue(new Error('some error')); - const linkInfo = { - ...defaultLinkInfo, - id: 'notfound', - }; + const parentApi = createMockLinksParent({}); + render( - - - + ); - await waitFor(() => expect(onLoading).toHaveBeenCalledTimes(1)); - await waitFor(() => expect(fetchDashboard).toHaveBeenCalledTimes(1)); - await waitFor(() => expect(onRender).toHaveBeenCalledTimes(1)); - const link = await screen.findByTestId('dashboardLink--notfound--error'); + const link = await screen.findByTestId('dashboardLink--foo--error'); expect(link).toHaveTextContent(DashboardLinkStrings.getDashboardErrorLabel()); }); test('current dashboard is not a clickable href', async () => { - const linkInfo = { - ...defaultLinkInfo, - destination: '123', - id: 'bar', - }; + const parentApi = createMockLinksParent({}); + parentApi.savedObjectId = new BehaviorSubject('123'); + parentApi.panelTitle = new BehaviorSubject('current dashboard'); + render( - - - + ); - await waitFor(() => expect(onLoading).toHaveBeenCalledTimes(1)); - await waitFor(() => expect(fetchDashboard).toHaveBeenCalledTimes(1)); - await waitFor(() => expect(onRender).toHaveBeenCalledTimes(1)); - const link = await screen.findByTestId('dashboardLink--bar'); + + const link = screen.getByTestId('dashboardLink--bar'); expect(link).toHaveTextContent('current dashboard'); userEvent.click(link); - expect(dashboardContainer.locator?.navigate).toBeCalledTimes(0); + expect(parentApi.locator?.navigate).toBeCalledTimes(0); expect(window.open).toBeCalledTimes(0); }); test('shows dashboard title and description in tooltip', async () => { + const parentApi = createMockLinksParent({}); + render( - - - + ); - await waitFor(() => expect(onLoading).toHaveBeenCalledTimes(1)); - await waitFor(() => expect(fetchDashboard).toHaveBeenCalledTimes(1)); - await waitFor(() => expect(onRender).toHaveBeenCalledTimes(1)); - const link = await screen.findByTestId('dashboardLink--foo'); + + const link = screen.getByTestId('dashboardLink--foo'); userEvent.hover(link); const tooltip = await screen.findByTestId('dashboardLink--foo--tooltip'); expect(tooltip).toHaveTextContent('another dashboard'); // title expect(tooltip).toHaveTextContent('something awesome'); // description }); + test('current dashboard title updates when parent changes', async () => { + const parentApi = { + ...createMockLinksParent({}), + panelTitle: new BehaviorSubject('old title'), + panelDescription: new BehaviorSubject('old description'), + savedObjectId: new BehaviorSubject('123'), + }; + + const { rerender } = render( + + ); + expect(await screen.findByTestId('dashboardLink--bar')).toHaveTextContent('old title'); + + parentApi.panelTitle.next('new title'); + rerender( + + ); + expect(await screen.findByTestId('dashboardLink--bar')).toHaveTextContent('new title'); + }); + test('can override link label', async () => { const label = 'my custom label'; - const linkInfo = { - ...defaultLinkInfo, - label, - }; + const parentApi = createMockLinksParent({}); render( - - - + ); - await waitFor(() => expect(onLoading).toHaveBeenCalledTimes(1)); - await waitFor(() => expect(fetchDashboard).toHaveBeenCalledTimes(1)); - await waitFor(() => expect(onRender).toHaveBeenCalledTimes(1)); - const link = await screen.findByTestId('dashboardLink--foo'); + const link = screen.getByTestId('dashboardLink--foo'); expect(link).toHaveTextContent(label); userEvent.hover(link); const tooltip = await screen.findByTestId('dashboardLink--foo--tooltip'); expect(tooltip).toHaveTextContent(label); }); + + test('can override link label for the current dashboard', async () => { + const customLabel = 'my new label for the current dashboard'; + const parentApi = createMockLinksParent({}); + parentApi.savedObjectId = new BehaviorSubject('123'); + + render( + + ); + + const link = screen.getByTestId('dashboardLink--bar'); + expect(link).toHaveTextContent(customLabel); + }); }); diff --git a/src/plugins/links/public/components/dashboard_link/dashboard_link_component.tsx b/src/plugins/links/public/components/dashboard_link/dashboard_link_component.tsx index 202a697cd7160..39e91bfa4c34b 100644 --- a/src/plugins/links/public/components/dashboard_link/dashboard_link_component.tsx +++ b/src/plugins/links/public/components/dashboard_link/dashboard_link_component.tsx @@ -7,69 +7,51 @@ */ import classNames from 'classnames'; -import React, { useEffect, useMemo, useState } from 'react'; -import useAsync from 'react-use/lib/useAsync'; -import useObservable from 'react-use/lib/useObservable'; +import React, { useMemo } from 'react'; -import { EuiButtonEmpty, EuiListGroupItem } from '@elastic/eui'; +import { EuiListGroupItem } from '@elastic/eui'; import { METRIC_TYPE } from '@kbn/analytics'; -import { - DashboardLocatorParams, - getDashboardLocatorParamsFromEmbeddable, -} from '@kbn/dashboard-plugin/public'; -import type { DashboardContainer } from '@kbn/dashboard-plugin/public/dashboard_container'; +import { DashboardLocatorParams } from '@kbn/dashboard-plugin/public'; import { DashboardDrilldownOptions, DEFAULT_DASHBOARD_DRILLDOWN_OPTIONS, } from '@kbn/presentation-util-plugin/public'; -import type { HasParentApi, PublishesUnifiedSearch } from '@kbn/presentation-publishing'; +import { useBatchedPublishingSubjects } from '@kbn/presentation-publishing'; +import { isFilterPinned, Query } from '@kbn/es-query'; import { DASHBOARD_LINK_TYPE, - Link, LinksLayoutType, LINKS_VERTICAL_LAYOUT, } from '../../../common/content_management'; import { trackUiMetric } from '../../services/kibana_services'; -import { useLinks } from '../links_hooks'; import { DashboardLinkStrings } from './dashboard_link_strings'; -import { fetchDashboard } from './dashboard_link_tools'; +import { LinksParentApi, ResolvedLink } from '../../types'; export const DashboardLinkComponent = ({ link, layout, - onLoading, - onRender, + parentApi, }: { - link: Link; + link: ResolvedLink; layout: LinksLayoutType; - onLoading: () => void; - onRender: () => void; + parentApi: LinksParentApi; }) => { - const linksEmbeddable = useLinks(); - const [error, setError] = useState(); - - const dashboardContainer = linksEmbeddable.parent as DashboardContainer; - const parentDashboardInput = useObservable(dashboardContainer.getInput$()); - const parentDashboardId = dashboardContainer.select((state) => state.componentState.lastSavedId); - - /** Fetch the dashboard that the link is pointing to */ - const { loading: loadingDestinationDashboard, value: destinationDashboard } = - useAsync(async () => { - if (link.id !== parentDashboardId && link.destination) { - /** - * only fetch the dashboard if it's not the current dashboard - if it is the current dashboard, - * use `dashboardContainer` and its corresponding state (title, description, etc.) instead. - */ - const dashboard = await fetchDashboard(link.destination) - .then((result) => { - setError(undefined); - return result; - }) - .catch((e) => setError(e)); - return dashboard; - } - }, [link, parentDashboardId]); + const [ + parentDashboardId, + parentDashboardTitle, + parentDashboardDescription, + timeRange, + filters, + query, + ] = useBatchedPublishingSubjects( + parentApi.savedObjectId, + parentApi.panelTitle, + parentApi.panelDescription, + parentApi.timeRange$, + parentApi.filters$, + parentApi.query$ + ); /** * Returns the title and description of the dashboard that the link points to; note that, if the link points to @@ -78,9 +60,9 @@ export const DashboardLinkComponent = ({ */ const [dashboardTitle, dashboardDescription] = useMemo(() => { return link.destination === parentDashboardId - ? [parentDashboardInput?.title, parentDashboardInput?.description] - : [destinationDashboard?.attributes.title, destinationDashboard?.attributes.description]; - }, [link.destination, parentDashboardId, parentDashboardInput, destinationDashboard]); + ? [parentDashboardTitle, parentDashboardDescription] + : [link.title, link.description]; + }, [link, parentDashboardId, parentDashboardTitle, parentDashboardDescription]); /** * Memoized link information @@ -90,17 +72,17 @@ export const DashboardLinkComponent = ({ }, [link, dashboardTitle]); const { tooltipTitle, tooltipMessage } = useMemo(() => { - if (error) { + if (link.error) { return { tooltipTitle: DashboardLinkStrings.getDashboardErrorLabel(), - tooltipMessage: error.message, + tooltipMessage: link.error.message, }; } return { tooltipTitle: Boolean(dashboardDescription) ? linkLabel : undefined, tooltipMessage: dashboardDescription || linkLabel, }; - }, [error, linkLabel, dashboardDescription]); + }, [link, linkLabel, dashboardDescription]); /** * Dashboard-to-dashboard navigation @@ -116,15 +98,18 @@ export const DashboardLinkComponent = ({ const params: DashboardLocatorParams = { dashboardId: link.destination, - ...getDashboardLocatorParamsFromEmbeddable( - linksEmbeddable as Partial< - PublishesUnifiedSearch & HasParentApi> - >, - linkOptions - ), }; + if (linkOptions.useCurrentFilters && query) { + params.query = query as Query; + } + + if (linkOptions.useCurrentDateRange && timeRange) { + params.timeRange = timeRange; + } - const locator = dashboardContainer.locator; + params.filters = linkOptions.useCurrentFilters ? filters : filters?.filter(isFilterPinned); + + const locator = parentApi.locator; if (!locator) return; const href = locator.getRedirectUrl(params); @@ -151,30 +136,24 @@ export const DashboardLinkComponent = ({ } }, }; - }, [link, dashboardContainer.locator, linksEmbeddable, parentDashboardId]); - - useEffect(() => { - if (loadingDestinationDashboard) { - onLoading(); - } else { - onRender(); - } - }, [link, linksEmbeddable, loadingDestinationDashboard, onLoading, onRender]); + }, [ + link.destination, + link.options, + parentDashboardId, + filters, + parentApi.locator, + query, + timeRange, + ]); const id = `dashboardLink--${link.id}`; - return loadingDestinationDashboard ? ( -
  • - - {DashboardLinkStrings.getLoadingDashboardLabel()} - -
  • - ) : ( + return ( ); diff --git a/src/plugins/links/public/components/dashboard_link/dashboard_link_destination_picker.tsx b/src/plugins/links/public/components/dashboard_link/dashboard_link_destination_picker.tsx index fea0a5239ba0d..8868dd1a2776a 100644 --- a/src/plugins/links/public/components/dashboard_link/dashboard_link_destination_picker.tsx +++ b/src/plugins/links/public/components/dashboard_link/dashboard_link_destination_picker.tsx @@ -20,9 +20,8 @@ import { EuiFlexGroup, EuiComboBoxOptionOption, } from '@elastic/eui'; -import type { DashboardContainer } from '@kbn/dashboard-plugin/public/dashboard_container'; -import { DashboardItem } from '../../embeddable/types'; +import { DashboardItem } from '../../types'; import { DashboardLinkStrings } from './dashboard_link_strings'; import { fetchDashboard, fetchDashboards } from './dashboard_link_tools'; @@ -31,20 +30,18 @@ type DashboardComboBoxOption = EuiComboBoxOptionOption; export const DashboardLinkDestinationPicker = ({ onDestinationPicked, initialSelection, - parentDashboard, + parentDashboardId, onUnmount, ...other }: { initialSelection?: string; - parentDashboard?: DashboardContainer; + parentDashboardId?: string; onUnmount: (dashboardId?: string) => void; onDestinationPicked: (selectedDashboard?: DashboardItem) => void; }) => { const [searchString, setSearchString] = useState(''); const [selectedOption, setSelectedOption] = useState([]); - const parentDashboardId = parentDashboard?.select((state) => state.componentState.lastSavedId); - const getDashboardItem = useCallback((dashboard: DashboardItem) => { return { key: dashboard.id, @@ -106,7 +103,7 @@ export const DashboardLinkDestinationPicker = ({ {DashboardLinkStrings.getCurrentDashboardLabel()} )} - + {label} diff --git a/src/plugins/links/public/components/dashboard_link/dashboard_link_tools.ts b/src/plugins/links/public/components/dashboard_link/dashboard_link_tools.ts index 9081b17815320..fc9d3f893ade6 100644 --- a/src/plugins/links/public/components/dashboard_link/dashboard_link_tools.ts +++ b/src/plugins/links/public/components/dashboard_link/dashboard_link_tools.ts @@ -8,7 +8,7 @@ import { isEmpty, filter } from 'lodash'; -import { DashboardItem } from '../../embeddable/types'; +import { DashboardItem } from '../../types'; import { dashboardServices } from '../../services/kibana_services'; /** diff --git a/src/plugins/links/public/components/editor/constants.ts b/src/plugins/links/public/components/editor/constants.ts new file mode 100644 index 0000000000000..a1ce4d742364b --- /dev/null +++ b/src/plugins/links/public/components/editor/constants.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { + DASHBOARD_LINK_TYPE, + EXTERNAL_LINK_TYPE, + LinkType, +} from '../../../common/content_management'; +import { DashboardLinkStrings } from '../dashboard_link/dashboard_link_strings'; +import { ExternalLinkStrings } from '../external_link/external_link_strings'; + +export const LinkInfo: { + [id in LinkType]: { + icon: string; + type: string; + displayName: string; + description: string; + }; +} = { + [DASHBOARD_LINK_TYPE]: { + icon: 'dashboardApp', + type: DashboardLinkStrings.getType(), + displayName: DashboardLinkStrings.getDisplayName(), + description: DashboardLinkStrings.getDescription(), + }, + [EXTERNAL_LINK_TYPE]: { + icon: 'link', + type: ExternalLinkStrings.getType(), + displayName: ExternalLinkStrings.getDisplayName(), + description: ExternalLinkStrings.getDescription(), + }, +}; diff --git a/src/plugins/links/public/components/editor/link_destination.tsx b/src/plugins/links/public/components/editor/link_destination.tsx index 5eb2d67a0d882..3337a6c4b2862 100644 --- a/src/plugins/links/public/components/editor/link_destination.tsx +++ b/src/plugins/links/public/components/editor/link_destination.tsx @@ -8,8 +8,6 @@ import React, { useState } from 'react'; -import type { DashboardContainer } from '@kbn/dashboard-plugin/public/dashboard_container'; - import { EuiFormRow } from '@elastic/eui'; import { LinkType, @@ -24,13 +22,17 @@ import { LinksStrings } from '../links_strings'; export const LinkDestination = ({ link, setDestination, - parentDashboard, + parentDashboardId, selectedLinkType, }: { selectedLinkType: LinkType; - parentDashboard?: DashboardContainer; + parentDashboardId?: string; link?: UnorderedLink; - setDestination: (destination?: string, defaultLabel?: string) => void; + setDestination: ( + destination?: string, + defaultLabel?: string, + defaultDescription?: string + ) => void; }) => { const [destinationError, setDestinationError] = useState(); @@ -60,10 +62,14 @@ export const LinkDestination = ({ setDestination(undefined, undefined); if (selectedDashboardId) setDashboardLinkDestination(selectedDashboardId); }} - parentDashboard={parentDashboard} + parentDashboardId={parentDashboardId} initialSelection={dashboardLinkDestination} onDestinationPicked={(dashboard) => - setDestination(dashboard?.id, dashboard?.attributes.title) + setDestination( + dashboard?.id, + dashboard?.attributes.title, + dashboard?.attributes.description + ) } /> ) : ( diff --git a/src/plugins/links/public/components/editor/link_editor.tsx b/src/plugins/links/public/components/editor/link_editor.tsx index ca3aeda7224bb..47a5d6155d055 100644 --- a/src/plugins/links/public/components/editor/link_editor.tsx +++ b/src/plugins/links/public/components/editor/link_editor.tsx @@ -26,17 +26,15 @@ import { EuiFlyoutHeader, EuiRadioGroupOption, } from '@elastic/eui'; -import type { DashboardContainer } from '@kbn/dashboard-plugin/public/dashboard_container'; import { LinkType, EXTERNAL_LINK_TYPE, DASHBOARD_LINK_TYPE, LinkOptions, - Link, } from '../../../common/content_management'; import { LinksStrings } from '../links_strings'; -import { LinkInfo } from '../../embeddable/types'; +import { LinkInfo } from './constants'; import { LinkOptionsComponent } from './link_options'; import { UnorderedLink } from '../../editor/open_link_editor_flyout'; import { LinkDestination } from './link_destination'; @@ -45,18 +43,19 @@ export const LinkEditor = ({ link, onSave, onClose, - parentDashboard, + parentDashboardId, }: { onClose: () => void; - parentDashboard?: DashboardContainer; + parentDashboardId?: string; link?: UnorderedLink; // will only be defined if **editing** a link; otherwise, creating a new link - onSave: (newLink: Omit) => void; + onSave: (newLink: UnorderedLink) => void; }) => { const [selectedLinkType, setSelectedLinkType] = useState( link?.type ?? DASHBOARD_LINK_TYPE ); const [defaultLinkLabel, setDefaultLinkLabel] = useState(); const [currentLinkLabel, setCurrentLinkLabel] = useState(link?.label ?? ''); + const [linkDescription, setLinkDescription] = useState(); const [linkOptions, setLinkOptions] = useState(); const [linkDestination, setLinkDestination] = useState(link?.destination); @@ -79,12 +78,13 @@ export const LinkEditor = ({ /** When a new destination is picked, handle the logic for what to display as the current + default labels */ const handleDestinationPicked = useCallback( - (destination?: string, label?: string) => { + (destination?: string, label?: string, description?: string) => { setLinkDestination(destination); if (!currentLinkLabel || defaultLinkLabel === currentLinkLabel) { setCurrentLinkLabel(label ?? ''); } setDefaultLinkLabel(label); + setLinkDescription(description); }, [defaultLinkLabel, currentLinkLabel] ); @@ -124,7 +124,7 @@ export const LinkEditor = ({ @@ -169,6 +169,8 @@ export const LinkEditor = ({ id: link?.id ?? uuidv4(), destination: linkDestination, options: linkOptions, + title: defaultLinkLabel ?? '', + description: linkDescription, }); onClose(); diff --git a/src/plugins/links/public/components/editor/links_editor.scss b/src/plugins/links/public/components/editor/links_editor.scss index 3eb0d574ddf27..02961c7d5f5cb 100644 --- a/src/plugins/links/public/components/editor/links_editor.scss +++ b/src/plugins/links/public/components/editor/links_editor.scss @@ -30,18 +30,18 @@ text-decoration: none; } - .linksPanelLinkText { + .linksPanelEditorLinkText { &:hover { text-decoration: underline !important; } } } -.linksPanelLink { +.linksPanelEditorLink { padding: $euiSizeXS $euiSizeS; color: $euiTextColor; - .linksPanelLinkText { + .linksPanelEditorLinkText { flex: 1; min-width: 0; } @@ -49,11 +49,11 @@ &.linkError { border: 1px solid transparentize($euiColorWarningText, .7); - .linksPanelLinkText { + .linksPanelEditorLinkText { color: $euiColorWarningText; } - .linksPanelLinkText--noLabel { + .linksPanelEditorLinkText--noLabel { font-style: italic; } } diff --git a/src/plugins/links/public/components/editor/links_editor.test.tsx b/src/plugins/links/public/components/editor/links_editor.test.tsx index b7c85099cf516..28a76d24471f3 100644 --- a/src/plugins/links/public/components/editor/links_editor.test.tsx +++ b/src/plugins/links/public/components/editor/links_editor.test.tsx @@ -11,27 +11,8 @@ import userEvent from '@testing-library/user-event'; import { render, screen, waitFor } from '@testing-library/react'; import LinksEditor from './links_editor'; import { LinksStrings } from '../links_strings'; -import { Link, LINKS_VERTICAL_LAYOUT } from '../../../common/content_management'; -import { fetchDashboard } from '../dashboard_link/dashboard_link_tools'; - -jest.mock('../dashboard_link/dashboard_link_tools', () => { - return { - fetchDashboard: jest.fn().mockImplementation((id: string) => - Promise.resolve({ - id, - status: 'success', - attributes: { - title: `dashboard #${id}`, - description: '', - panelsJSON: [], - timeRestore: false, - version: '1', - }, - references: [], - }) - ), - }; -}); +import { LINKS_VERTICAL_LAYOUT } from '../../../common/content_management'; +import { ResolvedLink } from '../../types'; describe('LinksEditor', () => { const defaultProps = { @@ -42,30 +23,35 @@ describe('LinksEditor', () => { flyoutId: 'test-id', }; - const someLinks: Link[] = [ + const someLinks: ResolvedLink[] = [ { id: 'foo', type: 'dashboardLink' as const, order: 1, destination: '123', + title: 'dashboard 01', }, { id: 'bar', type: 'dashboardLink' as const, order: 4, destination: '456', + title: 'dashboard 02', + description: 'awesome dashboard if you ask me', }, { id: 'bizz', type: 'externalLink' as const, order: 3, destination: 'http://example.com', + title: 'http://example.com', }, { id: 'buzz', type: 'externalLink' as const, order: 2, destination: 'http://elastic.co', + title: 'Elastic website', }, ]; @@ -88,7 +74,6 @@ describe('LinksEditor', () => { test('shows links in order', async () => { const expectedLinkIds = [...someLinks].sort((a, b) => a.order - b.order).map(({ id }) => id); render(); - await waitFor(() => expect(fetchDashboard).toHaveBeenCalledTimes(2)); expect(screen.getByTestId('links--panelEditor--title')).toHaveTextContent( LinksStrings.editor.panelEditor.getEditFlyoutTitle() ); @@ -103,9 +88,8 @@ describe('LinksEditor', () => { test('saving by reference panels calls onSaveToLibrary', async () => { const orderedLinks = [...someLinks].sort((a, b) => a.order - b.order); render(); - await waitFor(() => expect(fetchDashboard).toHaveBeenCalledTimes(2)); const saveButton = screen.getByTestId('links--panelEditor--saveBtn'); - await userEvent.click(saveButton); + userEvent.click(saveButton); await waitFor(() => expect(defaultProps.onSaveToLibrary).toHaveBeenCalledTimes(1)); expect(defaultProps.onSaveToLibrary).toHaveBeenCalledWith(orderedLinks, LINKS_VERTICAL_LAYOUT); }); @@ -113,9 +97,8 @@ describe('LinksEditor', () => { test('saving by value panel calls onAddToDashboard', async () => { const orderedLinks = [...someLinks].sort((a, b) => a.order - b.order); render(); - await waitFor(() => expect(fetchDashboard).toHaveBeenCalledTimes(2)); const saveButton = screen.getByTestId('links--panelEditor--saveBtn'); - await userEvent.click(saveButton); + userEvent.click(saveButton); expect(defaultProps.onAddToDashboard).toHaveBeenCalledTimes(1); expect(defaultProps.onAddToDashboard).toHaveBeenCalledWith(orderedLinks, LINKS_VERTICAL_LAYOUT); }); diff --git a/src/plugins/links/public/components/editor/links_editor.tsx b/src/plugins/links/public/components/editor/links_editor.tsx index bd2da0041499d..736c510c17571 100644 --- a/src/plugins/links/public/components/editor/links_editor.tsx +++ b/src/plugins/links/public/components/editor/links_editor.tsx @@ -28,17 +28,14 @@ import { EuiSwitch, EuiTitle, } from '@elastic/eui'; -import type { DashboardContainer } from '@kbn/dashboard-plugin/public/dashboard_container'; import { - Link, LinksLayoutType, LINKS_HORIZONTAL_LAYOUT, LINKS_VERTICAL_LAYOUT, } from '../../../common/content_management'; -import { focusMainFlyout, memoizedGetOrderedLinkList } from '../../editor/links_editor_tools'; +import { focusMainFlyout } from '../../editor/links_editor_tools'; import { openLinkEditorFlyout } from '../../editor/open_link_editor_flyout'; -import { LinksLayoutInfo } from '../../embeddable/types'; import { coreServices } from '../../services/kibana_services'; import { LinksStrings } from '../links_strings'; import { LinksEditorEmptyPrompt } from './links_editor_empty_prompt'; @@ -47,16 +44,18 @@ import { LinksEditorSingleLink } from './links_editor_single_link'; import { TooltipWrapper } from '../tooltip_wrapper'; import './links_editor.scss'; +import { ResolvedLink } from '../../types'; +import { getOrderedLinkList } from '../../lib/resolve_links'; const layoutOptions: EuiButtonGroupOptionProps[] = [ { id: LINKS_VERTICAL_LAYOUT, - label: LinksLayoutInfo[LINKS_VERTICAL_LAYOUT].displayName, + label: LinksStrings.editor.panelEditor.getVerticalLayoutLabel(), 'data-test-subj': `links--panelEditor--${LINKS_VERTICAL_LAYOUT}LayoutBtn`, }, { id: LINKS_HORIZONTAL_LAYOUT, - label: LinksLayoutInfo[LINKS_HORIZONTAL_LAYOUT].displayName, + label: LinksStrings.editor.panelEditor.getHorizontalLayoutLabel(), 'data-test-subj': `links--panelEditor--${LINKS_HORIZONTAL_LAYOUT}LayoutBtn`, }, ]; @@ -67,16 +66,16 @@ const LinksEditor = ({ onClose, initialLinks, initialLayout, - parentDashboard, + parentDashboardId, isByReference, flyoutId, }: { - onSaveToLibrary: (newLinks: Link[], newLayout: LinksLayoutType) => Promise; - onAddToDashboard: (newLinks: Link[], newLayout: LinksLayoutType) => void; + onSaveToLibrary: (newLinks: ResolvedLink[], newLayout: LinksLayoutType) => Promise; + onAddToDashboard: (newLinks: ResolvedLink[], newLayout: LinksLayoutType) => void; onClose: () => void; - initialLinks?: Link[]; + initialLinks?: ResolvedLink[]; initialLayout?: LinksLayoutType; - parentDashboard?: DashboardContainer; + parentDashboardId?: string; isByReference: boolean; flyoutId: string; // used to manage the focus of this flyout after individual link editor flyout is closed }) => { @@ -88,8 +87,8 @@ const LinksEditor = ({ initialLayout ?? LINKS_VERTICAL_LAYOUT ); const [isSaving, setIsSaving] = useState(false); - const [orderedLinks, setOrderedLinks] = useState([]); - const [saveByReference, setSaveByReference] = useState(!initialLinks ? false : isByReference); + const [orderedLinks, setOrderedLinks] = useState([]); + const [saveByReference, setSaveByReference] = useState(isByReference); const isEditingExisting = initialLinks || isByReference; @@ -98,7 +97,7 @@ const LinksEditor = ({ setOrderedLinks([]); return; } - setOrderedLinks(memoizedGetOrderedLinkList(initialLinks)); + setOrderedLinks(getOrderedLinkList(initialLinks)); }, [initialLinks]); const onDragEnd = useCallback( @@ -116,9 +115,9 @@ const LinksEditor = ({ ); const addOrEditLink = useCallback( - async (linkToEdit?: Link) => { + async (linkToEdit?: ResolvedLink) => { const newLink = await openLinkEditorFlyout({ - parentDashboard, + parentDashboardId, link: linkToEdit, mainFlyoutId: flyoutId, ref: editLinkFlyoutRef, @@ -128,17 +127,20 @@ const LinksEditor = ({ setOrderedLinks( orderedLinks.map((link) => { if (link.id === linkToEdit.id) { - return { ...newLink, order: linkToEdit.order } as Link; + return { ...newLink, order: linkToEdit.order } as ResolvedLink; } return link; }) ); } else { - setOrderedLinks([...orderedLinks, { ...newLink, order: orderedLinks.length } as Link]); + setOrderedLinks([ + ...orderedLinks, + { ...newLink, order: orderedLinks.length } as ResolvedLink, + ]); } } }, - [editLinkFlyoutRef, orderedLinks, parentDashboard, flyoutId] + [editLinkFlyoutRef, orderedLinks, parentDashboardId, flyoutId] ); const hasZeroLinks = useMemo(() => { @@ -213,7 +215,6 @@ const LinksEditor = ({ {(provided) => ( addOrEditLink(link)} deleteLink={() => deleteLink(link.id)} dragHandleProps={provided.dragHandleProps ?? undefined} // casting `null` to `undefined` diff --git a/src/plugins/links/public/components/editor/links_editor_single_link.tsx b/src/plugins/links/public/components/editor/links_editor_single_link.tsx index c69c33662c014..e030881334cb0 100644 --- a/src/plugins/links/public/components/editor/links_editor_single_link.tsx +++ b/src/plugins/links/public/components/editor/links_editor_single_link.tsx @@ -7,8 +7,7 @@ */ import classNames from 'classnames'; -import React, { useMemo, useState } from 'react'; -import useAsync from 'react-use/lib/useAsync'; +import React, { useMemo } from 'react'; import { EuiText, @@ -18,74 +17,35 @@ import { EuiFlexItem, EuiFlexGroup, EuiButtonIcon, - EuiSkeletonTitle, DraggableProvidedDragHandleProps, } from '@elastic/eui'; -import type { DashboardContainer } from '@kbn/dashboard-plugin/public/dashboard_container'; -import { LinkInfo } from '../../embeddable/types'; -import { validateUrl } from '../external_link/external_link_tools'; -import { fetchDashboard } from '../dashboard_link/dashboard_link_tools'; +import { LinkInfo } from './constants'; import { LinksStrings } from '../links_strings'; import { DashboardLinkStrings } from '../dashboard_link/dashboard_link_strings'; -import { DASHBOARD_LINK_TYPE, Link } from '../../../common/content_management'; +import { DASHBOARD_LINK_TYPE } from '../../../common/content_management'; +import { ResolvedLink } from '../../types'; export const LinksEditorSingleLink = ({ link, editLink, deleteLink, - parentDashboard, dragHandleProps, }: { editLink: () => void; deleteLink: () => void; - link: Link; - parentDashboard?: DashboardContainer; + link: ResolvedLink; dragHandleProps?: DraggableProvidedDragHandleProps; }) => { - const [destinationError, setDestinationError] = useState(); - const parentDashboardTitle = parentDashboard?.select((state) => state.explicitInput.title); - const parentDashboardId = parentDashboard?.select((state) => state.componentState.lastSavedId); - - const { value: linkLabel, loading: linkLabelLoading } = useAsync(async () => { - if (!link.destination) { - setDestinationError(new Error(DashboardLinkStrings.getDashboardErrorLabel())); - return; - } - - if (link.type === DASHBOARD_LINK_TYPE) { - if (parentDashboardId === link.destination) { - return link.label || parentDashboardTitle; - } else { - const dashboard = await fetchDashboard(link.destination) - .then((result) => { - setDestinationError(undefined); - return result; - }) - .catch((error) => setDestinationError(error)); - return ( - link.label || - (dashboard ? dashboard.attributes.title : DashboardLinkStrings.getDashboardErrorLabel()) - ); - } - } else { - const { valid, message } = validateUrl(link.destination); - if (!valid && message) { - setDestinationError(new Error(message)); - } - return link.label || link.destination; - } - }, [link]); - const LinkLabel = useMemo(() => { const labelText = ( - - - {linkLabel} - - + + {link.label || link.title} + ); return () => - destinationError ? ( + link.error ? ( @@ -148,7 +101,7 @@ export const LinksEditorSingleLink = ({ - + @@ -160,7 +113,7 @@ export const LinksEditorSingleLink = ({ size="xs" iconType="pencil" onClick={editLink} - aria-label={LinksStrings.editor.getEditLinkTitle(linkLabel)} + aria-label={LinksStrings.editor.getEditLinkTitle(link.title)} data-test-subj="panelEditorLink--editBtn" /> @@ -170,7 +123,7 @@ export const LinksEditorSingleLink = ({ { - const defaultLinkInfo = { + const defaultLinkInfo: ResolvedLink = { destination: 'https://example.com', order: 1, id: 'foo', type: 'externalLink' as const, + title: 'https://example.com', }; - let links: LinksEmbeddable; beforeEach(async () => { window.open = jest.fn(); - links = await mockLinksPanel({}); }); afterEach(() => { @@ -38,17 +34,8 @@ describe('external link component', () => { }); test('by default opens in new tab and renders external icon', async () => { - render( - - - - ); + render(); - expect(onRender).toBeCalledTimes(1); const link = await screen.findByTestId('externalLink--foo'); expect(link).toBeInTheDocument(); const externalIcon = within(link).getByText('External link'); @@ -62,11 +49,7 @@ describe('external link component', () => { ...defaultLinkInfo, options: { ...DEFAULT_URL_DRILLDOWN_OPTIONS, openInNewTab: false }, }; - render( - - - - ); + render(); const link = await screen.findByTestId('externalLink--foo'); const externalIcon = within(link).getByText('External link'); expect(externalIcon?.getAttribute('data-euiicon-type')).toBe('popout'); @@ -77,12 +60,8 @@ describe('external link component', () => { ...defaultLinkInfo, options: { ...DEFAULT_URL_DRILLDOWN_OPTIONS, openInNewTab: false }, }; - render( - - - - ); - expect(onRender).toBeCalledTimes(1); + render(); + const link = await screen.findByTestId('externalLink--foo'); expect(link).toHaveTextContent('https://example.com'); const clickEvent = createEvent.click(link, { ctrlKey: true }); @@ -96,12 +75,8 @@ describe('external link component', () => { ...defaultLinkInfo, options: { ...DEFAULT_URL_DRILLDOWN_OPTIONS, openInNewTab: false }, }; - render( - - - - ); - expect(onRender).toBeCalledTimes(1); + render(); + const link = await screen.findByTestId('externalLink--foo'); userEvent.click(link); expect(coreServices.application.navigateToUrl).toBeCalledTimes(1); @@ -112,14 +87,11 @@ describe('external link component', () => { const linkInfo = { ...defaultLinkInfo, destination: 'file://buzz', + error: new Error('URL not supported'), }; - render( - - - - ); - expect(onRender).toBeCalledTimes(1); - const link = await screen.findByTestId('externalLink--foo--error'); + render(); + + const link = screen.getByTestId('externalLink--foo--error'); expect(link).toBeDisabled(); /** * TODO: We should test the tooltip content, but the component is disabled diff --git a/src/plugins/links/public/components/external_link/external_link_component.tsx b/src/plugins/links/public/components/external_link/external_link_component.tsx index d2209efb8f100..c60b97115fbf3 100644 --- a/src/plugins/links/public/components/external_link/external_link_component.tsx +++ b/src/plugins/links/public/components/external_link/external_link_component.tsx @@ -6,9 +6,7 @@ * Side Public License, v 1. */ -import React, { useMemo, useState } from 'react'; -import useMount from 'react-use/lib/useMount'; - +import React, { useMemo } from 'react'; import { EuiListGroupItem } from '@elastic/eui'; import { METRIC_TYPE } from '@kbn/analytics'; import { @@ -18,28 +16,19 @@ import { import { EXTERNAL_LINK_TYPE, - Link, LinksLayoutType, LINKS_VERTICAL_LAYOUT, } from '../../../common/content_management'; import { coreServices, trackUiMetric } from '../../services/kibana_services'; -import { validateUrl } from './external_link_tools'; +import { ResolvedLink } from '../../types'; export const ExternalLinkComponent = ({ link, layout, - onRender, }: { - link: Link; + link: ResolvedLink; layout: LinksLayoutType; - onRender: () => void; }) => { - const [error, setError] = useState(); - - useMount(() => { - onRender(); - }); - const linkOptions = useMemo(() => { return { ...DEFAULT_URL_DRILLDOWN_OPTIONS, @@ -47,13 +36,6 @@ export const ExternalLinkComponent = ({ } as UrlDrilldownOptions; }, [link.options]); - const isValidUrl = useMemo(() => { - if (!link.destination) return false; - const { valid, message } = validateUrl(link.destination); - if (!valid) setError(message); - return valid; - }, [link.destination]); - const destination = useMemo(() => { return link.destination && linkOptions.encodeUrl ? encodeURI(link.destination) @@ -67,20 +49,20 @@ export const ExternalLinkComponent = ({ size="s" external color="text" - isDisabled={!link.destination || !isValidUrl} + isDisabled={Boolean(link.error)} className={'linksPanelLink'} - showToolTip={!isValidUrl} + showToolTip={Boolean(link.error)} toolTipProps={{ - content: error, + content: link.error?.message, position: layout === LINKS_VERTICAL_LAYOUT ? 'right' : 'bottom', repositionOnScroll: true, delay: 'long', 'data-test-subj': `${id}--tooltip`, }} - iconType={error ? 'warning' : undefined} + iconType={link.error ? 'warning' : undefined} id={id} label={link.label || link.destination} - data-test-subj={error ? `${id}--error` : `${id}`} + data-test-subj={link.error ? `${id}--error` : `${id}`} href={destination} onClick={async (event) => { if (!destination) return; diff --git a/src/plugins/links/public/components/links_component.tsx b/src/plugins/links/public/components/links_component.tsx deleted file mode 100644 index 0da40365abad0..0000000000000 --- a/src/plugins/links/public/components/links_component.tsx +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { EuiListGroup, EuiPanel } from '@elastic/eui'; -import React, { useEffect, useMemo } from 'react'; -import useMap from 'react-use/lib/useMap'; -import { - DASHBOARD_LINK_TYPE, - LINKS_HORIZONTAL_LAYOUT, - LINKS_VERTICAL_LAYOUT, -} from '../../common/content_management'; -import { memoizedGetOrderedLinkList } from '../editor/links_editor_tools'; -import { DashboardLinkComponent } from './dashboard_link/dashboard_link_component'; -import { ExternalLinkComponent } from './external_link/external_link_component'; - -import './links_component.scss'; -import { useLinks, useLinksAttributes } from './links_hooks'; - -export const LinksComponent = () => { - const linksEmbeddable = useLinks(); - const linksAttributes = useLinksAttributes(); - - const [linksLoading, { set: setLinkIsLoading }] = useMap( - Object.fromEntries( - (linksAttributes?.links ?? []).map((link) => { - return [link.id, true]; - }) - ) - ); - - useEffect(() => { - if (Object.values(linksLoading).includes(true)) { - linksEmbeddable.onLoading(); - } else { - linksEmbeddable.onRender(); - } - }, [linksLoading, linksEmbeddable]); - - const orderedLinks = useMemo(() => { - if (!linksAttributes?.links) return []; - return memoizedGetOrderedLinkList(linksAttributes?.links); - }, [linksAttributes]); - - const linkItems: { [id: string]: { id: string; content: JSX.Element } } = useMemo(() => { - return (linksAttributes?.links ?? []).reduce((prev, currentLink) => { - return { - ...prev, - [currentLink.id]: { - id: currentLink.id, - content: - currentLink.type === DASHBOARD_LINK_TYPE ? ( - setLinkIsLoading(currentLink.id, true)} - onRender={() => setLinkIsLoading(currentLink.id, false)} - /> - ) : ( - setLinkIsLoading(currentLink.id, false)} - /> - ), - }, - }; - }, {}); - }, [linksAttributes?.links, linksAttributes?.layout, setLinkIsLoading]); - - return ( - - - {orderedLinks.map((link) => linkItems[link.id].content)} - - - ); -}; diff --git a/src/plugins/links/public/components/links_hooks.tsx b/src/plugins/links/public/components/links_hooks.tsx deleted file mode 100644 index aa33c9d0f3ac1..0000000000000 --- a/src/plugins/links/public/components/links_hooks.tsx +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { useContext, useEffect, useState } from 'react'; - -import { LinksAttributes } from '../../common/content_management'; -import { LinksContext, LinksEmbeddable } from '../embeddable/links_embeddable'; - -export const useLinks = (): LinksEmbeddable => { - const linksEmbeddable = useContext(LinksContext); - if (linksEmbeddable == null) { - throw new Error('useLinks must be used inside LinksContext.'); - } - return linksEmbeddable!; -}; - -export const useLinksAttributes = (): LinksAttributes | undefined => { - const linksEmbeddable = useLinks(); - const [attributes, setAttributes] = useState( - linksEmbeddable.attributes - ); - - useEffect(() => { - const attributesSubscription = linksEmbeddable.attributes$.subscribe((newAttributes) => { - setAttributes(newAttributes); - }); - return () => { - attributesSubscription.unsubscribe(); - }; - }, [linksEmbeddable.attributes$]); - - return attributes; -}; diff --git a/src/plugins/links/public/components/links_strings.ts b/src/plugins/links/public/components/links_strings.ts index 8c6f1c888fb12..52b91a81d0054 100644 --- a/src/plugins/links/public/components/links_strings.ts +++ b/src/plugins/links/public/components/links_strings.ts @@ -13,6 +13,12 @@ export const LinksStrings = { i18n.translate('links.description', { defaultMessage: 'Use links to navigate to commonly used dashboards and websites.', }), + embeddable: { + getUnsupportedLinkTypeError: () => + i18n.translate('links.embeddable.unsupportedLinkTypeError', { + defaultMessage: 'Unsupported link type', + }), + }, editor: { getAddButtonLabel: () => i18n.translate('links.editor.addButtonLabel', { @@ -100,7 +106,7 @@ export const LinksStrings = { }), getErrorDuringSaveToastTitle: () => i18n.translate('links.editor.unableToSaveToastTitle', { - defaultMessage: 'Error saving Link panel', + defaultMessage: 'Error saving links panel', }), }, linkEditor: { diff --git a/src/plugins/links/public/content_management/index.ts b/src/plugins/links/public/content_management/index.ts index c7bc84b8f6b80..42e25c5465256 100644 --- a/src/plugins/links/public/content_management/index.ts +++ b/src/plugins/links/public/content_management/index.ts @@ -8,3 +8,5 @@ export { linksClient } from './links_content_management_client'; export { checkForDuplicateTitle } from './duplicate_title_check'; +export { runSaveToLibrary } from './save_to_library'; +export { loadFromLibrary } from './load_from_library'; diff --git a/src/plugins/links/public/content_management/load_from_library.ts b/src/plugins/links/public/content_management/load_from_library.ts new file mode 100644 index 0000000000000..5c6e54bb702de --- /dev/null +++ b/src/plugins/links/public/content_management/load_from_library.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 { injectReferences } from '../../common/persistable_state'; +import { linksClient } from './links_content_management_client'; + +export async function loadFromLibrary(savedObjectId: string) { + const { + item: savedObject, + meta: { outcome, aliasPurpose, aliasTargetId }, + } = await linksClient.get(savedObjectId); + if (savedObject.error) throw savedObject.error; + const { attributes } = injectReferences(savedObject); + return { + attributes, + metaInfo: { + sharingSavedObjectProps: { + aliasTargetId, + outcome, + aliasPurpose, + sourceId: savedObjectId, + }, + }, + }; +} diff --git a/src/plugins/links/public/content_management/save_to_library.tsx b/src/plugins/links/public/content_management/save_to_library.tsx index e9dba65a532f5..ea731681a7a1a 100644 --- a/src/plugins/links/public/content_management/save_to_library.tsx +++ b/src/plugins/links/public/content_management/save_to_library.tsx @@ -14,12 +14,11 @@ import { SavedObjectSaveModal, SaveResult, } from '@kbn/saved-objects-plugin/public'; - import { CONTENT_ID } from '../../common'; -import { LinksAttributes } from '../../common/content_management'; -import { LinksByReferenceInput, LinksInput } from '../embeddable/types'; import { checkForDuplicateTitle } from './duplicate_title_check'; -import { getLinksAttributeService } from '../services/attribute_service'; +import { linksClient } from './links_content_management_client'; +import { LinksRuntimeState } from '../types'; +import { serializeLinksAttributes } from '../lib/serialize_attributes'; const modalTitle = i18n.translate('links.contentManagement.saveModalTitle', { defaultMessage: `Save {contentId} panel to library`, @@ -29,10 +28,9 @@ const modalTitle = i18n.translate('links.contentManagement.saveModalTitle', { }); export const runSaveToLibrary = async ( - newAttributes: LinksAttributes, - initialInput: LinksInput -): Promise => { - return new Promise((resolve) => { + newState: LinksRuntimeState +): Promise => { + return new Promise((resolve, reject) => { const onSave = async ({ newTitle, newDescription, @@ -47,7 +45,7 @@ export const runSaveToLibrary = async ( if ( !(await checkForDuplicateTitle({ title: newTitle, - lastSavedTitle: newAttributes.title, + lastSavedTitle: newState.title ?? '', copyOnSave: false, onTitleDuplicate, isTitleDuplicateConfirmed, @@ -56,28 +54,40 @@ export const runSaveToLibrary = async ( return {}; } - const stateToSave = { - ...newAttributes, + const { attributes, references } = serializeLinksAttributes(newState); + + const newAttributes = { + ...attributes, ...stateFromSaveModal, }; - const updatedInput = (await getLinksAttributeService().wrapAttributes( - stateToSave, - true, - initialInput - )) as unknown as LinksByReferenceInput; - - resolve(updatedInput); - return { id: updatedInput.savedObjectId }; + try { + const { + item: { id }, + } = await linksClient.create({ + data: { ...newAttributes, title: newTitle }, + options: { references }, + }); + resolve({ + ...newState, + defaultPanelTitle: newTitle, + defaultPanelDescription: newDescription, + savedObjectId: id, + }); + return { id }; + } catch (error) { + reject(); + return { error }; + } }; const saveModal = ( resolve(undefined)} - title={newAttributes.title ?? ''} + title={newState.title ?? ''} customModalTitle={modalTitle} - description={newAttributes.description} + description={newState.description} showDescription showCopyOnSave={false} objectType={CONTENT_ID} diff --git a/src/plugins/links/public/editor/links_editor_tools.tsx b/src/plugins/links/public/editor/links_editor_tools.tsx index 543d08a48ea91..e89bd2ca18f82 100644 --- a/src/plugins/links/public/editor/links_editor_tools.tsx +++ b/src/plugins/links/public/editor/links_editor_tools.tsx @@ -6,29 +6,6 @@ * Side Public License, v 1. */ -import { memoize } from 'lodash'; -import { Link } from '../../common/content_management'; - -const getOrderedLinkList = (links: Link[]): Link[] => { - return [...links].sort((linkA, linkB) => { - return linkA.order - linkB.order; - }); -}; - -/** - * Memoizing this prevents the links panel editor from having to unnecessarily calculate this - * a second time once the embeddable exists - after all, the links component should have already - * calculated this so, we can get away with using the cached version in the editor - */ -export const memoizedGetOrderedLinkList = memoize( - (links: Link[]) => { - return getOrderedLinkList(links); - }, - (links: Link[]) => { - return links; - } -); - /** * Return focus to the main flyout div to align with a11y standards * @param flyoutId ID of the main flyout div element diff --git a/src/plugins/links/public/editor/open_editor_flyout.tsx b/src/plugins/links/public/editor/open_editor_flyout.tsx index 8455ca16e604b..7d1a1adf9c478 100644 --- a/src/plugins/links/public/editor/open_editor_flyout.tsx +++ b/src/plugins/links/public/editor/open_editor_flyout.tsx @@ -11,17 +11,17 @@ import { skip, take } from 'rxjs'; import { v4 as uuidv4 } from 'uuid'; import { EuiLoadingSpinner, EuiPanel } from '@elastic/eui'; -import type { DashboardContainer } from '@kbn/dashboard-plugin/public/dashboard_container'; import { toMountPoint } from '@kbn/react-kibana-mount'; import { withSuspense } from '@kbn/shared-ux-utility'; import { OverlayRef } from '@kbn/core-mount-utils-browser'; import { tracksOverlays } from '@kbn/presentation-containers'; -import { Link, LinksLayoutType } from '../../common/content_management'; -import { runSaveToLibrary } from '../content_management/save_to_library'; -import { LinksByReferenceInput, LinksEditorFlyoutReturn, LinksInput } from '../embeddable/types'; -import { getLinksAttributeService } from '../services/attribute_service'; +import { apiPublishesSavedObjectId } from '@kbn/presentation-publishing'; +import { LinksLayoutType } from '../../common/content_management'; +import { linksClient, runSaveToLibrary } from '../content_management'; import { coreServices } from '../services/kibana_services'; +import { LinksRuntimeState, ResolvedLink } from '../types'; +import { serializeLinksAttributes } from '../lib/serialize_attributes'; const LazyLinksEditor = React.lazy(() => import('../components/editor/links_editor')); @@ -35,18 +35,14 @@ const LinksEditor = withSuspense( /** * @throws in case user cancels */ -export async function openEditorFlyout( - initialInput: LinksInput, - parentDashboard?: DashboardContainer -): Promise { - const attributeService = getLinksAttributeService(); - const { attributes } = await attributeService.unwrapAttributes(initialInput); - const isByReference = attributeService.inputIsRefType(initialInput); - const initialLinks = attributes?.links; - const overlayTracker = - parentDashboard && tracksOverlays(parentDashboard) ? parentDashboard : undefined; - - if (!initialLinks) { +export async function openEditorFlyout({ + initialState, + parentDashboard, +}: { + initialState?: LinksRuntimeState; + parentDashboard?: unknown; +}): Promise { + if (!initialState) { /** * When creating a new links panel, the tooltip from the "Add panel" popover interacts badly with the flyout * and can cause a "double opening" animation if the flyout opens before the tooltip has time to unmount; so, @@ -58,6 +54,14 @@ export async function openEditorFlyout( await new Promise((resolve) => setTimeout(resolve, 50)); } + const overlayTracker = + parentDashboard && tracksOverlays(parentDashboard) ? parentDashboard : undefined; + + const parentDashboardId = + parentDashboard && apiPublishesSavedObjectId(parentDashboard) + ? parentDashboard.savedObjectId.value + : undefined; + return new Promise((resolve, reject) => { const flyoutId = `linksEditorFlyout-${uuidv4()}`; @@ -77,45 +81,35 @@ export async function openEditorFlyout( if (!overlayTracker) editorFlyout.close(); }); - const onSaveToLibrary = async (newLinks: Link[], newLayout: LinksLayoutType) => { - const newAttributes = { - ...attributes, + const onSaveToLibrary = async (newLinks: ResolvedLink[], newLayout: LinksLayoutType) => { + const newState: LinksRuntimeState = { + ...initialState, links: newLinks, layout: newLayout, }; - const updatedInput = (initialInput as LinksByReferenceInput).savedObjectId - ? await attributeService.wrapAttributes(newAttributes, true, initialInput) - : await runSaveToLibrary(newAttributes, initialInput); - if (!updatedInput) { - return; - } - resolve({ - newInput: updatedInput, - // pass attributes via attributes so that the Dashboard can choose the right panel size. - attributes: newAttributes, - }); - parentDashboard?.reload(); + if (initialState?.savedObjectId) { + const { attributes, references } = serializeLinksAttributes(newState); + await linksClient.update({ + id: initialState.savedObjectId, + data: attributes, + options: { references }, + }); + resolve(newState); + } else { + const saveResult = await runSaveToLibrary(newState); + resolve(saveResult); + } closeEditorFlyout(editorFlyout); }; - const onAddToDashboard = (newLinks: Link[], newLayout: LinksLayoutType) => { - const newAttributes = { - ...attributes, + const onAddToDashboard = (newLinks: ResolvedLink[], newLayout: LinksLayoutType) => { + const newState = { + ...initialState, links: newLinks, layout: newLayout, }; - const newInput: LinksInput = { - ...initialInput, - attributes: newAttributes, - }; - resolve({ - newInput, - - // pass attributes so that the Dashboard can choose the right panel size. - attributes: newAttributes, - }); - parentDashboard?.reload(); + resolve(newState); closeEditorFlyout(editorFlyout); }; @@ -128,13 +122,13 @@ export async function openEditorFlyout( toMountPoint( , { theme: coreServices.theme, i18n: coreServices.i18n } ), diff --git a/src/plugins/links/public/editor/open_link_editor_flyout.tsx b/src/plugins/links/public/editor/open_link_editor_flyout.tsx index d3406264db4ad..e6c931be5aee0 100644 --- a/src/plugins/links/public/editor/open_link_editor_flyout.tsx +++ b/src/plugins/links/public/editor/open_link_editor_flyout.tsx @@ -8,18 +8,15 @@ import React from 'react'; import ReactDOM from 'react-dom'; - import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; -import type { DashboardContainer } from '@kbn/dashboard-plugin/public/dashboard_container'; - import { coreServices } from '../services/kibana_services'; -import { Link } from '../../common/content_management'; import { LinkEditor } from '../components/editor/link_editor'; import { focusMainFlyout } from './links_editor_tools'; +import { ResolvedLink } from '../types'; export interface LinksEditorProps { - link?: Link; - parentDashboard?: DashboardContainer; + link?: ResolvedLink; + parentDashboardId?: string; mainFlyoutId: string; ref: React.RefObject; } @@ -28,7 +25,7 @@ export interface LinksEditorProps { * This editor has no context about other links, so it cannot determine order; order will be determined * by the **caller** (i.e. the panel editor, which contains the context about **all links**) */ -export type UnorderedLink = Omit; +export type UnorderedLink = Omit; /** * @throws in case user cancels @@ -37,8 +34,8 @@ export async function openLinkEditorFlyout({ ref, link, mainFlyoutId, // used to manage the focus of this flyout after inidividual link editor flyout is closed - parentDashboard, -}: LinksEditorProps): Promise { + parentDashboardId, +}: LinksEditorProps) { const unmountFlyout = async () => { if (ref.current) { ref.current.children[1].className = 'linkEditor out'; @@ -69,7 +66,7 @@ export async function openLinkEditorFlyout({ link={link} onSave={onSave} onClose={onCancel} - parentDashboard={parentDashboard} + parentDashboardId={parentDashboardId} /> , ref.current diff --git a/src/plugins/links/public/embeddable/index.ts b/src/plugins/links/public/embeddable/index.ts deleted file mode 100644 index ab89b768f1285..0000000000000 --- a/src/plugins/links/public/embeddable/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export { LinksEmbeddable } from './links_embeddable'; -export type { LinksFactory } from './links_embeddable_factory'; -export { LinksFactoryDefinition } from './links_embeddable_factory'; diff --git a/src/plugins/links/public/embeddable/links_embeddable.test.tsx b/src/plugins/links/public/embeddable/links_embeddable.test.tsx new file mode 100644 index 0000000000000..73de5b8237df5 --- /dev/null +++ b/src/plugins/links/public/embeddable/links_embeddable.test.tsx @@ -0,0 +1,364 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { render, screen, waitFor } from '@testing-library/react'; +import { embeddablePluginMock } from '@kbn/embeddable-plugin/public/mocks'; +import { setStubKibanaServices } from '@kbn/presentation-panel-plugin/public/mocks'; +import { getLinksEmbeddableFactory } from './links_embeddable'; +import { Link } from '../../common/content_management'; +import { CONTENT_ID } from '../../common'; +import { ReactEmbeddableRenderer } from '@kbn/embeddable-plugin/public'; +import { + LinksApi, + LinksParentApi, + LinksRuntimeState, + LinksSerializedState, + ResolvedLink, +} from '../types'; +import { linksClient } from '../content_management'; +import { getMockLinksParentApi } from '../mocks'; + +const links: Link[] = [ + { + id: '001', + order: 0, + type: 'dashboardLink', + label: '', + destinationRefName: 'link_001_dashboard', + }, + { + id: '002', + order: 1, + type: 'dashboardLink', + label: 'Dashboard 2', + destinationRefName: 'link_002_dashboard', + }, + { + id: '003', + order: 2, + type: 'externalLink', + label: 'Example homepage', + destination: 'https://example.com', + }, + { + id: '004', + order: 3, + type: 'externalLink', + destination: 'https://elastic.co', + }, +]; + +const resolvedLinks: ResolvedLink[] = [ + { + id: '001', + order: 0, + type: 'dashboardLink', + label: '', + destination: '999', + title: 'Dashboard 1', + description: 'Dashboard 1 description', + }, + { + id: '002', + order: 1, + type: 'dashboardLink', + label: 'Dashboard 2', + destination: '888', + title: 'Dashboard 2', + description: 'Dashboard 2 description', + }, + { + id: '003', + order: 2, + type: 'externalLink', + label: 'Example homepage', + destination: 'https://example.com', + title: 'Example homepage', + }, + { + id: '004', + order: 3, + type: 'externalLink', + destination: 'https://elastic.co', + title: 'https://elastic.co', + }, +]; + +const references = [ + { + id: '999', + name: 'link_001_dashboard', + type: 'dashboard', + }, + { + id: '888', + name: 'link_002_dashboard', + type: 'dashboard', + }, +]; + +jest.mock('../lib/resolve_links', () => { + return { + resolveLinks: jest.fn().mockResolvedValue(resolvedLinks), + }; +}); + +jest.mock('../content_management', () => { + return { + loadFromLibrary: jest.fn((savedObjectId) => { + return Promise.resolve({ + attributes: { + title: 'links 001', + description: 'some links', + links, + layout: 'vertical', + }, + metaInfo: { + sharingSavedObjectProps: { + aliasTargetId: '123', + outcome: 'exactMatch', + aliasPurpose: 'sharing', + sourceId: savedObjectId, + }, + }, + }); + }), + linksClient: { + create: jest.fn().mockResolvedValue({ item: { id: '333' } }), + update: jest.fn().mockResolvedValue({ item: { id: '123' } }), + }, + }; +}); + +describe('getLinksEmbeddableFactory', () => { + const factory = getLinksEmbeddableFactory(); + beforeAll(() => { + const embeddable = embeddablePluginMock.createSetupContract(); + embeddable.registerReactEmbeddableFactory(CONTENT_ID, async () => { + return factory; + }); + setStubKibanaServices(); + }); + + describe('by reference embeddable', () => { + const rawState = { + savedObjectId: '123', + title: 'my links', + description: 'just a few links', + } as LinksSerializedState; + + const expectedRuntimeState = { + defaultPanelTitle: 'links 001', + defaultPanelDescription: 'some links', + layout: 'vertical', + links: resolvedLinks, + description: 'just a few links', + title: 'my links', + savedObjectId: '123', + }; + + let parent: LinksParentApi; + + beforeEach(() => { + parent = getMockLinksParentApi(rawState, references); + }); + + test('deserializeState', async () => { + const deserializedState = await factory.deserializeState({ + rawState, + references, + }); + expect(deserializedState).toEqual({ + ...expectedRuntimeState, + }); + }); + + test('component renders', async () => { + render( + + type={CONTENT_ID} + getParentApi={() => parent} + /> + ); + + expect(await screen.findByTestId('links--component')).toBeInTheDocument(); + }); + + test('api methods', async () => { + const onApiAvailable = jest.fn() as jest.MockedFunction<(api: LinksApi) => void>; + + render( + + type={CONTENT_ID} + onApiAvailable={onApiAvailable} + getParentApi={() => parent} + /> + ); + + await waitFor(async () => { + const api = onApiAvailable.mock.calls[0][0]; + expect(await api.serializeState()).toEqual({ + rawState: { + savedObjectId: '123', + title: 'my links', + description: 'just a few links', + hidePanelTitles: undefined, + }, + references: [], + }); + expect(api.libraryId$.value).toBe('123'); + expect(api.defaultPanelTitle!.value).toBe('links 001'); + expect(api.defaultPanelDescription!.value).toBe('some links'); + }); + }); + + test('unlink from library', async () => { + const onApiAvailable = jest.fn() as jest.MockedFunction<(api: LinksApi) => void>; + + render( + + type={CONTENT_ID} + onApiAvailable={onApiAvailable} + getParentApi={() => parent} + /> + ); + + await waitFor(async () => { + const api = onApiAvailable.mock.calls[0][0]; + api.unlinkFromLibrary(); + expect(await api.serializeState()).toEqual({ + rawState: { + title: 'my links', + description: 'just a few links', + hidePanelTitles: undefined, + attributes: { + description: 'some links', + title: 'links 001', + links, + layout: 'vertical', + }, + }, + references, + }); + expect(api.libraryId$.value).toBeUndefined(); + }); + }); + }); + + describe('by value embeddable', () => { + const rawState = { + attributes: { + links, + layout: 'horizontal', + }, + description: 'just a few links', + title: 'my links', + } as LinksSerializedState; + + const expectedRuntimeState = { + defaultPanelTitle: undefined, + defaultPanelDescription: undefined, + layout: 'horizontal', + links: resolvedLinks, + description: 'just a few links', + title: 'my links', + savedObjectId: undefined, + }; + + let parent: LinksParentApi; + + beforeEach(() => { + parent = getMockLinksParentApi(rawState, references); + }); + + test('deserializeState', async () => { + const deserializedState = await factory.deserializeState({ + rawState, + references, + }); + expect(deserializedState).toEqual({ ...expectedRuntimeState, layout: 'horizontal' }); + }); + + test('component renders', async () => { + render( + + type={CONTENT_ID} + getParentApi={() => parent} + /> + ); + + expect(await screen.findByTestId('links--component')).toBeInTheDocument(); + }); + + test('api methods', async () => { + const onApiAvailable = jest.fn() as jest.MockedFunction<(api: LinksApi) => void>; + + render( + + type={CONTENT_ID} + onApiAvailable={onApiAvailable} + getParentApi={() => parent} + /> + ); + + await waitFor(async () => { + const api = onApiAvailable.mock.calls[0][0]; + expect(await api.serializeState()).toEqual({ + rawState: { + title: 'my links', + description: 'just a few links', + hidePanelTitles: undefined, + attributes: { + links, + layout: 'horizontal', + }, + }, + references, + }); + + expect(api.libraryId$.value).toBeUndefined(); + }); + }); + test('save to library', async () => { + const onApiAvailable = jest.fn() as jest.MockedFunction<(api: LinksApi) => void>; + + render( + + type={CONTENT_ID} + onApiAvailable={onApiAvailable} + getParentApi={() => parent} + /> + ); + + await waitFor(async () => { + const api = onApiAvailable.mock.calls[0][0]; + const newId = await api.saveToLibrary('some new title'); + expect(linksClient.create).toHaveBeenCalledWith({ + data: { + title: 'some new title', + links, + layout: 'horizontal', + }, + options: { references }, + }); + expect(newId).toBe('333'); + expect(api.libraryId$.value).toBe('333'); + expect(await api.serializeState()).toEqual({ + rawState: { + savedObjectId: '333', + title: 'my links', + description: 'just a few links', + hidePanelTitles: undefined, + }, + references: [], + }); + }); + }); + }); +}); diff --git a/src/plugins/links/public/embeddable/links_embeddable.tsx b/src/plugins/links/public/embeddable/links_embeddable.tsx index 523d8706b2b86..0a5b98a7ce3be 100644 --- a/src/plugins/links/public/embeddable/links_embeddable.tsx +++ b/src/plugins/links/public/embeddable/links_embeddable.tsx @@ -6,155 +6,271 @@ * Side Public License, v 1. */ -import deepEqual from 'fast-deep-equal'; -import React, { createContext } from 'react'; -import { unmountComponentAtNode } from 'react-dom'; -import { distinctUntilChanged, skip, Subject, Subscription, switchMap } from 'rxjs'; +import React, { createContext, useMemo } from 'react'; +import { cloneDeep } from 'lodash'; +import { BehaviorSubject } from 'rxjs'; +import fastIsEqual from 'fast-deep-equal'; +import { EuiListGroup, EuiPanel } from '@elastic/eui'; -import type { DashboardContainer } from '@kbn/dashboard-plugin/public/dashboard_container'; +import { PanelIncompatibleError, ReactEmbeddableFactory } from '@kbn/embeddable-plugin/public'; import { - AttributeService, - Embeddable, - ReferenceOrValueEmbeddable, - SavedObjectEmbeddableInput, - COMMON_EMBEDDABLE_GROUPING, -} from '@kbn/embeddable-plugin/public'; - -import { CONTENT_ID } from '../../common'; -import { LinksAttributes } from '../../common/content_management'; -import { LinksComponent } from '../components/links_component'; -import { LinksByReferenceInput, LinksByValueInput, LinksInput, LinksOutput } from './types'; - -export const LinksContext = createContext(null); - -export interface LinksConfig { - editable: boolean; -} - -export class LinksEmbeddable - extends Embeddable - implements ReferenceOrValueEmbeddable -{ - public readonly type = CONTENT_ID; - deferEmbeddableLoad = true; - - private domNode?: HTMLElement; - private isDestroyed?: boolean; - private subscriptions: Subscription = new Subscription(); - - public attributes?: LinksAttributes; - public attributes$ = new Subject(); - - public grouping = [COMMON_EMBEDDABLE_GROUPING.annotation]; - - constructor( - config: LinksConfig, - initialInput: LinksInput, - private attributeService: AttributeService, - parent?: DashboardContainer - ) { - super( - initialInput, - { - editable: config.editable, - editableWithExplicitInput: true, - }, - parent - ); - - this.initializeSavedLinks() - .then(() => this.setInitializationFinished()) - .catch((e: Error) => this.onFatalError(e)); - - // By-value panels should update the links attributes when input changes - this.subscriptions.add( - this.getInput$() - .pipe( - distinctUntilChanged(deepEqual), - skip(1), - switchMap(async () => await this.initializeSavedLinks()) - ) - .subscribe() - ); - - // Keep attributes in sync with subject value so it can be used in output - this.subscriptions.add( - this.attributes$.pipe(distinctUntilChanged(deepEqual)).subscribe((attributes) => { - this.attributes = attributes; - }) - ); - } - - private async initializeSavedLinks() { - const { attributes } = await this.attributeService.unwrapAttributes(this.getInput()); - this.attributes$.next(attributes); - await this.initializeOutput(); - } - - private async initializeOutput() { - const { title, description } = this.getInput(); - this.updateOutput({ - defaultTitle: this.attributes?.title, - defaultDescription: this.attributes?.description, - title: title ?? this.attributes?.title, - description: description ?? this.attributes?.description, - }); - } - - public onRender() { - this.renderComplete.dispatchComplete(); - } - - public onLoading() { - this.renderComplete.dispatchInProgress(); - } - - public inputIsRefType( - input: LinksByValueInput | LinksByReferenceInput - ): input is LinksByReferenceInput { - return this.attributeService.inputIsRefType(input); - } - - public async getInputAsRefType(): Promise { - return this.attributeService.getInputAsRefType(this.getExplicitInput(), { - showSaveModal: true, - saveModalTitle: this.getTitle(), - }); - } - - public async getInputAsValueType(): Promise { - return this.attributeService.getInputAsValueType(this.getExplicitInput()); - } - - public async reload() { - if (this.isDestroyed) return; - // By-reference embeddable panels are reloaded when changed, so update the attributes - this.initializeSavedLinks(); - if (this.domNode) { - this.render(this.domNode); - } - } - - public destroy() { - this.isDestroyed = true; - super.destroy(); - this.subscriptions.unsubscribe(); - if (this.domNode) { - unmountComponentAtNode(this.domNode); - } - } - - public render(domNode: HTMLElement) { - this.domNode = domNode; - if (this.isDestroyed) return; - super.render(domNode); - - this.domNode.setAttribute('data-shared-item', ''); - - return ( - - - - ); - } -} + apiPublishesPanelDescription, + apiPublishesPanelTitle, + apiPublishesSavedObjectId, + initializeTitles, + useBatchedOptionalPublishingSubjects, +} from '@kbn/presentation-publishing'; + +import { apiIsPresentationContainer, SerializedPanelState } from '@kbn/presentation-containers'; + +import { + CONTENT_ID, + DASHBOARD_LINK_TYPE, + LinksLayoutType, + LINKS_HORIZONTAL_LAYOUT, + LINKS_VERTICAL_LAYOUT, +} from '../../common/content_management'; +import { DashboardLinkComponent } from '../components/dashboard_link/dashboard_link_component'; +import { ExternalLinkComponent } from '../components/external_link/external_link_component'; +import { + LinksApi, + LinksByReferenceSerializedState, + LinksByValueSerializedState, + LinksParentApi, + LinksRuntimeState, + LinksSerializedState, + ResolvedLink, +} from '../types'; +import { DISPLAY_NAME } from '../../common'; +import { injectReferences } from '../../common/persistable_state'; + +import '../components/links_component.scss'; +import { checkForDuplicateTitle, linksClient } from '../content_management'; +import { resolveLinks } from '../lib/resolve_links'; +import { + deserializeLinksSavedObject, + linksSerializeStateIsByReference, +} from '../lib/deserialize_from_library'; +import { serializeLinksAttributes } from '../lib/serialize_attributes'; + +export const LinksContext = createContext(null); + +const isParentApiCompatible = (parentApi: unknown): parentApi is LinksParentApi => + apiIsPresentationContainer(parentApi) && + apiPublishesSavedObjectId(parentApi) && + apiPublishesPanelTitle(parentApi) && + apiPublishesPanelDescription(parentApi); + +export const getLinksEmbeddableFactory = () => { + const linksEmbeddableFactory: ReactEmbeddableFactory< + LinksSerializedState, + LinksRuntimeState, + LinksApi + > = { + type: CONTENT_ID, + deserializeState: async (serializedState) => { + // Clone the state to avoid an object not extensible error when injecting references + const state = cloneDeep(serializedState.rawState); + const { title, description } = serializedState.rawState; + + if (linksSerializeStateIsByReference(state)) { + const attributes = await deserializeLinksSavedObject(state); + return { + ...attributes, + title, + description, + }; + } + + const { attributes: attributesWithInjectedIds } = injectReferences({ + attributes: state.attributes, + references: serializedState.references ?? [], + }); + + const resolvedLinks = await resolveLinks(attributesWithInjectedIds.links ?? []); + + return { + title, + description, + links: resolvedLinks, + layout: attributesWithInjectedIds.layout, + defaultPanelTitle: attributesWithInjectedIds.title, + defaultPanelDescription: attributesWithInjectedIds.description, + }; + }, + buildEmbeddable: async (state, buildApi, uuid, parentApi) => { + const error$ = new BehaviorSubject(state.error); + if (!isParentApiCompatible(parentApi)) error$.next(new PanelIncompatibleError()); + + const links$ = new BehaviorSubject(state.links); + const layout$ = new BehaviorSubject(state.layout); + const defaultPanelTitle = new BehaviorSubject(state.defaultPanelTitle); + const defaultPanelDescription = new BehaviorSubject( + state.defaultPanelDescription + ); + const savedObjectId$ = new BehaviorSubject(state.savedObjectId); + const { titlesApi, titleComparators, serializeTitles } = initializeTitles(state); + + const api = buildApi( + { + ...titlesApi, + blockingError: error$, + defaultPanelTitle, + defaultPanelDescription, + isEditingEnabled: () => Boolean(error$.value === undefined), + libraryId$: savedObjectId$, + getTypeDisplayName: () => DISPLAY_NAME, + getByValueRuntimeSnapshot: () => { + const snapshot = api.snapshotRuntimeState(); + delete snapshot.savedObjectId; + return snapshot; + }, + serializeState: async (): Promise> => { + if (savedObjectId$.value !== undefined) { + const linksByReferenceState: LinksByReferenceSerializedState = { + savedObjectId: savedObjectId$.value, + ...serializeTitles(), + }; + return { rawState: linksByReferenceState, references: [] }; + } + const runtimeState = api.snapshotRuntimeState(); + const { attributes, references } = serializeLinksAttributes(runtimeState); + const linksByValueState: LinksByValueSerializedState = { + attributes, + ...serializeTitles(), + }; + return { rawState: linksByValueState, references }; + }, + saveToLibrary: async (newTitle: string) => { + defaultPanelTitle.next(newTitle); + const runtimeState = api.snapshotRuntimeState(); + const { attributes, references } = serializeLinksAttributes(runtimeState); + const { + item: { id }, + } = await linksClient.create({ + data: { + ...attributes, + title: newTitle, + }, + options: { references }, + }); + savedObjectId$.next(id); + return id; + }, + checkForDuplicateTitle: async ( + newTitle: string, + isTitleDuplicateConfirmed: boolean, + onTitleDuplicate: () => void + ) => { + await checkForDuplicateTitle({ + title: newTitle, + copyOnSave: false, + lastSavedTitle: '', + isTitleDuplicateConfirmed, + onTitleDuplicate, + }); + }, + unlinkFromLibrary: () => { + savedObjectId$.next(undefined); + }, + onEdit: async () => { + try { + const { openEditorFlyout } = await import('../editor/open_editor_flyout'); + const newState = await openEditorFlyout({ + initialState: api.snapshotRuntimeState(), + parentDashboard: parentApi, + }); + if (newState) { + links$.next(newState.links); + layout$.next(newState.layout); + defaultPanelTitle.next(newState.defaultPanelTitle); + defaultPanelDescription.next(newState.defaultPanelDescription); + savedObjectId$.next(newState.savedObjectId); + } + } catch { + // do nothing, user cancelled + } + }, + }, + { + ...titleComparators, + links: [ + links$, + (nextLinks?: ResolvedLink[]) => links$.next(nextLinks ?? []), + (a, b) => Boolean(savedObjectId$.value) || fastIsEqual(a, b), // Editing attributes in a by-reference panel should not trigger unsaved changes. + ], + layout: [ + layout$, + (nextLayout?: LinksLayoutType) => layout$.next(nextLayout ?? LINKS_VERTICAL_LAYOUT), + (a, b) => Boolean(savedObjectId$.value) || a === b, + ], + error: [error$, (nextError?: Error) => error$.next(nextError)], + defaultPanelDescription: [ + defaultPanelDescription, + (nextDescription?: string) => defaultPanelDescription.next(nextDescription), + ], + defaultPanelTitle: [ + defaultPanelTitle, + (nextTitle?: string) => defaultPanelTitle.next(nextTitle), + ], + savedObjectId: [savedObjectId$, (val) => savedObjectId$.next(val)], + } + ); + + const Component = () => { + const [links, layout] = useBatchedOptionalPublishingSubjects(links$, layout$); + + const linkItems: { [id: string]: { id: string; content: JSX.Element } } = useMemo(() => { + if (!links) return {}; + return links.reduce((prev, currentLink) => { + return { + ...prev, + [currentLink.id]: { + id: currentLink.id, + content: + currentLink.type === DASHBOARD_LINK_TYPE ? ( + + ) : ( + + ), + }, + }; + }, {}); + }, [links, layout]); + return ( + + + {links?.map((link) => linkItems[link.id].content)} + + + ); + }; + return { + api, + Component, + }; + }, + }; + return linksEmbeddableFactory; +}; diff --git a/src/plugins/links/public/embeddable/links_embeddable_factory.test.ts b/src/plugins/links/public/embeddable/links_embeddable_factory.test.ts deleted file mode 100644 index d575c975e0295..0000000000000 --- a/src/plugins/links/public/embeddable/links_embeddable_factory.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { LinksFactoryDefinition } from './links_embeddable_factory'; -import { LinksInput } from './types'; - -describe('linksFactory', () => { - test('returns an empty object when not given proper meta information', () => { - const linksFactory = new LinksFactoryDefinition(); - const settings = linksFactory.getLegacyPanelPlacementSettings({} as unknown as LinksInput, {}); - expect(settings.height).toBeUndefined(); - expect(settings.width).toBeUndefined(); - expect(settings.strategy).toBeUndefined(); - }); - - test('returns a horizontal layout', () => { - const linksFactory = new LinksFactoryDefinition(); - const settings = linksFactory.getLegacyPanelPlacementSettings({} as unknown as LinksInput, { - layout: 'horizontal', - links: [], - }); - expect(settings.height).toBe(4); - expect(settings.width).toBe(48); - expect(settings.strategy).toBe('placeAtTop'); - }); - - test('returns a vertical layout with the appropriate height', () => { - const linksFactory = new LinksFactoryDefinition(); - const settings = linksFactory.getLegacyPanelPlacementSettings({} as unknown as LinksInput, { - layout: 'vertical', - links: [ - { type: 'dashboardLink', destination: 'superDashboard1' }, - { type: 'dashboardLink', destination: 'superDashboard2' }, - { type: 'dashboardLink', destination: 'superDashboard3' }, - ], - }); - expect(settings.height).toBe(7); // 4 base plus 3 for each link. - expect(settings.width).toBe(8); - expect(settings.strategy).toBe('placeAtTop'); - }); -}); diff --git a/src/plugins/links/public/embeddable/links_embeddable_factory.ts b/src/plugins/links/public/embeddable/links_embeddable_factory.ts deleted file mode 100644 index 40d377345e4f2..0000000000000 --- a/src/plugins/links/public/embeddable/links_embeddable_factory.ts +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { DASHBOARD_GRID_COLUMN_COUNT, PanelPlacementStrategy } from '@kbn/dashboard-plugin/public'; -import type { DashboardContainer } from '@kbn/dashboard-plugin/public/dashboard_container'; -import { IProvidesLegacyPanelPlacementSettings } from '@kbn/dashboard-plugin/public'; -import { EmbeddableStateWithType } from '@kbn/embeddable-plugin/common'; -import { - EmbeddableFactory, - EmbeddableFactoryDefinition, - ErrorEmbeddable, - COMMON_EMBEDDABLE_GROUPING, -} from '@kbn/embeddable-plugin/public'; -import { - GetMigrationFunctionObjectFn, - MigrateFunctionsObject, -} from '@kbn/kibana-utils-plugin/common'; -import { UiActionsPresentableGrouping } from '@kbn/ui-actions-plugin/public'; - -import { APP_ICON, APP_NAME, CONTENT_ID } from '../../common'; -import { LinksAttributes } from '../../common/content_management'; -import { extract, inject } from '../../common/embeddable'; -import { LinksStrings } from '../components/links_strings'; -import { getLinksAttributeService } from '../services/attribute_service'; -import { coreServices, untilPluginStartServicesReady } from '../services/kibana_services'; -import type { LinksEmbeddable } from './links_embeddable'; -import { LinksByReferenceInput, LinksEditorFlyoutReturn, LinksInput } from './types'; - -export type LinksFactory = EmbeddableFactory; - -// TODO: Replace string 'OPEN_FLYOUT_ADD_DRILLDOWN' with constant once the dashboardEnhanced plugin is removed -// and it is no longer locked behind `x-pack` -const getDefaultLinksInput = (): Partial => ({ - disabledActions: ['OPEN_FLYOUT_ADD_DRILLDOWN'], -}); - -const isLinksAttributes = (attributes?: unknown): attributes is LinksAttributes => { - return ( - attributes !== undefined && - Boolean((attributes as LinksAttributes).layout || (attributes as LinksAttributes).links) - ); -}; - -export class LinksFactoryDefinition - implements - EmbeddableFactoryDefinition, - IProvidesLegacyPanelPlacementSettings -{ - latestVersion?: string | undefined; - telemetry?: - | ((state: EmbeddableStateWithType, stats: Record) => Record) - | undefined; - migrations?: MigrateFunctionsObject | GetMigrationFunctionObjectFn | undefined; - grouping: UiActionsPresentableGrouping = [COMMON_EMBEDDABLE_GROUPING.annotation]; - - public readonly type = CONTENT_ID; - - public readonly isContainerType = false; - - public readonly savedObjectMetaData = { - name: APP_NAME, - type: CONTENT_ID, - getIconForSavedObject: () => APP_ICON, - }; - - public getLegacyPanelPlacementSettings: IProvidesLegacyPanelPlacementSettings< - LinksInput, - LinksAttributes | unknown - >['getLegacyPanelPlacementSettings'] = (input, attributes) => { - if (!isLinksAttributes(attributes) || !attributes.layout) { - // if we have no information about the layout of this links panel defer to default panel size and placement. - return {}; - } - - const isHorizontal = attributes.layout === 'horizontal'; - const width = isHorizontal ? DASHBOARD_GRID_COLUMN_COUNT : 8; - const height = isHorizontal ? 4 : (attributes.links?.length ?? 1 * 3) + 4; - return { width, height, strategy: PanelPlacementStrategy.placeAtTop }; - }; - - public async isEditable() { - await untilPluginStartServicesReady(); - return Boolean(coreServices.application.capabilities.dashboard?.showWriteControls); - } - - public canCreateNew() { - return true; - } - - public getDefaultInput(): Partial { - return getDefaultLinksInput(); - } - - public async createFromSavedObject( - savedObjectId: string, - input: LinksInput, - parent: DashboardContainer - ): Promise { - if (!(input as LinksByReferenceInput).savedObjectId) { - (input as LinksByReferenceInput).savedObjectId = savedObjectId; - } - return this.create(input, parent); - } - - public async create(initialInput: LinksInput, parent: DashboardContainer) { - await untilPluginStartServicesReady(); - - const { LinksEmbeddable } = await import('./links_embeddable'); - const editable = await this.isEditable(); - - return new LinksEmbeddable( - { editable }, - { ...getDefaultLinksInput(), ...initialInput }, - getLinksAttributeService(), - parent - ); - } - - public async getExplicitInput( - initialInput: LinksInput, - parent?: DashboardContainer - ): Promise { - const { openEditorFlyout } = await import('../editor/open_editor_flyout'); - - const { newInput, attributes } = await openEditorFlyout( - { - ...getDefaultLinksInput(), - ...initialInput, - }, - parent - ); - - return { newInput, attributes }; - } - - public getDisplayName() { - return APP_NAME; - } - - public getIconType() { - return 'link'; - } - - public getDescription() { - return LinksStrings.getDescription(); - } - - inject = inject; - - extract = extract; -} diff --git a/src/plugins/links/public/embeddable/types.ts b/src/plugins/links/public/embeddable/types.ts deleted file mode 100644 index d16d8431a5601..0000000000000 --- a/src/plugins/links/public/embeddable/types.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { ReduxEmbeddableState } from '@kbn/presentation-util-plugin/public'; -import { - EmbeddableInput, - EmbeddableOutput, - SavedObjectEmbeddableInput, -} from '@kbn/embeddable-plugin/public'; - -import { DashboardAttributes } from '@kbn/dashboard-plugin/common'; -import { - LinkType, - EXTERNAL_LINK_TYPE, - DASHBOARD_LINK_TYPE, - LINKS_VERTICAL_LAYOUT, - LinksLayoutType, - LINKS_HORIZONTAL_LAYOUT, - LinksAttributes, -} from '../../common/content_management'; -import { DashboardLinkStrings } from '../components/dashboard_link/dashboard_link_strings'; -import { ExternalLinkStrings } from '../components/external_link/external_link_strings'; -import { LinksStrings } from '../components/links_strings'; - -export const LinksLayoutInfo: { - [id in LinksLayoutType]: { displayName: string }; -} = { - [LINKS_HORIZONTAL_LAYOUT]: { - displayName: LinksStrings.editor.panelEditor.getHorizontalLayoutLabel(), - }, - [LINKS_VERTICAL_LAYOUT]: { - displayName: LinksStrings.editor.panelEditor.getVerticalLayoutLabel(), - }, -}; - -export interface DashboardItem { - id: string; - attributes: DashboardAttributes; -} - -export const LinkInfo: { - [id in LinkType]: { - icon: string; - type: string; - displayName: string; - description: string; - }; -} = { - [DASHBOARD_LINK_TYPE]: { - icon: 'dashboardApp', - type: DashboardLinkStrings.getType(), - displayName: DashboardLinkStrings.getDisplayName(), - description: DashboardLinkStrings.getDescription(), - }, - [EXTERNAL_LINK_TYPE]: { - icon: 'link', - type: ExternalLinkStrings.getType(), - displayName: ExternalLinkStrings.getDisplayName(), - description: ExternalLinkStrings.getDescription(), - }, -}; - -export interface LinksEditorFlyoutReturn { - attributes?: unknown; - newInput: Partial; -} - -export type LinksByValueInput = { - attributes: LinksAttributes; -} & EmbeddableInput; - -export type LinksByReferenceInput = SavedObjectEmbeddableInput; - -export type LinksInput = LinksByValueInput | LinksByReferenceInput; - -export type LinksOutput = EmbeddableOutput & { - attributes?: LinksAttributes; -}; - -/** - * Links embeddable redux state - */ -export type LinksComponentState = LinksAttributes; - -export type LinksReduxState = ReduxEmbeddableState; diff --git a/src/plugins/links/public/index.ts b/src/plugins/links/public/index.ts index 3389cd48f4b67..ce842fc4f1f6d 100644 --- a/src/plugins/links/public/index.ts +++ b/src/plugins/links/public/index.ts @@ -6,9 +6,6 @@ * Side Public License, v 1. */ -export type { LinksFactory } from './embeddable'; -export { LinksFactoryDefinition, LinksEmbeddable } from './embeddable'; - import { LinksPlugin } from './plugin'; export function plugin() { diff --git a/src/plugins/links/public/lib/deserialize_from_library.ts b/src/plugins/links/public/lib/deserialize_from_library.ts new file mode 100644 index 0000000000000..a35be4f408554 --- /dev/null +++ b/src/plugins/links/public/lib/deserialize_from_library.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 { loadFromLibrary } from '../content_management'; +import { LinksByReferenceSerializedState, LinksSerializedState } from '../types'; +import { resolveLinks } from './resolve_links'; + +export const linksSerializeStateIsByReference = ( + state?: LinksSerializedState +): state is LinksByReferenceSerializedState => { + return Boolean(state && (state as LinksByReferenceSerializedState).savedObjectId !== undefined); +}; + +export const deserializeLinksSavedObject = async (state: LinksByReferenceSerializedState) => { + const { attributes } = await loadFromLibrary(state.savedObjectId); + + const links = await resolveLinks(attributes.links ?? []); + + const { title: defaultPanelTitle, description: defaultPanelDescription, layout } = attributes; + + return { + links, + layout, + savedObjectId: state.savedObjectId, + defaultPanelTitle, + defaultPanelDescription, + }; +}; diff --git a/src/plugins/links/public/lib/resolve_links.test.ts b/src/plugins/links/public/lib/resolve_links.test.ts new file mode 100644 index 0000000000000..e56c28324b6f7 --- /dev/null +++ b/src/plugins/links/public/lib/resolve_links.test.ts @@ -0,0 +1,73 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { resolveLinkInfo } from './resolve_links'; +import { Link, DASHBOARD_LINK_TYPE } from '../../common/content_management'; + +jest.mock('../components/dashboard_link/dashboard_link_tools', () => ({ + fetchDashboard: async (id: string) => { + if (id === '404') { + const error = new Error('Dashboard not found'); + throw error; + } + return { + attributes: { + title: `Dashboard ${id}`, + description: 'Some descriptive text.', + }, + }; + }, +})); + +describe('resolveLinkInfo', () => { + it('resolves a dashboard link with no label', async () => { + const link: Link = { + id: '1', + type: DASHBOARD_LINK_TYPE, + order: 0, + destination: '001', + }; + const resolvedLink = await resolveLinkInfo(link); + expect(resolvedLink).toEqual({ + title: 'Dashboard 001', + description: 'Some descriptive text.', + label: undefined, + }); + }); + + it('resolves a dashboard link with a label', async () => { + const link: Link = { + id: '1', + type: DASHBOARD_LINK_TYPE, + order: 0, + destination: '001', + label: 'My Dashboard', + }; + const resolvedLink = await resolveLinkInfo(link); + expect(resolvedLink).toEqual({ + title: 'Dashboard 001', + description: 'Some descriptive text.', + label: 'My Dashboard', + }); + }); + + it('adds an error for missing dashboard', async () => { + const link: Link = { + id: '1', + type: DASHBOARD_LINK_TYPE, + order: 0, + destination: '404', + }; + const resolvedLink = await resolveLinkInfo(link); + expect(resolvedLink).toEqual({ + title: 'Error fetching dashboard', + description: 'Dashboard not found', + error: new Error('Dashboard not found'), + }); + }); +}); diff --git a/src/plugins/links/public/lib/resolve_links.ts b/src/plugins/links/public/lib/resolve_links.ts new file mode 100644 index 0000000000000..c3ae15ef5393b --- /dev/null +++ b/src/plugins/links/public/lib/resolve_links.ts @@ -0,0 +1,73 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { memoize } from 'lodash'; +import { ResolvedLink } from '../types'; +import { DASHBOARD_LINK_TYPE, EXTERNAL_LINK_TYPE, Link } from '../../common/content_management'; +import { validateUrl } from '../components/external_link/external_link_tools'; +import { fetchDashboard } from '../components/dashboard_link/dashboard_link_tools'; +import { DashboardLinkStrings } from '../components/dashboard_link/dashboard_link_strings'; +import { LinksStrings } from '../components/links_strings'; + +export const getOrderedLinkList = (links: ResolvedLink[]): ResolvedLink[] => { + return [...links].sort((linkA, linkB) => { + return linkA.order - linkB.order; + }); +}; + +/** + * Memoizing this prevents the links panel editor from having to unnecessarily calculate this + * a second time once the embeddable exists - after all, the links component should have already + * calculated this so, we can get away with using the cached version in the editor + */ +export const memoizedGetOrderedLinkList = memoize( + (links: ResolvedLink[]) => { + return getOrderedLinkList(links); + }, + (links: ResolvedLink[]) => { + return links; + } +); + +export async function resolveLinks(links: Link[] = []) { + const resolvedLinkInfos = await Promise.all( + links.map(async (link) => { + return { ...link, ...(await resolveLinkInfo(link)) }; + }) + ); + return getOrderedLinkList(resolvedLinkInfos); +} + +export async function resolveLinkInfo( + link: Link +): Promise<{ title: string; label?: string; description?: string; error?: Error }> { + if (link.type === EXTERNAL_LINK_TYPE) { + const info = { title: link.label ?? link.destination }; + const { valid, message } = validateUrl(link.destination); + if (valid) { + return info; + } + return { ...info, error: new Error(message) }; + } + if (link.type === DASHBOARD_LINK_TYPE) { + if (!link.destination) return { title: '' }; + try { + const { + attributes: { title, description }, + } = await fetchDashboard(link.destination); + return { label: link.label, title, description }; + } catch (error) { + return { + title: DashboardLinkStrings.getDashboardErrorLabel(), + description: error.message, + error, + }; + } + } + throw new Error(LinksStrings.embeddable.getUnsupportedLinkTypeError()); +} diff --git a/src/plugins/links/public/lib/serialize_attributes.ts b/src/plugins/links/public/lib/serialize_attributes.ts new file mode 100644 index 0000000000000..d9e8d1de148bb --- /dev/null +++ b/src/plugins/links/public/lib/serialize_attributes.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Link } from '../../common/content_management'; +import { extractReferences } from '../../common/persistable_state'; +import { LinksRuntimeState } from '../types'; + +export const serializeLinksAttributes = ( + state: LinksRuntimeState, + shouldExtractReferences: boolean = true +) => { + const linksToSave: Link[] | undefined = state.links?.map( + ({ title, description, error, ...linkToSave }) => linkToSave + ); + const attributes = { + title: state.defaultPanelTitle, + description: state.defaultPanelDescription, + layout: state.layout, + links: linksToSave, + }; + + const serializedState = shouldExtractReferences + ? extractReferences({ attributes }) + : { attributes, references: [] }; + + return serializedState; +}; diff --git a/src/plugins/links/public/mocks.ts b/src/plugins/links/public/mocks.ts new file mode 100644 index 0000000000000..89f15ef9ea205 --- /dev/null +++ b/src/plugins/links/public/mocks.ts @@ -0,0 +1,65 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { coreMock } from '@kbn/core/public/mocks'; +import { dashboardPluginMock } from '@kbn/dashboard-plugin/public/mocks'; +import { embeddablePluginMock } from '@kbn/embeddable-plugin/public/mocks'; +import { contentManagementMock } from '@kbn/content-management-plugin/public/mocks'; +import { presentationUtilPluginMock } from '@kbn/presentation-util-plugin/public/mocks'; +import { uiActionsPluginMock } from '@kbn/ui-actions-plugin/public/mocks'; +import { BehaviorSubject } from 'rxjs'; +import { getMockPresentationContainer } from '@kbn/presentation-containers/mocks'; +import { AggregateQuery, Filter, Query, TimeRange } from '@kbn/es-query'; +import { Reference } from '@kbn/content-management-utils'; +import { setKibanaServices } from './services/kibana_services'; +import { LinksParentApi, LinksSerializedState } from './types'; + +export const setStubKibanaServices = () => { + const mockCore = coreMock.createStart(); + + const core = { + ...mockCore, + application: { + ...mockCore.application, + capabilities: { + ...mockCore.application.capabilities, + visualize: { + save: true, + }, + }, + }, + }; + + setKibanaServices(core, { + dashboard: dashboardPluginMock.createStartContract(), + embeddable: embeddablePluginMock.createStartContract(), + contentManagement: contentManagementMock.createStartContract(), + presentationUtil: presentationUtilPluginMock.createStartContract(core), + uiActions: uiActionsPluginMock.createStartContract(), + }); +}; + +export const getMockLinksParentApi = ( + serializedState: LinksSerializedState, + references?: Reference[] +): LinksParentApi => ({ + ...getMockPresentationContainer(), + type: 'dashboard', + filters$: new BehaviorSubject(undefined), + query$: new BehaviorSubject(undefined), + timeRange$: new BehaviorSubject({ + from: 'now-15m', + to: 'now', + }), + timeslice$: new BehaviorSubject<[number, number] | undefined>(undefined), + savedObjectId: new BehaviorSubject('999'), + hidePanelTitle: new BehaviorSubject(false), + panelTitle: new BehaviorSubject('My Dashboard'), + panelDescription: new BehaviorSubject(''), + getSerializedStateForChild: () => ({ rawState: serializedState, references }), +}); diff --git a/src/plugins/links/public/mocks.tsx b/src/plugins/links/public/mocks.tsx deleted file mode 100644 index 6a27185c9b09a..0000000000000 --- a/src/plugins/links/public/mocks.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 { coreMock } from '@kbn/core/public/mocks'; -import { dashboardPluginMock } from '@kbn/dashboard-plugin/public/mocks'; -import { embeddablePluginMock } from '@kbn/embeddable-plugin/public/mocks'; -import { contentManagementMock } from '@kbn/content-management-plugin/public/mocks'; -import { presentationUtilPluginMock } from '@kbn/presentation-util-plugin/public/mocks'; -import { setKibanaServices } from './services/kibana_services'; - -export const setStubKibanaServices = () => { - const core = coreMock.createStart(); - - setKibanaServices(core, { - dashboard: dashboardPluginMock.createStartContract(), - embeddable: embeddablePluginMock.createStartContract(), - contentManagement: contentManagementMock.createStartContract(), - presentationUtil: presentationUtilPluginMock.createStartContract(core), - }); -}; diff --git a/src/plugins/links/public/plugin.ts b/src/plugins/links/public/plugin.ts index 32788a2a283c1..f5ac0dd5f1d20 100644 --- a/src/plugins/links/public/plugin.ts +++ b/src/plugins/links/public/plugin.ts @@ -11,21 +11,28 @@ import { ContentManagementPublicStart, } from '@kbn/content-management-plugin/public'; import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; -import { DashboardStart } from '@kbn/dashboard-plugin/public'; -import type { DashboardContainer } from '@kbn/dashboard-plugin/public/dashboard_container'; +import { + DashboardStart, + DASHBOARD_GRID_COLUMN_COUNT, + PanelPlacementStrategy, +} from '@kbn/dashboard-plugin/public'; import { EmbeddableSetup, EmbeddableStart } from '@kbn/embeddable-plugin/public'; import { PresentationUtilPluginStart } from '@kbn/presentation-util-plugin/public'; import { UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; import { VisualizationsSetup } from '@kbn/visualizations-plugin/public'; +import { UiActionsPublicStart } from '@kbn/ui-actions-plugin/public/plugin'; +import { LinksSerializedState } from './types'; import { APP_ICON, APP_NAME, CONTENT_ID, LATEST_VERSION } from '../common'; import { LinksCrudTypes } from '../common/content_management'; import { LinksStrings } from './components/links_strings'; import { getLinksClient } from './content_management/links_content_management_client'; -import { LinksFactoryDefinition } from './embeddable'; -import { LinksByReferenceInput } from './embeddable/types'; -import { setKibanaServices } from './services/kibana_services'; - +import { setKibanaServices, untilPluginStartServicesReady } from './services/kibana_services'; +import { registerCreateLinksPanelAction } from './actions/create_links_panel_action'; +import { + deserializeLinksSavedObject, + linksSerializeStateIsByReference, +} from './lib/deserialize_from_library'; export interface LinksSetupDependencies { embeddable: EmbeddableSetup; visualizations: VisualizationsSetup; @@ -37,6 +44,7 @@ export interface LinksStartDependencies { dashboard: DashboardStart; presentationUtil: PresentationUtilPluginStart; contentManagement: ContentManagementPublicStart; + uiActions: UiActionsPublicStart; usageCollection?: UsageCollectionStart; } @@ -47,10 +55,6 @@ export class LinksPlugin public setup(core: CoreSetup, plugins: LinksSetupDependencies) { core.getStartServices().then(([_, deps]) => { - const linksFactory = new LinksFactoryDefinition(); - - plugins.embeddable.registerEmbeddableFactory(CONTENT_ID, linksFactory); - plugins.contentManagement.registry.register({ id: CONTENT_ID, version: { @@ -59,20 +63,23 @@ export class LinksPlugin name: APP_NAME, }); - const getExplicitInput = async ({ - savedObjectId, - parent, - }: { - savedObjectId?: string; - parent?: DashboardContainer; - }) => { - try { - await linksFactory.getExplicitInput({ savedObjectId } as LinksByReferenceInput, parent); - } catch { - // swallow any errors - this just means that the user cancelled editing - } - return; - }; + plugins.embeddable.registerReactEmbeddableSavedObject({ + onAdd: (container, savedObject) => { + container.addNewPanel({ + panelType: CONTENT_ID, + initialState: { savedObjectId: savedObject.id }, + }); + }, + embeddableType: CONTENT_ID, + savedObjectType: CONTENT_ID, + savedObjectName: APP_NAME, + getIconForSavedObject: () => APP_ICON, + }); + + plugins.embeddable.registerReactEmbeddableFactory(CONTENT_ID, async () => { + const { getLinksEmbeddableFactory } = await import('./embeddable/links_embeddable'); + return getLinksEmbeddableFactory(); + }); plugins.visualizations.registerAlias({ disableCreate: true, // do not allow creation through visualization listing page @@ -93,7 +100,13 @@ export class LinksPlugin return { id, title, - editor: { onEdit: (savedObjectId: string) => getExplicitInput({ savedObjectId }) }, + editor: { + onEdit: async (savedObjectId: string) => { + const { openEditorFlyout } = await import('./editor/open_editor_flyout'); + const initialState = await deserializeLinksSavedObject({ savedObjectId }); + await openEditorFlyout({ initialState }); + }, + }, description, updatedAt, icon: APP_ICON, @@ -110,6 +123,24 @@ export class LinksPlugin public start(core: CoreStart, plugins: LinksStartDependencies) { setKibanaServices(core, plugins); + untilPluginStartServicesReady().then(() => { + registerCreateLinksPanelAction(); + + plugins.dashboard.registerDashboardPanelPlacementSetting( + CONTENT_ID, + async (serializedState?: LinksSerializedState) => { + if (!serializedState) return {}; + const { links, layout } = linksSerializeStateIsByReference(serializedState) + ? await deserializeLinksSavedObject(serializedState) + : serializedState.attributes; + const isHorizontal = layout === 'horizontal'; + const width = isHorizontal ? DASHBOARD_GRID_COLUMN_COUNT : 8; + const height = isHorizontal ? 4 : (links?.length ?? 1 * 3) + 4; + return { width, height, strategy: PanelPlacementStrategy.placeAtTop }; + } + ); + }); + return {}; } diff --git a/src/plugins/links/public/services/attribute_service.ts b/src/plugins/links/public/services/attribute_service.ts deleted file mode 100644 index bde2ab27c1d15..0000000000000 --- a/src/plugins/links/public/services/attribute_service.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Reference } from '@kbn/content-management-utils'; -import { AttributeService } from '@kbn/embeddable-plugin/public'; -import type { OnSaveProps } from '@kbn/saved-objects-plugin/public'; -import { SharingSavedObjectProps } from '../../common/types'; -import { LinksAttributes } from '../../common/content_management'; -import { extractReferences, injectReferences } from '../../common/persistable_state'; -import { LinksByReferenceInput, LinksByValueInput } from '../embeddable/types'; -import { embeddableService } from './kibana_services'; -import { checkForDuplicateTitle, linksClient } from '../content_management'; -import { CONTENT_ID } from '../../common'; - -export type LinksDocument = LinksAttributes & { - references?: Reference[]; -}; - -export interface LinksUnwrapMetaInfo { - sharingSavedObjectProps?: SharingSavedObjectProps; -} - -export type LinksAttributeService = AttributeService< - LinksDocument, - LinksByValueInput, - LinksByReferenceInput, - LinksUnwrapMetaInfo ->; - -let linksAttributeService: LinksAttributeService | null = null; -export function getLinksAttributeService(): LinksAttributeService { - if (linksAttributeService) return linksAttributeService; - - linksAttributeService = embeddableService.getAttributeService< - LinksDocument, - LinksByValueInput, - LinksByReferenceInput, - LinksUnwrapMetaInfo - >(CONTENT_ID, { - saveMethod: async (attributes: LinksDocument, savedObjectId?: string) => { - const { attributes: updatedAttributes, references } = extractReferences({ - attributes, - references: attributes.references, - }); - const { - item: { id }, - } = await (savedObjectId - ? linksClient.update({ - id: savedObjectId, - data: updatedAttributes, - options: { references }, - }) - : linksClient.create({ data: updatedAttributes, options: { references } })); - return { id }; - }, - unwrapMethod: async ( - savedObjectId: string - ): Promise<{ - attributes: LinksDocument; - metaInfo: LinksUnwrapMetaInfo; - }> => { - const { - item: savedObject, - meta: { outcome, aliasPurpose, aliasTargetId }, - } = await linksClient.get(savedObjectId); - if (savedObject.error) throw savedObject.error; - - const { attributes } = injectReferences(savedObject); - return { - attributes, - metaInfo: { - sharingSavedObjectProps: { - aliasTargetId, - outcome, - aliasPurpose, - sourceId: savedObjectId, - }, - }, - }; - }, - checkForDuplicateTitle: (props: OnSaveProps) => { - return checkForDuplicateTitle({ - title: props.newTitle, - copyOnSave: false, - lastSavedTitle: '', - isTitleDuplicateConfirmed: props.isTitleDuplicateConfirmed, - onTitleDuplicate: props.onTitleDuplicate, - }); - }, - }); - return linksAttributeService; -} diff --git a/src/plugins/links/public/services/kibana_services.ts b/src/plugins/links/public/services/kibana_services.ts index 7536c12262792..f25ecdd4c3f16 100644 --- a/src/plugins/links/public/services/kibana_services.ts +++ b/src/plugins/links/public/services/kibana_services.ts @@ -14,6 +14,7 @@ import { DashboardStart } from '@kbn/dashboard-plugin/public'; import { EmbeddableStart } from '@kbn/embeddable-plugin/public'; import { PresentationUtilPluginStart } from '@kbn/presentation-util-plugin/public'; +import { UiActionsPublicStart } from '@kbn/ui-actions-plugin/public/plugin'; import { CONTENT_ID } from '../../common'; import { LinksStartDependencies } from '../plugin'; @@ -22,6 +23,7 @@ export let dashboardServices: DashboardStart; export let embeddableService: EmbeddableStart; export let presentationUtil: PresentationUtilPluginStart; export let contentManagement: ContentManagementPublicStart; +export let uiActions: UiActionsPublicStart; export let trackUiMetric: ( type: string, eventNames: string | string[], @@ -48,6 +50,7 @@ export const setKibanaServices = (kibanaCore: CoreStart, deps: LinksStartDepende embeddableService = deps.embeddable; presentationUtil = deps.presentationUtil; contentManagement = deps.contentManagement; + uiActions = deps.uiActions; if (deps.usageCollection) trackUiMetric = deps.usageCollection.reportUiCounter.bind(deps.usageCollection, CONTENT_ID); diff --git a/src/plugins/links/public/types.ts b/src/plugins/links/public/types.ts new file mode 100644 index 0000000000000..e88c6e5d51c84 --- /dev/null +++ b/src/plugins/links/public/types.ts @@ -0,0 +1,76 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { + HasEditCapabilities, + HasInPlaceLibraryTransforms, + HasType, + PublishesPanelDescription, + PublishesPanelTitle, + PublishesSavedObjectId, + PublishesUnifiedSearch, + SerializedTitles, +} from '@kbn/presentation-publishing'; +import { DefaultEmbeddableApi } from '@kbn/embeddable-plugin/public'; +import { DynamicActionsSerializedState } from '@kbn/embeddable-enhanced-plugin/public/plugin'; +import { HasSerializedChildState, PresentationContainer } from '@kbn/presentation-containers'; +import { LocatorPublic } from '@kbn/share-plugin/common'; +import { DashboardLocatorParams, DASHBOARD_CONTAINER_TYPE } from '@kbn/dashboard-plugin/public'; +import { DashboardAttributes } from '@kbn/dashboard-plugin/common'; + +import { CONTENT_ID } from '../common'; +import { Link, LinksAttributes, LinksLayoutType } from '../common/content_management'; + +export type LinksParentApi = PresentationContainer & + HasType & + HasSerializedChildState & + PublishesSavedObjectId & + PublishesPanelTitle & + PublishesPanelDescription & + PublishesUnifiedSearch & { + locator?: Pick, 'navigate' | 'getRedirectUrl'>; + }; + +export type LinksApi = HasType & + DefaultEmbeddableApi & + HasEditCapabilities & + HasInPlaceLibraryTransforms; + +export interface LinksByReferenceSerializedState { + savedObjectId: string; +} + +export interface LinksByValueSerializedState { + attributes: LinksAttributes; +} + +export type LinksSerializedState = SerializedTitles & + Partial & + (LinksByReferenceSerializedState | LinksByValueSerializedState); + +export interface LinksRuntimeState + extends Partial, + SerializedTitles { + error?: Error; + links?: ResolvedLink[]; + layout?: LinksLayoutType; + defaultPanelTitle?: string; + defaultPanelDescription?: string; +} + +export type ResolvedLink = Link & { + title: string; + label?: string; + description?: string; + error?: Error; +}; + +export interface DashboardItem { + id: string; + attributes: DashboardAttributes; +} diff --git a/src/plugins/links/tsconfig.json b/src/plugins/links/tsconfig.json index e0a5a1b1d4221..321809cb507d0 100644 --- a/src/plugins/links/tsconfig.json +++ b/src/plugins/links/tsconfig.json @@ -19,9 +19,8 @@ "@kbn/saved-objects-plugin", "@kbn/core-saved-objects-server", "@kbn/saved-objects-plugin", + "@kbn/ui-actions-plugin", "@kbn/ui-actions-enhanced-plugin", - "@kbn/kibana-utils-plugin", - "@kbn/utility-types", "@kbn/ui-actions-plugin", "@kbn/logging", "@kbn/core-plugins-server", @@ -32,7 +31,11 @@ "@kbn/core-mount-utils-browser", "@kbn/presentation-containers", "@kbn/presentation-publishing", - "@kbn/react-kibana-context-render" + "@kbn/react-kibana-context-render", + "@kbn/presentation-panel-plugin", + "@kbn/embeddable-enhanced-plugin", + "@kbn/share-plugin", + "@kbn/es-query", ], "exclude": ["target/**/*"] } diff --git a/src/plugins/saved_objects_management/public/index.ts b/src/plugins/saved_objects_management/public/index.ts index 6df2288d110b5..37ed13ea749e8 100644 --- a/src/plugins/saved_objects_management/public/index.ts +++ b/src/plugins/saved_objects_management/public/index.ts @@ -13,14 +13,7 @@ export type { SavedObjectsManagementPluginSetup, SavedObjectsManagementPluginStart, } from './plugin'; -export type { - SavedObjectsManagementActionServiceSetup, - SavedObjectsManagementActionServiceStart, - SavedObjectsManagementColumnServiceSetup, - SavedObjectsManagementColumnServiceStart, - SavedObjectsManagementColumn, - SavedObjectsManagementRecord, -} from './services'; +export type { SavedObjectsManagementColumn, SavedObjectsManagementRecord } from './services'; export { SavedObjectsManagementAction } from './services'; export type { ProcessedImportResponse, FailedImport } from './lib'; export { processImportResponse, getTagFindReferences, parseQuery } from './lib'; diff --git a/src/plugins/saved_objects_management/public/management_section/mount_section.tsx b/src/plugins/saved_objects_management/public/management_section/mount_section.tsx index 57103921c909a..66bd4f6e9542f 100644 --- a/src/plugins/saved_objects_management/public/management_section/mount_section.tsx +++ b/src/plugins/saved_objects_management/public/management_section/mount_section.tsx @@ -17,10 +17,16 @@ import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import type { SavedObjectManagementTypeInfo } from '../../common/types'; import { StartDependencies, SavedObjectsManagementPluginStart } from '../plugin'; import { getAllowedTypes } from '../lib'; +import { + SavedObjectsManagementActionServiceStart, + SavedObjectsManagementColumnServiceStart, +} from '../services'; interface MountParams { core: CoreSetup; mountParams: ManagementAppMountParams; + getActionServiceStart: () => SavedObjectsManagementActionServiceStart; + getColumnServiceStart: () => SavedObjectsManagementColumnServiceStart; } let allowedObjectTypes: SavedObjectManagementTypeInfo[] | undefined; @@ -31,8 +37,13 @@ const title = i18n.translate('savedObjectsManagement.objects.savedObjectsTitle', const SavedObjectsEditionPage = lazy(() => import('./saved_objects_edition_page')); const SavedObjectsTablePage = lazy(() => import('./saved_objects_table_page')); -export const mountManagementSection = async ({ core, mountParams }: MountParams) => { - const [coreStart, { data, dataViews, savedObjectsTaggingOss, spaces: spacesApi }, pluginStart] = +export const mountManagementSection = async ({ + core, + mountParams, + getColumnServiceStart, + getActionServiceStart, +}: MountParams) => { + const [coreStart, { data, dataViews, savedObjectsTaggingOss, spaces: spacesApi }] = await core.getStartServices(); const { capabilities } = coreStart.application; const { element, history, setBreadcrumbs } = mountParams; @@ -77,8 +88,8 @@ export const mountManagementSection = async ({ core, mountParams }: MountParams) spacesApi={spacesApi} dataStart={data} dataViewsApi={dataViews} - actionRegistry={pluginStart.actions} - columnRegistry={pluginStart.columns} + actionRegistry={getActionServiceStart()} + columnRegistry={getColumnServiceStart()} allowedTypes={allowedObjectTypes} setBreadcrumbs={setBreadcrumbs} /> diff --git a/src/plugins/saved_objects_management/public/mocks.ts b/src/plugins/saved_objects_management/public/mocks.ts index 82fe0d419855c..51b93f04c5826 100644 --- a/src/plugins/saved_objects_management/public/mocks.ts +++ b/src/plugins/saved_objects_management/public/mocks.ts @@ -6,22 +6,18 @@ * Side Public License, v 1. */ -import { actionServiceMock } from './services/action_service.mock'; -import { columnServiceMock } from './services/column_service.mock'; -import { SavedObjectsManagementPluginSetup, SavedObjectsManagementPluginStart } from './plugin'; +import type { + SavedObjectsManagementPluginSetup, + SavedObjectsManagementPluginStart, +} from './plugin'; const createSetupContractMock = (): jest.Mocked => { - const mock = { - actions: actionServiceMock.createSetup(), - columns: columnServiceMock.createSetup(), - }; + const mock = {}; return mock; }; const createStartContractMock = (): jest.Mocked => { const mock = { - actions: actionServiceMock.createStart(), - columns: columnServiceMock.createStart(), getAllowedTypes: jest.fn(), getRelationships: jest.fn(), getSavedObjectLabel: jest.fn(), diff --git a/src/plugins/saved_objects_management/public/plugin.ts b/src/plugins/saved_objects_management/public/plugin.ts index eaefe96a0916a..855ea9dd7c91e 100644 --- a/src/plugins/saved_objects_management/public/plugin.ts +++ b/src/plugins/saved_objects_management/public/plugin.ts @@ -16,10 +16,8 @@ import { HomePublicPluginSetup } from '@kbn/home-plugin/public'; import { SavedObjectTaggingOssPluginStart } from '@kbn/saved-objects-tagging-oss-plugin/public'; import { SavedObjectsManagementActionService, - SavedObjectsManagementActionServiceSetup, SavedObjectsManagementActionServiceStart, SavedObjectsManagementColumnService, - SavedObjectsManagementColumnServiceSetup, SavedObjectsManagementColumnServiceStart, } from './services'; @@ -28,21 +26,18 @@ import type { v1 } from '../common'; import { SavedObjectManagementTypeInfo } from './types'; import { getAllowedTypes, + getDefaultTitle, getRelationships, getSavedObjectLabel, - getDefaultTitle, - parseQuery, getTagFindReferences, + parseQuery, } from './lib'; -export interface SavedObjectsManagementPluginSetup { - actions: SavedObjectsManagementActionServiceSetup; - columns: SavedObjectsManagementColumnServiceSetup; -} +// keeping the interface to reduce work if we want to add back APIs later +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface SavedObjectsManagementPluginSetup {} export interface SavedObjectsManagementPluginStart { - actions: SavedObjectsManagementActionServiceStart; - columns: SavedObjectsManagementColumnServiceStart; getAllowedTypes: () => Promise; getRelationships: ( type: string, @@ -79,6 +74,9 @@ export class SavedObjectsManagementPlugin private actionService = new SavedObjectsManagementActionService(); private columnService = new SavedObjectsManagementColumnService(); + private actionServiceStart?: SavedObjectsManagementActionServiceStart; + private columnServiceStart?: SavedObjectsManagementColumnServiceStart; + public setup( core: CoreSetup, { home, management }: SetupDependencies @@ -114,6 +112,8 @@ export class SavedObjectsManagementPlugin return mountManagementSection({ core, mountParams, + getColumnServiceStart: () => this.columnServiceStart!, + getActionServiceStart: () => this.actionServiceStart!, }); }, }); @@ -125,12 +125,10 @@ export class SavedObjectsManagementPlugin } public start(_core: CoreStart, { spaces: spacesApi }: StartDependencies) { - const actionStart = this.actionService.start(spacesApi); - const columnStart = this.columnService.start(spacesApi); + this.actionServiceStart = this.actionService.start(spacesApi); + this.columnServiceStart = this.columnService.start(spacesApi); return { - actions: actionStart, - columns: columnStart, getAllowedTypes: () => getAllowedTypes(_core.http), getRelationships: (type: string, id: string, savedObjectTypes: string[]) => getRelationships(_core.http, type, id, savedObjectTypes), diff --git a/src/plugins/saved_objects_management/public/services/action_service.ts b/src/plugins/saved_objects_management/public/services/action_service.ts index b255ee9a7fa80..83f968a846113 100644 --- a/src/plugins/saved_objects_management/public/services/action_service.ts +++ b/src/plugins/saved_objects_management/public/services/action_service.ts @@ -36,30 +36,25 @@ export class SavedObjectsManagementActionService { setup(): SavedObjectsManagementActionServiceSetup { return { - register: (action) => { - if (this.actions.has(action.id)) { - throw new Error(`Saved Objects Management Action with id '${action.id}' already exists`); - } - this.actions.set(action.id, action); - }, + register: (action) => this.register(action), }; } start(spacesApi?: SpacesApi): SavedObjectsManagementActionServiceStart { if (spacesApi && !spacesApi.hasOnlyDefaultSpace) { - registerSpacesApiActions(this, spacesApi); + this.register(new ShareToSpaceSavedObjectsManagementAction(spacesApi.ui)); + this.register(new CopyToSpaceSavedObjectsManagementAction(spacesApi.ui)); } return { has: (actionId) => this.actions.has(actionId), getAll: () => [...this.actions.values()], }; } -} -function registerSpacesApiActions( - service: SavedObjectsManagementActionService, - spacesApi: SpacesApi -) { - service.setup().register(new ShareToSpaceSavedObjectsManagementAction(spacesApi.ui)); - service.setup().register(new CopyToSpaceSavedObjectsManagementAction(spacesApi.ui)); + private register(action: SavedObjectsManagementAction) { + if (this.actions.has(action.id)) { + throw new Error(`Saved Objects Management Action with id '${action.id}' already exists`); + } + this.actions.set(action.id, action); + } } diff --git a/src/plugins/saved_objects_management/public/services/column_service.ts b/src/plugins/saved_objects_management/public/services/column_service.ts index 665866df1b4b0..519704d258c49 100644 --- a/src/plugins/saved_objects_management/public/services/column_service.ts +++ b/src/plugins/saved_objects_management/public/services/column_service.ts @@ -29,28 +29,23 @@ export class SavedObjectsManagementColumnService { setup(): SavedObjectsManagementColumnServiceSetup { return { - register: (column) => { - if (this.columns.has(column.id)) { - throw new Error(`Saved Objects Management Column with id '${column.id}' already exists`); - } - this.columns.set(column.id, column); - }, + register: (column) => this.register(column), }; } start(spacesApi?: SpacesApi): SavedObjectsManagementColumnServiceStart { if (spacesApi && !spacesApi.hasOnlyDefaultSpace) { - registerSpacesApiColumns(this, spacesApi); + this.register(new ShareToSpaceSavedObjectsManagementColumn(spacesApi.ui)); } return { getAll: () => [...this.columns.values()], }; } -} -function registerSpacesApiColumns( - service: SavedObjectsManagementColumnService, - spacesApi: SpacesApi -) { - service.setup().register(new ShareToSpaceSavedObjectsManagementColumn(spacesApi.ui)); + private register(column: SavedObjectsManagementColumn) { + if (this.columns.has(column.id)) { + throw new Error(`Saved Objects Management Column with id '${column.id}' already exists`); + } + this.columns.set(column.id, column); + } } diff --git a/src/plugins/saved_objects_management/public/services/index.ts b/src/plugins/saved_objects_management/public/services/index.ts index 997a1b96b418f..9d6f96cee0cfb 100644 --- a/src/plugins/saved_objects_management/public/services/index.ts +++ b/src/plugins/saved_objects_management/public/services/index.ts @@ -6,15 +6,9 @@ * Side Public License, v 1. */ -export type { - SavedObjectsManagementActionServiceStart, - SavedObjectsManagementActionServiceSetup, -} from './action_service'; +export type { SavedObjectsManagementActionServiceStart } from './action_service'; export { SavedObjectsManagementActionService } from './action_service'; -export type { - SavedObjectsManagementColumnServiceStart, - SavedObjectsManagementColumnServiceSetup, -} from './column_service'; +export type { SavedObjectsManagementColumnServiceStart } from './column_service'; export { SavedObjectsManagementColumnService } from './column_service'; export type { SavedObjectsManagementRecord } from './types'; export { SavedObjectsManagementColumn, SavedObjectsManagementAction } from './types'; diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index 22e75e5d4b658..00c4a48da72fa 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -2098,7 +2098,7 @@ } } }, - "enterpriseSearchInferenceEndpoints": { + "enterpriseSearchRelevance": { "properties": { "appId": { "type": "keyword", diff --git a/src/plugins/text_based_languages/.i18nrc.json b/src/plugins/text_based_languages/.i18nrc.json deleted file mode 100755 index d5a020d5dd392..0000000000000 --- a/src/plugins/text_based_languages/.i18nrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "prefix": "textBasedLanguages", - "paths": { - "textBasedLanguages": "." - } -} diff --git a/src/plugins/unified_doc_viewer/kibana.jsonc b/src/plugins/unified_doc_viewer/kibana.jsonc index 2361a10120e9b..e2febffda4df6 100644 --- a/src/plugins/unified_doc_viewer/kibana.jsonc +++ b/src/plugins/unified_doc_viewer/kibana.jsonc @@ -8,7 +8,7 @@ "server": false, "browser": true, "requiredBundles": ["kibanaUtils"], - "requiredPlugins": ["data", "discoverShared", "fieldFormats"], + "requiredPlugins": ["data", "discoverShared", "fieldFormats", "share"], "optionalPlugins": ["fieldsMetadata"] } } diff --git a/src/plugins/unified_doc_viewer/public/__mocks__/services.ts b/src/plugins/unified_doc_viewer/public/__mocks__/services.ts index 8496b919b38f0..29ae5f2981a6e 100644 --- a/src/plugins/unified_doc_viewer/public/__mocks__/services.ts +++ b/src/plugins/unified_doc_viewer/public/__mocks__/services.ts @@ -12,6 +12,7 @@ import { discoverSharedPluginMock } from '@kbn/discover-shared-plugin/public/moc import { fieldFormatsMock } from '@kbn/field-formats-plugin/common/mocks'; import { fieldsMetadataPluginPublicMock } from '@kbn/fields-metadata-plugin/public/mocks'; import { uiSettingsServiceMock } from '@kbn/core-ui-settings-browser-mocks'; +import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; import type { UnifiedDocViewerServices, UnifiedDocViewerStart } from '../types'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import { DocViewsRegistry } from '@kbn/unified-doc-viewer'; @@ -29,4 +30,5 @@ export const mockUnifiedDocViewerServices: jest.Mocked storage: new Storage(localStorage), uiSettings: uiSettingsServiceMock.createStartContract(), unifiedDocViewer: mockUnifiedDocViewer, + share: sharePluginMock.createStartContract(), }; diff --git a/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview.test.tsx b/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview.test.tsx index 7b9379654cec1..a0f4ba8e993ff 100644 --- a/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview.test.tsx +++ b/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview.test.tsx @@ -18,6 +18,8 @@ const DATASET_NAME = 'logs.overview'; const NAMESPACE = 'default'; const DATA_STREAM_NAME = `logs-${DATASET_NAME}-${NAMESPACE}`; const NOW = Date.now(); +const MORE_THAN_1024_CHARS = + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?'; const dataView = { fields: { @@ -82,7 +84,7 @@ const fullHit = buildDataTableRecord( cloud: { provider: ['gcp'], region: 'us-central-1', - availability_zone: 'us-central-1a', + availability_zone: MORE_THAN_1024_CHARS, project: { id: 'elastic-project', }, @@ -92,6 +94,9 @@ const fullHit = buildDataTableRecord( }, 'agent.name': 'node', }, + ignored_field_values: { + 'cloud.availability_zone': [MORE_THAN_1024_CHARS], + }, }, dataView ); @@ -159,4 +164,37 @@ describe('LogsOverview', () => { expect(screen.queryByTestId('unifiedDocViewLogsOverviewLogShipper')).toBeInTheDocument(); }); }); + describe('Degraded Fields section', () => { + it('should load the degraded fields container when present', async () => { + expect( + screen.queryByTestId('unifiedDocViewLogsOverviewDegradedFieldsAccordion') + ).toBeInTheDocument(); + expect( + screen.queryByTestId('unifiedDocViewLogsOverviewDegradedFieldsTechPreview') + ).toBeInTheDocument(); + expect( + screen.queryByTestId('unifiedDocViewLogsOverviewDegradedFieldTitleCount') + ).toBeInTheDocument(); + + // The accordion must be closed by default + const accordion = screen.queryByTestId('unifiedDocViewLogsOverviewDegradedFieldsAccordion1'); + + if (accordion === null) { + return; + } + const button = accordion.querySelector('button'); + + if (button === null) { + return; + } + // Check the aria-expanded property of the button + const isExpanded = button.getAttribute('aria-expanded'); + expect(isExpanded).toBe('false'); + + button.click(); + expect( + screen.queryByTestId('unifiedDocViewLogsOverviewDegradedFieldsQualityIssuesTable') + ).toBeInTheDocument(); + }); + }); }); diff --git a/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview.tsx b/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview.tsx index c0161d112e955..b46570f4f0d37 100644 --- a/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview.tsx +++ b/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview.tsx @@ -15,6 +15,7 @@ import { LogsOverviewHighlights } from './logs_overview_highlights'; import { FieldActionsProvider } from '../../hooks/use_field_actions'; import { getUnifiedDocViewerServices } from '../../plugin'; import { LogsOverviewAIAssistant } from './logs_overview_ai_assistant'; +import { LogsOverviewDegradedFields } from './logs_overview_degraded_fields'; export function LogsOverview({ columns, @@ -38,6 +39,7 @@ export function LogsOverview({ + ); diff --git a/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview_degraded_fields.tsx b/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview_degraded_fields.tsx new file mode 100644 index 0000000000000..976ef71c6b647 --- /dev/null +++ b/src/plugins/unified_doc_viewer/public/components/doc_viewer_logs_overview/logs_overview_degraded_fields.tsx @@ -0,0 +1,321 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import React, { useMemo, useState } from 'react'; +import { DataTableRecord } from '@kbn/discover-utils'; +import { + EuiAccordion, + EuiBadge, + EuiBetaBadge, + EuiFlexGroup, + EuiFlexItem, + EuiHorizontalRule, + EuiTitle, + EuiBasicTable, + useGeneratedHtmlId, + EuiBasicTableColumn, + EuiHeaderLink, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { orderBy } from 'lodash'; +import { getRouterLinkProps } from '@kbn/router-utils'; +import { DATA_QUALITY_LOCATOR_ID, DataQualityLocatorParams } from '@kbn/deeplinks-observability'; +import { BrowserUrlService } from '@kbn/share-plugin/public'; +import { getUnifiedDocViewerServices } from '../../plugin'; + +type Direction = 'asc' | 'desc'; +type SortField = 'issue' | 'values'; + +const DEFAULT_SORT_FIELD = 'issue'; +const DEFAULT_SORT_DIRECTION = 'asc'; +const DEFAULT_ROWS_PER_PAGE = 5; + +interface DegradedField { + issue: string; + values: string[]; +} + +interface ParamsForLocator { + dataStreamType: string; + dataStreamName: string; + dataStreamNamespace: string; + rawName: string; +} + +interface TableOptions { + page: { + index: number; + size: number; + }; + sort: { + field: SortField; + direction: Direction; + }; +} + +const DEFAULT_TABLE_OPTIONS: TableOptions = { + page: { + index: 0, + size: 0, + }, + sort: { + field: DEFAULT_SORT_FIELD, + direction: DEFAULT_SORT_DIRECTION, + }, +}; + +const qualityIssuesAccordionTitle = i18n.translate( + 'unifiedDocViewer.docView.logsOverview.accordion.title.qualityIssues', + { + defaultMessage: 'Quality Issues', + } +); + +const qualityIssuesAccordionTechPreviewBadge = i18n.translate( + 'unifiedDocViewer.docView.logsOverview.accordion.title.techPreview', + { + defaultMessage: 'TECH PREVIEW', + } +); + +const issueColumnName = i18n.translate( + 'unifiedDocViewer.docView.logsOverview.accordion.qualityIssues.table.field', + { + defaultMessage: 'Issue', + } +); + +const valuesColumnName = i18n.translate( + 'unifiedDocViewer.docView.logsOverview.accordion.qualityIssues.table.values', + { + defaultMessage: 'Values', + } +); + +const textFieldIgnored = i18n.translate( + 'unifiedDocViewer.docView.logsOverview.accordion.qualityIssues.table.textIgnored', + { + defaultMessage: 'field ignored', + } +); + +export const datasetQualityLinkTitle = i18n.translate( + 'unifiedDocViewer.docView.logsOverview.accordion.qualityIssues.table.datasetQualityLinkTitle', + { + defaultMessage: 'Data set details', + } +); + +export const LogsOverviewDegradedFields = ({ rawDoc }: { rawDoc: DataTableRecord['raw'] }) => { + const { ignored_field_values: ignoredFieldValues = {}, fields: sourceFields = {} } = rawDoc; + const countOfDegradedFields = Object.keys(ignoredFieldValues)?.length; + + const columns = getDegradedFieldsColumns(); + const tableData = getDataFormattedForTable(ignoredFieldValues); + + const paramsForLocator = getParamsForLocator(sourceFields); + + const accordionId = useGeneratedHtmlId({ + prefix: qualityIssuesAccordionTitle, + }); + + const [tableOptions, setTableOptions] = useState(DEFAULT_TABLE_OPTIONS); + + const onTableChange = (options: { + page: { index: number; size: number }; + sort?: { field: SortField; direction: Direction }; + }) => { + setTableOptions({ + page: { + index: options.page.index, + size: options.page.size, + }, + sort: { + field: options.sort?.field ?? DEFAULT_SORT_FIELD, + direction: options.sort?.direction ?? DEFAULT_SORT_DIRECTION, + }, + }); + }; + + const pagination = useMemo( + () => ({ + pageIndex: tableOptions.page.index, + pageSize: DEFAULT_ROWS_PER_PAGE, + totalItemCount: tableData?.length ?? 0, + hidePerPageOptions: true, + }), + [tableData, tableOptions] + ); + + const renderedItems = useMemo(() => { + const sortedItems = orderBy(tableData, tableOptions.sort.field, tableOptions.sort.direction); + return sortedItems.slice( + tableOptions.page.index * DEFAULT_ROWS_PER_PAGE, + (tableOptions.page.index + 1) * DEFAULT_ROWS_PER_PAGE + ); + }, [tableData, tableOptions]); + + const { share } = getUnifiedDocViewerServices(); + const { url: urlService } = share; + + const accordionTitle = ( + + + +

    {qualityIssuesAccordionTitle}

    +
    +
    + + + {countOfDegradedFields} + + + + + +
    + ); + + return countOfDegradedFields > 0 ? ( + <> + + } + data-test-subj="unifiedDocViewLogsOverviewDegradedFieldsAccordion" + > + + + + + ) : null; +}; + +const getDegradedFieldsColumns = (): Array> => [ + { + name: issueColumnName, + sortable: true, + field: 'issue', + render: (issue: string) => { + return ( + <> + {issue} {textFieldIgnored} + + ); + }, + }, + { + name: valuesColumnName, + sortable: true, + field: 'values', + render: (values: string[]) => { + return values.map((value, idx) => {value}); + }, + }, +]; + +const getDataFormattedForTable = ( + ignoredFieldValues: Record +): DegradedField[] => { + return Object.entries(ignoredFieldValues).map(([field, values]) => ({ + issue: field, + values, + })); +}; + +const getParamsForLocator = ( + sourceFields: DataTableRecord['raw']['fields'] +): ParamsForLocator | undefined => { + if (sourceFields) { + const dataStreamTypeArr = sourceFields['data_stream.type']; + const dataStreamType = dataStreamTypeArr ? dataStreamTypeArr[0] : undefined; + const dataStreamNameArr = sourceFields['data_stream.dataset']; + const dataStreamName = dataStreamNameArr ? dataStreamNameArr[0] : undefined; + const dataStreamNamespaceArr = sourceFields['data_stream.namespace']; + const dataStreamNamespace = dataStreamNamespaceArr ? dataStreamNamespaceArr[0] : undefined; + let rawName; + + if (dataStreamType && dataStreamName && dataStreamNamespace) { + rawName = `${dataStreamType}-${dataStreamName}-${dataStreamNamespace}`; + } + + if (rawName) { + return { + dataStreamType, + dataStreamName, + dataStreamNamespace, + rawName, + }; + } + } +}; + +const DatasetQualityLink = React.memo( + ({ + urlService, + paramsForLocator, + }: { + urlService: BrowserUrlService; + paramsForLocator?: ParamsForLocator; + }) => { + const locator = urlService.locators.get(DATA_QUALITY_LOCATOR_ID); + const locatorParams: DataQualityLocatorParams = paramsForLocator + ? { + flyout: { + dataset: { + rawName: paramsForLocator.rawName, + type: paramsForLocator.dataStreamType, + name: paramsForLocator.dataStreamName, + namespace: paramsForLocator.dataStreamNamespace, + }, + }, + } + : {}; + + const datasetQualityUrl = locator?.getRedirectUrl(locatorParams); + + const navigateToDatasetQuality = () => { + locator?.navigate(locatorParams); + }; + + const datasetQualityLinkProps = getRouterLinkProps({ + href: datasetQualityUrl, + onClick: navigateToDatasetQuality, + }); + + return paramsForLocator ? ( + + {datasetQualityLinkTitle} + + ) : null; + } +); diff --git a/src/plugins/unified_doc_viewer/public/plugin.tsx b/src/plugins/unified_doc_viewer/public/plugin.tsx index 13027a2541084..9c4d7117c37dd 100644 --- a/src/plugins/unified_doc_viewer/public/plugin.tsx +++ b/src/plugins/unified_doc_viewer/public/plugin.tsx @@ -19,6 +19,7 @@ import { CoreStart } from '@kbn/core/public'; import { dynamic } from '@kbn/shared-ux-utility'; import { DiscoverSharedPublicStart } from '@kbn/discover-shared-plugin/public'; import { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public'; +import { SharePluginStart } from '@kbn/share-plugin/public'; import type { UnifiedDocViewerServices } from './types'; export const [getUnifiedDocViewerServices, setUnifiedDocViewerServices] = @@ -52,6 +53,7 @@ export interface UnifiedDocViewerStartDeps { discoverShared: DiscoverSharedPublicStart; fieldFormats: FieldFormatsStart; fieldsMetadata: FieldsMetadataPublicStart; + share: SharePluginStart; } export class UnifiedDocViewerPublicPlugin @@ -121,7 +123,7 @@ export class UnifiedDocViewerPublicPlugin public start(core: CoreStart, deps: UnifiedDocViewerStartDeps) { const { analytics, uiSettings } = core; - const { data, discoverShared, fieldFormats, fieldsMetadata } = deps; + const { data, discoverShared, fieldFormats, fieldsMetadata, share } = deps; const storage = new Storage(localStorage); const unifiedDocViewer = { registry: this.docViewsRegistry, @@ -135,6 +137,7 @@ export class UnifiedDocViewerPublicPlugin storage, uiSettings, unifiedDocViewer, + share, }; setUnifiedDocViewerServices(services); return unifiedDocViewer; diff --git a/src/plugins/unified_doc_viewer/public/types.ts b/src/plugins/unified_doc_viewer/public/types.ts index c19c60da72b13..e471fa87b85c1 100644 --- a/src/plugins/unified_doc_viewer/public/types.ts +++ b/src/plugins/unified_doc_viewer/public/types.ts @@ -5,7 +5,6 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - export type { JsonCodeEditorProps } from './components'; export type { EsDocSearchProps } from './hooks'; export type { UnifiedDocViewerSetup, UnifiedDocViewerStart } from './plugin'; @@ -17,6 +16,7 @@ import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; import type { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public'; import type { Storage } from '@kbn/kibana-utils-plugin/public'; import type { IUiSettingsClient } from '@kbn/core-ui-settings-browser'; +import type { SharePluginStart } from '@kbn/share-plugin/public'; import type { UnifiedDocViewerStart } from './plugin'; export interface UnifiedDocViewerServices { @@ -28,4 +28,5 @@ export interface UnifiedDocViewerServices { storage: Storage; uiSettings: IUiSettingsClient; unifiedDocViewer: UnifiedDocViewerStart; + share: SharePluginStart; } diff --git a/src/plugins/unified_doc_viewer/tsconfig.json b/src/plugins/unified_doc_viewer/tsconfig.json index fbe2ac83c5f1a..3b271744ed4af 100644 --- a/src/plugins/unified_doc_viewer/tsconfig.json +++ b/src/plugins/unified_doc_viewer/tsconfig.json @@ -32,7 +32,10 @@ "@kbn/discover-shared-plugin", "@kbn/fields-metadata-plugin", "@kbn/unified-data-table", - "@kbn/core-notifications-browser" + "@kbn/core-notifications-browser", + "@kbn/deeplinks-observability", + "@kbn/share-plugin", + "@kbn/router-utils" ], "exclude": [ "target/**/*", diff --git a/src/plugins/unified_histogram/public/chart/histogram.tsx b/src/plugins/unified_histogram/public/chart/histogram.tsx index 50c8f7242c589..aab4757706bd1 100644 --- a/src/plugins/unified_histogram/public/chart/histogram.tsx +++ b/src/plugins/unified_histogram/public/chart/histogram.tsx @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -import { useEuiTheme, useResizeObserver } from '@elastic/eui'; +import { useEuiTheme } from '@elastic/eui'; import { css } from '@emotion/react'; -import React, { useState, useRef, useEffect } from 'react'; +import React, { useState } from 'react'; import type { DataView } from '@kbn/data-views-plugin/public'; import type { DefaultInspectorAdapters, Datatable } from '@kbn/expressions-plugin/common'; import type { IKibanaSearchResponse } from '@kbn/search-types'; @@ -106,7 +106,6 @@ export function Histogram({ abortController, }: HistogramProps) { const [bucketInterval, setBucketInterval] = useState(); - const [chartSize, setChartSize] = useState('100%'); const { timeRangeText, timeRangeDisplay } = useTimeRange({ uiSettings, bucketInterval, @@ -115,19 +114,8 @@ export function Histogram({ isPlainRecord, timeField: dataView.timeFieldName, }); - const chartRef = useRef(null); - const { height: containerHeight, width: containerWidth } = useResizeObserver(chartRef.current); const { attributes } = visContext; - useEffect(() => { - if (attributes.visualizationType === 'lnsMetric') { - const size = containerHeight < containerWidth ? containerHeight : containerWidth; - setChartSize(`${size}px`); - } else { - setChartSize('100%'); - } - }, [attributes, containerHeight, containerWidth]); - const onLoad = useStableCallback( ( isLoading: boolean, @@ -197,7 +185,7 @@ export function Histogram({ } & .lnsExpressionRenderer { - width: ${chartSize}; + width: ${attributes.visualizationType === 'lnsMetric' ? '90%' : '100%'}; margin: auto; box-shadow: ${attributes.visualizationType === 'lnsMetric' ? boxShadow : 'none'}; } @@ -222,7 +210,6 @@ export function Histogram({ data-request-data={requestData} data-suggestion-type={visContext.suggestionType} css={chartCss} - ref={chartRef} > { - return `${appName}:${eventName}`; -}; - -export const deserializeUiCounterName = (key: string) => { - const [appName, ...restKey] = key.split(':'); - const eventName = restKey.join(':'); - return { appName, eventName }; -}; diff --git a/src/plugins/usage_collection/server/index.ts b/src/plugins/usage_collection/server/index.ts index 38298b42ed9c1..fb2894d7f3903 100644 --- a/src/plugins/usage_collection/server/index.ts +++ b/src/plugins/usage_collection/server/index.ts @@ -23,10 +23,9 @@ export type { UsageCountersSavedObjectAttributes, IncrementCounterParams, UsageCounter, - SerializeCounterParams, } from './usage_counters'; -export { USAGE_COUNTERS_SAVED_OBJECT_TYPE, serializeCounterKey } from './usage_counters'; +export { serializeCounterKey, USAGE_COUNTERS_SAVED_OBJECT_TYPE } from './usage_counters'; export type { UsageCollectionSetup } from './plugin'; export { config } from './config'; diff --git a/src/plugins/usage_collection/server/mocks.ts b/src/plugins/usage_collection/server/mocks.ts index bc59cf3cbef22..36f30357f6207 100644 --- a/src/plugins/usage_collection/server/mocks.ts +++ b/src/plugins/usage_collection/server/mocks.ts @@ -26,12 +26,12 @@ export const createUsageCollectionSetupMock = () => { executionContext: executionContextServiceMock.createSetupContract(), maximumWaitTimeForAllCollectorsInS: 1, }); - const { createUsageCounter, getUsageCounterByType } = + const { createUsageCounter, getUsageCounterByDomainId } = usageCountersServiceMock.createSetupContract(); const usageCollectionSetupMock: jest.Mocked = { createUsageCounter, - getUsageCounterByType, + getUsageCounterByDomainId, bulkFetch: jest.fn().mockImplementation(collectorSet.bulkFetch), getCollectorByType: jest.fn().mockImplementation(collectorSet.getCollectorByType), toApiFieldNames: jest.fn().mockImplementation(collectorSet.toApiFieldNames), diff --git a/src/plugins/usage_collection/server/plugin.ts b/src/plugins/usage_collection/server/plugin.ts index 7139de5091b50..ca551c129d84e 100644 --- a/src/plugins/usage_collection/server/plugin.ts +++ b/src/plugins/usage_collection/server/plugin.ts @@ -33,7 +33,7 @@ export interface UsageCollectionSetup { /** * Returns a usage counter by type */ - getUsageCounterByType: (type: string) => UsageCounter | undefined; + getUsageCounterByDomainId: (type: string) => UsageCounter | undefined; /** * Creates a usage collector to collect plugin telemetry data. * registerCollector must be called to connect the created collector with the service. @@ -112,13 +112,13 @@ export class UsageCollectionPlugin implements Plugin { bufferDurationMs: config.usageCounters.bufferDuration.asMilliseconds(), }); - const { createUsageCounter, getUsageCounterByType } = this.usageCountersService.setup(core); + const usageCountersServiceSetup = this.usageCountersService.setup(core); + const { createUsageCounter, getUsageCounterByDomainId } = usageCountersServiceSetup; - const uiCountersUsageCounter = createUsageCounter('uiCounter'); const router = core.http.createRouter(); setupRoutes({ router, - uiCountersUsageCounter, + usageCountersServiceSetup, getSavedObjects: () => this.savedObjects, collectorSet, config: { @@ -141,7 +141,7 @@ export class UsageCollectionPlugin implements Plugin { toApiFieldNames: collectorSet.toApiFieldNames, toObject: collectorSet.toObject, createUsageCounter, - getUsageCounterByType, + getUsageCounterByDomainId, }; } diff --git a/src/plugins/usage_collection/server/report/index.ts b/src/plugins/usage_collection/server/report/index.ts index 1a4cbd0e209a0..38df62c7e2f07 100644 --- a/src/plugins/usage_collection/server/report/index.ts +++ b/src/plugins/usage_collection/server/report/index.ts @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -export { storeReport } from './store_report'; +export { storeUiReport } from './store_ui_report'; export { reportSchema } from './schema'; diff --git a/src/plugins/usage_collection/server/report/schema.ts b/src/plugins/usage_collection/server/report/schema.ts index 1f76d3a4db76d..9f4e65c224e08 100644 --- a/src/plugins/usage_collection/server/report/schema.ts +++ b/src/plugins/usage_collection/server/report/schema.ts @@ -36,6 +36,7 @@ export const reportSchema = schema.object({ type: schema.string(), appName: schema.string(), eventName: schema.string(), + namespace: schema.maybe(schema.string()), total: schema.number(), }) ) diff --git a/src/plugins/usage_collection/server/report/store_report.test.mocks.ts b/src/plugins/usage_collection/server/report/store_ui_report.test.mocks.ts similarity index 100% rename from src/plugins/usage_collection/server/report/store_report.test.mocks.ts rename to src/plugins/usage_collection/server/report/store_ui_report.test.mocks.ts diff --git a/src/plugins/usage_collection/server/report/store_report.test.ts b/src/plugins/usage_collection/server/report/store_ui_report.test.ts similarity index 70% rename from src/plugins/usage_collection/server/report/store_report.test.ts rename to src/plugins/usage_collection/server/report/store_ui_report.test.ts index e1c33197142d9..4fb98c8897f0a 100644 --- a/src/plugins/usage_collection/server/report/store_report.test.ts +++ b/src/plugins/usage_collection/server/report/store_ui_report.test.ts @@ -6,22 +6,24 @@ * Side Public License, v 1. */ -import { storeApplicationUsageMock } from './store_report.test.mocks'; +import { storeApplicationUsageMock } from './store_ui_report.test.mocks'; import { savedObjectsRepositoryMock } from '@kbn/core/server/mocks'; -import { storeReport } from './store_report'; -import { ReportSchemaType } from './schema'; import { METRIC_TYPE } from '@kbn/analytics'; +import type { ReportSchemaType } from './schema'; +import { storeUiReport } from './store_ui_report'; import { usageCountersServiceMock } from '../usage_counters/usage_counters_service.mock'; -describe('store_report', () => { - const usageCountersServiceSetup = usageCountersServiceMock.createSetupContract(); - const uiCountersUsageCounter = usageCountersServiceSetup.createUsageCounter('uiCounter'); - +describe('store_ui_report', () => { let repository: ReturnType; + let usageCountersServiceSetup: ReturnType; + let usageCounterMock: ReturnType; beforeEach(() => { + usageCountersServiceSetup = usageCountersServiceMock.createSetupContract(); repository = savedObjectsRepositoryMock.create(); + usageCounterMock = usageCountersServiceSetup.createUsageCounter('dashboards'); + usageCountersServiceSetup.createUsageCounter.mockReturnValue(usageCounterMock); }); afterEach(() => { @@ -64,8 +66,22 @@ describe('store_report', () => { }, }, }; - await storeReport(repository, uiCountersUsageCounter, report); + await storeUiReport(repository, usageCountersServiceSetup, report); + await new Promise((resolve) => setTimeout(resolve, 4000)); + expect(usageCountersServiceSetup.createUsageCounter.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + "dashboards", + ], + Array [ + "test-app-name", + ], + Array [ + "test-app-name", + ], + ] + `); expect(repository.create.mock.calls).toMatchInlineSnapshot(` Array [ Array [ @@ -96,21 +112,22 @@ describe('store_report', () => { ], ] `); - expect((uiCountersUsageCounter.incrementCounter as jest.Mock).mock.calls) - .toMatchInlineSnapshot(` + expect((usageCounterMock.incrementCounter as jest.Mock).mock.calls).toMatchInlineSnapshot(` Array [ Array [ Object { - "counterName": "test-app-name:test-event-name", + "counterName": "test-event-name", "counterType": "loaded", "incrementBy": 1, + "source": "ui", }, ], Array [ Object { - "counterName": "test-app-name:test-event-name", + "counterName": "test-event-name", "counterType": "click", "incrementBy": 2, + "source": "ui", }, ], ] @@ -131,7 +148,7 @@ describe('store_report', () => { uiCounter: void 0, application_usage: void 0, }; - await storeReport(repository, uiCountersUsageCounter, report); + await storeUiReport(repository, usageCountersServiceSetup, report); expect(repository.bulkCreate).not.toHaveBeenCalled(); expect(repository.incrementCounter).not.toHaveBeenCalled(); diff --git a/src/plugins/usage_collection/server/report/store_report.ts b/src/plugins/usage_collection/server/report/store_ui_report.ts similarity index 86% rename from src/plugins/usage_collection/server/report/store_report.ts rename to src/plugins/usage_collection/server/report/store_ui_report.ts index 40ea5cbf414a8..1cf966e3466e8 100644 --- a/src/plugins/usage_collection/server/report/store_report.ts +++ b/src/plugins/usage_collection/server/report/store_ui_report.ts @@ -11,12 +11,11 @@ import moment from 'moment'; import { chain, sumBy } from 'lodash'; import { ReportSchemaType } from './schema'; import { storeApplicationUsage } from './store_application_usage'; -import { UsageCounter } from '../usage_counters'; -import { serializeUiCounterName } from '../../common/ui_counters'; +import { type UsageCountersServiceSetup } from '../usage_counters'; -export async function storeReport( +export async function storeUiReport( internalRepository: ISavedObjectsRepository, - uiCountersUsageCounter: UsageCounter, + counters: UsageCountersServiceSetup, report: ReportSchemaType ) { const uiCounters = report.uiCounter ? Object.entries(report.uiCounter) : []; @@ -60,11 +59,15 @@ export async function storeReport( // UI Counters ...uiCounters.map(async ([, metric]) => { const { appName, eventName, total, type } = metric; - const counterName = serializeUiCounterName({ appName, eventName }); - uiCountersUsageCounter.incrementCounter({ - counterName, + + const counter = + counters.getUsageCounterByDomainId(appName) ?? counters.createUsageCounter(appName); + + counter.incrementCounter({ + counterName: eventName, counterType: type, incrementBy: total, + source: 'ui', }); }), // Application Usage diff --git a/src/plugins/usage_collection/server/routes/index.ts b/src/plugins/usage_collection/server/routes/index.ts index 01d26b177218c..3bb42cf4865ce 100644 --- a/src/plugins/usage_collection/server/routes/index.ts +++ b/src/plugins/usage_collection/server/routes/index.ts @@ -16,16 +16,16 @@ import { Observable } from 'rxjs'; import { CollectorSet } from '../collector'; import { registerUiCountersRoute } from './ui_counters'; import { registerStatsRoute } from './stats'; -import type { UsageCounter } from '../usage_counters'; +import type { UsageCountersServiceSetup } from '../usage_counters'; export function setupRoutes({ router, - uiCountersUsageCounter, + usageCountersServiceSetup, getSavedObjects, ...rest }: { router: IRouter; getSavedObjects: () => ISavedObjectsRepository | undefined; - uiCountersUsageCounter: UsageCounter; + usageCountersServiceSetup: UsageCountersServiceSetup; config: { allowAnonymous: boolean; kibanaIndex: string; @@ -41,6 +41,6 @@ export function setupRoutes({ metrics: MetricsServiceSetup; overallStatus$: Observable; }) { - registerUiCountersRoute(router, getSavedObjects, uiCountersUsageCounter); + registerUiCountersRoute(router, getSavedObjects, usageCountersServiceSetup); registerStatsRoute({ router, ...rest }); } diff --git a/src/plugins/usage_collection/server/routes/ui_counters.ts b/src/plugins/usage_collection/server/routes/ui_counters.ts index 9752afeae3ef9..e19dd7c57ca6d 100644 --- a/src/plugins/usage_collection/server/routes/ui_counters.ts +++ b/src/plugins/usage_collection/server/routes/ui_counters.ts @@ -7,15 +7,15 @@ */ import { schema } from '@kbn/config-schema'; -import { IRouter, ISavedObjectsRepository } from '@kbn/core/server'; -import { storeReport, reportSchema } from '../report'; -import { UsageCounter } from '../usage_counters'; -import { UiCounters } from '../../common/types'; +import type { IRouter, ISavedObjectsRepository } from '@kbn/core/server'; +import { storeUiReport, reportSchema } from '../report'; +import type { UsageCountersServiceSetup } from '../usage_counters'; +import type { UiCounters } from '../../common/types'; export function registerUiCountersRoute( router: IRouter, getSavedObjects: () => ISavedObjectsRepository | undefined, - uiCountersUsageCounter: UsageCounter + usageCountersServiceSetup: UsageCountersServiceSetup ) { router.post( { @@ -33,7 +33,8 @@ export function registerUiCountersRoute( if (!internalRepository) { throw Error(`The saved objects client hasn't been initialised yet`); } - await storeReport(internalRepository, uiCountersUsageCounter, requestBody.report); + // we pass the whole usageCountersServiceSetup, so that we can create UI counters dynamically + await storeUiReport(internalRepository, usageCountersServiceSetup, requestBody.report); const bodyOk: UiCounters.v1.UiCountersResponseOk = { status: 'ok', }; diff --git a/src/plugins/usage_collection/server/usage_counters/index.ts b/src/plugins/usage_collection/server/usage_counters/index.ts index 05d36aaef502f..fcbcf9f02e681 100644 --- a/src/plugins/usage_collection/server/usage_counters/index.ts +++ b/src/plugins/usage_collection/server/usage_counters/index.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 { UsageCounters } from '../../common/types'; +import { UsageCounters } from '../../common'; export type IncrementCounterParams = UsageCounters.v1.IncrementCounterParams; export type { UsageCountersServiceSetup } from './usage_counters_service'; @@ -13,5 +13,4 @@ export type { UsageCountersSavedObjectAttributes, UsageCountersSavedObject } fro export type { IUsageCounter as UsageCounter } from './usage_counter'; export { UsageCountersService } from './usage_counters_service'; -export type { SerializeCounterParams } from './saved_objects'; -export { USAGE_COUNTERS_SAVED_OBJECT_TYPE, serializeCounterKey } from './saved_objects'; +export { serializeCounterKey, USAGE_COUNTERS_SAVED_OBJECT_TYPE } from './saved_objects'; diff --git a/src/plugins/usage_collection/server/usage_counters/saved_objects.test.ts b/src/plugins/usage_collection/server/usage_counters/saved_objects.test.ts index fa40fd5a8d2be..7a8934e4559fa 100644 --- a/src/plugins/usage_collection/server/usage_counters/saved_objects.test.ts +++ b/src/plugins/usage_collection/server/usage_counters/saved_objects.test.ts @@ -9,7 +9,7 @@ import { serializeCounterKey, storeCounter } from './saved_objects'; import { savedObjectsRepositoryMock } from '@kbn/core/server/mocks'; -import { UsageCounters } from '../../common/types'; +import { UsageCounters } from '../../common'; import moment from 'moment'; @@ -19,10 +19,12 @@ describe('counterKey', () => { domainId: 'a', counterName: 'b', counterType: 'c', + namespace: 'default', + source: 'ui', date: moment('09042021', 'DDMMYYYY'), }); - expect(result).toMatchInlineSnapshot(`"a:09042021:c:b"`); + expect(result).toEqual('a:b:c:ui:20210409:default'); }); }); @@ -40,20 +42,22 @@ describe('storeCounter', () => { }); it('stores counter in a saved object', async () => { - const counterMetric: UsageCounters.v1.CounterMetric = { + const metric: UsageCounters.v1.CounterMetric = { domainId: 'a', counterName: 'b', counterType: 'c', + namespace: 'default', + source: 'ui', incrementBy: 13, }; - await storeCounter(counterMetric, internalRepository); + await storeCounter({ metric, soRepository: internalRepository }); expect(internalRepository.incrementCounter).toBeCalledTimes(1); expect(internalRepository.incrementCounter.mock.calls[0]).toMatchInlineSnapshot(` Array [ - "usage-counters", - "a:09042021:c:b", + "usage-counter", + "a:b:c:ui:20210409", Array [ Object { "fieldName": "count", @@ -61,10 +65,12 @@ describe('storeCounter', () => { }, ], Object { + "namespace": "default", "upsertAttributes": Object { "counterName": "b", "counterType": "c", "domainId": "a", + "source": "ui", }, }, ] diff --git a/src/plugins/usage_collection/server/usage_counters/saved_objects.ts b/src/plugins/usage_collection/server/usage_counters/saved_objects.ts index 402dabb62b96b..ab8bc6620ac87 100644 --- a/src/plugins/usage_collection/server/usage_counters/saved_objects.ts +++ b/src/plugins/usage_collection/server/usage_counters/saved_objects.ts @@ -6,13 +6,14 @@ * Side Public License, v 1. */ +import moment from 'moment'; +import { USAGE_COUNTERS_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; import type { SavedObject, SavedObjectsRepository, SavedObjectsServiceSetup, } from '@kbn/core/server'; -import moment from 'moment'; -import { UsageCounters } from '../../common/types'; +import { UsageCounters } from '../../common'; /** * The attributes stored in the UsageCounters' SavedObjects @@ -24,6 +25,8 @@ export interface UsageCountersSavedObjectAttributes { counterName: string; /** The counter type **/ counterType: string; + /** The source of the event that is being counted: 'server' | 'ui' **/ + source: string; /** Number of times the event has occurred **/ count: number; } @@ -34,13 +37,31 @@ export interface UsageCountersSavedObjectAttributes { export type UsageCountersSavedObject = SavedObject; /** The Saved Objects type for Usage Counters **/ -export const USAGE_COUNTERS_SAVED_OBJECT_TYPE = 'usage-counters'; +export const USAGE_COUNTERS_SAVED_OBJECT_TYPE = 'usage-counter'; -export const registerUsageCountersSavedObjectType = ( +export const registerUsageCountersSavedObjectTypes = ( savedObjectsSetup: SavedObjectsServiceSetup ) => { savedObjectsSetup.registerType({ name: USAGE_COUNTERS_SAVED_OBJECT_TYPE, + indexPattern: USAGE_COUNTERS_SAVED_OBJECT_INDEX, + hidden: false, + namespaceType: 'single', + mappings: { + dynamic: false, + properties: { + domainId: { type: 'keyword' }, + counterName: { type: 'keyword' }, + counterType: { type: 'keyword' }, + source: { type: 'keyword' }, + count: { type: 'integer' }, + }, + }, + }); + + // DEPRECATED: we keep it just to ensure non-reindex migrations (serverless) + savedObjectsSetup.registerType({ + name: 'usage-counters', hidden: false, namespaceType: 'agnostic', mappings: { @@ -56,53 +77,68 @@ export const registerUsageCountersSavedObjectType = ( * Parameters to the `serializeCounterKey` method * @internal used in kibana_usage_collectors */ -export interface SerializeCounterParams { +export interface SerializeCounterKeyParams { /** The domain ID registered in the UsageCounter **/ domainId: string; /** The counter name **/ counterName: string; /** The counter type **/ counterType: string; - /** The date to which serialize the key **/ - date: moment.MomentInput; + /** The namespace of this counter */ + namespace?: string; + /** The source of the event we are counting */ + source: string; + /** The date to which serialize the key (defaults to 'now') **/ + date?: moment.MomentInput; } /** * Generates a key based on the UsageCounter details * @internal used in kibana_usage_collectors - * @param opts {@link SerializeCounterParams} + * @param opts {@link SerializeCounterKeyParams} */ export const serializeCounterKey = ({ domainId, counterName, counterType, + namespace, + source, date, -}: SerializeCounterParams) => { - const dayDate = moment(date).format('DDMMYYYY'); - return `${domainId}:${dayDate}:${counterType}:${counterName}`; +}: SerializeCounterKeyParams) => { + const dayDate = moment(date).format('YYYYMMDD'); + // e.g. 'dashboards:viewed:total:ui:20240628' // namespace-agnostic counters + // e.g. 'dashboards:viewed:total:ui:20240628:default' // namespaced counters + const namespaceSuffix = namespace ? `:${namespace}` : ''; + return `${domainId}:${counterName}:${counterType}:${source}:${dayDate}${namespaceSuffix}`; }; -export const storeCounter = async ( - counterMetric: UsageCounters.v1.CounterMetric, - internalRepository: Pick -) => { - const { counterName, counterType, domainId, incrementBy } = counterMetric; +export interface StoreCounterParams { + metric: UsageCounters.v1.CounterMetric; + soRepository: Pick; +} + +export const storeCounter = async ({ metric, soRepository }: StoreCounterParams) => { + const { namespace, counterName, counterType, domainId, source, incrementBy } = metric; + // same counter key can be used in different namespaces (no need to make namespace part of the key) const key = serializeCounterKey({ - date: moment.now(), domainId, counterName, counterType, + source, + date: moment.now(), }); - return await internalRepository.incrementCounter( + return await soRepository.incrementCounter( USAGE_COUNTERS_SAVED_OBJECT_TYPE, key, [{ fieldName: 'count', incrementBy }], { + ...(namespace && { namespace }), upsertAttributes: { domainId, counterName, counterType, + source, }, } ); diff --git a/src/plugins/usage_collection/server/usage_counters/usage_counter.test.ts b/src/plugins/usage_collection/server/usage_counters/usage_counter.test.ts index f3f6c2870ce25..aea0ab44f6cdd 100644 --- a/src/plugins/usage_collection/server/usage_counters/usage_counter.test.ts +++ b/src/plugins/usage_collection/server/usage_counters/usage_counter.test.ts @@ -5,10 +5,9 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import { UsageCounter } from './usage_counter'; -import type { UsageCounters } from '../../common/types'; import * as Rx from 'rxjs'; -import * as rxOp from 'rxjs'; +import { UsageCounter } from './usage_counter'; +import type { UsageCounters } from '../../common'; describe('UsageCounter', () => { const domainId = 'test-domain-id'; @@ -21,18 +20,37 @@ describe('UsageCounter', () => { describe('#incrementCounter', () => { it('#incrementCounter calls counter$.next', async () => { - const result = counter$.pipe(rxOp.take(1), rxOp.toArray()).toPromise(); - usageCounter.incrementCounter({ counterName: 'test', counterType: 'type', incrementBy: 13 }); + const result = Rx.firstValueFrom(counter$.pipe(Rx.take(1), Rx.toArray())); + usageCounter.incrementCounter({ + counterName: 'test', + counterType: 'type', + incrementBy: 13, + source: 'ui', + namespace: 'second', + }); await expect(result).resolves.toEqual([ - { counterName: 'test', counterType: 'type', domainId: 'test-domain-id', incrementBy: 13 }, + { + domainId: 'test-domain-id', + counterType: 'type', + counterName: 'test', + source: 'ui', + namespace: 'second', + incrementBy: 13, + }, ]); }); it('passes default configs to counter$', async () => { - const result = counter$.pipe(rxOp.take(1), rxOp.toArray()).toPromise(); + const result = Rx.firstValueFrom(counter$.pipe(Rx.take(1), Rx.toArray())); usageCounter.incrementCounter({ counterName: 'test' }); await expect(result).resolves.toEqual([ - { counterName: 'test', counterType: 'count', domainId: 'test-domain-id', incrementBy: 1 }, + { + domainId: 'test-domain-id', + counterType: 'count', + counterName: 'test', + source: 'server', + incrementBy: 1, + }, ]); }); }); diff --git a/src/plugins/usage_collection/server/usage_counters/usage_counter.ts b/src/plugins/usage_collection/server/usage_counters/usage_counter.ts index 80bd32ae4d1db..6f8c892f2627a 100644 --- a/src/plugins/usage_collection/server/usage_counters/usage_counter.ts +++ b/src/plugins/usage_collection/server/usage_counters/usage_counter.ts @@ -7,9 +7,9 @@ */ import * as Rx from 'rxjs'; -import { UsageCounters } from '../../common/types'; +import type { UsageCounters } from '../../common'; -export interface UsageCounterDeps { +export interface UsageCounterParams { domainId: string; counter$: Rx.Subject; } @@ -31,19 +31,27 @@ export class UsageCounter implements IUsageCounter { private domainId: string; private counter$: Rx.Subject; - constructor({ domainId, counter$ }: UsageCounterDeps) { + constructor({ domainId, counter$ }: UsageCounterParams) { this.domainId = domainId; this.counter$ = counter$; } public incrementCounter = (params: UsageCounters.v1.IncrementCounterParams) => { - const { counterName, counterType = 'count', incrementBy = 1 } = params; + const { + counterName, + counterType = 'count', + source = 'server', // default behavior before introducing the property + incrementBy = 1, + namespace, + } = params; this.counter$.next({ - counterName, domainId: this.domainId, + counterName, counterType, + source, incrementBy, + ...(namespace && { namespace }), }); }; } diff --git a/src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock.ts b/src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock.ts index 0d96def540540..8e8627c5aea2d 100644 --- a/src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock.ts +++ b/src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock.ts @@ -13,7 +13,7 @@ import type { UsageCounter } from './usage_counter'; const createSetupContractMock = () => { const setupContract: jest.Mocked = { createUsageCounter: jest.fn(), - getUsageCounterByType: jest.fn(), + getUsageCounterByDomainId: jest.fn(), }; setupContract.createUsageCounter.mockReturnValue({ diff --git a/src/plugins/usage_collection/server/usage_counters/usage_counters_service.test.ts b/src/plugins/usage_collection/server/usage_counters/usage_counters_service.test.ts index 1222924b6ec94..1350c8b706b87 100644 --- a/src/plugins/usage_collection/server/usage_counters/usage_counters_service.test.ts +++ b/src/plugins/usage_collection/server/usage_counters/usage_counters_service.test.ts @@ -40,7 +40,7 @@ describe('UsageCountersService', () => { const usageCounter = createUsageCounter('test-counter'); usageCounter.incrementCounter({ counterName: 'counterA' }); - usageCounter.incrementCounter({ counterName: 'counterA' }); + usageCounter.incrementCounter({ counterName: 'counterA', namespace: 'second', source: 'ui' }); const dataInSourcePromise = usageCountersService['source$'].pipe(rxOp.toArray()).toPromise(); usageCountersService['flushCache$'].next(); @@ -48,10 +48,10 @@ describe('UsageCountersService', () => { await expect(dataInSourcePromise).resolves.toHaveLength(2); }); - it('registers savedObject type during setup', () => { + it('registers savedObject types during setup', () => { const usageCountersService = new UsageCountersService({ logger, retryCount, bufferDurationMs }); usageCountersService.setup(coreSetup); - expect(coreSetup.savedObjects.registerType).toBeCalledTimes(1); + expect(coreSetup.savedObjects.registerType).toBeCalledTimes(2); }); it('flushes cached data on start', async () => { @@ -67,28 +67,31 @@ describe('UsageCountersService', () => { const usageCounter = createUsageCounter('test-counter'); usageCounter.incrementCounter({ counterName: 'counterA' }); - usageCounter.incrementCounter({ counterName: 'counterA' }); + usageCounter.incrementCounter({ counterName: 'counterA', namespace: 'second', source: 'ui' }); const dataInSourcePromise = usageCountersService['source$'].pipe(rxOp.toArray()).toPromise(); usageCountersService.start(coreStart); usageCountersService['source$'].complete(); await expect(dataInSourcePromise).resolves.toMatchInlineSnapshot(` - Array [ - Object { - "counterName": "counterA", - "counterType": "count", - "domainId": "test-counter", - "incrementBy": 1, - }, - Object { - "counterName": "counterA", - "counterType": "count", - "domainId": "test-counter", - "incrementBy": 1, - }, - ] - `); + Array [ + Object { + "counterName": "counterA", + "counterType": "count", + "domainId": "test-counter", + "incrementBy": 1, + "source": "server", + }, + Object { + "counterName": "counterA", + "counterType": "count", + "domainId": "test-counter", + "incrementBy": 1, + "namespace": "second", + "source": "ui", + }, + ] + `); }); it('buffers data into savedObject', async () => { @@ -114,8 +117,8 @@ describe('UsageCountersService', () => { expect(mockIncrementCounter.mock.calls).toMatchInlineSnapshot(` Array [ Array [ - "usage-counters", - "test-counter:09042021:count:counterA", + "usage-counter", + "test-counter:counterA:count:server:20210409", Array [ Object { "fieldName": "count", @@ -127,12 +130,13 @@ describe('UsageCountersService', () => { "counterName": "counterA", "counterType": "count", "domainId": "test-counter", + "source": "server", }, }, ], Array [ - "usage-counters", - "test-counter:09042021:count:counterB", + "usage-counter", + "test-counter:counterB:count:server:20210409", Array [ Object { "fieldName": "count", @@ -144,6 +148,7 @@ describe('UsageCountersService', () => { "counterName": "counterB", "counterType": "count", "domainId": "test-counter", + "source": "server", }, }, ], @@ -162,9 +167,9 @@ describe('UsageCountersService', () => { const mockError = new Error('failed.'); const mockIncrementCounter = jest.fn().mockImplementation((_, key) => { switch (key) { - case 'test-counter:09042021:count:counterA': + case 'test-counter:counterA:count:server:20210409': throw mockError; - case 'test-counter:09042021:count:counterB': + case 'test-counter:counterB:count:server:20210409': return 'pass'; default: throw new Error(`unknown key ${key}`); @@ -232,11 +237,11 @@ describe('UsageCountersService', () => { Array [ Object { "incrementBy": 2, - "key": "test-counter:09042021:count:counterA", + "key": "test-counter:counterA:count:server:20210409", }, Object { "incrementBy": 1, - "key": "test-counter:09042021:count:counterA", + "key": "test-counter:counterA:count:server:20210409", }, ] `); diff --git a/src/plugins/usage_collection/server/usage_counters/usage_counters_service.ts b/src/plugins/usage_collection/server/usage_counters/usage_counters_service.ts index c0e71bdd28dbf..28c3aaf2be148 100644 --- a/src/plugins/usage_collection/server/usage_counters/usage_counters_service.ts +++ b/src/plugins/usage_collection/server/usage_counters/usage_counters_service.ts @@ -8,18 +8,18 @@ import * as Rx from 'rxjs'; import * as rxOp from 'rxjs'; -import { +import moment from 'moment'; +import type { SavedObjectsRepository, SavedObjectsServiceSetup, SavedObjectsServiceStart, } from '@kbn/core/server'; import type { Logger, LogMeta } from '@kbn/core/server'; -import moment from 'moment'; -import { UsageCounter } from './usage_counter'; -import { UsageCounters } from '../../common/types'; +import { type IUsageCounter, UsageCounter } from './usage_counter'; +import type { UsageCounters } from '../../common'; import { - registerUsageCountersSavedObjectType, + registerUsageCountersSavedObjectTypes, storeCounter, serializeCounterKey, } from './saved_objects'; @@ -35,8 +35,8 @@ export interface UsageCountersServiceDeps { } export interface UsageCountersServiceSetup { - createUsageCounter: (type: string) => UsageCounter; - getUsageCounterByType: (type: string) => UsageCounter | undefined; + createUsageCounter: (domainId: string) => IUsageCounter; + getUsageCounterByDomainId: (domainId: string) => IUsageCounter | undefined; } /* internal */ @@ -95,11 +95,11 @@ export class UsageCountersService { storingCache$.next(false); }); - registerUsageCountersSavedObjectType(core.savedObjects); + registerUsageCountersSavedObjectTypes(core.savedObjects); return { createUsageCounter: this.createUsageCounter, - getUsageCounterByType: this.getUsageCounterByType, + getUsageCounterByDomainId: this.getUsageCounterByDomainId, }; }; @@ -137,11 +137,11 @@ export class UsageCountersService { private storeDate$( counters: UsageCounters.v1.CounterMetric[], - internalRepository: Pick + soRepository: Pick ) { return Rx.forkJoin( - counters.map((counter) => - Rx.defer(() => storeCounter(counter, internalRepository)).pipe( + counters.map((metric) => + Rx.defer(() => storeCounter({ metric, soRepository })).pipe( rxOp.retry(this.retryCount), rxOp.catchError((error) => { this.logger.warn(error); @@ -152,22 +152,17 @@ export class UsageCountersService { ); } - private createUsageCounter = (type: string): UsageCounter => { - if (this.counterSets.get(type)) { - throw new Error(`Usage counter set "${type}" already exists.`); + private createUsageCounter = (domainId: string): IUsageCounter => { + if (this.counterSets.get(domainId)) { + throw new Error(`Usage counter set "${domainId}" already exists.`); } - const counterSet = new UsageCounter({ - domainId: type, - counter$: this.source$, - }); - - this.counterSets.set(type, counterSet); - + const counterSet = new UsageCounter({ domainId, counter$: this.source$ }); + this.counterSets.set(domainId, counterSet); return counterSet; }; - private getUsageCounterByType = (type: string): UsageCounter | undefined => { + private getUsageCounterByDomainId = (type: string): IUsageCounter | undefined => { return this.counterSets.get(type); }; @@ -176,8 +171,15 @@ export class UsageCountersService { ): Record => { const date = moment.now(); return counters.reduce((acc, counter) => { - const { counterName, domainId, counterType } = counter; - const key = serializeCounterKey({ domainId, counterName, counterType, date }); + const { domainId, counterName, counterType, namespace, source } = counter; + const key = serializeCounterKey({ + domainId, + counterName, + counterType, + namespace, + source, + date, + }); const existingCounter = acc[key]; if (!existingCounter) { acc[key] = counter; diff --git a/src/plugins/usage_collection/tsconfig.json b/src/plugins/usage_collection/tsconfig.json index e7c24d604be96..53fba66071c5e 100644 --- a/src/plugins/usage_collection/tsconfig.json +++ b/src/plugins/usage_collection/tsconfig.json @@ -23,6 +23,7 @@ "@kbn/analytics-collection-utils", "@kbn/logging", "@kbn/ebt", + "@kbn/core-saved-objects-server", ], "exclude": [ "target/**/*", diff --git a/src/plugins/visualizations/public/actions/add_agg_vis_action.test.ts b/src/plugins/visualizations/public/actions/add_agg_vis_action.test.ts new file mode 100644 index 0000000000000..15003c4b04566 --- /dev/null +++ b/src/plugins/visualizations/public/actions/add_agg_vis_action.test.ts @@ -0,0 +1,62 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { + AddAggVisualizationPanelAction, + ADD_AGG_VIS_ACTION_ID, + type AddAggVisualizationPanelActionApi, +} from './add_agg_vis_action'; +import type { BaseVisType } from '../vis_types/base_vis_type'; +import { VisGroups } from '../vis_types/vis_groups_enum'; +import { TypesService, type TypesStart } from '../vis_types/types_service'; + +const mockCompatibleEmbeddableAPI: AddAggVisualizationPanelActionApi = { + type: ADD_AGG_VIS_ACTION_ID, + addNewPanel: jest.fn(), + getAppContext: jest.fn(), +}; + +describe('AddAggVisualizationPanelAction', () => { + let typeServiceStart: TypesStart; + + beforeEach(() => { + const typeService = new TypesService(); + + typeServiceStart = typeService.start(); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + test('invoking the compatibility function returns false when initialized with types that are not grouped as agg visualizations', async () => { + jest.spyOn(typeServiceStart, 'all').mockReturnValue([]); + + const addAggVisualizationPanelAction = new AddAggVisualizationPanelAction(typeServiceStart); + + expect( + await addAggVisualizationPanelAction.isCompatible({ embeddable: mockCompatibleEmbeddableAPI }) + ).toBe(false); + }); + + test('invoking the compatibility function returns true when the registered agg visualizations type does not have creation disabled', async () => { + jest.spyOn(typeServiceStart, 'all').mockReturnValue([ + { + group: VisGroups.AGGBASED, + disableCreate: false, + name: 'test visualization', + } as BaseVisType, + ]); + + const addAggVisualizationPanelAction = new AddAggVisualizationPanelAction(typeServiceStart); + + expect( + await addAggVisualizationPanelAction.isCompatible({ embeddable: mockCompatibleEmbeddableAPI }) + ).toBe(true); + }); +}); diff --git a/src/plugins/visualizations/public/actions/add_agg_vis_action.ts b/src/plugins/visualizations/public/actions/add_agg_vis_action.ts index 62c8e3654db6e..d0b7b2d9a7f6d 100644 --- a/src/plugins/visualizations/public/actions/add_agg_vis_action.ts +++ b/src/plugins/visualizations/public/actions/add_agg_vis_action.ts @@ -17,11 +17,13 @@ import { COMMON_EMBEDDABLE_GROUPING } from '@kbn/embeddable-plugin/public'; import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public'; import { apiHasType } from '@kbn/presentation-publishing'; import { apiCanAddNewPanel, CanAddNewPanel } from '@kbn/presentation-containers'; +import { VisGroups } from '../vis_types/vis_groups_enum'; +import type { TypesStart } from '../vis_types/types_service'; import { showNewVisModal } from '../wizard/show_new_vis'; -const ADD_AGG_VIS_ACTION_ID = 'ADD_AGG_VIS'; +export const ADD_AGG_VIS_ACTION_ID = 'ADD_AGG_VIS'; -type AddAggVisualizationPanelActionApi = HasType & CanAddNewPanel & HasAppContext; +export type AddAggVisualizationPanelActionApi = HasType & CanAddNewPanel & HasAppContext; const isApiCompatible = (api: unknown | null): api is AddAggVisualizationPanelActionApi => { return apiHasType(api) && apiCanAddNewPanel(api) && apiHasAppContext(api); @@ -31,10 +33,15 @@ export class AddAggVisualizationPanelAction implements Action { + return !type.disableCreate && type.group === VisGroups.AGGBASED; + }); + } public getIconType() { return 'visualizeApp'; @@ -47,7 +54,8 @@ export class AddAggVisualizationPanelAction implements Action { diff --git a/src/plugins/visualizations/public/plugin.ts b/src/plugins/visualizations/public/plugin.ts index c97ff8f4eba45..bb931a072f192 100644 --- a/src/plugins/visualizations/public/plugin.ts +++ b/src/plugins/visualizations/public/plugin.ts @@ -400,8 +400,6 @@ export class VisualizationsPlugin uiActions.registerTrigger(dashboardVisualizationPanelTrigger); const editInLensAction = new EditInLensAction(data.query.timefilter.timefilter); uiActions.addTriggerAction(CONTEXT_MENU_TRIGGER, editInLensAction); - const addAggVisAction = new AddAggVisualizationPanelAction(); - uiActions.addTriggerAction(ADD_PANEL_TRIGGER, addAggVisAction); const embeddableFactory = new VisualizeEmbeddableFactory({ start }); embeddable.registerEmbeddableFactory(VISUALIZE_EMBEDDABLE_TYPE, embeddableFactory); @@ -499,6 +497,9 @@ export class VisualizationsPlugin setSavedObjectTagging(savedObjectsTaggingOss); } + const addAggVisAction = new AddAggVisualizationPanelAction(types); + uiActions.addTriggerAction(ADD_PANEL_TRIGGER, addAggVisAction); + return { ...types, showNewVisModal, diff --git a/test/api_integration/apis/esql/errors.ts b/test/api_integration/apis/esql/errors.ts index e74f86efcb44c..5dcc951e95484 100644 --- a/test/api_integration/apis/esql/errors.ts +++ b/test/api_integration/apis/esql/errors.ts @@ -237,7 +237,8 @@ export default function ({ getService }: FtrProviderContext) { await cleanup(); }); - it(`Checking error messages`, async () => { + // FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/188109 + it.skip(`Checking error messages`, async () => { for (const { query, error } of queryToErrors) { const jsonBody = await sendESQLQuery(query); diff --git a/test/api_integration/apis/ui_counters/ui_counters.ts b/test/api_integration/apis/ui_counters/ui_counters.ts index 3016af858d6be..cf6b6eee51d21 100644 --- a/test/api_integration/apis/ui_counters/ui_counters.ts +++ b/test/api_integration/apis/ui_counters/ui_counters.ts @@ -29,7 +29,7 @@ export default function ({ getService }: FtrProviderContext) { const { body: { saved_objects: savedObjects }, } = await supertest - .get('/api/saved_objects/_find?type=usage-counters') + .get('/api/saved_objects/_find?type=usage-counter') .set('kbn-xsrf', 'kibana') .expect(200); @@ -51,7 +51,8 @@ export default function ({ getService }: FtrProviderContext) { counterType: UiCounterMetricType ): UsageCountersSavedObject[] => { const matchingEventName = savedObjects.filter( - ({ attributes }) => attributes.counterName === `${APP_NAME}:${eventName}` + ({ attributes: { domainId, counterName } }) => + domainId === APP_NAME && counterName === eventName ); if (!matchingEventName.length) { throw new Error( diff --git a/test/functional/apps/dashboard/group1/create_and_add_embeddables.ts b/test/functional/apps/dashboard/group1/create_and_add_embeddables.ts index 1219fb03fd1c2..e1941ab08a850 100644 --- a/test/functional/apps/dashboard/group1/create_and_add_embeddables.ts +++ b/test/functional/apps/dashboard/group1/create_and_add_embeddables.ts @@ -34,7 +34,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.dashboard.clickNewDashboard(); await PageObjects.dashboard.switchToEditMode(); await dashboardAddPanel.clickEditorMenuButton(); - await dashboardAddPanel.clickAddNewPanelFromUIActionLink('Log stream'); + await dashboardAddPanel.clickAddNewPanelFromUIActionLink('Log stream (deprecated)'); await dashboardAddPanel.expectEditorMenuClosed(); }); diff --git a/test/functional/apps/dashboard_elements/links/links_create_edit.ts b/test/functional/apps/dashboard_elements/links/links_create_edit.ts index 97e78ca2fb0a4..da67064602dad 100644 --- a/test/functional/apps/dashboard_elements/links/links_create_edit.ts +++ b/test/functional/apps/dashboard_elements/links/links_create_edit.ts @@ -54,7 +54,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('can not add an external link that violates externalLinks.policy', async () => { await dashboardAddPanel.clickEditorMenuButton(); - await dashboardAddPanel.clickAddNewEmbeddableLink('links'); + await dashboardAddPanel.clickAddNewPanelFromUIActionLink('Links'); await dashboardLinks.setExternalUrlInput('https://danger.example.com'); expect(await testSubjects.exists('links--linkDestination--error')).to.be(true); @@ -64,7 +64,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('can create a new by-reference links panel', async () => { await dashboardAddPanel.clickEditorMenuButton(); - await dashboardAddPanel.clickAddNewEmbeddableLink('links'); + await dashboardAddPanel.clickAddNewPanelFromUIActionLink('Links'); await createSomeLinks(); await dashboardLinks.toggleSaveByReference(true); @@ -75,8 +75,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await testSubjects.click('confirmSaveSavedObjectButton'); await common.waitForSaveModalToClose(); await testSubjects.exists('addObjectToDashboardSuccess'); + await testSubjects.existOrFail('links--component'); + await testSubjects.existOrFail('embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION'); - expect(await testSubjects.existOrFail('links--component')); expect(await dashboardLinks.getNumberOfLinksInPanel()).to.equal(4); await dashboard.clickDiscardChanges(); }); @@ -84,14 +85,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('by-value links panel', async () => { it('can create a new by-value links panel', async () => { await dashboardAddPanel.clickEditorMenuButton(); - await dashboardAddPanel.clickAddNewEmbeddableLink('links'); + await dashboardAddPanel.clickAddNewPanelFromUIActionLink('Links'); await dashboardLinks.setLayout('horizontal'); await createSomeLinks(); await dashboardLinks.toggleSaveByReference(false); await dashboardLinks.clickPanelEditorSaveButton(); await testSubjects.exists('addObjectToDashboardSuccess'); + await testSubjects.existOrFail('links--component'); + await testSubjects.missingOrFail( + 'embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION' + ); - expect(await testSubjects.existOrFail('links--component')); expect(await dashboardLinks.getNumberOfLinksInPanel()).to.equal(4); }); @@ -101,10 +105,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboard.clickUnsavedChangesContinueEditing(DASHBOARD_NAME); await dashboard.waitForRenderComplete(); - await dashboardPanelActions.legacySaveToLibrary('Some more links'); + await dashboardPanelActions.saveToLibrary('Some more links'); await testSubjects.existOrFail('addPanelToLibrarySuccess'); }); + it('can unlink a panel from the library', async () => { + const panel = await testSubjects.find('embeddablePanelHeading-Somemorelinks'); + await dashboardPanelActions.unlinkFromLibrary(panel); + await testSubjects.existOrFail('unlinkPanelSuccess'); + }); + after(async () => { await dashboard.clickDiscardChanges(); }); diff --git a/test/functional/apps/discover/classic/_doc_table.ts b/test/functional/apps/discover/classic/_doc_table.ts index 7539cce991af8..0e5934a62f943 100644 --- a/test/functional/apps/discover/classic/_doc_table.ts +++ b/test/functional/apps/discover/classic/_doc_table.ts @@ -230,7 +230,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('add and remove columns', async function () { const extraColumns = ['phpmemory', 'ip']; - + const expectedFieldLength: Record = { + phpmemory: 1, + ip: 4, + }; afterEach(async function () { for (const column of extraColumns) { await PageObjects.unifiedFieldList.clickFieldListItemRemove(column); @@ -242,6 +245,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { for (const column of extraColumns) { await PageObjects.unifiedFieldList.clearFieldSearchInput(); await PageObjects.unifiedFieldList.findFieldByName(column); + await PageObjects.unifiedFieldList.waitUntilFieldlistHasCountOfFields( + expectedFieldLength[column] + ); await retry.waitFor('field to appear', async function () { return await testSubjects.exists(`field-${column}`); }); @@ -258,9 +264,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { for (const column of extraColumns) { await PageObjects.unifiedFieldList.clearFieldSearchInput(); await PageObjects.unifiedFieldList.findFieldByName(column); - await retry.waitFor('field to appear', async function () { - return await testSubjects.exists(`field-${column}`); - }); + await PageObjects.unifiedFieldList.waitUntilFieldlistHasCountOfFields( + expectedFieldLength[column] + ); await PageObjects.unifiedFieldList.clickFieldListItemAdd(column); await PageObjects.header.waitUntilLoadingHasFinished(); } diff --git a/test/functional/apps/discover/context_awareness/_data_source_profile.ts b/test/functional/apps/discover/context_awareness/_data_source_profile.ts index d203f33c887e8..f3f7e35d7030b 100644 --- a/test/functional/apps/discover/context_awareness/_data_source_profile.ts +++ b/test/functional/apps/discover/context_awareness/_data_source_profile.ts @@ -14,6 +14,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['common', 'timePicker', 'discover', 'unifiedFieldList']); const testSubjects = getService('testSubjects'); const dataViews = getService('dataViews'); + const dataGrid = getService('dataGrid'); describe('data source profile', () => { describe('ES|QL mode', () => { @@ -58,6 +59,40 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await logLevels[2].getVisibleText()).to.be('Info'); }); }); + + describe('doc viewer extension', () => { + it('should not render custom doc viewer view', async () => { + const state = kbnRison.encode({ + dataSource: { type: 'esql' }, + query: { esql: 'from my-example-* | sort @timestamp desc' }, + }); + await PageObjects.common.navigateToApp('discover', { + hash: `/?_a=${state}`, + }); + await PageObjects.discover.waitUntilSearchingHasFinished(); + await dataGrid.clickRowToggle({ rowIndex: 0 }); + await testSubjects.existOrFail('docViewerTab-doc_view_table'); + await testSubjects.existOrFail('docViewerTab-doc_view_source'); + await testSubjects.missingOrFail('docViewerTab-doc_view_logs_overview'); + expect(await testSubjects.getVisibleText('docViewerRowDetailsTitle')).to.be('Result'); + }); + + it('should render custom doc viewer view', async () => { + const state = kbnRison.encode({ + dataSource: { type: 'esql' }, + query: { esql: 'from my-example-logs | sort @timestamp desc' }, + }); + await PageObjects.common.navigateToApp('discover', { + hash: `/?_a=${state}`, + }); + await PageObjects.discover.waitUntilSearchingHasFinished(); + await dataGrid.clickRowToggle({ rowIndex: 0 }); + await testSubjects.existOrFail('docViewerTab-doc_view_table'); + await testSubjects.existOrFail('docViewerTab-doc_view_source'); + await testSubjects.existOrFail('docViewerTab-doc_view_logs_overview'); + expect(await testSubjects.getVisibleText('docViewerRowDetailsTitle')).to.be('Record #0'); + }); + }); }); describe('data view mode', () => { @@ -92,6 +127,32 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await logLevels[2].getVisibleText()).to.be('Info'); }); }); + + describe('doc viewer extension', () => { + it('should not render custom doc viewer view', async () => { + await PageObjects.common.navigateToApp('discover'); + await dataViews.switchTo('my-example-*'); + await PageObjects.discover.waitUntilSearchingHasFinished(); + await dataGrid.clickRowToggle({ rowIndex: 0 }); + await testSubjects.existOrFail('docViewerTab-doc_view_table'); + await testSubjects.existOrFail('docViewerTab-doc_view_source'); + await testSubjects.missingOrFail('docViewerTab-doc_view_logs_overview'); + expect(await testSubjects.getVisibleText('docViewerRowDetailsTitle')).to.be('Document'); + }); + + it('should render custom doc viewer view', async () => { + await PageObjects.common.navigateToApp('discover'); + await dataViews.switchTo('my-example-logs'); + await PageObjects.discover.waitUntilSearchingHasFinished(); + await dataGrid.clickRowToggle({ rowIndex: 0 }); + await testSubjects.existOrFail('docViewerTab-doc_view_table'); + await testSubjects.existOrFail('docViewerTab-doc_view_source'); + await testSubjects.existOrFail('docViewerTab-doc_view_logs_overview'); + expect(await testSubjects.getVisibleText('docViewerRowDetailsTitle')).to.be( + 'Record #my-example-logs::XdQFDpABfGznVC1bCHLo::' + ); + }); + }); }); }); } diff --git a/test/functional/apps/discover/esql/_esql_columns.ts b/test/functional/apps/discover/esql/_esql_columns.ts index d48ec83f6ba91..ad1fe5d31edc9 100644 --- a/test/functional/apps/discover/esql/_esql_columns.ts +++ b/test/functional/apps/discover/esql/_esql_columns.ts @@ -36,8 +36,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { defaultIndex: 'logstash-*', }; - // FLAKY: https://github.com/elastic/kibana/issues/186416 - describe.skip('discover esql columns', async function () { + describe('discover esql columns', async function () { before(async () => { await kibanaServer.savedObjects.cleanStandardList(); await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); @@ -95,13 +94,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const columns = ['@timestamp', 'Document']; expect(await dataGrid.getHeaderFields()).to.eql(columns); - await monacoEditor.setCodeEditorValue('from logstash-* | limit 1'); + await monacoEditor.setCodeEditorValue('from logstash-* | limit 500'); await testSubjects.click('querySubmitButton'); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.discover.waitUntilSearchingHasFinished(); expect(await dataGrid.getHeaderFields()).to.eql(columns); - await monacoEditor.setCodeEditorValue('from logs* | limit 1'); + await monacoEditor.setCodeEditorValue('from logs* | limit 500'); await testSubjects.click('querySubmitButton'); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.discover.waitUntilSearchingHasFinished(); @@ -113,7 +112,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await dataGrid.getHeaderFields()).to.eql(['bytes']); // different index pattern => reset columns - await monacoEditor.setCodeEditorValue('from logstash-* | limit 1'); + await monacoEditor.setCodeEditorValue('from logstash-* | limit 500'); await testSubjects.click('querySubmitButton'); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.discover.waitUntilSearchingHasFinished(); diff --git a/test/functional/apps/discover/esql/_esql_view.ts b/test/functional/apps/discover/esql/_esql_view.ts index cea3b6ecce044..4bd351febc66c 100644 --- a/test/functional/apps/discover/esql/_esql_view.ts +++ b/test/functional/apps/discover/esql/_esql_view.ts @@ -85,7 +85,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await testSubjects.exists('discoverQueryHits')).to.be(true); expect(await testSubjects.exists('discoverAlertsButton')).to.be(true); expect(await testSubjects.exists('shareTopNavButton')).to.be(true); - expect(await testSubjects.exists('dataGridColumnSortingButton')).to.be(true); + // we don't sort for the Document view + expect(await testSubjects.exists('dataGridColumnSortingButton')).to.be(false); expect(await testSubjects.exists('docTableExpandToggleColumn')).to.be(true); expect(await testSubjects.exists('fieldListFiltersFieldTypeFilterToggle')).to.be(true); await testSubjects.click('field-@message-showDetails'); diff --git a/test/functional/apps/discover/group2_data_grid1/_data_grid_doc_table.ts b/test/functional/apps/discover/group2_data_grid1/_data_grid_doc_table.ts index ac77fe3f70714..24056a3986624 100644 --- a/test/functional/apps/discover/group2_data_grid1/_data_grid_doc_table.ts +++ b/test/functional/apps/discover/group2_data_grid1/_data_grid_doc_table.ts @@ -220,6 +220,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('add and remove columns', function () { const extraColumns = ['phpmemory', 'ip']; + const expectedFieldLength: Record = { + phpmemory: 1, + ip: 4, + }; afterEach(async function () { for (const column of extraColumns) { @@ -232,6 +236,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { for (const column of extraColumns) { await PageObjects.unifiedFieldList.clearFieldSearchInput(); await PageObjects.unifiedFieldList.findFieldByName(column); + await PageObjects.unifiedFieldList.waitUntilFieldlistHasCountOfFields( + expectedFieldLength[column] + ); await PageObjects.unifiedFieldList.clickFieldListItemAdd(column); await PageObjects.header.waitUntilLoadingHasFinished(); // test the header now @@ -244,6 +251,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { for (const column of extraColumns) { await PageObjects.unifiedFieldList.clearFieldSearchInput(); await PageObjects.unifiedFieldList.findFieldByName(column); + await PageObjects.unifiedFieldList.waitUntilFieldlistHasCountOfFields( + expectedFieldLength[column] + ); await PageObjects.unifiedFieldList.clickFieldListItemAdd(column); await PageObjects.header.waitUntilLoadingHasFinished(); } diff --git a/test/functional/apps/discover/group3/_doc_viewer.ts b/test/functional/apps/discover/group3/_doc_viewer.ts index 140129c6a251f..ddcdf5c4e40b7 100644 --- a/test/functional/apps/discover/group3/_doc_viewer.ts +++ b/test/functional/apps/discover/group3/_doc_viewer.ts @@ -61,7 +61,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { return (await find.allByCssSelector('.kbnDocViewer__fieldName')).length === 4; }); - await PageObjects.discover.findFieldByNameInDocViewer('.s'); + await PageObjects.discover.findFieldByNameInDocViewer('.sr'); await retry.waitFor('second updates', async () => { return (await find.allByCssSelector('.kbnDocViewer__fieldName')).length === 2; @@ -70,7 +70,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should be able to search by wildcard', async function () { await PageObjects.discover.findFieldByNameInDocViewer('relatedContent*image'); - await retry.waitFor('updates', async () => { return (await find.allByCssSelector('.kbnDocViewer__fieldName')).length === 2; }); @@ -78,12 +77,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should be able to search with spaces as wildcard', async function () { await PageObjects.discover.findFieldByNameInDocViewer('relatedContent image'); - await retry.waitFor('updates', async () => { return (await find.allByCssSelector('.kbnDocViewer__fieldName')).length === 4; }); }); + it('should be able to search with fuzzy search (1 typo)', async function () { + await PageObjects.discover.findFieldByNameInDocViewer('rel4tedContent.art'); + + await retry.waitFor('updates', async () => { + return (await find.allByCssSelector('.kbnDocViewer__fieldName')).length === 3; + }); + }); + it('should ignore empty search', async function () { await PageObjects.discover.findFieldByNameInDocViewer(' '); // only spaces diff --git a/test/functional/apps/discover/group6/_field_stats_table.ts b/test/functional/apps/discover/group6/_field_stats_table.ts new file mode 100644 index 0000000000000..45b05d7ddc4bf --- /dev/null +++ b/test/functional/apps/discover/group6/_field_stats_table.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 { FtrProviderContext } from '../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const PageObjects = getPageObjects(['common', 'discover', 'timePicker', 'header']); + const esArchiver = getService('esArchiver'); + const testSubjects = getService('testSubjects'); + const kibanaServer = getService('kibanaServer'); + const security = getService('security'); + const defaultSettings = { + defaultIndex: 'logstash-*', + }; + + describe('discover field statistics table', function () { + before(async () => { + await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); + }); + + after(async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional'); + await kibanaServer.savedObjects.cleanStandardList(); + }); + + [true, false].forEach((shouldSearchFieldsFromSource) => { + describe(`discover:searchFieldsFromSource: ${shouldSearchFieldsFromSource}`, function () { + before(async function () { + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); + await kibanaServer.uiSettings.update({ + ...defaultSettings, + 'discover:searchFieldsFromSource': shouldSearchFieldsFromSource, + }); + await PageObjects.common.navigateToApp('discover'); + await PageObjects.header.waitUntilLoadingHasFinished(); + await PageObjects.discover.waitUntilSearchingHasFinished(); + }); + + after(async () => { + await kibanaServer.uiSettings.replace({}); + }); + + it('should show Field Statistics data in data view mode', async () => { + await testSubjects.click('dscViewModeFieldStatsButton'); + await PageObjects.header.waitUntilLoadingHasFinished(); + await testSubjects.existOrFail('dataVisualizerTableContainer'); + + await testSubjects.click('dscViewModeDocumentButton'); + await PageObjects.header.waitUntilLoadingHasFinished(); + await testSubjects.existOrFail('discoverDocTable'); + }); + + it('should show Field Statistics data in ES|QL mode', async () => { + await PageObjects.discover.selectTextBaseLang(); + await PageObjects.discover.waitUntilSearchingHasFinished(); + + await testSubjects.click('dscViewModeFieldStatsButton'); + await PageObjects.header.waitUntilLoadingHasFinished(); + await testSubjects.existOrFail('dataVisualizerTableContainer'); + }); + }); + }); + }); +} diff --git a/test/functional/apps/discover/group6/_sidebar.ts b/test/functional/apps/discover/group6/_sidebar.ts index ab2dc70e9e782..a2841bddf8777 100644 --- a/test/functional/apps/discover/group6/_sidebar.ts +++ b/test/functional/apps/discover/group6/_sidebar.ts @@ -223,6 +223,23 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); }); + it('should be able to search with fuzzy search (1 typo)', async function () { + await PageObjects.unifiedFieldList.findFieldByName('rel4tedContent.art'); + + await retry.waitFor('updates', async () => { + return ( + (await PageObjects.unifiedFieldList.getSidebarAriaDescription()) === + '4 available fields. 0 meta fields.' + ); + }); + + expect( + (await PageObjects.unifiedFieldList.getSidebarSectionFieldNames('available')).join(', ') + ).to.be( + 'relatedContent.article:modified_time, relatedContent.article:published_time, relatedContent.article:section, relatedContent.article:tag' + ); + }); + it('should ignore empty search', async function () { await PageObjects.unifiedFieldList.findFieldByName(' '); // only spaces diff --git a/test/functional/apps/discover/group6/index.ts b/test/functional/apps/discover/group6/index.ts index f71d96e63d2fd..6ed514463705f 100644 --- a/test/functional/apps/discover/group6/index.ts +++ b/test/functional/apps/discover/group6/index.ts @@ -25,5 +25,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./_time_field_column')); loadTestFile(require.resolve('./_unsaved_changes_badge')); loadTestFile(require.resolve('./_view_mode_toggle')); + loadTestFile(require.resolve('./_field_stats_table')); }); } diff --git a/test/functional/apps/home/_welcome.ts b/test/functional/apps/home/_welcome.ts index d61afd879090e..6c8bda90de699 100644 --- a/test/functional/apps/home/_welcome.ts +++ b/test/functional/apps/home/_welcome.ts @@ -15,7 +15,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['common', 'home']); const deployment = getService('deployment'); - describe('Welcome interstitial', () => { + // FLAKY: https://github.com/elastic/kibana/issues/186168 + describe.skip('Welcome interstitial', () => { beforeEach(async () => { // Need to navigate to page first to clear storage before test can be run await PageObjects.common.navigateToUrl('home', undefined); diff --git a/test/functional/apps/saved_objects_management/show_relationships.ts b/test/functional/apps/saved_objects_management/show_relationships.ts index a48e8069fe436..5714fdac1faaa 100644 --- a/test/functional/apps/saved_objects_management/show_relationships.ts +++ b/test/functional/apps/saved_objects_management/show_relationships.ts @@ -36,18 +36,18 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const invalidRelations = await PageObjects.savedObjects.getInvalidRelations(); expect(invalidRelations).to.eql([ - { - error: 'Saved object [visualization/missing-vis-ref] not found', - id: 'missing-vis-ref', - relationship: 'Child', - type: 'visualization', - }, { error: 'Saved object [dashboard/missing-dashboard-ref] not found', id: 'missing-dashboard-ref', relationship: 'Child', type: 'dashboard', }, + { + error: 'Saved object [visualization/missing-vis-ref] not found', + id: 'missing-vis-ref', + relationship: 'Child', + type: 'visualization', + }, ]); }); }); diff --git a/test/functional/page_objects/management/saved_objects_page.ts b/test/functional/page_objects/management/saved_objects_page.ts index cbbb70587ea0e..5285836ccd85d 100644 --- a/test/functional/page_objects/management/saved_objects_page.ts +++ b/test/functional/page_objects/management/saved_objects_page.ts @@ -357,7 +357,7 @@ export class SavedObjectsPageObject extends FtrService { error: await error.getVisibleText(), }; }) - ); + ).then((result) => result.sort((a, b) => a.id.localeCompare(b.id))); } async getTableSummary() { diff --git a/test/functional/page_objects/unified_field_list.ts b/test/functional/page_objects/unified_field_list.ts index 95644bf7483b1..a6cbaf81730df 100644 --- a/test/functional/page_objects/unified_field_list.ts +++ b/test/functional/page_objects/unified_field_list.ts @@ -53,6 +53,15 @@ export class UnifiedFieldListPageObject extends FtrService { }); } + public async waitUntilFieldlistHasCountOfFields(count: number) { + await this.retry.waitFor('wait until fieldlist has updated number of fields', async () => { + return ( + (await this.find.allByCssSelector('#fieldListGroupedAvailableFields .kbnFieldButton')) + .length === count + ); + }); + } + public async doesSidebarShowFields() { return await this.testSubjects.exists('fieldListGroupedFieldGroups'); } diff --git a/test/functional/services/dashboard/add_panel.ts b/test/functional/services/dashboard/add_panel.ts index ffc62bdfdb68a..16b283f2b5c53 100644 --- a/test/functional/services/dashboard/add_panel.ts +++ b/test/functional/services/dashboard/add_panel.ts @@ -69,9 +69,14 @@ export class DashboardAddPanelService extends FtrService { await this.testSubjects.click(`visType-${visType}`); } - async verifyEmbeddableFactoryGroupExists(groupId: string) { + async verifyEmbeddableFactoryGroupExists(groupId: string, expectExist: boolean = true) { this.log.debug('DashboardAddPanel.verifyEmbeddableFactoryGroupExists'); - await this.testSubjects.existOrFail(`dashboardEditorMenu-${groupId}Group`); + const testSubject = `dashboardEditorMenu-${groupId}Group`; + if (expectExist) { + await this.testSubjects.existOrFail(testSubject); + } else { + await this.testSubjects.missingOrFail(testSubject); + } } async clickAddNewEmbeddableLink(type: string) { diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index b9bb6183b22b0..a5b5cba1469ba 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -267,6 +267,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'xpack.fleet.internal.onlyAllowAgentUpgradeToKnownVersions (boolean)', 'xpack.fleet.developer.maxAgentPoliciesWithInactivityTimeout (number)', 'xpack.global_search.search_timeout (duration)', + 'xpack.global_search_bar.input_max_limit (number)', 'xpack.graph.canEditDrillDownUrls (boolean)', 'xpack.graph.savePolicy (alternatives)', 'xpack.ilm.ui.enabled (boolean)', diff --git a/test/plugin_functional/test_suites/usage_collection/usage_counters.ts b/test/plugin_functional/test_suites/usage_collection/usage_counters.ts index be4797b1cf61f..c7137470e0e7e 100644 --- a/test/plugin_functional/test_suites/usage_collection/usage_counters.ts +++ b/test/plugin_functional/test_suites/usage_collection/usage_counters.ts @@ -21,7 +21,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide await new Promise((res) => setTimeout(res, 10 * 1000)); return await supertest - .get('/api/saved_objects/_find?type=usage-counters') + .get('/api/saved_objects/_find?type=usage-counter') .set('kbn-xsrf', 'true') .expect(200) .then(({ body }) => { @@ -40,13 +40,13 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide describe('Usage Counters service', () => { before(async () => { const key = serializeCounterKey({ + domainId: 'usageCollectionTestPlugin', counterName: 'routeAccessed', counterType: 'count', - domainId: 'usageCollectionTestPlugin', - date: Date.now(), + source: 'server', }); - await supertest.delete(`/api/saved_objects/usage-counters/${key}`).set('kbn-xsrf', 'true'); + await supertest.delete(`/api/saved_objects/counter/${key}`).set('kbn-xsrf', 'true'); }); it('stores usage counters sent during start and setup', async () => { diff --git a/tsconfig.base.json b/tsconfig.base.json index 689df41bae17a..6d4637281115e 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -50,6 +50,8 @@ "@kbn/alerting-types/*": ["packages/kbn-alerting-types/*"], "@kbn/alerts-as-data-utils": ["packages/kbn-alerts-as-data-utils"], "@kbn/alerts-as-data-utils/*": ["packages/kbn-alerts-as-data-utils/*"], + "@kbn/alerts-grouping": ["packages/kbn-alerts-grouping"], + "@kbn/alerts-grouping/*": ["packages/kbn-alerts-grouping/*"], "@kbn/alerts-restricted-fixtures-plugin": ["x-pack/test/alerting_api_integration/common/plugins/alerts_restricted"], "@kbn/alerts-restricted-fixtures-plugin/*": ["x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/*"], "@kbn/alerts-ui-shared": ["packages/kbn-alerts-ui-shared"], @@ -806,6 +808,8 @@ "@kbn/eso-model-version-example/*": ["examples/eso_model_version_example/*"], "@kbn/eso-plugin": ["x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin"], "@kbn/eso-plugin/*": ["x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin/*"], + "@kbn/esql": ["src/plugins/esql"], + "@kbn/esql/*": ["src/plugins/esql/*"], "@kbn/esql-ast": ["packages/kbn-esql-ast"], "@kbn/esql-ast/*": ["packages/kbn-esql-ast/*"], "@kbn/esql-ast-inspector-plugin": ["examples/esql_ast_inspector"], @@ -1308,6 +1312,8 @@ "@kbn/react-kibana-context-theme/*": ["packages/react/kibana_context/theme/*"], "@kbn/react-kibana-mount": ["packages/react/kibana_mount"], "@kbn/react-kibana-mount/*": ["packages/react/kibana_mount/*"], + "@kbn/recently-accessed": ["packages/kbn-recently-accessed"], + "@kbn/recently-accessed/*": ["packages/kbn-recently-accessed/*"], "@kbn/remote-clusters-plugin": ["x-pack/plugins/remote_clusters"], "@kbn/remote-clusters-plugin/*": ["x-pack/plugins/remote_clusters/*"], "@kbn/rendering-plugin": ["test/plugin_functional/plugins/rendering_plugin"], @@ -1722,8 +1728,6 @@ "@kbn/testing-embedded-lens-plugin/*": ["x-pack/examples/testing_embedded_lens/*"], "@kbn/text-based-editor": ["packages/kbn-text-based-editor"], "@kbn/text-based-editor/*": ["packages/kbn-text-based-editor/*"], - "@kbn/text-based-languages": ["src/plugins/text_based_languages"], - "@kbn/text-based-languages/*": ["src/plugins/text_based_languages/*"], "@kbn/third-party-lens-navigation-prompt-plugin": ["x-pack/examples/third_party_lens_navigation_prompt"], "@kbn/third-party-lens-navigation-prompt-plugin/*": ["x-pack/examples/third_party_lens_navigation_prompt/*"], "@kbn/third-party-vis-lens-example-plugin": ["x-pack/examples/third_party_vis_lens_example"], diff --git a/versions.json b/versions.json index f43e07cfdf2e2..3816626bb83ca 100644 --- a/versions.json +++ b/versions.json @@ -2,13 +2,19 @@ "notice": "This file is not maintained outside of the main branch and should only be used for tooling.", "versions": [ { - "version": "8.15.0", + "version": "8.16.0", "branch": "main", "currentMajor": true, "currentMinor": true }, { - "version": "8.14.2", + "version": "8.15.0", + "branch": "8.15", + "currentMajor": true, + "previousMinor": true + }, + { + "version": "8.14.4", "branch": "8.14", "currentMajor": true, "previousMinor": true diff --git a/x-pack/package.json b/x-pack/package.json index a65aaf142fd25..c4f8f4efe770d 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -1,6 +1,6 @@ { "name": "x-pack", - "version": "8.15.0", + "version": "8.16.0", "author": "Elastic", "private": true, "license": "Elastic-License", diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/mock/get_anonymized_value/index.ts b/x-pack/packages/kbn-elastic-assistant-common/impl/mock/get_anonymized_value/index.ts index 3822c736b670e..256f9776c4563 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/mock/get_anonymized_value/index.ts +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/mock/get_anonymized_value/index.ts @@ -5,13 +5,6 @@ * 2.0. */ -import { Replacements } from '../../schemas'; - /** This mock returns the reverse of `value` */ -export const mockGetAnonymizedValue = ({ - currentReplacements, - rawValue, -}: { - currentReplacements: Replacements | undefined; - rawValue: string; -}): string => rawValue.split('').reverse().join(''); +export const mockGetAnonymizedValue = ({ rawValue }: { rawValue: string }): string => + rawValue.split('').reverse().join(''); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/assistant_header_flyout.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/assistant_header_flyout.tsx deleted file mode 100644 index 5725d983eff33..0000000000000 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/assistant_header_flyout.tsx +++ /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 React, { useState, useMemo, useCallback } from 'react'; -import { QueryObserverResult, RefetchOptions, RefetchQueryFilters } from '@tanstack/react-query'; -import { - EuiFlexGroup, - EuiFlexItem, - EuiPopover, - EuiContextMenu, - EuiButtonIcon, - EuiPanel, - EuiConfirmModal, - EuiToolTip, -} from '@elastic/eui'; -import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; -import { DocLinksStart } from '@kbn/core-doc-links-browser'; -import { isEmpty } from 'lodash'; -import { Conversation } from '../../..'; -import { AssistantTitle } from '../assistant_title'; -import { ConnectorSelectorInline } from '../../connectorland/connector_selector_inline/connector_selector_inline'; -import { FlyoutNavigation } from '../assistant_overlay/flyout_navigation'; -import { AssistantSettingsButton } from '../settings/assistant_settings_button'; -import * as i18n from './translations'; -import { AIConnector } from '../../connectorland/connector_selector'; - -interface OwnProps { - selectedConversation: Conversation | undefined; - defaultConnector?: AIConnector; - docLinks: Omit; - isDisabled: boolean; - isSettingsModalVisible: boolean; - onToggleShowAnonymizedValues: () => void; - setIsSettingsModalVisible: React.Dispatch>; - showAnonymizedValues: boolean; - onChatCleared: () => void; - onCloseFlyout?: () => void; - chatHistoryVisible?: boolean; - setChatHistoryVisible?: React.Dispatch>; - onConversationSelected: ({ cId, cTitle }: { cId: string; cTitle: string }) => void; - conversations: Record; - conversationsLoaded: boolean; - refetchConversationsState: () => Promise; - onConversationCreate: () => Promise; - isAssistantEnabled: boolean; - refetchPrompts?: ( - options?: RefetchOptions & RefetchQueryFilters - ) => Promise>; -} - -type Props = OwnProps; -/** - * Renders the header of the Elastic AI Assistant. - * Provide a user interface for selecting and managing conversations, - * toggling the display of anonymized values, and accessing the assistant settings. - */ -export const AssistantHeaderFlyout: React.FC = ({ - selectedConversation, - defaultConnector, - docLinks, - isDisabled, - isSettingsModalVisible, - onToggleShowAnonymizedValues, - setIsSettingsModalVisible, - showAnonymizedValues, - onChatCleared, - chatHistoryVisible, - setChatHistoryVisible, - onCloseFlyout, - onConversationSelected, - conversations, - conversationsLoaded, - refetchConversationsState, - onConversationCreate, - isAssistantEnabled, - refetchPrompts, -}) => { - const showAnonymizedValuesChecked = useMemo( - () => - selectedConversation?.replacements != null && - Object.keys(selectedConversation?.replacements).length > 0 && - showAnonymizedValues, - [selectedConversation?.replacements, showAnonymizedValues] - ); - - const selectedConnectorId = useMemo( - () => selectedConversation?.apiConfig?.connectorId, - [selectedConversation?.apiConfig?.connectorId] - ); - - const [isPopoverOpen, setPopover] = useState(false); - - const onButtonClick = useCallback(() => { - setPopover(!isPopoverOpen); - }, [isPopoverOpen]); - - const closePopover = useCallback(() => { - setPopover(false); - }, []); - - const [isResetConversationModalVisible, setIsResetConversationModalVisible] = useState(false); - - const closeDestroyModal = useCallback(() => setIsResetConversationModalVisible(false), []); - const showDestroyModal = useCallback(() => setIsResetConversationModalVisible(true), []); - - const onConversationChange = useCallback( - (updatedConversation) => { - onConversationSelected({ - cId: updatedConversation.id, - cTitle: updatedConversation.title, - }); - }, - [onConversationSelected] - ); - - const panels = useMemo( - () => [ - { - id: 0, - items: [ - { - name: i18n.RESET_CONVERSATION, - css: css` - color: ${euiThemeVars.euiColorDanger}; - `, - onClick: showDestroyModal, - icon: 'refresh', - 'data-test-subj': 'clear-chat', - }, - ], - }, - ], - [showDestroyModal] - ); - - const handleReset = useCallback(() => { - onChatCleared(); - closeDestroyModal(); - closePopover(); - }, [onChatCleared, closeDestroyModal, closePopover]); - - return ( - <> - - - - - - - {onCloseFlyout && ( - - - - )} - - - - - - - - - - - - - - - - - - - - - } - isOpen={isPopoverOpen} - closePopover={closePopover} - panelPaddingSize="none" - anchorPosition="downLeft" - > - - - - - - - - {isResetConversationModalVisible && ( - -

    {i18n.CLEAR_CHAT_CONFIRMATION}

    -
    - )} - - ); -}; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.test.tsx index f806f5d1ef7c6..b4f4bd2c25384 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.test.tsx @@ -20,7 +20,7 @@ const mockConversations = { }; const testProps = { conversationsLoaded: true, - currentConversation: welcomeConvo, + selectedConversation: welcomeConvo, title: 'Test Title', docLinks: { ELASTIC_WEBSITE_URL: 'https://www.elastic.co/', @@ -30,12 +30,13 @@ const testProps = { isSettingsModalVisible: false, onConversationSelected, onToggleShowAnonymizedValues: jest.fn(), - selectedConversationId: emptyWelcomeConvo.id, setIsSettingsModalVisible: jest.fn(), - onConversationDeleted: jest.fn(), + onConversationCreate: jest.fn(), + onChatCleared: jest.fn(), showAnonymizedValues: false, conversations: mockConversations, refetchConversationsState: jest.fn(), + isAssistantEnabled: true, anonymizationFields: { total: 0, page: 1, perPage: 1000, data: [] }, refetchAnonymizationFieldsResults: jest.fn(), allPrompts: [], @@ -69,53 +70,64 @@ describe('AssistantHeader', () => { beforeEach(() => { jest.clearAllMocks(); }); - it('showAnonymizedValues is not checked when currentConversation.replacements is null', () => { + it('showAnonymizedValues is not checked when selectedConversation.replacements is null', () => { const { getByText, getByTestId } = render(, { wrapper: TestProviders, }); - expect(getByText('Test Title')).toBeInTheDocument(); - expect(getByTestId('showAnonymizedValues')).toHaveAttribute('aria-checked', 'false'); + expect(getByText(welcomeConvo.title)).toBeInTheDocument(); + expect(getByTestId('showAnonymizedValues').firstChild).toHaveAttribute( + 'data-euiicon-type', + 'eyeClosed' + ); }); - it('showAnonymizedValues is not checked when currentConversation.replacements is empty', () => { + it('showAnonymizedValues is not checked when selectedConversation.replacements is empty', () => { const { getByText, getByTestId } = render( , { wrapper: TestProviders, } ); - expect(getByText('Test Title')).toBeInTheDocument(); - expect(getByTestId('showAnonymizedValues')).toHaveAttribute('aria-checked', 'false'); + expect(getByText(welcomeConvo.title)).toBeInTheDocument(); + expect(getByTestId('showAnonymizedValues').firstChild).toHaveAttribute( + 'data-euiicon-type', + 'eyeClosed' + ); }); - it('showAnonymizedValues is not checked when currentConversation.replacements has values and showAnonymizedValues is false', () => { + it('showAnonymizedValues is not checked when selectedConversation.replacements has values and showAnonymizedValues is false', () => { const { getByTestId } = render( - , + , { wrapper: TestProviders, } ); - expect(getByTestId('showAnonymizedValues')).toHaveAttribute('aria-checked', 'false'); + expect(getByTestId('showAnonymizedValues').firstChild).toHaveAttribute( + 'data-euiicon-type', + 'eyeClosed' + ); }); - it('showAnonymizedValues is checked when currentConversation.replacements has values and showAnonymizedValues is true', () => { + it('showAnonymizedValues is checked when selectedConversation.replacements has values and showAnonymizedValues is true', () => { const { getByTestId } = render( - , + , { wrapper: TestProviders, } ); - expect(getByTestId('showAnonymizedValues')).toHaveAttribute('aria-checked', 'true'); + expect(getByTestId('showAnonymizedValues').firstChild).toHaveAttribute( + 'data-euiicon-type', + 'eye' + ); }); it('Conversation is updated when connector change occurs', async () => { const { getByTestId } = render(, { wrapper: TestProviders, }); - fireEvent.click(getByTestId('connectorSelectorPlaceholderButton')); fireEvent.click(getByTestId('connector-selector')); await act(async () => { diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx index 7507c14648614..30e620ea38873 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx @@ -5,44 +5,47 @@ * 2.0. */ -import React, { useCallback, useMemo } from 'react'; +import React, { useState, useMemo, useCallback } from 'react'; +import { QueryObserverResult, RefetchOptions, RefetchQueryFilters } from '@tanstack/react-query'; import { EuiFlexGroup, EuiFlexItem, - EuiHorizontalRule, - EuiSpacer, - EuiSwitch, + EuiPopover, + EuiContextMenu, + EuiButtonIcon, + EuiPanel, + EuiConfirmModal, EuiToolTip, } from '@elastic/eui'; -import { QueryObserverResult, RefetchOptions, RefetchQueryFilters } from '@tanstack/react-query'; import { css } from '@emotion/react'; -import { DocLinksStart } from '@kbn/core-doc-links-browser'; +import { euiThemeVars } from '@kbn/ui-theme'; import { isEmpty } from 'lodash'; -import { PromptResponse } from '@kbn/elastic-assistant-common'; -import { AIConnector } from '../../connectorland/connector_selector'; import { Conversation } from '../../..'; import { AssistantTitle } from '../assistant_title'; -import { ConversationSelector } from '../conversations/conversation_selector'; +import { ConnectorSelectorInline } from '../../connectorland/connector_selector_inline/connector_selector_inline'; +import { FlyoutNavigation } from '../assistant_overlay/flyout_navigation'; import { AssistantSettingsButton } from '../settings/assistant_settings_button'; import * as i18n from './translations'; +import { AIConnector } from '../../connectorland/connector_selector'; interface OwnProps { - currentConversation?: Conversation; + selectedConversation: Conversation | undefined; defaultConnector?: AIConnector; - docLinks: Omit; isDisabled: boolean; isSettingsModalVisible: boolean; - onConversationSelected: ({ cId, cTitle }: { cId: string; cTitle: string }) => void; - onConversationDeleted: (conversationId: string) => void; onToggleShowAnonymizedValues: () => void; setIsSettingsModalVisible: React.Dispatch>; - shouldDisableKeyboardShortcut?: () => boolean; showAnonymizedValues: boolean; - title: string; + onChatCleared: () => void; + onCloseFlyout?: () => void; + chatHistoryVisible?: boolean; + setChatHistoryVisible?: React.Dispatch>; + onConversationSelected: ({ cId, cTitle }: { cId: string; cTitle: string }) => void; conversations: Record; conversationsLoaded: boolean; refetchConversationsState: () => Promise; - allPrompts: PromptResponse[]; + onConversationCreate: () => Promise; + isAssistantEnabled: boolean; refetchPrompts?: ( options?: RefetchOptions & RefetchQueryFilters ) => Promise>; @@ -55,31 +58,53 @@ type Props = OwnProps; * toggling the display of anonymized values, and accessing the assistant settings. */ export const AssistantHeader: React.FC = ({ - currentConversation, + selectedConversation, defaultConnector, - docLinks, isDisabled, isSettingsModalVisible, - onConversationSelected, - onConversationDeleted, onToggleShowAnonymizedValues, setIsSettingsModalVisible, - shouldDisableKeyboardShortcut, showAnonymizedValues, - title, + onChatCleared, + chatHistoryVisible, + setChatHistoryVisible, + onCloseFlyout, + onConversationSelected, conversations, conversationsLoaded, refetchConversationsState, - allPrompts, + onConversationCreate, + isAssistantEnabled, refetchPrompts, }) => { const showAnonymizedValuesChecked = useMemo( () => - currentConversation?.replacements != null && - Object.keys(currentConversation?.replacements).length > 0 && + selectedConversation?.replacements != null && + Object.keys(selectedConversation?.replacements).length > 0 && showAnonymizedValues, - [currentConversation?.replacements, showAnonymizedValues] + [selectedConversation?.replacements, showAnonymizedValues] ); + + const selectedConnectorId = useMemo( + () => selectedConversation?.apiConfig?.connectorId, + [selectedConversation?.apiConfig?.connectorId] + ); + + const [isPopoverOpen, setPopover] = useState(false); + + const onButtonClick = useCallback(() => { + setPopover(!isPopoverOpen); + }, [isPopoverOpen]); + + const closePopover = useCallback(() => { + setPopover(false); + }, []); + + const [isResetConversationModalVisible, setIsResetConversationModalVisible] = useState(false); + + const closeDestroyModal = useCallback(() => setIsResetConversationModalVisible(false), []); + const showDestroyModal = useCallback(() => setIsResetConversationModalVisible(true), []); + const onConversationChange = useCallback( (updatedConversation) => { onConversationSelected({ @@ -89,90 +114,163 @@ export const AssistantHeader: React.FC = ({ }, [onConversationSelected] ); - const selectedConversationId = useMemo( - () => - !isEmpty(currentConversation?.id) ? currentConversation?.id : currentConversation?.title, - [currentConversation?.id, currentConversation?.title] + + const panels = useMemo( + () => [ + { + id: 0, + items: [ + { + name: i18n.RESET_CONVERSATION, + css: css` + color: ${euiThemeVars.euiColorDanger}; + `, + onClick: showDestroyModal, + icon: 'refresh', + 'data-test-subj': 'clear-chat', + }, + ], + }, + ], + [showDestroyModal] ); + const handleReset = useCallback(() => { + onChatCleared(); + closeDestroyModal(); + closePopover(); + }, [onChatCleared, closeDestroyModal, closePopover]); + return ( <> - + + + + + + {onCloseFlyout && ( + + + + )} + + + - - - - - - + + + + - <> - - + + + + + - - - - + + + } + isOpen={isPopoverOpen} + closePopover={closePopover} + panelPaddingSize="none" + anchorPosition="downLeft" + > + + - - - - + + + + {isResetConversationModalVisible && ( + +

    {i18n.CLEAR_CHAT_CONFIRMATION}

    +
    + )} ); }; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/flyout_navigation.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/flyout_navigation.tsx index 85d7360c2870a..3f7c3f7ea1bcb 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/flyout_navigation.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/flyout_navigation.tsx @@ -48,6 +48,7 @@ export const FlyoutNavigation = memo( onClick={onToggle} iconType={isExpanded ? 'arrowEnd' : 'arrowStart'} size="xs" + data-test-subj="aiAssistantFlyoutNavigationToggle" aria-label={ isExpanded ? i18n.translate( diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/index.test.tsx index 679901bc02748..9e6a9164607a3 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/index.test.tsx @@ -24,31 +24,33 @@ describe('AssistantOverlay', () => { it('renders when isAssistantEnabled prop is true and keyboard shortcut is pressed', () => { const { getByTestId } = render( - + ); fireEvent.keyDown(document, { key: ';', ctrlKey: true }); - const modal = getByTestId('ai-assistant-modal'); - expect(modal).toBeInTheDocument(); + const flyout = getByTestId('ai-assistant-flyout'); + expect(flyout).toBeInTheDocument(); }); - it('modal closes when close button is clicked', () => { - const { getByLabelText, queryByTestId } = render( + it('flyout closes when close button is clicked', () => { + const { queryByTestId } = render( - + ); fireEvent.keyDown(document, { key: ';', ctrlKey: true }); - const closeButton = getByLabelText('Closes this modal window'); - fireEvent.click(closeButton); - const modal = queryByTestId('ai-assistant-modal'); - expect(modal).not.toBeInTheDocument(); + const closeButton = queryByTestId('euiFlyoutCloseButton'); + if (closeButton) { + fireEvent.click(closeButton); + } + const flyout = queryByTestId('ai-assistant-flyout'); + expect(flyout).not.toBeInTheDocument(); }); - it('Assistant invoked from shortcut tracking happens on modal open only (not close)', () => { + it('Assistant invoked from shortcut tracking happens on flyout open only (not close)', () => { render( - + ); fireEvent.keyDown(document, { key: ';', ctrlKey: true }); @@ -61,26 +63,26 @@ describe('AssistantOverlay', () => { expect(reportAssistantInvoked).toHaveBeenCalledTimes(1); }); - it('modal closes when shortcut is pressed and modal is already open', () => { + it('flyout closes when shortcut is pressed and flyout is already open', () => { const { queryByTestId } = render( - + ); fireEvent.keyDown(document, { key: ';', ctrlKey: true }); fireEvent.keyDown(document, { key: ';', ctrlKey: true }); - const modal = queryByTestId('ai-assistant-modal'); - expect(modal).not.toBeInTheDocument(); + const flyout = queryByTestId('ai-assistant-flyout'); + expect(flyout).not.toBeInTheDocument(); }); - it('modal does not open when incorrect shortcut is pressed', () => { + it('flyout does not open when incorrect shortcut is pressed', () => { const { queryByTestId } = render( - + ); fireEvent.keyDown(document, { key: 'a', ctrlKey: true }); - const modal = queryByTestId('ai-assistant-modal'); - expect(modal).not.toBeInTheDocument(); + const flyout = queryByTestId('ai-assistant-flyout'); + expect(flyout).not.toBeInTheDocument(); }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/index.tsx index 44907d8b1fd00..689f60f0a52d9 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_overlay/index.tsx @@ -6,12 +6,12 @@ */ import React, { useCallback, useEffect, useRef, useState } from 'react'; -import { EuiModal, EuiFlyoutResizable, useEuiTheme } from '@elastic/eui'; +import { EuiFlyoutResizable } from '@elastic/eui'; import useEvent from 'react-use/lib/useEvent'; -// eslint-disable-next-line @kbn/eslint/module_migration -import styled from 'styled-components'; import { css } from '@emotion/react'; +// eslint-disable-next-line @kbn/eslint/module_migration +import { createGlobalStyle } from 'styled-components'; import { ShowAssistantOverlayProps, useAssistantContext, @@ -22,23 +22,21 @@ import { WELCOME_CONVERSATION_TITLE } from '../use_conversation/translations'; const isMac = navigator.platform.toLowerCase().indexOf('mac') >= 0; -const StyledEuiModal = styled(EuiModal)` - ${({ theme }) => `margin-top: ${theme.eui.euiSizeXXL};`} - min-width: 95vw; - min-height: 25vh; -`; - /** * Modal container for Elastic AI Assistant conversations, receiving the page contents as context, plus whatever * component currently has focus and any specific context it may provide through the SAssInterface. */ export interface Props { - isFlyoutMode: boolean; currentUserAvatar?: UserAvatar; } -export const AssistantOverlay = React.memo(({ isFlyoutMode, currentUserAvatar }) => { - const { euiTheme } = useEuiTheme(); +export const UnifiedTimelineGlobalStyles = createGlobalStyle` + body:has(.timeline-portal-overlay-mask) .euiOverlayMask { + z-index: 1003 !important; + } +`; + +export const AssistantOverlay = React.memo(({ currentUserAvatar }) => { const [isModalVisible, setIsModalVisible] = useState(false); const [conversationTitle, setConversationTitle] = useState( WELCOME_CONVERSATION_TITLE @@ -130,8 +128,8 @@ export const AssistantOverlay = React.memo(({ isFlyoutMode, currentUserAv if (!isModalVisible) return null; - if (isFlyoutMode) { - return ( + return ( + <> (({ isFlyoutMode, currentUserAv data-test-subj="ai-assistant-flyout" paddingSize="none" hideCloseButton - // EUI TODO: This z-index override of EuiOverlayMask is a workaround, and ideally should be resolved with a cleaner UI/UX flow long-term - maskProps={{ style: `z-index: ${(euiTheme.levels.flyout as number) + 3}` }} // we need this flyout to be above the timeline flyout (which has a z-index of 1002) > - ); - } - - return ( - <> - {isModalVisible && ( - - - - )} + ); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_title/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_title/index.test.tsx index ee4a998a1439f..d9dd84cb0b51d 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_title/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_title/index.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { render, fireEvent } from '@testing-library/react'; +import { render } from '@testing-library/react'; import { AssistantTitle } from '.'; import { TestProviders } from '../../mock/test_providers/test_providers'; @@ -14,7 +14,6 @@ const testProps = { title: 'Test Title', docLinks: { ELASTIC_WEBSITE_URL: 'https://www.elastic.co/', DOC_LINK_VERSION: '7.15' }, selectedConversation: undefined, - isFlyoutMode: false, onChange: jest.fn(), refetchConversationsState: jest.fn(), }; @@ -28,22 +27,4 @@ describe('AssistantTitle', () => { ); expect(getByText('Test Title')).toBeInTheDocument(); }); - - it('clicking on the popover button opens the popover with the correct link', () => { - const { getByTestId, queryByTestId } = render( - - - , - { - wrapper: TestProviders, - } - ); - expect(queryByTestId('tooltipContent')).not.toBeInTheDocument(); - fireEvent.click(getByTestId('tooltipIcon')); - expect(getByTestId('tooltipContent')).toBeInTheDocument(); - expect(getByTestId('externalDocumentationLink')).toHaveAttribute( - 'href', - 'https://www.elastic.co/guide/en/security/7.15/security-assistant.html' - ); - }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_title/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_title/index.tsx index 7e9934afcaa90..2090a92645c65 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_title/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_title/index.tsx @@ -5,24 +5,10 @@ * 2.0. */ -import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import { - EuiButtonIcon, - EuiFlexGroup, - EuiFlexItem, - EuiInlineEditTitle, - EuiLink, - EuiModalHeaderTitle, - EuiPopover, - EuiText, - EuiTitle, -} from '@elastic/eui'; -import type { DocLinksStart } from '@kbn/core-doc-links-browser'; -import { FormattedMessage } from '@kbn/i18n-react'; +import React, { useCallback, useEffect, useState } from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiInlineEditTitle } from '@elastic/eui'; import { css } from '@emotion/react'; -import * as i18n from '../translations'; import type { Conversation } from '../../..'; -import { ConnectorSelectorInline } from '../../connectorland/connector_selector_inline/connector_selector_inline'; import { AssistantAvatar } from '../assistant_avatar/assistant_avatar'; import { useConversation } from '../use_conversation'; import { NEW_CHAT } from '../conversations/conversation_sidepanel/translations'; @@ -32,63 +18,14 @@ import { NEW_CHAT } from '../conversations/conversation_sidepanel/translations'; * information about the assistant feature and access to documentation. */ export const AssistantTitle: React.FC<{ - isDisabled?: boolean; title?: string; - docLinks: Omit; selectedConversation: Conversation | undefined; - isFlyoutMode: boolean; - onChange: (updatedConversation: Conversation) => void; refetchConversationsState: () => Promise; -}> = ({ - isDisabled = false, - title, - docLinks, - selectedConversation, - isFlyoutMode, - onChange, - refetchConversationsState, -}) => { +}> = ({ title, selectedConversation, refetchConversationsState }) => { const [newTitle, setNewTitle] = useState(title); const [newTitleError, setNewTitleError] = useState(false); const { updateConversationTitle } = useConversation(); - const selectedConnectorId = selectedConversation?.apiConfig?.connectorId; - - const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = docLinks; - const url = `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/security-assistant.html`; - - const documentationLink = useMemo( - () => ( - - {i18n.DOCUMENTATION} - - ), - [url] - ); - - const content = useMemo( - () => ( - - ), - [documentationLink] - ); - - const [isPopoverOpen, setIsPopoverOpen] = useState(false); - const onButtonClick = useCallback(() => setIsPopoverOpen((isOpen: boolean) => !isOpen), []); - const closePopover = useCallback(() => setIsPopoverOpen(false), []); - const handleUpdateTitle = useCallback( async (updatedTitle: string) => { setNewTitleError(false); @@ -109,108 +46,33 @@ export const AssistantTitle: React.FC<{ setNewTitle(title); }, [title]); - if (isFlyoutMode) { - return ( - - - - - - setNewTitle(e.currentTarget.nodeValue || '')} - onCancel={() => setNewTitle(title)} - onSave={handleUpdateTitle} - editModeProps={{ - formRowProps: { - fullWidth: true, - }, - }} - /> - - - ); - } - return ( - - - - - - - - - - - -

    {title}

    -
    -
    - - - } - isOpen={isPopoverOpen} - closePopover={closePopover} - anchorPosition="rightUp" - > - - -

    {content}

    -
    -
    -
    -
    -
    -
    - {!isFlyoutMode && ( - - - - )} -
    -
    -
    -
    + + + + + + setNewTitle(e.currentTarget.nodeValue || '')} + onCancel={() => setNewTitle(title)} + onSave={handleUpdateTitle} + editModeProps={{ + formRowProps: { + fullWidth: true, + }, + }} + /> + + ); }; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_actions/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_actions/index.test.tsx index 36936c7565112..7fbd7e1a03366 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_actions/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_actions/index.test.tsx @@ -9,14 +9,11 @@ import React from 'react'; import { render, fireEvent, within } from '@testing-library/react'; import { ChatActions } from '.'; -const onChatCleared = jest.fn(); const onSendMessage = jest.fn(); const testProps = { isDisabled: false, isLoading: false, - onChatCleared, onSendMessage, - isFlyoutMode: false, promptValue: 'prompt', }; @@ -26,16 +23,9 @@ describe('ChatActions', () => { }); it('the component renders with all props', () => { const { getByTestId } = render(); - expect(getByTestId('clear-chat')).toHaveAttribute('aria-label', 'Clear chat'); expect(getByTestId('submit-chat')).toHaveAttribute('aria-label', 'Submit message'); }); - it('onChatCleared function is called when clear chat button is clicked', () => { - const { getByTestId } = render(); - fireEvent.click(getByTestId('clear-chat')); - expect(onChatCleared).toHaveBeenCalled(); - }); - it('onSendMessage function is called when send message button is clicked', () => { const { getByTestId } = render(); @@ -49,7 +39,6 @@ describe('ChatActions', () => { isDisabled: true, }; const { getByTestId } = render(); - expect(getByTestId('clear-chat')).toBeDisabled(); expect(getByTestId('submit-chat')).toBeDisabled(); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_actions/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_actions/index.tsx index e7ff0922b30ae..ba980356351fd 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_actions/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_actions/index.tsx @@ -7,14 +7,12 @@ import React, { useCallback, useRef } from 'react'; import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; -import { CLEAR_CHAT, SUBMIT_MESSAGE } from '../translations'; +import { SUBMIT_MESSAGE } from '../translations'; interface OwnProps { isDisabled: boolean; isLoading: boolean; - isFlyoutMode: boolean; promptValue?: string; - onChatCleared: () => void; onSendMessage: () => void; } @@ -26,9 +24,7 @@ type Props = OwnProps; export const ChatActions: React.FC = ({ isDisabled, isLoading, - onChatCleared, onSendMessage, - isFlyoutMode, promptValue, }) => { const submitTooltipRef = useRef(null); @@ -39,21 +35,6 @@ export const ChatActions: React.FC = ({ return ( - {!isFlyoutMode && ( - - - - - - )} = ({ aria-label={SUBMIT_MESSAGE} data-test-subj="submit-chat" color="primary" - display={isFlyoutMode && promptValue?.length ? 'fill' : 'base'} - size={isFlyoutMode ? 'm' : 'xs'} - iconType={isFlyoutMode ? 'kqlFunction' : 'returnKey'} + display={promptValue?.length ? 'fill' : 'base'} + size={'m'} + iconType={'kqlFunction'} isDisabled={isDisabled || !promptValue?.length} isLoading={isLoading} onClick={onSendMessage} diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/index.test.tsx index ab7b942476f81..99f30cde68a82 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/index.test.tsx @@ -12,12 +12,10 @@ import { TestProviders } from '../../mock/test_providers/test_providers'; jest.mock('./use_chat_send'); -const handleOnChatCleared = jest.fn(); const handlePromptChange = jest.fn(); const handleSendMessage = jest.fn(); const handleRegenerateResponse = jest.fn(); const testProps: Props = { - handleOnChatCleared, handlePromptChange, handleSendMessage, handleRegenerateResponse, @@ -25,7 +23,6 @@ const testProps: Props = { isDisabled: false, shouldRefocusPrompt: false, userPrompt: '', - isFlyoutMode: false, }; describe('ChatSend', () => { beforeEach(() => { diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/index.tsx index 880d4d5f9f88f..c292a70252a03 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/index.tsx @@ -14,11 +14,10 @@ import { ChatActions } from '../chat_actions'; import { PromptTextArea } from '../prompt_textarea'; import { useAutosizeTextArea } from './use_autosize_textarea'; -export interface Props extends Omit { +export interface Props extends Omit { isDisabled: boolean; shouldRefocusPrompt: boolean; userPrompt: string | null; - isFlyoutMode: boolean; } /** @@ -26,12 +25,10 @@ export interface Props extends Omit { * Allows the user to clear the chat and switch between different system prompts. */ export const ChatSend: React.FC = ({ - handleOnChatCleared, handlePromptChange, handleSendMessage, isDisabled, isLoading, - isFlyoutMode, shouldRefocusPrompt, userPrompt, }) => { @@ -58,7 +55,7 @@ export const ChatSend: React.FC = ({ return ( = ({ handlePromptChange={handlePromptChange} value={promptValue} isDisabled={isDisabled} - isFlyoutMode={isFlyoutMode} /> diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/use_chat_send.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/use_chat_send.test.tsx index 17a421313e3a4..a9231499570c7 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/use_chat_send.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/use_chat_send.test.tsx @@ -21,7 +21,6 @@ jest.mock('../use_conversation'); jest.mock('../../..'); const setEditingSystemPromptId = jest.fn(); -const setPromptTextPreview = jest.fn(); const setSelectedPromptContexts = jest.fn(); const setUserPrompt = jest.fn(); const sendMessage = jest.fn(); @@ -43,7 +42,6 @@ export const testProps: UseChatSendProps = { } as unknown as HttpSetup, editingSystemPromptId: defaultSystemPrompt.id, setEditingSystemPromptId, - setPromptTextPreview, setSelectedPromptContexts, setUserPrompt, setCurrentConversation, @@ -75,7 +73,6 @@ describe('use chat send', () => { }); result.current.handleOnChatCleared(); expect(clearConversation).toHaveBeenCalled(); - expect(setPromptTextPreview).toHaveBeenCalledWith(''); expect(setUserPrompt).toHaveBeenCalledWith(''); expect(setSelectedPromptContexts).toHaveBeenCalledWith({}); await waitFor(() => { @@ -89,7 +86,6 @@ describe('use chat send', () => { wrapper: TestProviders, }); result.current.handlePromptChange('new prompt'); - expect(setPromptTextPreview).toHaveBeenCalledWith('new prompt'); expect(setUserPrompt).toHaveBeenCalledWith('new prompt'); }); it('handleSendMessage sends message with context prompt when a valid prompt text is provided', async () => { diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/use_chat_send.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/use_chat_send.tsx index 9d5e822fcdf55..5a70b6ad32cd8 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/use_chat_send.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/use_chat_send.tsx @@ -25,7 +25,6 @@ export interface UseChatSendProps { http: HttpSetup; selectedPromptContexts: Record; setEditingSystemPromptId: React.Dispatch>; - setPromptTextPreview: React.Dispatch>; setSelectedPromptContexts: React.Dispatch< React.SetStateAction> >; @@ -54,7 +53,6 @@ export const useChatSend = ({ http, selectedPromptContexts, setEditingSystemPromptId, - setPromptTextPreview, setSelectedPromptContexts, setUserPrompt, setCurrentConversation, @@ -69,7 +67,6 @@ export const useChatSend = ({ const { clearConversation, removeLastMessage } = useConversation(); const handlePromptChange = (prompt: string) => { - setPromptTextPreview(prompt); setUserPrompt(prompt); }; @@ -120,7 +117,6 @@ export const useChatSend = ({ // Reset prompt context selection and preview before sending: setSelectedPromptContexts({}); - setPromptTextPreview(''); const rawResponse = await sendMessage({ apiConfig: currentConversation.apiConfig, @@ -168,7 +164,6 @@ export const useChatSend = ({ selectedPromptContexts, sendMessage, setCurrentConversation, - setPromptTextPreview, setSelectedPromptContexts, toasts, ] @@ -214,7 +209,6 @@ export const useChatSend = ({ conversation: currentConversation, })?.id; - setPromptTextPreview(''); setUserPrompt(''); setSelectedPromptContexts({}); if (currentConversation) { @@ -230,7 +224,6 @@ export const useChatSend = ({ currentConversation, setCurrentConversation, setEditingSystemPromptId, - setPromptTextPreview, setSelectedPromptContexts, setUserPrompt, ]); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/context_pills/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/context_pills/index.test.tsx index 0168c27c7f548..da2dd3008a1b0 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/context_pills/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/context_pills/index.test.tsx @@ -33,7 +33,6 @@ const mockPromptContexts: Record = { const defaultProps = { anonymizationFields: { total: 0, page: 1, perPage: 1000, data: [] }, promptContexts: mockPromptContexts, - isFlyoutMode: false, }; describe('ContextPills', () => { diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/context_pills/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/context_pills/index.tsx index ce5a0cf59ca6a..d3ae29643804e 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/context_pills/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/context_pills/index.tsx @@ -5,20 +5,14 @@ * 2.0. */ -import { EuiButton, EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; +import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; import { sortBy } from 'lodash/fp'; import React, { useCallback, useMemo } from 'react'; -// eslint-disable-next-line @kbn/eslint/module_migration -import styled from 'styled-components'; import { FindAnonymizationFieldsResponse } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/find_anonymization_fields_route.gen'; import { getNewSelectedPromptContext } from '../../data_anonymization/get_new_selected_prompt_context'; import type { PromptContext, SelectedPromptContext } from '../prompt_context/types'; -const PillButton = styled(EuiButton)` - margin-right: ${({ theme }) => theme.eui.euiSizeXS}; -`; - interface Props { anonymizationFields: FindAnonymizationFieldsResponse; promptContexts: Record; @@ -26,7 +20,6 @@ interface Props { setSelectedPromptContexts: React.Dispatch< React.SetStateAction> >; - isFlyoutMode: boolean; } const ContextPillsComponent: React.FC = ({ @@ -34,7 +27,6 @@ const ContextPillsComponent: React.FC = ({ promptContexts, selectedPromptContexts, setSelectedPromptContexts, - isFlyoutMode, }) => { const sortedPromptContexts = useMemo( () => sortBy('description', Object.values(promptContexts)), @@ -63,7 +55,7 @@ const ContextPillsComponent: React.FC = ({ {sortedPromptContexts.map(({ description, id, tooltip }) => { // Workaround for known issue where tooltip won't dismiss after button state is changed once clicked // See: https://github.com/elastic/eui/issues/6488#issuecomment-1379656704 - const button = isFlyoutMode ? ( + const button = ( = ({ > {description} - ) : ( - selectPromptContext(id)} - > - {description} - ); return ( diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx index fd9cddc39dbbe..4ee8076c42a9d 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.tsx @@ -35,7 +35,6 @@ interface Props { selectedConversationId: string | undefined; onConversationSelected: ({ cId, cTitle }: { cId: string; cTitle: string }) => void; onConversationDeleted: (conversationId: string) => void; - shouldDisableKeyboardShortcut?: () => boolean; isDisabled?: boolean; conversations: Record; allPrompts: PromptResponse[]; @@ -65,7 +64,6 @@ export const ConversationSelector: React.FC = React.memo( defaultConnector, onConversationSelected, onConversationDeleted, - shouldDisableKeyboardShortcut = () => false, isDisabled = false, conversations, allPrompts, @@ -199,9 +197,8 @@ export const ConversationSelector: React.FC = React.memo( const renderOption: ( option: ConversationSelectorOption, - searchValue: string, - OPTION_CONTENT_CLASSNAME: string - ) => React.ReactNode = (option, searchValue, contentClassName) => { + searchValue: string + ) => React.ReactNode = (option, searchValue) => { const { label, id, value } = option; return ( diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx index f4b8f9a79412f..f1edb5a9dc2a9 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.tsx @@ -27,7 +27,6 @@ interface Props { onConversationDeleted: (conversationTitle: string) => void; onConversationSelectionChange: (conversation?: Conversation | string) => void; selectedConversationTitle: string; - shouldDisableKeyboardShortcut?: () => boolean; isDisabled?: boolean; } @@ -62,7 +61,6 @@ export const ConversationSelectorSettings: React.FC = React.memo( onConversationSelectionChange, selectedConversationTitle, isDisabled, - shouldDisableKeyboardShortcut = () => false, }) => { const conversationTitles = useMemo( () => Object.values(conversations).map((c) => c.title), diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/conversation_settings.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/conversation_settings.tsx index cba17030e1577..1584a46ee687a 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/conversation_settings.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/conversation_settings.tsx @@ -49,7 +49,6 @@ export interface ConversationSettingsProps { React.SetStateAction >; isDisabled?: boolean; - isFlyoutMode: boolean; } /** @@ -66,7 +65,6 @@ export const ConversationSettings: React.FC = React.m conversationSettings, http, isDisabled = false, - isFlyoutMode, setAssistantStreamingEnabled, setConversationSettings, conversationsSettingsBulkActions, @@ -127,7 +125,6 @@ export const ConversationSettings: React.FC = React.m conversationsSettingsBulkActions={conversationsSettingsBulkActions} http={http} isDisabled={isDisabled} - isFlyoutMode={isFlyoutMode} selectedConversation={selectedConversationWithApiConfig} setConversationSettings={setConversationSettings} setConversationsSettingsBulkActions={setConversationsSettingsBulkActions} diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/conversation_settings_editor.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/conversation_settings_editor.tsx index 41da376d21b73..cf8275203090b 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/conversation_settings_editor.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/conversation_settings_editor.tsx @@ -31,7 +31,6 @@ export interface ConversationSettingsEditorProps { conversationsSettingsBulkActions: ConversationsBulkActions; http: HttpSetup; isDisabled?: boolean; - isFlyoutMode: boolean; selectedConversation?: Conversation; setConversationSettings: React.Dispatch>>; setConversationsSettingsBulkActions: React.Dispatch< @@ -49,7 +48,6 @@ export const ConversationSettingsEditor: React.FC @@ -304,7 +299,6 @@ export const ConversationSettingsEditor: React.FC diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings_management/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings_management/index.tsx index 485f89358f57a..10608502e70d3 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings_management/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings_management/index.tsx @@ -36,7 +36,6 @@ interface Props { defaultConnector?: AIConnector; handleSave: (shouldRefetchConversation?: boolean) => void; isDisabled?: boolean; - isFlyoutMode: boolean; onCancelClick: () => void; setAssistantStreamingEnabled: React.Dispatch>; setConversationSettings: React.Dispatch>>; @@ -62,7 +61,6 @@ const ConversationSettingsManagementComponent: React.FC = ({ conversationsLoaded, handleSave, isDisabled, - isFlyoutMode, onSelectedConversationChange, onCancelClick, selectedConversation, @@ -221,7 +219,6 @@ const ConversationSettingsManagementComponent: React.FC = ({ conversationsSettingsBulkActions={conversationsSettingsBulkActions} http={http} isDisabled={isDisabled} - isFlyoutMode={isFlyoutMode} selectedConversation={selectedConversation} setConversationSettings={setConversationSettings} setConversationsSettingsBulkActions={setConversationsSettingsBulkActions} diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_sidepanel/title_field.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_sidepanel/title_field.tsx index acbda15320277..373c052ede6e1 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_sidepanel/title_field.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_sidepanel/title_field.tsx @@ -32,7 +32,7 @@ const TitleFieldComponent = ({ conversationIds, euiFieldProps }: TitleFieldProps ), value: true, }, - validate: (text: string) => { + validate: () => { if (conversationIds?.includes(value)) { return i18n.translate( 'xpack.elasticAssistant.conversationSidepanel.titleField.uniqueTitle', diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/helpers.test.ts b/x-pack/packages/kbn-elastic-assistant/impl/assistant/helpers.test.ts index 19d703a271edc..b4ed11a82df9e 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/helpers.test.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/helpers.test.ts @@ -22,12 +22,11 @@ const defaultConversation = { replacements: {}, title: 'conversation_id', }; -const isFlyoutMode = false; describe('helpers', () => { describe('isAssistantEnabled = false', () => { const isAssistantEnabled = false; it('When no conversation history, return only enterprise messaging', () => { - const result = getBlockBotConversation(defaultConversation, isAssistantEnabled, isFlyoutMode); + const result = getBlockBotConversation(defaultConversation, isAssistantEnabled); expect(result.messages).toEqual(enterpriseMessaging); expect(result.messages.length).toEqual(1); }); @@ -47,7 +46,7 @@ describe('helpers', () => { }, ], }; - const result = getBlockBotConversation(conversation, isAssistantEnabled, isFlyoutMode); + const result = getBlockBotConversation(conversation, isAssistantEnabled); expect(result.messages.length).toEqual(2); }); @@ -56,7 +55,7 @@ describe('helpers', () => { ...defaultConversation, messages: enterpriseMessaging, }; - const result = getBlockBotConversation(conversation, isAssistantEnabled, isFlyoutMode); + const result = getBlockBotConversation(conversation, isAssistantEnabled); expect(result.messages.length).toEqual(1); expect(result.messages).toEqual(enterpriseMessaging); }); @@ -77,7 +76,7 @@ describe('helpers', () => { }, ], }; - const result = getBlockBotConversation(conversation, isAssistantEnabled, isFlyoutMode); + const result = getBlockBotConversation(conversation, isAssistantEnabled); expect(result.messages.length).toEqual(3); }); }); @@ -85,8 +84,8 @@ describe('helpers', () => { describe('isAssistantEnabled = true', () => { const isAssistantEnabled = true; it('when no conversation history, returns the welcome conversation', () => { - const result = getBlockBotConversation(defaultConversation, isAssistantEnabled, isFlyoutMode); - expect(result.messages.length).toEqual(3); + const result = getBlockBotConversation(defaultConversation, isAssistantEnabled); + expect(result.messages.length).toEqual(0); }); it('returns a conversation history with the welcome conversation appended', () => { const conversation = { @@ -103,8 +102,8 @@ describe('helpers', () => { }, ], }; - const result = getBlockBotConversation(conversation, isAssistantEnabled, isFlyoutMode); - expect(result.messages.length).toEqual(4); + const result = getBlockBotConversation(conversation, isAssistantEnabled); + expect(result.messages.length).toEqual(1); }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/helpers.ts b/x-pack/packages/kbn-elastic-assistant/impl/assistant/helpers.ts index e9a0599ca4fc2..f369bf430ea54 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/helpers.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/helpers.ts @@ -10,7 +10,7 @@ import { AIConnector } from '../connectorland/connector_selector'; import { FetchConnectorExecuteResponse, FetchConversationsResponse } from './api'; import { Conversation } from '../..'; import type { ClientMessage } from '../assistant_context/types'; -import { enterpriseMessaging, WELCOME_CONVERSATION } from './use_conversation/sample_conversations'; +import { enterpriseMessaging } from './use_conversation/sample_conversations'; export const getMessageFromRawResponse = ( rawResponse: FetchConnectorExecuteResponse @@ -57,8 +57,7 @@ export const mergeBaseWithPersistedConversations = ( export const getBlockBotConversation = ( conversation: Conversation, - isAssistantEnabled: boolean, - isFlyoutMode: boolean + isAssistantEnabled: boolean ): Conversation => { if (!isAssistantEnabled) { if ( @@ -76,7 +75,7 @@ export const getBlockBotConversation = ( return { ...conversation, - messages: [...conversation.messages, ...(!isFlyoutMode ? WELCOME_CONVERSATION.messages : [])], + messages: conversation.messages, }; }; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.test.tsx index b25945dd247bf..cd0d53bd460c3 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.test.tsx @@ -7,12 +7,11 @@ import React from 'react'; -import { act, fireEvent, render, screen, waitFor, within } from '@testing-library/react'; +import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'; import { Assistant } from '.'; import type { IHttpFetchError } from '@kbn/core/public'; import { useLoadConnectors } from '../connectorland/use_load_connectors'; -import { useConnectorSetup } from '../connectorland/connector_setup'; import { DefinedUseQueryResult, UseQueryResult } from '@tanstack/react-query'; @@ -40,7 +39,7 @@ jest.mock('./use_conversation'); const renderAssistant = (extraProps = {}, providerProps = {}) => render( - + ); @@ -63,11 +62,12 @@ const mockData = { }, }; const mockDeleteConvo = jest.fn(); +const mockGetDefaultConversation = jest.fn().mockReturnValue(mockData.welcome_id); const clearConversation = jest.fn(); const mockUseConversation = { clearConversation: clearConversation.mockResolvedValue(mockData.welcome_id), getConversation: jest.fn(), - getDefaultConversation: jest.fn().mockReturnValue(mockData.welcome_id), + getDefaultConversation: mockGetDefaultConversation, deleteConversation: mockDeleteConvo, setApiConfig: jest.fn().mockResolvedValue({}), }; @@ -83,10 +83,6 @@ describe('Assistant', () => { persistToLocalStorage = jest.fn(); persistToSessionStorage = jest.fn(); (useConversation as jest.Mock).mockReturnValue(mockUseConversation); - jest.mocked(useConnectorSetup).mockReturnValue({ - comments: [], - prompt: <>, - }); jest.mocked(PromptEditor).mockReturnValue(null); jest.mocked(QuickPrompts).mockReturnValue(null); @@ -221,22 +217,21 @@ describe('Assistant', () => { it('should delete conversation when delete button is clicked', async () => { renderAssistant(); + const deleteButton = screen.getAllByTestId('delete-option')[0]; await act(async () => { - fireEvent.click( - within(screen.getByTestId('conversation-selector')).getByTestId( - 'comboBoxToggleListButton' - ) - ); + fireEvent.click(deleteButton); }); - const deleteButton = screen.getAllByTestId('delete-option')[0]; await act(async () => { - fireEvent.click(deleteButton); + fireEvent.click(screen.getByTestId('confirmModalConfirmButton')); + }); + + await waitFor(() => { + expect(mockDeleteConvo).toHaveBeenCalledWith(mockData.electric_sheep_id.id); }); - expect(mockDeleteConvo).toHaveBeenCalledWith(mockData.welcome_id.id); }); it('should refetchConversationsState after clear chat history button click', async () => { - renderAssistant({ isFlyoutMode: true }); + renderAssistant(); fireEvent.click(screen.getByTestId('chat-context-menu')); fireEvent.click(screen.getByTestId('clear-chat')); fireEvent.click(screen.getByTestId('confirmModalConfirmButton')); @@ -259,7 +254,7 @@ describe('Assistant', () => { expect(persistToLocalStorage).toHaveBeenLastCalledWith(mockData.welcome_id.id); - const previousConversationButton = screen.getByLabelText('Previous conversation'); + const previousConversationButton = await screen.findByText(mockData.electric_sheep_id.title); expect(previousConversationButton).toBeInTheDocument(); await act(async () => { @@ -295,13 +290,13 @@ describe('Assistant', () => { isFetched: true, } as unknown as DefinedUseQueryResult, unknown>); - const { getByLabelText } = renderAssistant(); + const { findByText } = renderAssistant(); expect(persistToLocalStorage).toHaveBeenCalled(); expect(persistToLocalStorage).toHaveBeenLastCalledWith(mockData.welcome_id.id); - const previousConversationButton = getByLabelText('Previous conversation'); + const previousConversationButton = await findByText(mockData.electric_sheep_id.title); expect(previousConversationButton).toBeInTheDocument(); @@ -321,7 +316,7 @@ describe('Assistant', () => { renderAssistant({ setConversationTitle }); await act(async () => { - fireEvent.click(screen.getByLabelText('Previous conversation')); + fireEvent.click(await screen.findByText(mockData.electric_sheep_id.title)); }); expect(setConversationTitle).toHaveBeenLastCalledWith('electric sheep'); @@ -351,7 +346,7 @@ describe('Assistant', () => { } as unknown as DefinedUseQueryResult, unknown>); renderAssistant(); - const previousConversationButton = screen.getByLabelText('Previous conversation'); + const previousConversationButton = await screen.findByText('updated title'); await act(async () => { fireEvent.click(previousConversationButton); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx index 6892fdcaf48bd..3fe4e1586e239 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx @@ -5,8 +5,6 @@ * 2.0. */ -/* eslint-disable complexity */ - import React, { Dispatch, SetStateAction, @@ -26,9 +24,6 @@ import { EuiFlyoutFooter, EuiFlyoutHeader, EuiFlyoutBody, - EuiModalFooter, - EuiModalHeader, - EuiModalBody, EuiText, } from '@elastic/eui'; import { euiThemeVars } from '@kbn/ui-theme'; @@ -43,7 +38,6 @@ import { PromptTypeEnum } from '@kbn/elastic-assistant-common/impl/schemas/promp import { useChatSend } from './chat_send/use_chat_send'; import { ChatSend } from './chat_send'; import { BlockBotCallToAction } from './block_bot/cta'; -import { AssistantHeader } from './assistant_header'; import { WELCOME_CONVERSATION_TITLE } from './use_conversation/translations'; import { getDefaultConnector, @@ -57,16 +51,15 @@ import { getNewSelectedPromptContext } from '../data_anonymization/get_new_selec import type { PromptContext, SelectedPromptContext } from './prompt_context/types'; import { useConversation } from './use_conversation'; import { CodeBlockDetails, getDefaultSystemPrompt } from './use_conversation/helpers'; -import { PromptEditor } from './prompt_editor'; import { QuickPrompts } from './quick_prompts/quick_prompts'; import { useLoadConnectors } from '../connectorland/use_load_connectors'; -import { useConnectorSetup } from '../connectorland/connector_setup'; +import { ConnectorSetup } from '../connectorland/connector_setup'; import { ConnectorMissingCallout } from '../connectorland/connector_missing_callout'; import { ConversationSidePanel } from './conversations/conversation_sidepanel'; import { NEW_CHAT } from './conversations/conversation_sidepanel/translations'; import { SystemPrompt } from './prompt_editor/system_prompt'; import { SelectedPromptContexts } from './prompt_editor/selected_prompt_contexts'; -import { AssistantHeaderFlyout } from './assistant_header/assistant_header_flyout'; +import { AssistantHeader } from './assistant_header'; import * as i18n from './translations'; export const CONVERSATION_SIDE_PANEL_WIDTH = 220; @@ -77,17 +70,12 @@ const CommentContainer = styled('span')` overflow: hidden; `; -const ModalPromptEditorWrapper = styled.div` - margin-right: 24px; -`; - import { FetchConversationsResponse, useFetchCurrentUserConversations, CONVERSATIONS_QUERY_KEYS, } from './api/conversations/use_fetch_current_user_conversations'; import { Conversation } from '../assistant_context/types'; -import { clearPresentationData } from '../connectorland/connector_setup/helpers'; import { getGenAiConfig } from '../connectorland/helpers'; import { AssistantAnimatedIcon } from './assistant_animated_icon'; import { useFetchAnonymizationFields } from './api/anonymization_fields/use_fetch_anonymization_fields'; @@ -102,7 +90,6 @@ export interface Props { showTitle?: boolean; setConversationTitle?: Dispatch>; onCloseFlyout?: () => void; - isFlyoutMode?: boolean; chatHistoryVisible?: boolean; setChatHistoryVisible?: Dispatch>; currentUserAvatar?: UserAvatar; @@ -120,7 +107,6 @@ const AssistantComponent: React.FC = ({ showTitle = true, setConversationTitle, onCloseFlyout, - isFlyoutMode = false, chatHistoryVisible, setChatHistoryVisible, currentUserAvatar, @@ -129,14 +115,12 @@ const AssistantComponent: React.FC = ({ assistantTelemetry, augmentMessageCodeBlocks, assistantAvailability: { isAssistantEnabled }, - docLinks, getComments, http, knowledgeBase: { isEnabledKnowledgeBase, isEnabledRAGAlerts }, promptContexts, setLastConversationId, getLastConversationId, - title, baseConversations, } = useAssistantContext(); @@ -251,7 +235,7 @@ const AssistantComponent: React.FC = ({ nextConversation?.id !== '' ? nextConversation?.id : nextConversation?.title ]) ?? conversations[WELCOME_CONVERSATION_TITLE] ?? - getDefaultConversation({ cTitle: WELCOME_CONVERSATION_TITLE, isFlyoutMode }); + getDefaultConversation({ cTitle: WELCOME_CONVERSATION_TITLE }); if ( prev && @@ -278,7 +262,6 @@ const AssistantComponent: React.FC = ({ getDefaultConversation, getLastConversationId, isAssistantEnabled, - isFlyoutMode, ]); // Welcome setup state @@ -295,10 +278,8 @@ const AssistantComponent: React.FC = ({ // Welcome conversation is a special 'setup' case when no connector exists, mostly extracted to `ConnectorSetup` component, // but currently a bit of state is littered throughout the assistant component. TODO: clean up/isolate this state const blockBotConversation = useMemo( - () => - currentConversation && - getBlockBotConversation(currentConversation, isAssistantEnabled, isFlyoutMode), - [currentConversation, isAssistantEnabled, isFlyoutMode] + () => currentConversation && getBlockBotConversation(currentConversation, isAssistantEnabled), + [currentConversation, isAssistantEnabled] ); // Settings modal state (so it isn't shared between assistant instances like Timeline) @@ -325,7 +306,6 @@ const AssistantComponent: React.FC = ({ setLastConversationId, ]); - const [promptTextPreview, setPromptTextPreview] = useState(''); const [autoPopulatedOnce, setAutoPopulatedOnce] = useState(false); const [userPrompt, setUserPrompt] = useState(null); @@ -398,16 +378,10 @@ const AssistantComponent: React.FC = ({ // when scrollHeight changes, parent is scrolled to bottom parent.scrollTop = parent.scrollHeight; - if (isFlyoutMode) { - ( - commentsContainerRef.current?.childNodes[0].childNodes[0] as HTMLElement - ).lastElementChild?.scrollIntoView(); - } + ( + commentsContainerRef.current?.childNodes[0].childNodes[0] as HTMLElement + ).lastElementChild?.scrollIntoView(); }); - - const getWrapper = (children: React.ReactNode, isCommentContainer: boolean) => - isCommentContainer ? {children} : <>{children}; - // End Scrolling const selectedSystemPrompt = useMemo( @@ -446,17 +420,6 @@ const AssistantComponent: React.FC = ({ [allSystemPrompts, refetchCurrentConversation, refetchResults] ); - const { comments: connectorComments, prompt: connectorPrompt } = useConnectorSetup({ - isFlyoutMode, - conversation: blockBotConversation, - onConversationUpdate: handleOnConversationSelected, - onSetupComplete: () => { - if (currentConversation) { - setCurrentConversation(clearPresentationData(currentConversation)); - } - }, - }); - const handleOnConversationDeleted = useCallback( async (cTitle: string) => { await deleteConversation(conversations[cTitle].id); @@ -538,14 +501,6 @@ const AssistantComponent: React.FC = ({ isFetchedAnonymizationFields, ]); - useEffect(() => {}, [ - areConnectorsFetched, - connectors, - conversationsLoaded, - currentConversation, - isLoading, - ]); - const createCodeBlockPortals = useCallback( () => messageCodeBlocks?.map((codeBlocks: CodeBlockDetails[], i: number) => { @@ -576,7 +531,6 @@ const AssistantComponent: React.FC = ({ } = useChatSend({ allSystemPrompts, currentConversation, - setPromptTextPreview, setUserPrompt, editingSystemPromptId, http, @@ -601,7 +555,7 @@ const AssistantComponent: React.FC = ({ [currentConversation, handleSendMessage, refetchResults] ); - const chatbotComments = useMemo( + const comments = useMemo( () => ( <> = ({ isFetchingResponse: isLoadingChatSend, setIsStreaming, currentUserAvatar, - isFlyoutMode, })} - {...(!isFlyoutMode - ? { - css: css` - margin-right: ${euiThemeVars.euiSizeL}; + // Avoid comments going off the flyout + css={css` + padding-bottom: ${euiThemeVars.euiSizeL}; - > li > div:nth-child(2) { - overflow: hidden; - } - `, - } - : { - // Avoid comments going off the flyout - css: css` - padding-bottom: ${euiThemeVars.euiSizeL}; - - > li > div:nth-child(2) { - overflow: hidden; - } - `, - })} + > li > div:nth-child(2) { + overflow: hidden; + } + `} /> {currentConversation?.messages.length !== 0 && selectedPromptContextsCount > 0 && ( )} - - {!isFlyoutMode && - (currentConversation?.messages.length === 0 || selectedPromptContextsCount > 0) && ( - - - - )} ), [ @@ -675,34 +596,10 @@ const AssistantComponent: React.FC = ({ isEnabledRAGAlerts, isLoadingChatSend, currentUserAvatar, - isFlyoutMode, selectedPromptContextsCount, - editingSystemPromptId, - isNewConversation, - isSettingsModalVisible, - promptContexts, - promptTextPreview, - handleOnSystemPromptSelectionChange, - selectedPromptContexts, - allSystemPrompts, ] ); - const comments = useMemo(() => { - if (isDisabled && !isFlyoutMode) { - return ( - - ); - } - - return chatbotComments; - }, [isDisabled, isFlyoutMode, chatbotComments, connectorComments]); - const trackPrompt = useCallback( (promptTitle: string) => { if (currentConversation?.title) { @@ -800,19 +697,14 @@ const AssistantComponent: React.FC = ({ textAlign="center" color={euiThemeVars.euiColorMediumShade} size="xs" - css={ - isFlyoutMode - ? css` - margin: 0 ${euiThemeVars.euiSizeL} ${euiThemeVars.euiSizeM} - ${euiThemeVars.euiSizeL}; - ` - : {} - } + css={css` + margin: 0 ${euiThemeVars.euiSizeL} ${euiThemeVars.euiSizeM} ${euiThemeVars.euiSizeL}; + `} > {i18n.DISCLAIMER} ), - [isFlyoutMode, isNewConversation] + [isNewConversation] ); const flyoutBodyContent = useMemo(() => { @@ -842,7 +734,10 @@ const AssistantComponent: React.FC = ({ - {connectorPrompt} + @@ -879,7 +774,6 @@ const AssistantComponent: React.FC = ({ onSystemPromptSelectionChange={handleOnSystemPromptSelectionChange} isSettingsModalVisible={isSettingsModalVisible} setIsSettingsModalVisible={setIsSettingsModalVisible} - isFlyoutMode allSystemPrompts={allSystemPrompts} />
    @@ -905,328 +799,212 @@ const AssistantComponent: React.FC = ({ ); }, [ allSystemPrompts, + blockBotConversation, comments, - connectorPrompt, currentConversation, editingSystemPromptId, + handleOnConversationSelected, handleOnSystemPromptSelectionChange, isSettingsModalVisible, isWelcomeSetup, ]); - if (isFlyoutMode) { - return ( - - {chatHistoryVisible && ( - - - - )} + return ( + + {chatHistoryVisible && ( - - + + )} + + + + - + + + {/* Create portals for each EuiCodeBlock to add the `Investigate in Timeline` action */} + {createCodeBlockPortals()} + + - - + min-height: 100px; + flex: 1; - {/* Create portals for each EuiCodeBlock to add the `Investigate in Timeline` action */} - {createCodeBlockPortals()} - - div { + display: flex; + flex-direction: column; + align-items: stretch; + + > .euiFlyoutBody__banner { + overflow-x: unset; + } - > div { + > .euiFlyoutBody__overflowContent { display: flex; - flex-direction: column; - align-items: stretch; - - > .euiFlyoutBody__banner { - overflow-x: unset; - } - - > .euiFlyoutBody__overflowContent { - display: flex; - flex: 1; - overflow: auto; - } + flex: 1; + overflow: auto; } - `} - banner={ - !isDisabled && - showMissingConnectorCallout && - areConnectorsFetched && ( - 0} - isSettingsModalVisible={isSettingsModalVisible} - setIsSettingsModalVisible={setIsSettingsModalVisible} - isFlyoutMode={isFlyoutMode} - /> - ) } - > - {!isAssistantEnabled ? ( - 0} + isSettingsModalVisible={isSettingsModalVisible} + setIsSettingsModalVisible={setIsSettingsModalVisible} /> - ) : ( - - {flyoutBodyContent} - {disclaimer} - - )} - - + {!isAssistantEnabled ? ( + + } + http={http} + isAssistantEnabled={isAssistantEnabled} + isWelcomeSetup={isWelcomeSetup} + /> + ) : ( + + {flyoutBodyContent} + {disclaimer} + + )} + + + - - {!isDisabled && - Object.keys(promptContexts).length !== selectedPromptContextsCount && ( - - - <> - - {Object.keys(promptContexts).length > 0 && } - - - - )} - - - {Object.keys(selectedPromptContexts).length ? ( - - + {!isDisabled && + Object.keys(promptContexts).length !== selectedPromptContextsCount && ( + + + <> + + {Object.keys(promptContexts).length > 0 && } + - ) : null} + + )} + + {Object.keys(selectedPromptContexts).length ? ( - - - - - {!isDisabled && ( - - + - - )} - - - - - - - ); - } - - return getWrapper( - <> - - {showTitle && ( - - )} +
    + + - {/* Create portals for each EuiCodeBlock to add the `Investigate in Timeline` action */} - {createCodeBlockPortals()} - - {!isDisabled && !isLoadingAnonymizationFields && !isErrorAnonymizationFields && ( - <> - - {Object.keys(promptContexts).length > 0 && } - - )} - - - - - {' '} - {getWrapper( - <> - {comments} - - {!isDisabled && showMissingConnectorCallout && areConnectorsFetched && ( - <> - - - - 0} - isSettingsModalVisible={isSettingsModalVisible} - setIsSettingsModalVisible={setIsSettingsModalVisible} - isFlyoutMode={isFlyoutMode} - /> - - - + {!isDisabled && ( + + + )} - , - !embeddedLayout - )} - - {disclaimer} - - - - - - {!isDisabled && ( - - )} - - , - embeddedLayout + + + + + + ); }; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/index.test.tsx index 6d421b649a380..e2f55ee89202e 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/index.test.tsx @@ -39,7 +39,6 @@ const defaultProps: Props = { selectedPromptContexts: {}, setIsSettingsModalVisible: jest.fn(), setSelectedPromptContexts: jest.fn(), - isFlyoutMode: false, allSystemPrompts: [], }; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/index.tsx index 1528435764acd..adf9b7d4aa658 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/index.tsx @@ -31,7 +31,6 @@ export interface Props { setSelectedPromptContexts: React.Dispatch< React.SetStateAction> >; - isFlyoutMode: boolean; allSystemPrompts: PromptResponse[]; } @@ -50,7 +49,6 @@ const PromptEditorComponent: React.FC = ({ selectedPromptContexts, setIsSettingsModalVisible, setSelectedPromptContexts, - isFlyoutMode, allSystemPrompts, }) => { const commentBody = useMemo( @@ -64,17 +62,14 @@ const PromptEditorComponent: React.FC = ({ onSystemPromptSelectionChange={onSystemPromptSelectionChange} isSettingsModalVisible={isSettingsModalVisible} setIsSettingsModalVisible={setIsSettingsModalVisible} - isFlyoutMode={isFlyoutMode} /> )} @@ -90,7 +85,6 @@ const PromptEditorComponent: React.FC = ({ onSystemPromptSelectionChange, isSettingsModalVisible, setIsSettingsModalVisible, - isFlyoutMode, promptContexts, selectedPromptContexts, setSelectedPromptContexts, diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/selected_prompt_contexts/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/selected_prompt_contexts/index.test.tsx index 899ee5ed7488c..873c41731bd20 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/selected_prompt_contexts/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/selected_prompt_contexts/index.test.tsx @@ -15,7 +15,6 @@ import type { SelectedPromptContext } from '../../prompt_context/types'; import { Props, SelectedPromptContexts } from '.'; const defaultProps: Props = { - isNewConversation: false, promptContexts: { [mockAlertPromptContext.id]: mockAlertPromptContext, [mockEventPromptContext.id]: mockEventPromptContext, @@ -23,7 +22,6 @@ const defaultProps: Props = { selectedPromptContexts: {}, setSelectedPromptContexts: jest.fn(), currentReplacements: {}, - isFlyoutMode: false, }; const mockSelectedAlertPromptContext: SelectedPromptContext = { @@ -53,61 +51,6 @@ describe('SelectedPromptContexts', () => { }); }); - it('it does NOT render a spacer when isNewConversation is false and selectedPromptContextIds.length is 1', async () => { - render( - - - - ); - - await waitFor(() => { - expect(screen.queryByTestId('spacer')).not.toBeInTheDocument(); - }); - }); - - it('it renders a spacer when isNewConversation is true and selectedPromptContextIds.length is 1', async () => { - render( - - - - ); - - await waitFor(() => { - expect(screen.getByTestId('spacer')).toBeInTheDocument(); - }); - }); - - it('it renders a spacer for each selected prompt context when isNewConversation is false and selectedPromptContextIds.length is 2', async () => { - render( - - - - ); - - await waitFor(() => { - expect(screen.getAllByTestId('spacer')).toHaveLength(2); - }); - }); - it('renders the selected prompt contexts', async () => { const selectedPromptContexts = { [mockAlertPromptContext.id]: mockSelectedAlertPromptContext, diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/selected_prompt_contexts/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/selected_prompt_contexts/index.tsx index d3555b2e2ac86..3a0e6f3ce87d2 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/selected_prompt_contexts/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/selected_prompt_contexts/index.tsx @@ -5,19 +5,10 @@ * 2.0. */ -import { - EuiAccordion, - EuiButtonIcon, - EuiFlexGroup, - EuiFlexItem, - EuiSpacer, - EuiToolTip, -} from '@elastic/eui'; +import { EuiAccordion, EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; import { isEmpty, omit } from 'lodash/fp'; import React, { useCallback } from 'react'; -// eslint-disable-next-line @kbn/eslint/module_migration -import styled from 'styled-components'; - +import styled from '@emotion/styled'; import { css } from '@emotion/react'; import { euiThemeVars } from '@kbn/ui-theme'; import { Conversation } from '../../../assistant_context/types'; @@ -26,14 +17,12 @@ import type { PromptContext, SelectedPromptContext } from '../../prompt_context/ import * as i18n from './translations'; export interface Props { - isNewConversation: boolean; promptContexts: Record; selectedPromptContexts: Record; setSelectedPromptContexts: React.Dispatch< React.SetStateAction> >; currentReplacements: Conversation['replacements'] | undefined; - isFlyoutMode: boolean; } export const EditorContainer = styled.div<{ @@ -45,20 +34,11 @@ export const EditorContainer = styled.div<{ `; const SelectedPromptContextsComponent: React.FC = ({ - isNewConversation, promptContexts, selectedPromptContexts, setSelectedPromptContexts, currentReplacements, - isFlyoutMode, }) => { - const [accordionState, setAccordionState] = React.useState<'closed' | 'open'>('closed'); - - const onToggle = useCallback( - () => setAccordionState((prev) => (prev === 'open' ? 'closed' : 'open')), - [] - ); - const unselectPromptContext = useCallback( (unselectedId: string) => { setSelectedPromptContexts((prev) => omit(unselectedId, prev)); @@ -71,22 +51,13 @@ const SelectedPromptContextsComponent: React.FC = ({ } return ( - + {Object.keys(selectedPromptContexts) .sort() .map((id) => ( - {!isFlyoutMode && - (isNewConversation || Object.keys(selectedPromptContexts).length > 1) ? ( - - ) : null} = ({ } id={id} - {...(!isFlyoutMode && { onToggle })} paddingSize="s" - {...(isFlyoutMode - ? { - css: css` - background: ${euiThemeVars.euiPageBackgroundColor}; - border-radius: ${euiThemeVars.euiBorderRadius}; + css={css` + background: ${euiThemeVars.euiPageBackgroundColor}; + border-radius: ${euiThemeVars.euiBorderRadius}; - > div:first-child { - color: ${euiThemeVars.euiColorPrimary}; - padding: ${euiThemeVars.euiFormControlPadding}; - } - `, - borders: 'all', - arrowProps: { - color: 'primary', - }, - } - : {})} + > div:first-child { + color: ${euiThemeVars.euiColorPrimary}; + padding: ${euiThemeVars.euiFormControlPadding}; + } + `} + borders={'all'} + arrowProps={{ + color: 'primary', + }} > - {isFlyoutMode ? ( - - ) : ( - - - - )} + ))} diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/helpers.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/helpers.test.tsx index 82b04c60a569c..f13441a3102f9 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/helpers.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/helpers.test.tsx @@ -16,21 +16,21 @@ import { getOptions, getOptionFromPrompt } from './helpers'; describe('helpers', () => { describe('getOptionFromPrompt', () => { it('returns an EuiSuperSelectOption with the correct value', () => { - const option = getOptionFromPrompt({ ...mockSystemPrompt, isFlyoutMode: true }); + const option = getOptionFromPrompt({ ...mockSystemPrompt }); expect(option.value).toBe(mockSystemPrompt.id); }); it('returns an EuiSuperSelectOption with the correct inputDisplay', () => { - const option = getOptionFromPrompt({ ...mockSystemPrompt, isFlyoutMode: false }); + const option = getOptionFromPrompt({ ...mockSystemPrompt }); render(<>{option.inputDisplay}); - expect(screen.getByTestId('systemPromptText')).toHaveTextContent(mockSystemPrompt.content); + expect(screen.getByTestId('systemPromptText')).toHaveTextContent(mockSystemPrompt.name); }); it('shows the expected name in the dropdownDisplay', () => { - const option = getOptionFromPrompt({ ...mockSystemPrompt, isFlyoutMode: true }); + const option = getOptionFromPrompt({ ...mockSystemPrompt }); render({option.dropdownDisplay}); @@ -38,7 +38,7 @@ describe('helpers', () => { }); it('shows the expected prompt content in the dropdownDisplay', () => { - const option = getOptionFromPrompt({ ...mockSystemPrompt, isFlyoutMode: true }); + const option = getOptionFromPrompt({ ...mockSystemPrompt }); render({option.dropdownDisplay}); @@ -51,7 +51,7 @@ describe('helpers', () => { const prompts = [mockSystemPrompt, mockSuperheroSystemPrompt]; const promptIds = prompts.map(({ id }) => id); - const options = getOptions({ prompts, isFlyoutMode: false }); + const options = getOptions({ prompts }); const optionValues = options.map(({ value }) => value); expect(optionValues).toEqual(promptIds); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/helpers.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/helpers.tsx index bd217bb54e9f6..92814927f980a 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/helpers.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/helpers.tsx @@ -8,46 +8,23 @@ import { EuiText, EuiToolTip } from '@elastic/eui'; import type { EuiSuperSelectOption } from '@elastic/eui'; import React from 'react'; -// eslint-disable-next-line @kbn/eslint/module_migration -import styled from 'styled-components'; - -import { css } from '@emotion/react'; +import styled from '@emotion/styled'; import { isEmpty } from 'lodash/fp'; +import { euiThemeVars } from '@kbn/ui-theme'; import { PromptResponse } from '@kbn/elastic-assistant-common'; import { EMPTY_PROMPT } from './translations'; const Strong = styled.strong` - margin-right: ${({ theme }) => theme.eui.euiSizeS}; + margin-right: ${euiThemeVars.euiSizeS}; `; export const getOptionFromPrompt = ({ content, id, name, - showTitles = false, - isFlyoutMode, -}: PromptResponse & { - showTitles?: boolean; - isFlyoutMode: boolean; -}): EuiSuperSelectOption => ({ +}: PromptResponse): EuiSuperSelectOption => ({ value: id, - inputDisplay: isFlyoutMode ? ( - name - ) : ( - - {showTitles ? name : content} - - ), + inputDisplay: {name}, dropdownDisplay: ( <> {name} @@ -64,12 +41,6 @@ export const getOptionFromPrompt = ({ interface GetOptionsProps { prompts: PromptResponse[] | undefined; - showTitles?: boolean; - isFlyoutMode: boolean; } -export const getOptions = ({ - prompts, - showTitles = false, - isFlyoutMode, -}: GetOptionsProps): Array> => - prompts?.map((p) => getOptionFromPrompt({ ...p, showTitles, isFlyoutMode })) ?? []; +export const getOptions = ({ prompts }: GetOptionsProps): Array> => + prompts?.map(getOptionFromPrompt) ?? []; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/index.test.tsx index 34d40852ba505..3b82b1fd0fbe5 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/index.test.tsx @@ -90,7 +90,6 @@ describe('SystemPrompt', () => { isSettingsModalVisible={isSettingsModalVisible} onSystemPromptSelectionChange={onSystemPromptSelectionChange} setIsSettingsModalVisible={setIsSettingsModalVisible} - isFlyoutMode={false} allSystemPrompts={mockSystemPrompts} /> ); @@ -100,10 +99,6 @@ describe('SystemPrompt', () => { expect(screen.getByTestId('selectSystemPrompt')).toBeInTheDocument(); }); - it('does NOT render the system prompt text', () => { - expect(screen.queryByTestId('systemPromptText')).not.toBeInTheDocument(); - }); - it('does NOT render the edit button', () => { expect(screen.queryByTestId('edit')).not.toBeInTheDocument(); }); @@ -122,26 +117,21 @@ describe('SystemPrompt', () => { isSettingsModalVisible={isSettingsModalVisible} onSystemPromptSelectionChange={onSystemPromptSelectionChange} setIsSettingsModalVisible={setIsSettingsModalVisible} - isFlyoutMode={false} allSystemPrompts={mockSystemPrompts} /> ); }); - it('does NOT render the system prompt select', () => { - expect(screen.queryByTestId('selectSystemPrompt')).not.toBeInTheDocument(); + it('does render the system prompt select', () => { + expect(screen.queryByTestId('selectSystemPrompt')).toBeInTheDocument(); }); it('renders the system prompt text', () => { - expect(screen.getByTestId('systemPromptText')).toHaveTextContent(mockSystemPrompt.content); - }); - - it('renders the edit button', () => { - expect(screen.getByTestId('edit')).toBeInTheDocument(); + expect(screen.getByTestId('systemPromptText')).toHaveTextContent(mockSystemPrompt.name); }); it('renders the clear button', () => { - expect(screen.getByTestId('clear')).toBeInTheDocument(); + expect(screen.getByTestId('clearSystemPrompt')).toBeInTheDocument(); }); }); @@ -158,7 +148,6 @@ describe('SystemPrompt', () => { isSettingsModalVisible={isSettingsModalVisible} onSystemPromptSelectionChange={onSystemPromptSelectionChange} setIsSettingsModalVisible={setIsSettingsModalVisible} - isFlyoutMode={false} allSystemPrompts={mockSystemPrompts} /> @@ -206,7 +195,6 @@ describe('SystemPrompt', () => { isSettingsModalVisible={isSettingsModalVisible} onSystemPromptSelectionChange={onSystemPromptSelectionChange} setIsSettingsModalVisible={setIsSettingsModalVisible} - isFlyoutMode={false} allSystemPrompts={mockSystemPrompts} /> @@ -268,7 +256,6 @@ describe('SystemPrompt', () => { isSettingsModalVisible={isSettingsModalVisible} onSystemPromptSelectionChange={onSystemPromptSelectionChange} setIsSettingsModalVisible={setIsSettingsModalVisible} - isFlyoutMode={false} allSystemPrompts={mockSystemPrompts} /> @@ -337,7 +324,6 @@ describe('SystemPrompt', () => { isSettingsModalVisible={isSettingsModalVisible} onSystemPromptSelectionChange={onSystemPromptSelectionChange} setIsSettingsModalVisible={setIsSettingsModalVisible} - isFlyoutMode={false} allSystemPrompts={mockSystemPrompts} /> @@ -421,7 +407,6 @@ describe('SystemPrompt', () => { isSettingsModalVisible={isSettingsModalVisible} onSystemPromptSelectionChange={onSystemPromptSelectionChange} setIsSettingsModalVisible={setIsSettingsModalVisible} - isFlyoutMode={false} allSystemPrompts={mockSystemPrompts} /> @@ -483,26 +468,6 @@ describe('SystemPrompt', () => { }); }); - it('shows the system prompt select when the edit button is clicked', () => { - render( - - - - ); - - userEvent.click(screen.getByTestId('edit')); - - expect(screen.getByTestId('selectSystemPrompt')).toBeInTheDocument(); - }); - it('shows the system prompt select when system prompt text is clicked', () => { render( @@ -512,7 +477,6 @@ describe('SystemPrompt', () => { isSettingsModalVisible={isSettingsModalVisible} onSystemPromptSelectionChange={onSystemPromptSelectionChange} setIsSettingsModalVisible={setIsSettingsModalVisible} - isFlyoutMode={false} allSystemPrompts={mockSystemPrompts} /> diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/index.tsx index f2808c3e204f1..01fe334eb1f7d 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/index.tsx @@ -5,14 +5,9 @@ * 2.0. */ -import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiText, EuiToolTip } from '@elastic/eui'; import React, { useCallback, useMemo } from 'react'; - -import { css } from '@emotion/react'; -import { isEmpty } from 'lodash/fp'; import { PromptResponse } from '@kbn/elastic-assistant-common'; import { Conversation } from '../../../..'; -import * as i18n from './translations'; import { SelectSystemPrompt } from './select_system_prompt'; interface Props { @@ -21,7 +16,6 @@ interface Props { isSettingsModalVisible: boolean; onSystemPromptSelectionChange: (systemPromptId: string | undefined) => void; setIsSettingsModalVisible: React.Dispatch>; - isFlyoutMode: boolean; allSystemPrompts: PromptResponse[]; } @@ -31,7 +25,6 @@ const SystemPromptComponent: React.FC = ({ isSettingsModalVisible, onSystemPromptSelectionChange, setIsSettingsModalVisible, - isFlyoutMode, allSystemPrompts, }) => { const selectedPrompt = useMemo(() => { @@ -42,99 +35,24 @@ const SystemPromptComponent: React.FC = ({ } }, [allSystemPrompts, conversation?.apiConfig?.defaultSystemPromptId, editingSystemPromptId]); - const [isEditing, setIsEditing] = React.useState(false); - const handleClearSystemPrompt = useCallback(() => { if (conversation) { onSystemPromptSelectionChange(undefined); } }, [conversation, onSystemPromptSelectionChange]); - const handleEditSystemPrompt = useCallback(() => setIsEditing(true), []); - - if (isFlyoutMode) { - return ( - - ); - } - return ( -
    - {selectedPrompt == null || isEditing ? ( - - ) : ( - - - - {isEmpty(selectedPrompt?.content) ? i18n.EMPTY_PROMPT : selectedPrompt?.content} - - - - - - - - - - - - - - - - - - - )} -
    + ); }; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/select_system_prompt/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/select_system_prompt/index.test.tsx index 3796e5b4a81eb..7c8f575cd49d7 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/select_system_prompt/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/select_system_prompt/index.test.tsx @@ -48,9 +48,9 @@ const props: Props = { ], conversation: undefined, isSettingsModalVisible: false, + isClearable: true, selectedPrompt: { id: 'default-system-prompt', content: '', name: '', promptType: 'system' }, setIsSettingsModalVisible: jest.fn(), - isFlyoutMode: false, }; const mockUseAssistantContext = { @@ -91,93 +91,27 @@ jest.mock('../../../../assistant_context', () => { describe('SelectSystemPrompt', () => { beforeEach(() => jest.clearAllMocks()); - it('renders the prompt super select when isEditing is true', () => { - const { getByTestId } = render(); + it('renders the prompt super select', () => { + const { getByTestId } = render(); expect(getByTestId(TEST_IDS.PROMPT_SUPERSELECT)).toBeInTheDocument(); }); - it('does NOT render the prompt super select when isEditing is false', () => { - const { queryByTestId } = render(); - - expect(queryByTestId(TEST_IDS.PROMPT_SUPERSELECT)).not.toBeInTheDocument(); - }); - - it('does NOT render the clear system prompt button when isEditing is true', () => { - const { queryByTestId } = render(); - - expect(queryByTestId('clearSystemPrompt')).not.toBeInTheDocument(); - }); - - it('renders the clear system prompt button when isEditing is true AND isClearable is true', () => { - const { getByTestId } = render( - - ); + it('renders the clear system prompt button', () => { + const { getByTestId } = render(); expect(getByTestId('clearSystemPrompt')).toBeInTheDocument(); }); - it('does NOT render the clear system prompt button when isEditing is false', () => { - const { queryByTestId } = render(); - - expect(queryByTestId('clearSystemPrompt')).not.toBeInTheDocument(); - }); - - it('renders the add system prompt button when isEditing is false', () => { - const { getByTestId } = render(); - - expect(getByTestId('addSystemPrompt')).toBeInTheDocument(); - }); - - it('does NOT render the add system prompt button when isEditing is true', () => { - const { queryByTestId } = render(); - - expect(queryByTestId('addSystemPrompt')).not.toBeInTheDocument(); - }); - it('clears the selected system prompt when the clear button is clicked', () => { const clearSelectedSystemPrompt = jest.fn(); const { getByTestId } = render( - + ); userEvent.click(getByTestId('clearSystemPrompt')); expect(clearSelectedSystemPrompt).toHaveBeenCalledTimes(1); }); - - it('hides the select when the clear button is clicked', () => { - const setIsEditing = jest.fn(); - - const { getByTestId } = render( - - ); - - userEvent.click(getByTestId('clearSystemPrompt')); - - expect(setIsEditing).toHaveBeenCalledWith(false); - }); - - it('shows the select when the add button is clicked', () => { - const setIsEditing = jest.fn(); - - const { getByTestId } = render( - - ); - - userEvent.click(getByTestId('addSystemPrompt')); - - expect(setIsEditing).toHaveBeenCalledWith(true); - }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/select_system_prompt/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/select_system_prompt/index.tsx index 0296fa3e636ca..0f10cf6d3063f 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/select_system_prompt/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/select_system_prompt/index.tsx @@ -38,15 +38,11 @@ export interface Props { selectedPrompt: PromptResponse | undefined; clearSelectedSystemPrompt?: () => void; isClearable?: boolean; - isEditing?: boolean; isDisabled?: boolean; isOpen?: boolean; isSettingsModalVisible: boolean; - setIsEditing?: React.Dispatch>; setIsSettingsModalVisible: React.Dispatch>; - showTitles?: boolean; onSystemPromptSelectionChange?: (promptId: string | undefined) => void; - isFlyoutMode: boolean; } const ADD_NEW_SYSTEM_PROMPT = 'ADD_NEW_SYSTEM_PROMPT'; @@ -58,15 +54,11 @@ const SelectSystemPromptComponent: React.FC = ({ selectedPrompt, clearSelectedSystemPrompt, isClearable = false, - isEditing = false, isDisabled = false, isOpen = false, isSettingsModalVisible, onSystemPromptSelectionChange, - setIsEditing, setIsSettingsModalVisible, - showTitles = false, - isFlyoutMode = false, }) => { const { setSelectedSettingsTab } = useAssistantContext(); const { setApiConfig } = useConversation(); @@ -117,10 +109,7 @@ const SelectSystemPromptComponent: React.FC = ({ }, []); // SuperSelect State/Actions - const options = useMemo( - () => getOptions({ prompts: allSystemPrompts, showTitles, isFlyoutMode }), - [allSystemPrompts, showTitles, isFlyoutMode] - ); + const options = useMemo(() => getOptions({ prompts: allSystemPrompts }), [allSystemPrompts]); const onChange = useCallback( (selectedSystemPromptId) => { @@ -134,11 +123,9 @@ const SelectSystemPromptComponent: React.FC = ({ onSystemPromptSelectionChange(selectedSystemPromptId); } setSelectedSystemPrompt(selectedSystemPromptId); - setIsEditing?.(false); }, [ onSystemPromptSelectionChange, - setIsEditing, setIsSettingsModalVisible, setSelectedSettingsTab, setSelectedSystemPrompt, @@ -147,14 +134,8 @@ const SelectSystemPromptComponent: React.FC = ({ const clearSystemPrompt = useCallback(() => { setSelectedSystemPrompt(undefined); - setIsEditing?.(false); clearSelectedSystemPrompt?.(); - }, [clearSelectedSystemPrompt, setIsEditing, setSelectedSystemPrompt]); - - const onShowSelectSystemPrompt = useCallback(() => { - setIsEditing?.(true); - setIsOpenLocal(true); - }, [setIsEditing]); + }, [clearSelectedSystemPrompt, setSelectedSystemPrompt]); return ( = ({ max-width: 100%; `} > - {isEditing && ( - + - - - )} + /> + - {isEditing && isClearable && selectedPrompt && ( + {isClearable && selectedPrompt && ( svg { - width: 8px; - height: 8px; - stroke-width: 2px; - fill: #fff; - stroke: #fff; - } - ` - : undefined - } - /> - - )} - {!isEditing && ( - - svg { + width: 8px; + height: 8px; + stroke-width: 2px; + fill: #fff; + stroke: #fff; + } + `} /> )} diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_selector/system_prompt_selector.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_selector/system_prompt_selector.tsx index 2c4826940a7ca..ae5fce935cfe3 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_selector/system_prompt_selector.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_selector/system_prompt_selector.tsx @@ -147,9 +147,8 @@ export const SystemPromptSelector: React.FC = React.memo( const renderOption: ( option: SystemPromptSelectorOption, - searchValue: string, - OPTION_CONTENT_CLASSNAME: string - ) => React.ReactNode = (option, searchValue, contentClassName) => { + searchValue: string + ) => React.ReactNode = (option, searchValue) => { const { label, value } = option; return ( isDisabled?: boolean; onPromptSubmit: (value: string) => void; value: string; - isFlyoutMode: boolean; } export const PromptTextArea = forwardRef( - ({ isDisabled = false, value, onPromptSubmit, handlePromptChange, isFlyoutMode }, ref) => { + ({ isDisabled = false, value, onPromptSubmit, handlePromptChange }, ref) => { const onChangeCallback = useCallback( (event: React.ChangeEvent) => { handlePromptChange(event.target.value); @@ -46,8 +45,8 @@ export const PromptTextArea = forwardRef( ( value={value} onChange={onChangeCallback} onKeyDown={onKeyDown} - rows={isFlyoutMode ? 1 : 6} + rows={1} /> ); } diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_selector/quick_prompt_selector.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_selector/quick_prompt_selector.tsx index d29887e8c4f6a..759c6e49e446e 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_selector/quick_prompt_selector.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_selector/quick_prompt_selector.tsx @@ -140,9 +140,8 @@ export const QuickPromptSelector: React.FC = React.memo( const renderOption: ( option: QuickPromptSelectorOption, - searchValue: string, - OPTION_CONTENT_CLASSNAME: string - ) => React.ReactNode = (option, searchValue, contentClassName) => { + searchValue: string + ) => React.ReactNode = (option, searchValue) => { const { color, label, value } = option; return ( ({ + ...jest.requireActual('react-use'), + useMeasure: () => [ + () => {}, + { + width: 500, + }, + ], +})); + jest.mock('../../assistant_context', () => ({ ...jest.requireActual('../../assistant_context'), useAssistantContext: () => mockUseAssistantContext, diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompts.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompts.tsx index c578a58be728d..e910d238ccc5d 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompts.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompts.tsx @@ -27,12 +27,10 @@ import { QUICK_PROMPTS_TAB } from '../settings/const'; export const KNOWLEDGE_BASE_CATEGORY = 'knowledge-base'; -const COUNT_BEFORE_OVERFLOW = 5; interface QuickPromptsProps { setInput: (input: string) => void; setIsSettingsModalVisible: React.Dispatch>; trackPrompt: (prompt: string) => void; - isFlyoutMode: boolean; allPrompts: PromptResponse[]; } @@ -42,7 +40,7 @@ interface QuickPromptsProps { * and localstorage for storing new and edited prompts. */ export const QuickPrompts: React.FC = React.memo( - ({ setInput, setIsSettingsModalVisible, trackPrompt, isFlyoutMode, allPrompts }) => { + ({ setInput, setIsSettingsModalVisible, trackPrompt, allPrompts }) => { const [quickPromptsContainerRef, { width }] = useMeasure(); const { knowledgeBase, promptContexts, setSelectedSettingsTab } = useAssistantContext(); @@ -103,25 +101,15 @@ export const QuickPrompts: React.FC = React.memo( }, [setIsSettingsModalVisible, setSelectedSettingsTab]); const quickPrompts = useMemo(() => { - const visibleCount = isFlyoutMode ? Math.floor(width / 120) : COUNT_BEFORE_OVERFLOW; + const visibleCount = Math.floor(width / 120); const visibleItems = contextFilteredQuickPrompts.slice(0, visibleCount); const overflowItems = contextFilteredQuickPrompts.slice(visibleCount); return { visible: visibleItems, overflow: overflowItems }; - }, [contextFilteredQuickPrompts, isFlyoutMode, width]); + }, [contextFilteredQuickPrompts, width]); return ( - + = React.memo( - ) : ( - - ) + } isOpen={isOverflowPopoverOpen} closePopover={closeOverflowPopover} diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.test.tsx index 8f4a8680f9c57..9fb8db972e482 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.test.tsx @@ -55,7 +55,6 @@ const testProps = { selectedConversationId: welcomeConvo.title, onClose, onSave, - isFlyoutMode: false, onConversationSelected, conversations: {}, anonymizationFields: { total: 0, page: 1, perPage: 1000, data: [] }, diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx index d5bbefe304208..4b46d2b75d0a9 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings.tsx @@ -59,7 +59,6 @@ interface Props { onClose: ( event?: React.KeyboardEvent | React.MouseEvent ) => void; - isFlyoutMode: boolean; onSave: (success: boolean) => Promise; selectedConversationId?: string; onConversationSelected: ({ cId, cTitle }: { cId: string; cTitle: string }) => void; @@ -80,7 +79,6 @@ export const AssistantSettings: React.FC = React.memo( onConversationSelected, conversations, conversationsLoaded, - isFlyoutMode, }) => { const { actionTypeRegistry, @@ -338,7 +336,6 @@ export const AssistantSettings: React.FC = React.memo( setAssistantStreamingEnabled={setUpdatedAssistantStreamingEnabled} onSelectedConversationChange={onHandleSelectedConversationChange} http={http} - isFlyoutMode={isFlyoutMode} /> ))} {selectedSettingsTab === QUICK_PROMPTS_TAB && ( diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.test.tsx index 3aab8d1169bfc..0ef76adad9940 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.test.tsx @@ -22,7 +22,6 @@ const testProps = { isSettingsModalVisible: false, selectedConversation: welcomeConvo, setIsSettingsModalVisible, - isFlyoutMode: false, onConversationSelected, conversations: {}, conversationsLoaded: true, diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx index 30f141f219476..0df20b0cd4db2 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_button.tsx @@ -23,7 +23,6 @@ interface Props { setIsSettingsModalVisible: React.Dispatch>; onConversationSelected: ({ cId, cTitle }: { cId: string; cTitle: string }) => void; isDisabled?: boolean; - isFlyoutMode: boolean; conversations: Record; conversationsLoaded: boolean; refetchConversationsState: () => Promise; @@ -42,7 +41,6 @@ export const AssistantSettingsButton: React.FC = React.memo( isSettingsModalVisible, setIsSettingsModalVisible, selectedConversationId, - isFlyoutMode, onConversationSelected, conversations, conversationsLoaded, @@ -92,7 +90,7 @@ export const AssistantSettingsButton: React.FC = React.memo( isDisabled={isDisabled} iconType="gear" size="xs" - {...(isFlyoutMode ? { color: 'text' } : {})} + color="text" /> @@ -103,7 +101,6 @@ export const AssistantSettingsButton: React.FC = React.memo( onConversationSelected={onConversationSelected} onClose={handleCloseModal} onSave={handleSave} - isFlyoutMode={isFlyoutMode} conversations={conversations} conversationsLoaded={conversationsLoaded} /> diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_management.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_management.test.tsx index 15fb05ca1c807..7d70ee5ede730 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_management.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_management.test.tsx @@ -62,7 +62,6 @@ const testProps = { selectedConversation: welcomeConvo, onClose, onSave, - isFlyoutMode: false, onConversationSelected, conversations: {}, anonymizationFields: { total: 0, page: 1, perPage: 1000, data: [] }, diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_management.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_management.tsx index 3f9be4972fe7e..be6370d36e841 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_management.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/assistant_settings_management.tsx @@ -49,7 +49,6 @@ interface Props { conversations: Record; conversationsLoaded: boolean; selectedConversation: Conversation; - isFlyoutMode: boolean; refetchConversations: () => void; } @@ -61,7 +60,6 @@ export const AssistantSettingsManagement: React.FC = React.memo( ({ conversations, conversationsLoaded, - isFlyoutMode, refetchConversations, selectedConversation: defaultSelectedConversation, }) => { @@ -304,7 +302,6 @@ export const AssistantSettingsManagement: React.FC = React.memo( conversationsSettingsBulkActions={conversationsSettingsBulkActions} defaultConnector={defaultConnector} handleSave={handleSave} - isFlyoutMode={isFlyoutMode} onCancelClick={onCancelClick} onSelectedConversationChange={onHandleSelectedConversationChange} selectedConversation={selectedConversation} diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/evaluation_settings/evaluation_settings.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/evaluation_settings/evaluation_settings.tsx index fe4d75be04004..71bbab7636a4a 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/evaluation_settings/evaluation_settings.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/evaluation_settings/evaluation_settings.tsx @@ -44,14 +44,10 @@ const DEFAULT_EVAL_TYPES_OPTIONS = [ ]; const DEFAULT_OUTPUT_INDEX = '.kibana-elastic-ai-assistant-evaluation-results'; -interface Props { - onEvaluationSettingsChange?: () => void; -} - /** * Evaluation Settings -- development-only feature for evaluating models */ -export const EvaluationSettings: React.FC = React.memo(({ onEvaluationSettingsChange }) => { +export const EvaluationSettings: React.FC = React.memo(() => { const { actionTypeRegistry, basePath, http, setTraceOptions, traceOptions } = useAssistantContext(); const { data: connectors } = useLoadConnectors({ http }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_assistant_overlay/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_assistant_overlay/index.tsx index 3396223d192ca..9ccc2cbce815d 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_assistant_overlay/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_assistant_overlay/index.tsx @@ -130,7 +130,7 @@ export const useAssistantOverlay = ( // proxy show / hide calls to assistant context, using our internal prompt context id: // silent:boolean doesn't show the toast notification if the conversation is not found const showAssistantOverlay = useCallback( - async (showOverlay: boolean, silent?: boolean) => { + async (showOverlay: boolean) => { let conversation; if (!isLoading) { conversation = conversationTitle diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_conversation/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_conversation/index.tsx index a276aea3ff4ab..4643af5509aeb 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_conversation/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_conversation/index.tsx @@ -33,7 +33,6 @@ interface CreateConversationProps { messages?: ClientMessage[]; conversationIds?: string[]; apiConfig?: Conversation['apiConfig']; - isFlyoutMode: boolean; } interface SetApiConfigProps { @@ -126,13 +125,10 @@ export const useConversation = (): UseConversation => { * Create a new conversation with the given conversationId, and optionally add messages */ const getDefaultConversation = useCallback( - ({ cTitle, messages, isFlyoutMode }: CreateConversationProps): Conversation => { + ({ cTitle, messages }: CreateConversationProps): Conversation => { const newConversation: Conversation = cTitle === i18n.WELCOME_CONVERSATION_TITLE - ? { - ...WELCOME_CONVERSATION, - messages: !isFlyoutMode ? WELCOME_CONVERSATION.messages : [], - } + ? WELCOME_CONVERSATION : { ...DEFAULT_CONVERSATION_STATE, id: '', diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_conversation/sample_conversations.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_conversation/sample_conversations.tsx index 7cdf709192f70..85192f646963c 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_conversation/sample_conversations.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_conversation/sample_conversations.tsx @@ -13,35 +13,7 @@ export const WELCOME_CONVERSATION: Conversation = { id: '', title: WELCOME_CONVERSATION_TITLE, category: 'assistant', - messages: [ - { - role: 'assistant', - content: i18n.WELCOME_GENERAL, - timestamp: '', - presentation: { - delay: 2 * 1000, - stream: true, - }, - }, - { - role: 'assistant', - content: i18n.WELCOME_GENERAL_2, - timestamp: '', - presentation: { - delay: 1000, - stream: true, - }, - }, - { - role: 'assistant', - content: i18n.WELCOME_GENERAL_3, - timestamp: '', - presentation: { - delay: 1000, - stream: true, - }, - }, - ], + messages: [], replacements: {}, excludeFromLastConversationStorage: true, }; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/index.tsx index 78336f8a8b03d..65fca75623306 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/index.tsx @@ -73,7 +73,6 @@ export interface AssistantProviderProps { showAnonymizedValues: boolean; setIsStreaming: (isStreaming: boolean) => void; currentUserAvatar?: UserAvatar; - isFlyoutMode: boolean; }) => EuiCommentProps[]; http: HttpSetup; baseConversations: Record; @@ -114,7 +113,6 @@ export interface UseAssistantContext { showAnonymizedValues: boolean; currentUserAvatar?: UserAvatar; setIsStreaming: (isStreaming: boolean) => void; - isFlyoutMode: boolean; }) => EuiCommentProps[]; http: HttpSetup; knowledgeBase: KnowledgeBaseConfig; @@ -234,9 +232,7 @@ export const AssistantProvider: React.FC = ({ /** * Global Assistant Overlay actions */ - const [showAssistantOverlay, setShowAssistantOverlay] = useState( - (showAssistant) => {} - ); + const [showAssistantOverlay, setShowAssistantOverlay] = useState(() => {}); /** * Settings State diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_missing_callout/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_missing_callout/index.test.tsx index a131e63ae49c3..5465ca19e99de 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_missing_callout/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_missing_callout/index.test.tsx @@ -30,7 +30,6 @@ describe('connectorMissingCallout', () => { isConnectorConfigured={false} isSettingsModalVisible={false} setIsSettingsModalVisible={jest.fn()} - isFlyoutMode={false} /> ); @@ -45,7 +44,6 @@ describe('connectorMissingCallout', () => { isConnectorConfigured={true} isSettingsModalVisible={false} setIsSettingsModalVisible={jest.fn()} - isFlyoutMode={false} /> ); @@ -70,7 +68,6 @@ describe('connectorMissingCallout', () => { isConnectorConfigured={true} isSettingsModalVisible={false} setIsSettingsModalVisible={jest.fn()} - isFlyoutMode={false} /> ); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_missing_callout/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_missing_callout/index.tsx index 8853ca0a67d33..26ce2f736ed9a 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_missing_callout/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_missing_callout/index.tsx @@ -20,7 +20,6 @@ interface Props { isConnectorConfigured: boolean; isSettingsModalVisible: boolean; setIsSettingsModalVisible: React.Dispatch>; - isFlyoutMode: boolean; } /** @@ -31,7 +30,7 @@ interface Props { * TODO: Add setting for 'default connector' so we can auto-resolve and not even show this */ export const ConnectorMissingCallout: React.FC = React.memo( - ({ isConnectorConfigured, isSettingsModalVisible, setIsSettingsModalVisible, isFlyoutMode }) => { + ({ isConnectorConfigured, isSettingsModalVisible, setIsSettingsModalVisible }) => { const { assistantAvailability, setSelectedSettingsTab } = useAssistantContext(); const onConversationSettingsClicked = useCallback(() => { @@ -55,13 +54,10 @@ export const ConnectorMissingCallout: React.FC = React.memo( iconType="controlsVertical" size="m" title={i18n.MISSING_CONNECTOR_CALLOUT_TITLE} - css={ - isFlyoutMode && - css` - padding-left: ${euiLightVars.euiPanelPaddingModifiers.paddingMedium} !important; - padding-right: ${euiLightVars.euiPanelPaddingModifiers.paddingMedium} !important; - ` - } + css={css` + padding-left: ${euiLightVars.euiPanelPaddingModifiers.paddingMedium} !important; + padding-right: ${euiLightVars.euiPanelPaddingModifiers.paddingMedium} !important; + `} >

    { beforeEach(() => { jest.clearAllMocks(); }); - it('renders empty selection if no selected connector is provided', () => { + it('renders add new connector button if no selected connector is provided', () => { const { getByTestId } = render( ); - expect(getByTestId('connector-selector')).toBeInTheDocument(); - expect(getByTestId('connector-selector')).toHaveTextContent(''); + fireEvent.click(getByTestId('connector-selector')); + expect(getByTestId('addNewConnectorButton')).toBeInTheDocument(); }); it('renders with provided selected connector', () => { const { getByTestId } = render( diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_selector/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_selector/index.tsx index 410ee650c43ef..ad0fffc44e6b5 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_selector/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_selector/index.tsx @@ -30,7 +30,6 @@ interface Props { selectedConnectorId?: string; displayFancy?: (displayText: string) => React.ReactNode; setIsOpen?: (isOpen: boolean) => void; - isFlyoutMode: boolean; stats?: AttackDiscoveryStats | null; } @@ -47,7 +46,6 @@ export const ConnectorSelector: React.FC = React.memo( selectedConnectorId, onConnectorSelectionChange, setIsOpen, - isFlyoutMode, stats = null, }) => { const { actionTypeRegistry, http, assistantAvailability } = useAssistantContext(); @@ -177,7 +175,7 @@ export const ConnectorSelector: React.FC = React.memo( return ( <> - {isFlyoutMode && !connectorExists && !connectorOptions.length ? ( + {!connectorExists && !connectorOptions.length ? ( ({ jest.mock('../use_load_connectors', () => ({ useLoadConnectors: jest.fn(() => { return { - data: [], + data: mockConnectors, error: null, isSuccess: true, }; @@ -68,67 +67,61 @@ describe('ConnectorSelectorInline', () => { jest.clearAllMocks(); }); it('renders empty view if no selected conversation is provided', () => { - const { getByText } = render( + const { getByTestId } = render( ); - expect(getByText(i18n.INLINE_CONNECTOR_PLACEHOLDER)).toBeInTheDocument(); + fireEvent.click(getByTestId('connector-selector')); + expect(getByTestId('addNewConnectorButton')).toBeInTheDocument(); }); it('renders empty view if selectedConnectorId is NOT in list of connectors', () => { - const { getByText } = render( + const { getByTestId } = render( ); - expect(getByText(i18n.INLINE_CONNECTOR_PLACEHOLDER)).toBeInTheDocument(); + fireEvent.click(getByTestId('connector-selector')); + expect(getByTestId('addNewConnectorButton')).toBeInTheDocument(); }); - it('Clicking add connector button opens the connector selector', () => { - const { getByTestId, queryByTestId } = render( + it('renders the connector selector', () => { + const { getByTestId } = render( ); - expect(queryByTestId('connector-selector')).not.toBeInTheDocument(); - fireEvent.click(getByTestId('connectorSelectorPlaceholderButton')); expect(getByTestId('connector-selector')).toBeInTheDocument(); }); it('On connector change, update conversation API config', () => { const connectorTwo = mockConnectors[1]; - const { getByTestId, queryByTestId } = render( + const { getByTestId } = render( ); - fireEvent.click(getByTestId('connectorSelectorPlaceholderButton')); fireEvent.click(getByTestId('connector-selector')); fireEvent.click(getByTestId(connectorTwo.id)); - expect(queryByTestId('connector-selector')).not.toBeInTheDocument(); expect(setApiConfig).toHaveBeenCalledWith({ apiConfig: { actionTypeId: '.gen-ai', @@ -151,16 +144,13 @@ describe('ConnectorSelectorInline', () => { ); - fireEvent.click(getByTestId('connectorSelectorPlaceholderButton')); fireEvent.click(getByTestId('connector-selector')); - fireEvent.click(getByTestId('addNewConnectorButton')); expect(getByTestId('connector-selector')).toBeInTheDocument(); expect(setApiConfig).not.toHaveBeenCalled(); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_selector_inline/connector_selector_inline.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_selector_inline/connector_selector_inline.tsx index ebf762530af11..19e5db98a74fa 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_selector_inline/connector_selector_inline.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_selector_inline/connector_selector_inline.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; import React, { useCallback, useState } from 'react'; import { css } from '@emotion/css'; @@ -13,8 +13,6 @@ import { euiThemeVars } from '@kbn/ui-theme'; import type { AttackDiscoveryStats } from '@kbn/elastic-assistant-common'; import { AIConnector, ConnectorSelector } from '../connector_selector'; import { Conversation } from '../../..'; -import { useLoadConnectors } from '../use_load_connectors'; -import * as i18n from '../translations'; import { useAssistantContext } from '../../assistant_context'; import { useConversation } from '../../assistant/use_conversation'; import { getGenAiConfig } from '../helpers'; @@ -25,7 +23,6 @@ interface Props { isDisabled?: boolean; selectedConnectorId?: string; selectedConversation?: Conversation; - isFlyoutMode: boolean; onConnectorIdSelected?: (connectorId: string) => void; onConnectorSelected?: (conversation: Conversation) => void; stats?: AttackDiscoveryStats | null; @@ -53,14 +50,6 @@ const inputDisplayClassName = css` text-overflow: ellipsis; `; -const placeholderButtonClassName = css` - overflow: hidden; - text-overflow: ellipsis; - max-width: 400px; - font-weight: normal; - padding: 0 14px 0 0; -`; - /** * A compact wrapper of the ConnectorSelector component used in the Settings modal. */ @@ -69,29 +58,16 @@ export const ConnectorSelectorInline: React.FC = React.memo( isDisabled = false, selectedConnectorId, selectedConversation, - isFlyoutMode, - onConnectorIdSelected, onConnectorSelected, stats = null, }) => { const [isOpen, setIsOpen] = useState(false); - const { assistantAvailability, http } = useAssistantContext(); + const { assistantAvailability } = useAssistantContext(); const { setApiConfig } = useConversation(); - const { data: aiConnectors } = useLoadConnectors({ - http, - }); - - const selectedConnectorName = - (aiConnectors ?? []).find((c) => c.id === selectedConnectorId)?.name ?? - i18n.INLINE_CONNECTOR_PLACEHOLDER; const localIsDisabled = isDisabled || !assistantAvailability.hasConnectorsReadPrivilege; - const onConnectorClick = useCallback(() => { - setIsOpen(!isOpen); - }, [isOpen]); - const onChange = useCallback( async (connector: AIConnector) => { const connectorId = connector.id; @@ -129,40 +105,6 @@ export const ConnectorSelectorInline: React.FC = React.memo( [selectedConversation, setApiConfig, onConnectorIdSelected, onConnectorSelected] ); - if (isFlyoutMode) { - return ( - - - ( - - {displayText} - - )} - isOpen={isOpen} - isDisabled={localIsDisabled} - selectedConnectorId={selectedConnectorId} - setIsOpen={setIsOpen} - onConnectorSelectionChange={onChange} - isFlyoutMode={isFlyoutMode} - stats={stats} - /> - - - ); - } - return ( = React.memo( responsive={false} > - {isOpen ? ( - ( - - {displayText} - - )} - isOpen - isDisabled={localIsDisabled} - selectedConnectorId={selectedConnectorId} - setIsOpen={setIsOpen} - onConnectorSelectionChange={onChange} - isFlyoutMode={isFlyoutMode} - stats={stats} - /> - ) : ( - - ( + - {selectedConnectorName} - - - )} + {displayText} + + )} + isOpen={isOpen} + isDisabled={localIsDisabled} + selectedConnectorId={selectedConnectorId} + setIsOpen={setIsOpen} + onConnectorSelectionChange={onChange} + stats={stats} + /> ); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_setup/helpers.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_setup/helpers.tsx deleted file mode 100644 index cb11ca51047f0..0000000000000 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_setup/helpers.tsx +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { Conversation } from '../../assistant_context/types'; - -/** - * Removes all presentation data from the conversation - * @param conversation - */ -export const clearPresentationData = (conversation: Conversation): Conversation => { - const { messages, ...restConversation } = conversation; - return { - ...restConversation, - messages: messages.map((message) => { - const { presentation, ...restMessages } = message; - return { - ...restMessages, - presentation: undefined, - }; - }), - }; -}; - -/** - * Returns true if the conversation has no presentation data - * @param conversation - */ -export const conversationHasNoPresentationData = (conversation: Conversation): boolean => - !conversation.messages.some((message) => message.presentation !== undefined); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_setup/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_setup/index.test.tsx index cf46b5886a389..b6eaa4578d4a0 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_setup/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_setup/index.test.tsx @@ -6,19 +6,15 @@ */ import React from 'react'; -import { useConnectorSetup } from '.'; -import { act, renderHook } from '@testing-library/react-hooks'; import { fireEvent, render } from '@testing-library/react'; import { welcomeConvo } from '../../mock/conversation'; import { TestProviders } from '../../mock/test_providers/test_providers'; -import { EuiCommentList } from '@elastic/eui'; +import { ConnectorSetup } from '.'; -const onSetupComplete = jest.fn(); const onConversationUpdate = jest.fn(); const defaultProps = { conversation: welcomeConvo, - onSetupComplete, onConversationUpdate, }; const newConnector = { actionTypeId: '.gen-ai', name: 'cool name' }; @@ -50,121 +46,40 @@ jest.mock('../../assistant/use_conversation', () => ({ })); jest.spyOn(global, 'clearTimeout'); -describe('useConnectorSetup', () => { +describe('ConnectorSetup', () => { beforeEach(() => { jest.clearAllMocks(); }); - it('should render comments and prompts', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => useConnectorSetup(defaultProps), { - wrapper: ({ children }) => {children}, - }); - await waitForNextUpdate(); - expect( - result.current.comments.map((c) => ({ username: c.username, timestamp: c.timestamp })) - ).toEqual([ - { - username: 'You', - timestamp: `at: ${new Date('2024-03-18T18:59:18.174Z').toLocaleString()}`, - }, - { - username: 'Assistant', - timestamp: `at: ${new Date('2024-03-19T18:59:18.174Z').toLocaleString()}`, - }, - ]); - - expect(result.current.prompt.props['data-test-subj']).toEqual('prompt'); + it('should render action type selector', async () => { + const { getByTestId } = render(, { + wrapper: TestProviders, }); + + expect(getByTestId('modal-mock')).toBeInTheDocument(); }); - it('should set api config for each conversation when new connector is saved', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => useConnectorSetup(defaultProps), { - wrapper: ({ children }) => {children}, - }); - await waitForNextUpdate(); - const { getByTestId, queryByTestId, rerender } = render(result.current.prompt, { - wrapper: TestProviders, - }); - expect(getByTestId('connectorButton')).toBeInTheDocument(); - expect(queryByTestId('skip-setup-button')).not.toBeInTheDocument(); - fireEvent.click(getByTestId('connectorButton')); - rerender(result.current.prompt); - fireEvent.click(getByTestId('modal-mock')); - expect(setApiConfig).toHaveBeenCalledTimes(1); + it('should set api config for each conversation when new connector is saved', async () => { + const { getByTestId } = render(, { + wrapper: TestProviders, }); + + fireEvent.click(getByTestId('modal-mock')); + expect(setApiConfig).toHaveBeenCalledTimes(1); }); it('should NOT set the api config for each conversation when a new connector is saved and updateConversationsOnSaveConnector is false', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook( - () => - useConnectorSetup({ - ...defaultProps, - updateConversationsOnSaveConnector: false, // <-- don't update the conversations - }), - { - wrapper: ({ children }) => {children}, - } - ); - await waitForNextUpdate(); - const { getByTestId, queryByTestId, rerender } = render(result.current.prompt, { + const { getByTestId } = render( + , + { wrapper: TestProviders, - }); - expect(getByTestId('connectorButton')).toBeInTheDocument(); - expect(queryByTestId('skip-setup-button')).not.toBeInTheDocument(); - fireEvent.click(getByTestId('connectorButton')); + } + ); - rerender(result.current.prompt); - fireEvent.click(getByTestId('modal-mock')); + fireEvent.click(getByTestId('modal-mock')); - expect(setApiConfig).not.toHaveBeenCalled(); - }); - }); - - it('should show skip button if message has presentation data', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook( - () => - useConnectorSetup({ - ...defaultProps, - conversation: { - ...defaultProps.conversation, - messages: [ - { - ...defaultProps.conversation.messages[0], - presentation: { - delay: 0, - stream: false, - }, - }, - ], - }, - }), - { - wrapper: ({ children }) => {children}, - } - ); - await waitForNextUpdate(); - const { getByTestId, queryByTestId } = render(result.current.prompt, { - wrapper: TestProviders, - }); - expect(getByTestId('skip-setup-button')).toBeInTheDocument(); - expect(queryByTestId('connectorButton')).not.toBeInTheDocument(); - }); - }); - it('should call onSetupComplete and setConversations when onHandleMessageStreamingComplete', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => useConnectorSetup(defaultProps), { - wrapper: ({ children }) => {children}, - }); - await waitForNextUpdate(); - render(, { - wrapper: TestProviders, - }); - - expect(clearTimeout).toHaveBeenCalled(); - expect(onSetupComplete).toHaveBeenCalled(); - }); + expect(setApiConfig).not.toHaveBeenCalled(); }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_setup/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_setup/index.tsx index 81166bbf90fa1..a27da69709c38 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_setup/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/connector_setup/index.tsx @@ -5,181 +5,44 @@ * 2.0. */ -import React, { useCallback, useMemo, useRef, useState } from 'react'; -import type { EuiCommentProps } from '@elastic/eui'; -import { EuiAvatar, EuiBadge, EuiMarkdownFormat, EuiText, EuiTextAlign } from '@elastic/eui'; -import styled from '@emotion/styled'; -import { css } from '@emotion/react'; +import React, { useCallback, useMemo, useState } from 'react'; import { ActionConnector } from '@kbn/triggers-actions-ui-plugin/public/common/constants'; import { ActionType } from '@kbn/triggers-actions-ui-plugin/public'; import { AddConnectorModal } from '../add_connector_modal'; import { WELCOME_CONVERSATION } from '../../assistant/use_conversation/sample_conversations'; -import { Conversation, ClientMessage } from '../../..'; +import { Conversation } from '../../..'; import { useLoadActionTypes } from '../use_load_action_types'; -import { StreamingText } from '../../assistant/streaming_text'; -import { ConnectorButton } from '../connector_button'; import { useConversation } from '../../assistant/use_conversation'; -import { conversationHasNoPresentationData } from './helpers'; -import * as i18n from '../translations'; import { useAssistantContext } from '../../assistant_context'; import { useLoadConnectors } from '../use_load_connectors'; -import { AssistantAvatar } from '../../assistant/assistant_avatar/assistant_avatar'; import { getGenAiConfig } from '../helpers'; -const ConnectorButtonWrapper = styled.div` - margin-bottom: 10px; -`; - export interface ConnectorSetupProps { conversation?: Conversation; - isFlyoutMode?: boolean; - onSetupComplete?: () => void; onConversationUpdate?: ({ cId, cTitle }: { cId: string; cTitle: string }) => Promise; updateConversationsOnSaveConnector?: boolean; } -export const useConnectorSetup = ({ +export const ConnectorSetup = ({ conversation: defaultConversation, - isFlyoutMode, - onSetupComplete, onConversationUpdate, updateConversationsOnSaveConnector = true, -}: ConnectorSetupProps): { - comments: EuiCommentProps[]; - prompt: React.ReactElement; -} => { +}: ConnectorSetupProps) => { const conversation = useMemo( - () => - defaultConversation || { - ...WELCOME_CONVERSATION, - messages: !isFlyoutMode ? WELCOME_CONVERSATION.messages : [], - }, - [defaultConversation, isFlyoutMode] + () => defaultConversation || WELCOME_CONVERSATION, + [defaultConversation] ); const { setApiConfig } = useConversation(); - const bottomRef = useRef(null); // Access all conversations so we can add connector to all on initial setup const { actionTypeRegistry, http } = useAssistantContext(); - const { - data: connectors, - isSuccess: areConnectorsFetched, - refetch: refetchConnectors, - } = useLoadConnectors({ http }); - const isConnectorConfigured = areConnectorsFetched && !!connectors?.length; + const { refetch: refetchConnectors } = useLoadConnectors({ http }); - const [isConnectorModalVisible, setIsConnectorModalVisible] = useState(false); - const [showAddConnectorButton, setShowAddConnectorButton] = useState(() => { - // If no presentation data on messages, default to showing add connector button so it doesn't delay render and flash on screen - return conversationHasNoPresentationData(conversation); - }); const { data: actionTypes } = useLoadActionTypes({ http }); const [selectedActionType, setSelectedActionType] = useState(null); - const lastConversationMessageIndex = useMemo( - () => conversation.messages.length - 1, - [conversation.messages.length] - ); - - const [currentMessageIndex, setCurrentMessageIndex] = useState( - // If connector is configured or conversation has already been replayed show all messages immediately - isConnectorConfigured || conversationHasNoPresentationData(conversation) - ? lastConversationMessageIndex - : 0 - ); - - const streamingTimeoutRef = useRef(undefined); - - // Once streaming of previous message is complete, proceed to next message - const onHandleMessageStreamingComplete = useCallback(() => { - if (currentMessageIndex === lastConversationMessageIndex) { - clearTimeout(streamingTimeoutRef.current); - return; - } - streamingTimeoutRef.current = window.setTimeout(() => { - bottomRef.current?.scrollIntoView({ block: 'end' }); - return setCurrentMessageIndex(currentMessageIndex + 1); - }, conversation.messages[currentMessageIndex]?.presentation?.delay ?? 0); - return () => clearTimeout(streamingTimeoutRef.current); - }, [conversation.messages, currentMessageIndex, lastConversationMessageIndex]); - - // Show button to add connector after last message has finished streaming - const onHandleLastMessageStreamingComplete = useCallback(() => { - setShowAddConnectorButton(true); - bottomRef.current?.scrollIntoView({ block: 'end' }); - onSetupComplete?.(); - }, [onSetupComplete]); - - // Show button to add connector after last message has finished streaming - const handleSkipSetup = useCallback(() => { - setCurrentMessageIndex(lastConversationMessageIndex); - }, [lastConversationMessageIndex]); - - // Create EuiCommentProps[] from conversation messages - const commentBody = useCallback( - (message: ClientMessage, index: number, length: number) => { - // If timestamp is not set, set it to current time (will update conversation at end of setup) - if ( - conversation.messages[index].timestamp == null || - conversation.messages[index].timestamp.length === 0 - ) { - conversation.messages[index].timestamp = new Date().toISOString(); - } - const isLastMessage = index === length - 1; - const enableStreaming = - (message?.presentation?.stream ?? false) && currentMessageIndex !== length - 1; - return ( - - {(streamedText, isStreamingComplete) => ( - - {streamedText} - - - )} - - ); - }, - [ - conversation.messages, - currentMessageIndex, - onHandleLastMessageStreamingComplete, - onHandleMessageStreamingComplete, - ] - ); - - const comments = useMemo( - () => - conversation.messages.slice(0, currentMessageIndex + 1).map((message, index) => { - const isUser = message.role === 'user'; - const timestamp = `${i18n.CONNECTOR_SETUP_TIMESTAMP_AT}: ${new Date( - message.timestamp - ).toLocaleString()}`; - const commentProps: EuiCommentProps = { - username: isUser ? i18n.CONNECTOR_SETUP_USER_YOU : i18n.CONNECTOR_SETUP_USER_ASSISTANT, - children: commentBody(message, index, conversation.messages.length), - timelineAvatar: ( - - ), - timestamp, - }; - return commentProps; - }), - [commentBody, conversation.messages, currentMessageIndex] - ); - const onSaveConnector = useCallback( async (connector: ActionConnector) => { if (updateConversationsOnSaveConnector) { @@ -204,7 +67,6 @@ export const useConnectorSetup = ({ }); refetchConnectors?.(); - setIsConnectorModalVisible(false); } } else { refetchConnectors?.(); @@ -221,65 +83,17 @@ export const useConnectorSetup = ({ const handleClose = useCallback(() => { setSelectedActionType(null); - setIsConnectorModalVisible(false); }, []); - return { - comments: isFlyoutMode ? [] : comments, - prompt: isFlyoutMode ? ( -

    - -
    - ) : ( -
    - {showAddConnectorButton && ( - - - - )} - {!showAddConnectorButton && ( - - - - {i18n.CONNECTOR_SETUP_SKIP} - - - - )} - {isConnectorModalVisible && ( - - )} -
    - ), - }; + return ( + + ); }; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts b/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts index 387c1d01422f6..3324d09b50a5a 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/content/prompts/welcome/translations.ts @@ -7,30 +7,6 @@ import { i18n } from '@kbn/i18n'; -export const WELCOME_GENERAL = i18n.translate( - 'xpack.elasticAssistant.securityAssistant.content.prompts.welcome.welcomeGeneralPrompt', - { - defaultMessage: - 'Welcome to your Elastic AI Assistant! I am your 100% open-code portal into your Elastic life. In time, I will be able to answer questions and provide assistance across all your information in Elastic, and oh-so much more. Till then, I hope this early preview will open your mind to the possibilities of what we can create when we work together, in the open. Cheers!', - } -); - -export const WELCOME_GENERAL_2 = i18n.translate( - 'xpack.elasticAssistant.securityAssistant.content.prompts.welcome.welcomeGeneral2Prompt', - { - defaultMessage: - "First things first, we'll need to set up a Generative AI Connector to get this chat experience going! With the Generative AI Connector, you'll be able to configure access to either an OpenAI service or an Amazon Bedrock service, but you better believe you'll be able to deploy your own models within your Elastic Cloud instance and use those here in the future... 😉", - } -); - -export const WELCOME_GENERAL_3 = i18n.translate( - 'xpack.elasticAssistant.securityAssistant.content.prompts.welcome.welcomeGeneral3Prompt', - { - defaultMessage: - 'Go ahead and click the add connector button below to continue the conversation!', - } -); - export const ENTERPRISE = i18n.translate( 'xpack.elasticAssistant.securityAssistant.content.prompts.welcome.enterprisePrompt', { diff --git a/x-pack/packages/kbn-elastic-assistant/impl/data_anonymization_editor/context_preview.tsx b/x-pack/packages/kbn-elastic-assistant/impl/data_anonymization_editor/context_preview.tsx index 91b676c491e47..49d5d0fe4d63d 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/data_anonymization_editor/context_preview.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/data_anonymization_editor/context_preview.tsx @@ -48,6 +48,7 @@ const SelectedPromptContextPreviewComponent = ({ return ( { rawData: 'test-raw-data', }; - it('renders stats', () => { - render( - - - - ); - - expect(screen.getByTestId('stats')).toBeInTheDocument(); - }); - describe('when rawData is a string (non-anonymized data)', () => { it('renders the ReadOnlyContextViewer when rawData is (non-anonymized data)', () => { render( @@ -61,7 +45,6 @@ describe('DataAnonymizationEditor', () => { selectedPromptContext={mockSelectedPromptContext} setSelectedPromptContexts={jest.fn()} currentReplacements={{}} - isFlyoutMode={false} /> ); @@ -76,7 +59,6 @@ describe('DataAnonymizationEditor', () => { selectedPromptContext={mockSelectedPromptContext} setSelectedPromptContexts={jest.fn()} currentReplacements={{}} - isFlyoutMode={false} /> ); @@ -105,24 +87,17 @@ describe('DataAnonymizationEditor', () => { selectedPromptContext={selectedPromptContextWithAnonymized} setSelectedPromptContexts={setSelectedPromptContexts} currentReplacements={{}} - isFlyoutMode={false} /> ); }); - it('renders the ContextEditor when rawData is anonymized data', () => { - expect(screen.getByTestId('contextEditor')).toBeInTheDocument(); + it('renders the SelectedPromptContextPreview when rawData is anonymized data', () => { + expect(screen.getByTestId('selectedPromptContextPreview')).toBeInTheDocument(); }); it('does NOT render the ReadOnlyContextViewer when rawData is anonymized data', () => { expect(screen.queryByTestId('readOnlyContextViewer')).not.toBeInTheDocument(); }); - - it('calls setSelectedPromptContexts when a field is toggled', () => { - userEvent.click(screen.getAllByTestId('allowed')[0]); // toggle the first field - - expect(setSelectedPromptContexts).toBeCalled(); - }); }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/data_anonymization_editor/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/data_anonymization_editor/index.tsx index 1fd0e31c78767..0794ca4330350 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/data_anonymization_editor/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/data_anonymization_editor/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { EuiPanel, EuiSpacer } from '@elastic/eui'; +import { EuiPanel } from '@elastic/eui'; import React, { useCallback, useMemo } from 'react'; import styled from '@emotion/styled'; import { AnonymizedData } from '@kbn/elastic-assistant-common/impl/data_anonymization/types'; @@ -14,9 +14,7 @@ import { BatchUpdateListItem } from './context_editor/types'; import { getIsDataAnonymizable, updateSelectedPromptContext } from './helpers'; import { ReadOnlyContextViewer } from './read_only_context_viewer'; import { ContextEditorFlyout } from './context_editor_flyout'; -import { ContextEditor } from './context_editor'; import { ReplacementsContextViewer } from './replacements_context_viewer'; -import { Stats } from './stats'; const EditorContainer = styled.div` overflow-x: auto; @@ -28,14 +26,12 @@ export interface Props { React.SetStateAction> >; currentReplacements: AnonymizedData['replacements'] | undefined; - isFlyoutMode: boolean; } const DataAnonymizationEditorComponent: React.FC = ({ selectedPromptContext, setSelectedPromptContexts, currentReplacements, - isFlyoutMode, }) => { const isDataAnonymizable = useMemo( () => getIsDataAnonymizable(selectedPromptContext.rawData), @@ -63,66 +59,27 @@ const DataAnonymizationEditorComponent: React.FC = ({ [selectedPromptContext, setSelectedPromptContexts] ); - if (isFlyoutMode) { - return ( - - - {typeof selectedPromptContext.rawData === 'string' ? ( - selectedPromptContext.replacements != null ? ( - - ) : ( - - ) - ) : ( - - )} - - - ); - } - return ( - - - - - {typeof selectedPromptContext.rawData === 'string' ? ( - selectedPromptContext.replacements != null ? ( - + + {typeof selectedPromptContext.rawData === 'string' ? ( + selectedPromptContext.replacements != null ? ( + + ) : ( + + ) ) : ( - - ) - ) : ( - - )} + + )} + ); }; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/mock/get_anonymized_value/index.ts b/x-pack/packages/kbn-elastic-assistant/impl/mock/get_anonymized_value/index.ts index a6d5c4e5d3972..256f9776c4563 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/mock/get_anonymized_value/index.ts +++ b/x-pack/packages/kbn-elastic-assistant/impl/mock/get_anonymized_value/index.ts @@ -5,13 +5,6 @@ * 2.0. */ -import { Replacements } from '@kbn/elastic-assistant-common'; - /** This mock returns the reverse of `value` */ -export const mockGetAnonymizedValue = ({ - currentReplacements, - rawValue, -}: { - currentReplacements: Replacements | undefined; - rawValue: string; -}): string => rawValue.split('').reverse().join(''); +export const mockGetAnonymizedValue = ({ rawValue }: { rawValue: string }): string => + rawValue.split('').reverse().join(''); diff --git a/x-pack/packages/kbn-entities-schema/src/schema/common.ts b/x-pack/packages/kbn-entities-schema/src/schema/common.ts index b0d4b7247d12c..bb9d07b1957f4 100644 --- a/x-pack/packages/kbn-entities-schema/src/schema/common.ts +++ b/x-pack/packages/kbn-entities-schema/src/schema/common.ts @@ -96,3 +96,9 @@ export const identityFieldsSchema = z optional: z.boolean(), }) .or(z.string().transform((value) => ({ field: value, optional: false }))); + +const semVerRegex = new RegExp(/^[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$/); +export const semVerSchema = z.string().refine((maybeSemVer) => semVerRegex.test(maybeSemVer), { + message: + 'The string does use the Semantic Versioning (Semver) format of {major}.{minor}.{patch} (e.g., 1.0.0), ensure each part contains only digits.', +}); diff --git a/x-pack/packages/kbn-entities-schema/src/schema/entity.ts b/x-pack/packages/kbn-entities-schema/src/schema/entity.ts index 8e5c411c2489e..58a9c011091b4 100644 --- a/x-pack/packages/kbn-entities-schema/src/schema/entity.ts +++ b/x-pack/packages/kbn-entities-schema/src/schema/entity.ts @@ -13,7 +13,6 @@ const entitySchema = z.object({ id: z.string(), identityFields: arrayOfStringsSchema, displayName: z.string(), - spaceId: z.string(), metrics: z.record(z.string(), z.number()), }), }); diff --git a/x-pack/packages/kbn-entities-schema/src/schema/entity_definition.ts b/x-pack/packages/kbn-entities-schema/src/schema/entity_definition.ts index 15f3e98582c97..8fee16117b9c6 100644 --- a/x-pack/packages/kbn-entities-schema/src/schema/entity_definition.ts +++ b/x-pack/packages/kbn-entities-schema/src/schema/entity_definition.ts @@ -13,10 +13,12 @@ import { filterSchema, durationSchema, identityFieldsSchema, + semVerSchema, } from './common'; export const entityDefinitionSchema = z.object({ id: z.string().regex(/^[\w-]+$/), + version: semVerSchema, name: z.string(), description: z.optional(z.string()), type: z.string(), diff --git a/x-pack/packages/kbn-langchain/server/language_models/chat_openai.ts b/x-pack/packages/kbn-langchain/server/language_models/chat_openai.ts index 391609db21565..c20de3be57e07 100644 --- a/x-pack/packages/kbn-langchain/server/language_models/chat_openai.ts +++ b/x-pack/packages/kbn-langchain/server/language_models/chat_openai.ts @@ -138,9 +138,10 @@ export class ActionsClientChatOpenAI extends ChatOpenAI { return this.caller.call(async () => { const requestBody = this.formatRequestForActionsClient(completionRequest); this.#logger.debug( - `${LLM_TYPE}#completionWithRetry ${this.#traceId} assistantMessage:\n${JSON.stringify( - requestBody.params.subActionParams - )} ` + () => + `${LLM_TYPE}#completionWithRetry ${this.#traceId} assistantMessage:\n${JSON.stringify( + requestBody.params.subActionParams + )} ` ); const actionResult = await this.#actionsClient.execute(requestBody); diff --git a/x-pack/packages/kbn-langchain/server/language_models/llm.ts b/x-pack/packages/kbn-langchain/server/language_models/llm.ts index bad538821ff1d..8ebf62e8c31f0 100644 --- a/x-pack/packages/kbn-langchain/server/language_models/llm.ts +++ b/x-pack/packages/kbn-langchain/server/language_models/llm.ts @@ -84,9 +84,10 @@ export class ActionsClientLlm extends LLM { // convert the Langchain prompt to an assistant message: const assistantMessage = getMessageContentAndRole(prompt); this.#logger.debug( - `ActionsClientLlm#_call\ntraceId: ${this.#traceId}\nassistantMessage:\n${JSON.stringify( - assistantMessage - )} ` + () => + `ActionsClientLlm#_call\ntraceId: ${this.#traceId}\nassistantMessage:\n${JSON.stringify( + assistantMessage + )} ` ); // create a new connector request body with the assistant message: const requestBody = { diff --git a/x-pack/packages/kbn-langchain/server/language_models/simple_chat_model.ts b/x-pack/packages/kbn-langchain/server/language_models/simple_chat_model.ts index ed38723993876..4bd77919d9fce 100644 --- a/x-pack/packages/kbn-langchain/server/language_models/simple_chat_model.ts +++ b/x-pack/packages/kbn-langchain/server/language_models/simple_chat_model.ts @@ -102,9 +102,10 @@ export class ActionsClientSimpleChatModel extends SimpleChatModel { formattedMessages.push(getMessageContentAndRole(message.content, message._getType())); }); this.#logger.debug( - `ActionsClientSimpleChatModel#_call\ntraceId: ${ - this.#traceId - }\nassistantMessage:\n${JSON.stringify(formattedMessages)} ` + () => + `ActionsClientSimpleChatModel#_call\ntraceId: ${ + this.#traceId + }\nassistantMessage:\n${JSON.stringify(formattedMessages)} ` ); // create a new connector request body with the assistant message: const requestBody = { diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/tracers/README.mdx b/x-pack/packages/kbn-langchain/server/tracers/README.mdx similarity index 100% rename from x-pack/plugins/elastic_assistant/server/lib/langchain/tracers/README.mdx rename to x-pack/packages/kbn-langchain/server/tracers/README.mdx diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/tracers/apm_tracer.ts b/x-pack/packages/kbn-langchain/server/tracers/apm/apm_tracer.ts similarity index 80% rename from x-pack/plugins/elastic_assistant/server/lib/langchain/tracers/apm_tracer.ts rename to x-pack/packages/kbn-langchain/server/tracers/apm/apm_tracer.ts index ba4baef0433ad..b0843c1c50d8d 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/langchain/tracers/apm_tracer.ts +++ b/x-pack/packages/kbn-langchain/server/tracers/apm/apm_tracer.ts @@ -77,12 +77,12 @@ export class APMTracer extends BaseTracer implements LangChainTracerFields { } async onRetrieverStart(run: Run): Promise { - this.logger.debug(`onRetrieverStart: run:\n${JSON.stringify(run, null, 2)}`); + this.logger.debug(() => `onRetrieverStart: run:\n${JSON.stringify(run, null, 2)}`); this.createAndAddSpanFromRun(run, this.retrieverSpans); } async onRetrieverEnd(run: Run): Promise { - this.logger.debug(`onRetrieverEnd: run:\n${JSON.stringify(run, null, 2)}`); + this.logger.debug(() => `onRetrieverEnd: run:\n${JSON.stringify(run, null, 2)}`); const span = this.retrieverSpans.pop(); if (span != null) { span.addLabels(this._getLabelsFromRun(run)); @@ -91,16 +91,16 @@ export class APMTracer extends BaseTracer implements LangChainTracerFields { } async onRetrieverError(run: Run): Promise { - this.logger.debug(`onRetrieverError: run:\n${JSON.stringify(run, null, 2)}`); + this.logger.debug(() => `onRetrieverError: run:\n${JSON.stringify(run, null, 2)}`); } async onLLMStart(run: Run): Promise { - this.logger.debug(`onLLMStart: run:\n${JSON.stringify(run, null, 2)}`); + this.logger.debug(() => `onLLMStart: run:\n${JSON.stringify(run, null, 2)}`); this.createAndAddSpanFromRun(run, this.llmSpans); } async onLLMEnd(run: Run): Promise { - this.logger.debug(`onLLMEnd: run:\n${JSON.stringify(run, null, 2)}`); + this.logger.debug(() => `onLLMEnd: run:\n${JSON.stringify(run, null, 2)}`); const span = this.llmSpans.pop(); if (span != null) { span.addLabels(this._getLabelsFromRun(run)); @@ -109,16 +109,16 @@ export class APMTracer extends BaseTracer implements LangChainTracerFields { } async onLLMError(run: Run): Promise { - this.logger.debug(`onLLMError: run:\n${JSON.stringify(run, null, 2)}`); + this.logger.debug(() => `onLLMError: run:\n${JSON.stringify(run, null, 2)}`); } async onChainStart(run: Run): Promise { - this.logger.debug(`onChainStart: run:\n${JSON.stringify(run, null, 2)}`); + this.logger.debug(() => `onChainStart: run:\n${JSON.stringify(run, null, 2)}`); this.createAndAddSpanFromRun(run, this.chainSpans); } async onChainEnd(run: Run): Promise { - this.logger.debug(`onChainEnd: run:\n${JSON.stringify(run, null, 2)}`); + this.logger.debug(() => `onChainEnd: run:\n${JSON.stringify(run, null, 2)}`); const span = this.chainSpans.pop(); if (span != null) { span.addLabels(this._getLabelsFromRun(run)); @@ -127,16 +127,16 @@ export class APMTracer extends BaseTracer implements LangChainTracerFields { } async onChainError(run: Run): Promise { - this.logger.debug(`onChainError: run:\n${JSON.stringify(run, null, 2)}`); + this.logger.debug(() => `onChainError: run:\n${JSON.stringify(run, null, 2)}`); } async onToolStart(run: Run): Promise { - this.logger.debug(`onToolStart: run:\n${JSON.stringify(run, null, 2)}`); + this.logger.debug(() => `onToolStart: run:\n${JSON.stringify(run, null, 2)}`); this.createAndAddSpanFromRun(run, this.toolSpans); } async onToolEnd(run: Run): Promise { - this.logger.debug(`onToolEnd: run:\n${JSON.stringify(run, null, 2)}`); + this.logger.debug(() => `onToolEnd: run:\n${JSON.stringify(run, null, 2)}`); const span = this.toolSpans.pop(); if (span != null) { span.addLabels(this._getLabelsFromRun(run)); @@ -145,6 +145,6 @@ export class APMTracer extends BaseTracer implements LangChainTracerFields { } async onToolError(run: Run): Promise { - this.logger.debug(`onToolError: run:\n${JSON.stringify(run, null, 2)}`); + this.logger.debug(() => `onToolError: run:\n${JSON.stringify(run, null, 2)}`); } } diff --git a/x-pack/packages/kbn-langchain/server/tracers/apm/index.ts b/x-pack/packages/kbn-langchain/server/tracers/apm/index.ts new file mode 100644 index 0000000000000..293db467d740b --- /dev/null +++ b/x-pack/packages/kbn-langchain/server/tracers/apm/index.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { APMTracer } from './apm_tracer'; diff --git a/x-pack/packages/kbn-langchain/server/tracers/langsmith/index.ts b/x-pack/packages/kbn-langchain/server/tracers/langsmith/index.ts new file mode 100644 index 0000000000000..179a5aa297c7e --- /dev/null +++ b/x-pack/packages/kbn-langchain/server/tracers/langsmith/index.ts @@ -0,0 +1,7 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +export { getLangSmithTracer, isLangSmithEnabled } from './langsmith_tracer'; diff --git a/x-pack/packages/kbn-langchain/server/tracers/langsmith/langsmith_tracer.ts b/x-pack/packages/kbn-langchain/server/tracers/langsmith/langsmith_tracer.ts new file mode 100644 index 0000000000000..15501d22dbe09 --- /dev/null +++ b/x-pack/packages/kbn-langchain/server/tracers/langsmith/langsmith_tracer.ts @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Client } from 'langsmith'; +import type { Logger } from '@kbn/core/server'; +import { ToolingLog } from '@kbn/tooling-log'; +import { LangChainTracer } from '@langchain/core/tracers/tracer_langchain'; + +/** + * Returns a custom LangChainTracer which adds the `exampleId` so Dataset 'Test' runs are written to LangSmith + * If `exampleId` is present (and a corresponding example exists in LangSmith) trace is written to the Dataset's `Tests` + * section, otherwise it is written to the `Project` provided + * + * @param apiKey API Key for LangSmith (will fetch from env vars if not provided) + * @param projectName Name of project to trace results to + * @param exampleId Dataset exampleId to associate trace with + * @param logger + */ +export const getLangSmithTracer = ({ + apiKey, + projectName, + exampleId, + logger, +}: { + apiKey?: string; + projectName?: string; + exampleId?: string; + logger: Logger | ToolingLog; +}): LangChainTracer[] => { + try { + if (!isLangSmithEnabled() || apiKey == null) { + return []; + } + const lcTracer = new LangChainTracer({ + projectName, // Shows as the 'test' run's 'name' in langsmith ui + exampleId, + client: new Client({ apiKey }), + }); + + return [lcTracer]; + } catch (e) { + // Note: creating a tracer can fail if the LangSmith env vars are not set correctly + logger.error(`Error creating LangSmith tracer: ${e.message}`); + } + + return []; +}; + +/** + * Returns true if LangSmith/tracing is enabled + */ +export const isLangSmithEnabled = (): boolean => { + try { + // Just checking if apiKey is available, if better way to check for enabled that is not env var please update + const config = Client.getDefaultClientConfig(); + return config.apiKey != null; + } catch (e) { + return false; + } +}; diff --git a/x-pack/packages/kbn-langchain/tsconfig.json b/x-pack/packages/kbn-langchain/tsconfig.json index 949aca47794ec..e775b1a4ad50d 100644 --- a/x-pack/packages/kbn-langchain/tsconfig.json +++ b/x-pack/packages/kbn-langchain/tsconfig.json @@ -18,6 +18,7 @@ "@kbn/logging", "@kbn/actions-plugin", "@kbn/logging-mocks", - "@kbn/utility-types" + "@kbn/utility-types", + "@kbn/tooling-log" ] } diff --git a/x-pack/packages/ml/agg_utils/index.ts b/x-pack/packages/ml/agg_utils/index.ts index 2102522bea636..049623ffddb38 100644 --- a/x-pack/packages/ml/agg_utils/index.ts +++ b/x-pack/packages/ml/agg_utils/index.ts @@ -6,7 +6,7 @@ */ export { buildSamplerAggregation } from './src/build_sampler_aggregation'; -export { fetchAggIntervals } from './src/fetch_agg_intervals'; +export { fetchAggIntervals, type FetchAggIntervalsParams } from './src/fetch_agg_intervals'; export { fetchHistogramsForFields } from './src/fetch_histograms_for_fields'; export { DEFAULT_SAMPLER_SHARD_SIZE } from './src/field_histograms'; export { getSamplerAggregationsResponsePath } from './src/get_sampler_aggregations_response_path'; diff --git a/x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts b/x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts index 14dd0b850abef..f10977073f9bf 100644 --- a/x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts +++ b/x-pack/packages/ml/agg_utils/src/fetch_agg_intervals.ts @@ -22,30 +22,51 @@ import type { HistogramField, NumericColumnStatsMap } from './types'; const MAX_CHART_COLUMNS = 20; /** - * Returns aggregation intervals for the supplied document fields. + * Interface for the parameters required to fetch aggregation intervals. + */ +export interface FetchAggIntervalsParams { + /** The Elasticsearch client to use for the query. */ + esClient: ElasticsearchClient; + /** An optional abort signal to cancel the request. */ + abortSignal?: AbortSignal; + /** The arguments for the aggregation query. */ + arguments: { + /** The index pattern to query against. */ + indexPattern: string; + /** The query to filter documents. */ + query: estypes.QueryDslQueryContainer; + /** The fields to aggregate on. */ + fields: HistogramField[]; + /** The size of the sampler shard. */ + samplerShardSize: number; + /** Optional runtime mappings for the query. */ + runtimeMappings?: estypes.MappingRuntimeFields; + /** Optional probability for random sampling. */ + randomSamplerProbability?: number; + /** Optional seed for random sampling. */ + randomSamplerSeed?: number; + }; +} +/** + * Asynchronously fetches aggregation intervals from an Elasticsearch client. * - * @param client - The Elasticsearch client. - * @param indexPattern - The index pattern to search. - * @param query - The query to filter documents. - * @param fields - An array of field definitions for which aggregation intervals are requested. - * @param samplerShardSize - The shard size parameter for sampling aggregations. A value less than 1 indicates no sampling. - * @param runtimeMappings - Optional runtime mappings to apply. - * @param abortSignal - Optional AbortSignal for canceling the request. - * @param randomSamplerProbability - Optional probability value for random sampling. - * @param randomSamplerSeed - Optional seed value for random sampling. - * @returns A promise that resolves to a map of aggregation intervals for the specified fields. + * @param params - The parameters for fetching aggregation intervals. + * @returns A promise that resolves to a map of numeric column statistics. */ export const fetchAggIntervals = async ( - client: ElasticsearchClient, - indexPattern: string, - query: estypes.QueryDslQueryContainer, - fields: HistogramField[], - samplerShardSize: number, - runtimeMappings?: estypes.MappingRuntimeFields, - abortSignal?: AbortSignal, - randomSamplerProbability?: number, - randomSamplerSeed?: number + params: FetchAggIntervalsParams ): Promise => { + const { esClient, abortSignal, arguments: args } = params; + const { + indexPattern, + query, + fields, + samplerShardSize, + runtimeMappings, + randomSamplerProbability, + randomSamplerSeed, + } = args; + if ( samplerShardSize >= 1 && randomSamplerProbability !== undefined && @@ -77,7 +98,7 @@ export const fetchAggIntervals = async ( seed: randomSamplerSeed, }); - const body = await client.search( + const body = await esClient.search( { index: indexPattern, size: 0, diff --git a/x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts b/x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts index c6f1d6c5e0166..f74ebbaac3994 100644 --- a/x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts +++ b/x-pack/packages/ml/agg_utils/src/fetch_histograms_for_fields.ts @@ -167,32 +167,48 @@ export type FieldsForHistograms = Array< | UnsupportedHistogramField >; +interface FetchHistogramsForFieldsParams { + /** The Elasticsearch client to use for the query. */ + esClient: ElasticsearchClient; + /** An optional abort signal to cancel the request. */ + abortSignal?: AbortSignal; + /** The arguments for the aggregation query. */ + arguments: { + /** The index pattern to query against. */ + indexPattern: string; + /** The query to filter documents. */ + query: any; + /** The fields for which histograms are to be fetched. */ + fields: FieldsForHistograms; + /** The size of the sampler shard. */ + samplerShardSize: number; + /** Optional runtime mappings for the query. */ + runtimeMappings?: estypes.MappingRuntimeFields; + /** Optional probability for random sampling. */ + randomSamplerProbability?: number; + /** Optional seed for random sampling. */ + randomSamplerSeed?: number; + }; +} + /** - * Fetches data to be used in mini histogram charts. Supports auto-identifying - * the histogram interval and min/max values. + * Asynchronously fetches histograms for specified fields from an Elasticsearch client. * - * @param client Elasticsearch Client - * @param indexPattern index pattern to be queried - * @param query Elasticsearch query - * @param fields the fields the histograms should be generated for - * @param samplerShardSize shard_size parameter of the sampler aggregation - * @param runtimeMappings optional runtime mappings - * @param abortSignal optional abort signal - * @param randomSamplerProbability optional random sampler probability - * @param randomSamplerSeed optional random sampler seed - * @returns an array of histogram data for each supplied field + * @param params The parameters for fetching histograms. + * @returns A promise that resolves with the fetched histograms. */ -export const fetchHistogramsForFields = async ( - client: ElasticsearchClient, - indexPattern: string, - query: any, - fields: FieldsForHistograms, - samplerShardSize: number, - runtimeMappings?: estypes.MappingRuntimeFields, - abortSignal?: AbortSignal, - randomSamplerProbability?: number, - randomSamplerSeed?: number -) => { +export const fetchHistogramsForFields = async (params: FetchHistogramsForFieldsParams) => { + const { esClient, abortSignal, arguments: args } = params; + const { + indexPattern, + query, + fields, + samplerShardSize, + runtimeMappings, + randomSamplerProbability, + randomSamplerSeed, + } = args; + if ( samplerShardSize >= 1 && randomSamplerProbability !== undefined && @@ -202,17 +218,19 @@ export const fetchHistogramsForFields = async ( } const aggIntervals = { - ...(await fetchAggIntervals( - client, - indexPattern, - query, - fields.filter((f) => !isNumericHistogramFieldWithColumnStats(f)), - samplerShardSize, - runtimeMappings, + ...(await fetchAggIntervals({ + esClient, abortSignal, - randomSamplerProbability, - randomSamplerSeed - )), + arguments: { + indexPattern, + query, + fields: fields.filter((f) => !isNumericHistogramFieldWithColumnStats(f)), + samplerShardSize, + runtimeMappings, + randomSamplerProbability, + randomSamplerSeed, + }, + })), ...fields.filter(isNumericHistogramFieldWithColumnStats).reduce((p, field) => { const { interval, min, max, fieldName } = field; p[stringHash(fieldName)] = { interval, min, max }; @@ -259,7 +277,7 @@ export const fetchHistogramsForFields = async ( seed: randomSamplerSeed, }); - const body = await client.search( + const body = await esClient.search( { index: indexPattern, size: 0, diff --git a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_categories.ts b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_categories.ts index 99300b2bef2e6..56f2b57f2fee8 100644 --- a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_categories.ts +++ b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_categories.ts @@ -97,10 +97,10 @@ export const fetchCategories = async ( esClient: ElasticsearchClient, params: AiopsLogRateAnalysisSchema, fieldNames: string[], - logger: Logger, + logger?: Logger, // The default value of 1 means no sampling will be used sampleProbability: number = 1, - emitError: (m: string) => void, + emitError?: (m: string) => void, abortSignal?: AbortSignal ): Promise => { const randomSamplerWrapper = createRandomSamplerWrapper({ @@ -122,14 +122,19 @@ export const fetchCategories = async ( function reportError(fieldName: string, error: unknown) { if (!isRequestAbortedError(error)) { - logger.error( - `Failed to fetch category aggregation for fieldName "${fieldName}", got: \n${JSON.stringify( - error, - null, - 2 - )}` - ); - emitError(`Failed to fetch category aggregation for fieldName "${fieldName}".`); + if (logger) { + logger.error( + `Failed to fetch category aggregation for fieldName "${fieldName}", got: \n${JSON.stringify( + error, + null, + 2 + )}` + ); + } + + if (emitError) { + emitError(`Failed to fetch category aggregation for fieldName "${fieldName}".`); + } } } diff --git a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_category_counts.ts b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_category_counts.ts index 93018370a54ff..0879e5de7aeff 100644 --- a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_category_counts.ts +++ b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_category_counts.ts @@ -75,8 +75,8 @@ export const fetchCategoryCounts = async ( categories: FetchCategoriesResponse, from: number | undefined, to: number | undefined, - logger: Logger, - emitError: (m: string) => void, + logger?: Logger, + emitError?: (m: string) => void, abortSignal?: AbortSignal ): Promise => { const updatedCategories = cloneDeep(categories); @@ -101,14 +101,19 @@ export const fetchCategoryCounts = async ( ); } catch (error) { if (!isRequestAbortedError(error)) { - logger.error( - `Failed to fetch category counts for field name "${fieldName}", got: \n${JSON.stringify( - error, - null, - 2 - )}` - ); - emitError(`Failed to fetch category counts for field name "${fieldName}".`); + if (logger) { + logger.error( + `Failed to fetch category counts for field name "${fieldName}", got: \n${JSON.stringify( + error, + null, + 2 + )}` + ); + } + + if (emitError) { + emitError(`Failed to fetch category counts for field name "${fieldName}".`); + } } return updatedCategories; } @@ -118,14 +123,19 @@ export const fetchCategoryCounts = async ( updatedCategories.categories[index].count = (resp.hits.total as estypes.SearchTotalHits).value ?? 0; } else { - logger.error( - `Failed to fetch category count for category "${ - updatedCategories.categories[index].key - }", got: \n${JSON.stringify(resp, null, 2)}` - ); - emitError( - `Failed to fetch category count for category "${updatedCategories.categories[index].key}".` - ); + if (logger) { + logger.error( + `Failed to fetch category count for category "${ + updatedCategories.categories[index].key + }", got: \n${JSON.stringify(resp, null, 2)}` + ); + } + + if (emitError) { + emitError( + `Failed to fetch category count for category "${updatedCategories.categories[index].key}".` + ); + } } } diff --git a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_frequent_item_sets.ts b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_frequent_item_sets.ts index bf3607ce23736..34c34482ccf7c 100644 --- a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_frequent_item_sets.ts +++ b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_frequent_item_sets.ts @@ -80,20 +80,38 @@ export function getFrequentItemSetsAggFields(significantItems: SignificantItem[] ); } -export async function fetchFrequentItemSets( - client: ElasticsearchClient, - index: string, - searchQuery: estypes.QueryDslQueryContainer, - significantItems: SignificantItem[], - timeFieldName: string, - deviationMin: number, - deviationMax: number, - logger: Logger, - // The default value of 1 means no sampling will be used - sampleProbability: number = 1, - emitError: (m: string) => void, - abortSignal?: AbortSignal -): Promise { +export async function fetchFrequentItemSets({ + esClient, + abortSignal, + emitError, + logger, + arguments: args, +}: { + esClient: ElasticsearchClient; + emitError: (m: string) => void; + abortSignal?: AbortSignal; + logger: Logger; + arguments: { + index: string; + searchQuery: estypes.QueryDslQueryContainer; + significantItems: SignificantItem[]; + timeFieldName: string; + deviationMin: number; + deviationMax: number; + sampleProbability?: number; + }; +}): Promise { + const { + index, + searchQuery, + significantItems, + timeFieldName, + deviationMin, + deviationMax, + // The default value of 1 means no sampling will be used + sampleProbability = 1, + } = args; + // Sort significant terms by ascending p-value, necessary to apply the field limit correctly. const sortedSignificantItems = significantItems.slice().sort((a, b) => { return (a.pValue ?? 0) - (b.pValue ?? 0); @@ -140,7 +158,7 @@ export async function fetchFrequentItemSets( track_total_hits: true, }; - const body = await client.search< + const body = await esClient.search< unknown, { sample: FrequentItemSetsAggregation } | FrequentItemSetsAggregation >( diff --git a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_index_info.test.ts b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_index_info.test.ts index a47b6d94db128..dc6d3537f8424 100644 --- a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_index_info.test.ts +++ b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_index_info.test.ts @@ -46,7 +46,7 @@ describe('fetch_index_info', () => { } as unknown as ElasticsearchClient; const { baselineTotalDocCount, deviationTotalDocCount, fieldCandidates } = - await fetchIndexInfo(esClientMock, paramsSearchQueryMock); + await fetchIndexInfo({ esClient: esClientMock, arguments: paramsSearchQueryMock }); expect(fieldCandidates).toEqual(['myIpFieldName', 'myKeywordFieldName']); expect(baselineTotalDocCount).toEqual(5000000); @@ -76,7 +76,7 @@ describe('fetch_index_info', () => { deviationTotalDocCount, fieldCandidates, textFieldCandidates, - } = await fetchIndexInfo(esClientMock, paramsSearchQueryMock); + } = await fetchIndexInfo({ esClient: esClientMock, arguments: paramsSearchQueryMock }); expect(fieldCandidates).toEqual([ '_metadata.elastic_apm_trace_id', @@ -258,7 +258,7 @@ describe('fetch_index_info', () => { deviationTotalDocCount, fieldCandidates, textFieldCandidates, - } = await fetchIndexInfo(esClientMock, paramsSearchQueryMock); + } = await fetchIndexInfo({ esClient: esClientMock, arguments: paramsSearchQueryMock }); expect(fieldCandidates).toEqual([ 'category.keyword', @@ -315,7 +315,7 @@ describe('fetch_index_info', () => { deviationTotalDocCount, fieldCandidates, textFieldCandidates, - } = await fetchIndexInfo(esClientMock, paramsSearchQueryMock); + } = await fetchIndexInfo({ esClient: esClientMock, arguments: paramsSearchQueryMock }); expect(fieldCandidates).toEqual(['items']); expect(textFieldCandidates).toEqual([]); diff --git a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_index_info.ts b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_index_info.ts index 458fc630b5009..a97b6049ab7b5 100644 --- a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_index_info.ts +++ b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_index_info.ts @@ -39,12 +39,18 @@ interface IndexInfo { zeroDocsFallback: boolean; } -export const fetchIndexInfo = async ( - esClient: ElasticsearchClient, - params: AiopsLogRateAnalysisSchema, - textFieldCandidatesOverrides: string[] = [], - abortSignal?: AbortSignal -): Promise => { +export const fetchIndexInfo = async ({ + esClient, + abortSignal, + arguments: args, +}: { + esClient: ElasticsearchClient; + abortSignal?: AbortSignal; + arguments: AiopsLogRateAnalysisSchema & { + textFieldCandidatesOverrides?: string[]; + }; +}): Promise => { + const { textFieldCandidatesOverrides = [], ...params } = args; const { index } = params; // Get all supported fields const respMapping = await esClient.fieldCaps( diff --git a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_significant_categories.ts b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_significant_categories.ts index e15918d0896e7..1d95995157192 100644 --- a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_significant_categories.ts +++ b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_significant_categories.ts @@ -32,16 +32,22 @@ const getCategoriesTestData = (categories: Category[]): Histogram[] => { const getCategoriesTotalCount = (categories: Category[]): number => categories.reduce((p, c) => p + c.count, 0); -export const fetchSignificantCategories = async ( - esClient: ElasticsearchClient, - params: AiopsLogRateAnalysisSchema, - fieldNames: string[], - logger: Logger, +export const fetchSignificantCategories = async ({ + esClient, + abortSignal, + emitError, + logger, + arguments: args, +}: { + esClient: ElasticsearchClient; + abortSignal?: AbortSignal; + emitError?: (m: string) => void; + logger?: Logger; + arguments: AiopsLogRateAnalysisSchema & { fieldNames: string[]; sampleProbability?: number }; +}) => { // The default value of 1 means no sampling will be used - sampleProbability: number = 1, - emitError: (m: string) => void, - abortSignal?: AbortSignal -) => { + const { fieldNames, sampleProbability = 1, ...params } = args; + const categoriesOverall = await fetchCategories( esClient, params, diff --git a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_significant_term_p_values.ts b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_significant_term_p_values.ts index 98dbd11398174..9017b4949c8fe 100644 --- a/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_significant_term_p_values.ts +++ b/x-pack/packages/ml/aiops_log_rate_analysis/queries/fetch_significant_term_p_values.ts @@ -111,16 +111,25 @@ interface Aggs extends estypes.AggregationsSignificantLongTermsAggregate { buckets: estypes.AggregationsSignificantLongTermsBucket[]; } -export const fetchSignificantTermPValues = async ( - esClient: ElasticsearchClient, - params: AiopsLogRateAnalysisSchema, - fieldNames: string[], - logger: Logger, +export const fetchSignificantTermPValues = async ({ + esClient, + abortSignal, + logger, + emitError, + arguments: args, +}: { + esClient: ElasticsearchClient; + abortSignal?: AbortSignal; + logger?: Logger; + emitError?: (m: string) => void; + arguments: AiopsLogRateAnalysisSchema & { + fieldNames: string[]; + sampleProbability?: number; + }; +}): Promise => { // The default value of 1 means no sampling will be used - sampleProbability: number = 1, - emitError: (m: string) => void, - abortSignal?: AbortSignal -): Promise => { + const { fieldNames, sampleProbability = 1, ...params } = args; + const randomSamplerWrapper = createRandomSamplerWrapper({ probability: sampleProbability, seed: RANDOM_SAMPLER_SEED, @@ -139,14 +148,19 @@ export const fetchSignificantTermPValues = async ( function reportError(fieldName: string, error: unknown) { if (!isRequestAbortedError(error)) { - logger.error( - `Failed to fetch p-value aggregation for fieldName "${fieldName}", got: \n${JSON.stringify( - error, - null, - 2 - )}` - ); - emitError(`Failed to fetch p-value aggregation for fieldName "${fieldName}".`); + if (logger) { + logger.error( + `Failed to fetch p-value aggregation for fieldName "${fieldName}", got: \n${JSON.stringify( + error, + null, + 2 + )}` + ); + } + + if (emitError) { + emitError(`Failed to fetch p-value aggregation for fieldName "${fieldName}".`); + } } } diff --git a/x-pack/packages/ml/inference_integration_flyout/components/elasticsearch_models.tsx b/x-pack/packages/ml/inference_integration_flyout/components/elasticsearch_models.tsx index 0825cba6828b4..4bd6354ef73da 100644 --- a/x-pack/packages/ml/inference_integration_flyout/components/elasticsearch_models.tsx +++ b/x-pack/packages/ml/inference_integration_flyout/components/elasticsearch_models.tsx @@ -70,10 +70,7 @@ export const ElasticsearchModels: React.FC = ({ } }, [numberOfAllocations, numberOfThreads, serviceType]); - const elasticSearchModelTypesDescriptions: Record< - ElasticsearchModelDefaultOptions | string, - ElasticsearchModelDescriptions - > = { + const elasticSearchModelTypesDescriptions: Record = { [ElasticsearchModelDefaultOptions.elser]: { description: i18n.translate( 'xpack.ml.addInferenceEndpoint.elasticsearchModels.elser.description', diff --git a/x-pack/packages/ml/trained_models_utils/index.ts b/x-pack/packages/ml/trained_models_utils/index.ts index ada09d62af072..293f6662f5011 100644 --- a/x-pack/packages/ml/trained_models_utils/index.ts +++ b/x-pack/packages/ml/trained_models_utils/index.ts @@ -27,4 +27,13 @@ export { ELASTIC_MODEL_TYPE, MODEL_STATE, type ModelState, + ELSER_LINUX_OPTIMIZED_MODEL_ID, + ELSER_MODEL_ID, + E5_LINUX_OPTIMIZED_MODEL_ID, + E5_MODEL_ID, + LANG_IDENT_MODEL_ID, + LATEST_ELSER_VERSION, + LATEST_ELSER_MODEL_ID, + LATEST_E5_MODEL_ID, + ElserModels, } from './src/constants/trained_models'; diff --git a/x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts b/x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts index 0e19fef36e2e2..938f9c0ef81e0 100644 --- a/x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts +++ b/x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts @@ -7,6 +7,18 @@ import { i18n } from '@kbn/i18n'; +export const ELSER_MODEL_ID = '.elser_model_2'; +export const ELSER_LINUX_OPTIMIZED_MODEL_ID = '.elser_model_2_linux-x86_64'; +export const E5_MODEL_ID = '.multilingual-e5-small'; +export const E5_LINUX_OPTIMIZED_MODEL_ID = '.multilingual-e5-small_linux-x86_64'; +export const LANG_IDENT_MODEL_ID = 'lang_ident_model_1'; +export const ELSER_ID_V1 = '.elser_model_1' as const; +export const LATEST_ELSER_VERSION: ElserVersion = 2; +export const LATEST_ELSER_MODEL_ID = ELSER_LINUX_OPTIMIZED_MODEL_ID; +export const LATEST_E5_MODEL_ID = E5_LINUX_OPTIMIZED_MODEL_ID; + +export const ElserModels = [ELSER_MODEL_ID, ELSER_LINUX_OPTIMIZED_MODEL_ID, ELSER_ID_V1]; + export const DEPLOYMENT_STATE = { STARTED: 'started', STARTING: 'starting', @@ -46,10 +58,8 @@ export const BUILT_IN_MODEL_TAG = 'prepackaged'; export const ELASTIC_MODEL_TAG = 'elastic'; -export const ELSER_ID_V1 = '.elser_model_1' as const; - export const ELASTIC_MODEL_DEFINITIONS: Record = Object.freeze({ - '.elser_model_1': { + [ELSER_ID_V1]: { modelName: 'elser', hidden: true, version: 1, @@ -63,7 +73,7 @@ export const ELASTIC_MODEL_DEFINITIONS: Record = Object }), type: ['elastic', 'pytorch', 'text_expansion'], }, - '.elser_model_2': { + [ELSER_MODEL_ID]: { modelName: 'elser', version: 2, default: true, @@ -77,7 +87,7 @@ export const ELASTIC_MODEL_DEFINITIONS: Record = Object }), type: ['elastic', 'pytorch', 'text_expansion'], }, - '.elser_model_2_linux-x86_64': { + [ELSER_LINUX_OPTIMIZED_MODEL_ID]: { modelName: 'elser', version: 2, os: 'Linux', @@ -92,7 +102,7 @@ export const ELASTIC_MODEL_DEFINITIONS: Record = Object }), type: ['elastic', 'pytorch', 'text_expansion'], }, - '.multilingual-e5-small': { + [E5_MODEL_ID]: { modelName: 'e5', version: 1, default: true, @@ -108,7 +118,7 @@ export const ELASTIC_MODEL_DEFINITIONS: Record = Object licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small', type: ['pytorch', 'text_embedding'], }, - '.multilingual-e5-small_linux-x86_64': { + [E5_LINUX_OPTIMIZED_MODEL_ID]: { modelName: 'e5', version: 1, os: 'Linux', @@ -178,29 +188,69 @@ export interface GetModelDownloadConfigOptions { version?: ElserVersion; } +export interface LocalInferenceServiceSettings { + service: 'elser' | 'elasticsearch'; + service_settings: { + num_allocations: number; + num_threads: number; + model_id: string; + }; +} + export type InferenceServiceSettings = + | LocalInferenceServiceSettings | { - service: 'elser'; + service: 'openai'; service_settings: { - num_allocations: number; - num_threads: number; + api_key: string; + organization_id: string; + url: string; model_id: string; }; } | { - service: 'elasticsearch'; + service: 'mistral'; + service_settings: { + api_key: string; + model: string; + max_input_tokens: string; + rate_limit: { + requests_per_minute: number; + }; + }; + } + | { + service: 'cohere'; service_settings: { - num_allocations: number; - num_threads: number; + similarity: string; + dimensions: string; model_id: string; + embedding_type: string; }; } | { - service: 'openai'; + service: 'azureaistudio'; service_settings: { - api_key: string; - organization_id: string; - url: string; + target: string; + provider: string; + embedding_type: string; + }; + } + | { + service: 'azureopenai'; + service_settings: { + resource_name: string; + deployment_id: string; + api_version: string; + }; + } + | { + service: 'googleaistudio'; + service_settings: { + model_id: string; + rate_limit: { + requests_per_minute: number; + }; }; } | { diff --git a/x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.test.tsx b/x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.test.tsx index c68dd56b4b00e..cf2f39da52651 100644 --- a/x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.test.tsx +++ b/x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.test.tsx @@ -231,7 +231,6 @@ describe('helpers', () => { esTypes: ['date'], format: '', id: '@timestamp', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], isSortable, name: '@timestamp', readFromDocValues: true, @@ -248,7 +247,6 @@ describe('helpers', () => { esTypes: ['ip'], format: '', id: 'source.ip', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], isSortable, name: 'source.ip', schema: undefined, @@ -264,7 +262,6 @@ describe('helpers', () => { esTypes: ['ip'], format: '', id: 'destination.ip', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], isSortable, name: 'destination.ip', schema: undefined, @@ -290,7 +287,6 @@ describe('helpers', () => { esTypes: ['date'], format: '', id: '@timestamp', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], isSortable, name: '@timestamp', readFromDocValues: true, diff --git a/x-pack/packages/security-solution/data_table/mock/mock_source.ts b/x-pack/packages/security-solution/data_table/mock/mock_source.ts index 822922f52754d..eebf9f0979d57 100644 --- a/x-pack/packages/security-solution/data_table/mock/mock_source.ts +++ b/x-pack/packages/security-solution/data_table/mock/mock_source.ts @@ -8,25 +8,12 @@ import type { MappingRuntimeFields } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { BrowserFields } from '@kbn/timelines-plugin/common'; -const DEFAULT_INDEX_PATTERN = [ - 'apm-*-transaction*', - 'auditbeat-*', - 'endgame-*', - 'filebeat-*', - 'logs-*', - 'packetbeat-*', - 'traces-apm*', - 'winlogbeat-*', - '-*elastic-cloud-logs-*', -]; - export const mockBrowserFields: BrowserFields = { agent: { fields: { 'agent.ephemeral_id': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'agent.ephemeral_id', searchable: true, type: 'string', @@ -35,7 +22,6 @@ export const mockBrowserFields: BrowserFields = { 'agent.hostname': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'agent.hostname', searchable: true, type: 'string', @@ -44,7 +30,6 @@ export const mockBrowserFields: BrowserFields = { 'agent.id': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'agent.id', searchable: true, type: 'string', @@ -53,7 +38,6 @@ export const mockBrowserFields: BrowserFields = { 'agent.name': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'agent.name', searchable: true, type: 'string', @@ -66,7 +50,6 @@ export const mockBrowserFields: BrowserFields = { 'auditd.data.a0': { aggregatable: true, format: '', - indexes: ['auditbeat'], name: 'auditd.data.a0', searchable: true, type: 'string', @@ -75,7 +58,6 @@ export const mockBrowserFields: BrowserFields = { 'auditd.data.a1': { aggregatable: true, format: '', - indexes: ['auditbeat'], name: 'auditd.data.a1', searchable: true, type: 'string', @@ -84,7 +66,6 @@ export const mockBrowserFields: BrowserFields = { 'auditd.data.a2': { aggregatable: true, format: '', - indexes: ['auditbeat'], name: 'auditd.data.a2', searchable: true, type: 'string', @@ -97,7 +78,6 @@ export const mockBrowserFields: BrowserFields = { '@timestamp': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: '@timestamp', searchable: true, type: 'date', @@ -110,7 +90,6 @@ export const mockBrowserFields: BrowserFields = { esTypes: [], searchable: true, aggregatable: false, - indexes: ['auditbeat', 'filebeat', 'packetbeat'], }, message: { name: 'message', @@ -119,7 +98,6 @@ export const mockBrowserFields: BrowserFields = { searchable: true, aggregatable: false, format: 'string', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], }, }, }, @@ -128,7 +106,6 @@ export const mockBrowserFields: BrowserFields = { 'client.address': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'client.address', searchable: true, type: 'string', @@ -137,7 +114,6 @@ export const mockBrowserFields: BrowserFields = { 'client.bytes': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'client.bytes', searchable: true, type: 'number', @@ -146,7 +122,6 @@ export const mockBrowserFields: BrowserFields = { 'client.domain': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'client.domain', searchable: true, type: 'string', @@ -155,7 +130,6 @@ export const mockBrowserFields: BrowserFields = { 'client.geo.country_iso_code': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'client.geo.country_iso_code', searchable: true, type: 'string', @@ -168,7 +142,6 @@ export const mockBrowserFields: BrowserFields = { 'cloud.account.id': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'cloud.account.id', searchable: true, type: 'string', @@ -177,7 +150,6 @@ export const mockBrowserFields: BrowserFields = { 'cloud.availability_zone': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'cloud.availability_zone', searchable: true, type: 'string', @@ -190,7 +162,6 @@ export const mockBrowserFields: BrowserFields = { 'container.id': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'container.id', searchable: true, type: 'string', @@ -199,7 +170,6 @@ export const mockBrowserFields: BrowserFields = { 'container.image.name': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'container.image.name', searchable: true, type: 'string', @@ -208,7 +178,6 @@ export const mockBrowserFields: BrowserFields = { 'container.image.tag': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'container.image.tag', searchable: true, type: 'string', @@ -221,7 +190,6 @@ export const mockBrowserFields: BrowserFields = { 'destination.address': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'destination.address', searchable: true, type: 'string', @@ -230,7 +198,6 @@ export const mockBrowserFields: BrowserFields = { 'destination.bytes': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'destination.bytes', searchable: true, type: 'number', @@ -239,7 +206,6 @@ export const mockBrowserFields: BrowserFields = { 'destination.domain': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'destination.domain', searchable: true, type: 'string', @@ -248,7 +214,6 @@ export const mockBrowserFields: BrowserFields = { 'destination.ip': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'destination.ip', searchable: true, type: 'ip', @@ -257,7 +222,6 @@ export const mockBrowserFields: BrowserFields = { 'destination.port': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'destination.port', searchable: true, type: 'number', @@ -269,7 +233,6 @@ export const mockBrowserFields: BrowserFields = { fields: { 'event.end': { format: '', - indexes: DEFAULT_INDEX_PATTERN, name: 'event.end', searchable: true, type: 'date', @@ -283,7 +246,6 @@ export const mockBrowserFields: BrowserFields = { searchable: true, aggregatable: true, format: 'string', - indexes: DEFAULT_INDEX_PATTERN, }, 'event.category': { name: 'event.category', @@ -292,7 +254,6 @@ export const mockBrowserFields: BrowserFields = { searchable: true, aggregatable: true, format: 'string', - indexes: DEFAULT_INDEX_PATTERN, }, 'event.severity': { name: 'event.severity', @@ -301,7 +262,6 @@ export const mockBrowserFields: BrowserFields = { format: 'number', searchable: true, aggregatable: true, - indexes: DEFAULT_INDEX_PATTERN, }, }, }, @@ -314,7 +274,6 @@ export const mockBrowserFields: BrowserFields = { searchable: true, aggregatable: true, format: 'string', - indexes: DEFAULT_INDEX_PATTERN, }, }, }, @@ -323,7 +282,6 @@ export const mockBrowserFields: BrowserFields = { 'source.ip': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'source.ip', searchable: true, type: 'ip', @@ -332,7 +290,6 @@ export const mockBrowserFields: BrowserFields = { 'source.port': { aggregatable: true, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'source.port', searchable: true, type: 'number', @@ -349,7 +306,6 @@ export const mockBrowserFields: BrowserFields = { searchable: true, aggregatable: true, format: 'string', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], }, }, }, @@ -358,7 +314,6 @@ export const mockBrowserFields: BrowserFields = { 'nestedField.firstAttributes': { aggregatable: false, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'nestedField.firstAttributes', searchable: true, type: 'string', @@ -371,7 +326,6 @@ export const mockBrowserFields: BrowserFields = { 'nestedField.secondAttributes': { aggregatable: false, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'nestedField.secondAttributes', searchable: true, type: 'string', @@ -384,7 +338,6 @@ export const mockBrowserFields: BrowserFields = { 'nestedField.thirdAttributes': { aggregatable: false, format: '', - indexes: ['auditbeat', 'filebeat', 'packetbeat'], name: 'nestedField.thirdAttributes', searchable: true, type: 'date', diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.ts b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.ts index 5b3860af44920..3eaf493222cb0 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.ts +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/body/data_quality_details/storage_details/helpers.ts @@ -134,37 +134,34 @@ export const getFlattenedBuckets = ({ if (((isILMAvailable && ilmExplain != null) || !isILMAvailable) && stats != null) { return [ ...acc, - ...Object.entries(stats).reduce( - (validStats, [indexName, indexStats]) => { - const ilmPhase = getIlmPhase(ilmExplain?.[indexName], isILMAvailable); - const isSelectedPhase = - (isILMAvailable && ilmPhase != null && ilmPhasesMap[ilmPhase] != null) || - !isILMAvailable; - - if (isSelectedPhase) { - const incompatible = - results != null && results[indexName] != null - ? results[indexName].incompatible - : undefined; - const sizeInBytes = getSizeInBytes({ indexName, stats }); - const docsCount = getDocsCount({ stats, indexName }); - return [ - ...validStats, - { - ilmPhase, - incompatible, - indexName, - pattern, - sizeInBytes, - docsCount, - }, - ]; - } else { - return validStats; - } - }, - [] - ), + ...Object.entries(stats).reduce((validStats, [indexName]) => { + const ilmPhase = getIlmPhase(ilmExplain?.[indexName], isILMAvailable); + const isSelectedPhase = + (isILMAvailable && ilmPhase != null && ilmPhasesMap[ilmPhase] != null) || + !isILMAvailable; + + if (isSelectedPhase) { + const incompatible = + results != null && results[indexName] != null + ? results[indexName].incompatible + : undefined; + const sizeInBytes = getSizeInBytes({ indexName, stats }); + const docsCount = getDocsCount({ stats, indexName }); + return [ + ...validStats, + { + ilmPhase, + incompatible, + indexName, + pattern, + sizeInBytes, + docsCount, + }, + ]; + } else { + return validStats; + } + }, []), ]; } @@ -232,7 +229,7 @@ export const getLayersMultiDimensional = ({ groupByRollup: (d: Datum) => d.indexName, nodeLabel: (indexName: Datum) => indexName, shape: { - fillColor: (indexName: Key, sortIndex: number, node: Pick) => { + fillColor: (indexName: Key, _sortIndex: number, node: Pick) => { const pattern = getGroupFromPath(node.path) ?? ''; const flattenedBucket = pathToFlattenedBucketMap[`${pattern}${indexName}`]; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/stat_label/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/stat_label/index.tsx index 31b4620fbb5f0..32402b49b570c 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/stat_label/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/stat_label/index.tsx @@ -19,12 +19,11 @@ const Line2 = styled.span` const EMPTY = ' '; interface Props { - color?: string; line1?: string; line2?: string; } -export const StatLabel: React.FC = ({ color, line1 = EMPTY, line2 = EMPTY }) => ( +export const StatLabel: React.FC = ({ line1 = EMPTY, line2 = EMPTY }) => ( <> {line1} {line2} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/ecs_compliant_tab/index.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/ecs_compliant_tab/index.tsx index b53567e709eb4..855ef75e80b84 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/ecs_compliant_tab/index.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/ecs_compliant_tab/index.tsx @@ -26,15 +26,10 @@ const EmptyPromptContainer = styled.div` interface Props { indexName: string; - onAddToNewCase: (markdownComments: string[]) => void; partitionedFieldMetadata: PartitionedFieldMetadata; } -const EcsCompliantTabComponent: React.FC = ({ - indexName, - onAddToNewCase, - partitionedFieldMetadata, -}) => { +const EcsCompliantTabComponent: React.FC = ({ indexName, partitionedFieldMetadata }) => { const emptyPromptBody = useMemo(() => , []); const title = useMemo(() => , []); diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.tsx b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.tsx index 670357c3730f7..8790ab12591b3 100644 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.tsx +++ b/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality/data_quality_panel/tabs/helpers.tsx @@ -212,11 +212,7 @@ export const getTabs = ({
    ), content: ( - + ), id: ECS_COMPLIANT_TAB_ID, name: i18n.ECS_COMPLIANT_FIELDS, diff --git a/x-pack/packages/security-solution/side_nav/src/solution_side_nav_panel.styles.ts b/x-pack/packages/security-solution/side_nav/src/solution_side_nav_panel.styles.ts index ca0f592f96a43..f5af4cd05ad24 100644 --- a/x-pack/packages/security-solution/side_nav/src/solution_side_nav_panel.styles.ts +++ b/x-pack/packages/security-solution/side_nav/src/solution_side_nav_panel.styles.ts @@ -69,7 +69,7 @@ export const SolutionSideNavCategoryTitleStyles = (euiTheme: EuiThemeComputed<{} font-weight: ${euiTheme.font.weight.medium}; `; -export const SolutionSideNavPanelLinksGroupStyles = (euiTheme: EuiThemeComputed<{}>) => css` +export const SolutionSideNavPanelLinksGroupStyles = () => css` padding-left: 0; padding-right: 0; `; diff --git a/x-pack/packages/security-solution/side_nav/src/solution_side_nav_panel.tsx b/x-pack/packages/security-solution/side_nav/src/solution_side_nav_panel.tsx index dfe2f643d4783..248121872018b 100644 --- a/x-pack/packages/security-solution/side_nav/src/solution_side_nav_panel.tsx +++ b/x-pack/packages/security-solution/side_nav/src/solution_side_nav_panel.tsx @@ -333,8 +333,7 @@ interface SolutionSideNavPanelItemsProps { */ const SolutionSideNavPanelItems: React.FC = React.memo( function SolutionSideNavPanelItems({ items, onClose }) { - const { euiTheme } = useEuiTheme(); - const panelLinksGroupClassNames = classNames(SolutionSideNavPanelLinksGroupStyles(euiTheme)); + const panelLinksGroupClassNames = classNames(SolutionSideNavPanelLinksGroupStyles()); return ( {items.map((item) => ( diff --git a/x-pack/packages/security/plugin_types_server/index.ts b/x-pack/packages/security/plugin_types_server/index.ts index 1228b9d36f961..21ab0eb2b39af 100644 --- a/x-pack/packages/security/plugin_types_server/index.ts +++ b/x-pack/packages/security/plugin_types_server/index.ts @@ -14,15 +14,6 @@ export type { AuditLogger, } from './src/audit'; export type { - CreateAPIKeyParams, - CreateAPIKeyResult, - CreateRestAPIKeyParams, - GrantAPIKeyResult, - InvalidateAPIKeysParams, - ValidateAPIKeyParams, - CreateRestAPIKeyWithKibanaPrivilegesParams, - CreateCrossClusterAPIKeyParams, - InvalidateAPIKeyResult, APIKeys, AuthenticationServiceStart, UpdateAPIKeyParams, @@ -39,7 +30,6 @@ export type { CheckPrivilegesWithRequest, CheckSavedObjectsPrivilegesWithRequest, CheckPrivilegesDynamicallyWithRequest, - KibanaPrivilegesType, SavedObjectActions, UIActions, CheckPrivilegesPayload, @@ -51,7 +41,6 @@ export type { CheckPrivilegesOptions, CheckUserProfilesPrivilegesPayload, CheckUserProfilesPrivilegesResponse, - ElasticsearchPrivilegesType, CasesActions, CheckPrivileges, AlertingActions, @@ -72,11 +61,30 @@ export type { } from './src/user_profile'; export { - restApiKeySchema, - getRestApiKeyWithKibanaPrivilegesSchema, getUpdateRestApiKeyWithKibanaPrivilegesSchema, - crossClusterApiKeySchema, updateRestApiKeySchema, updateCrossClusterApiKeySchema, } from './src/authentication'; -export { GLOBAL_RESOURCE, elasticsearchRoleSchema, getKibanaRoleSchema } from './src/authorization'; + +export type { + ElasticsearchPrivilegesType, + KibanaPrivilegesType, + APIKeysService, + CreateAPIKeyParams, + CreateAPIKeyResult, + InvalidateAPIKeyResult, + InvalidateAPIKeysParams, + ValidateAPIKeyParams, + CreateRestAPIKeyParams, + CreateRestAPIKeyWithKibanaPrivilegesParams, + CreateCrossClusterAPIKeyParams, + GrantAPIKeyResult, +} from '@kbn/core-security-server'; +export { isCreateRestAPIKeyParams } from '@kbn/core-security-server'; + +export { + restApiKeySchema, + crossClusterApiKeySchema, + getRestApiKeyWithKibanaPrivilegesSchema, +} from './src/authentication'; +export { getKibanaRoleSchema, elasticsearchRoleSchema, GLOBAL_RESOURCE } from './src/authorization'; diff --git a/x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts b/x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts index 2ced5478b46eb..c331802c7f693 100644 --- a/x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts +++ b/x-pack/packages/security/plugin_types_server/src/authentication/api_keys/api_keys.ts @@ -5,153 +5,9 @@ * 2.0. */ -import type { estypes } from '@elastic/elasticsearch'; - -import type { KibanaRequest } from '@kbn/core/server'; -import { schema, TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; import { getKibanaRoleSchema, elasticsearchRoleSchema } from '../../authorization'; -export interface APIKeys { - /** - * Determines if API Keys are enabled in Elasticsearch. - */ - areAPIKeysEnabled(): Promise; - - /** - * Determines if Cross-Cluster API Keys are enabled in Elasticsearch. - */ - areCrossClusterAPIKeysEnabled(): Promise; - - /** - * Tries to create an API key for the current user. - * - * Returns newly created API key or `null` if API keys are disabled. - * - * User needs `manage_api_key` privilege to create REST API keys and `manage_security` for Cross-Cluster API keys. - * - * @param request Request instance. - * @param createParams The params to create an API key - */ - create( - request: KibanaRequest, - createParams: CreateAPIKeyParams - ): Promise; - - /** - * Tries to grant an API key for the current user. - * @param request Request instance. - * @param createParams Create operation parameters. - */ - grantAsInternalUser( - request: KibanaRequest, - createParams: CreateRestAPIKeyParams | CreateRestAPIKeyWithKibanaPrivilegesParams - ): Promise; - - /** - * Tries to validate an API key. - * @param apiKeyPrams ValidateAPIKeyParams. - */ - validate(apiKeyPrams: ValidateAPIKeyParams): Promise; - - /** - * Tries to invalidate an API keys. - * @param request Request instance. - * @param params The params to invalidate an API keys. - */ - invalidate( - request: KibanaRequest, - params: InvalidateAPIKeysParams - ): Promise; - - /** - * Tries to invalidate the API keys by using the internal user. - * @param params The params to invalidate the API keys. - */ - invalidateAsInternalUser(params: InvalidateAPIKeysParams): Promise; -} - -export type CreateAPIKeyParams = - | CreateRestAPIKeyParams - | CreateRestAPIKeyWithKibanaPrivilegesParams - | CreateCrossClusterAPIKeyParams; - -/** - * Response of Kibana Create API key endpoint. - */ -export type CreateAPIKeyResult = estypes.SecurityCreateApiKeyResponse; - -export type CreateRestAPIKeyParams = TypeOf; -export type CreateRestAPIKeyWithKibanaPrivilegesParams = TypeOf< - ReturnType ->; -export type CreateCrossClusterAPIKeyParams = TypeOf; - -export interface GrantAPIKeyResult { - /** - * Unique id for this API key - */ - id: string; - /** - * Name for this API key - */ - name: string; - /** - * Generated API key - */ - api_key: string; -} - -/** - * Represents the parameters for validating API Key credentials. - */ -export interface ValidateAPIKeyParams { - /** - * Unique id for this API key - */ - id: string; - - /** - * Generated API Key (secret) - */ - api_key: string; -} - -/** - * Represents the params for invalidating multiple API keys - */ -export interface InvalidateAPIKeysParams { - ids: string[]; -} - -/** - * The return value when invalidating an API key in Elasticsearch. - */ -export interface InvalidateAPIKeyResult { - /** - * The IDs of the API keys that were invalidated as part of the request. - */ - invalidated_api_keys: string[]; - /** - * The IDs of the API keys that were already invalidated. - */ - previously_invalidated_api_keys: string[]; - /** - * The number of errors that were encountered when invalidating the API keys. - */ - error_count: number; - /** - * Details about these errors. This field is not present in the response when error_count is 0. - */ - error_details?: Array<{ - type?: string; - reason?: string; - caused_by?: { - type?: string; - reason?: string; - }; - }>; -} - export const restApiKeySchema = schema.object({ type: schema.maybe(schema.literal('rest')), name: schema.string(), @@ -165,8 +21,11 @@ export const restApiKeySchema = schema.object({ export const getRestApiKeyWithKibanaPrivilegesSchema = ( getBasePrivilegeNames: Parameters[0] ) => - restApiKeySchema.extends({ - role_descriptors: null, + schema.object({ + type: schema.maybe(schema.literal('rest')), + name: schema.string(), + expiration: schema.maybe(schema.string()), + metadata: schema.maybe(schema.object({}, { unknowns: 'allow' })), kibana_role_descriptors: schema.recordOf( schema.string(), schema.object({ @@ -176,9 +35,11 @@ export const getRestApiKeyWithKibanaPrivilegesSchema = ( ), }); -export const crossClusterApiKeySchema = restApiKeySchema.extends({ +export const crossClusterApiKeySchema = schema.object({ type: schema.literal('cross_cluster'), - role_descriptors: null, + name: schema.string(), + expiration: schema.maybe(schema.string()), + metadata: schema.maybe(schema.object({}, { unknowns: 'allow' })), access: schema.object( { search: schema.maybe( @@ -203,41 +64,52 @@ export const crossClusterApiKeySchema = restApiKeySchema.extends({ ), }); -/** - * Response of Kibana Update API key endpoint. - */ -export type UpdateAPIKeyResult = estypes.SecurityUpdateApiKeyResponse; - -/** - * Request body of Kibana Update API key endpoint. - */ -export type UpdateAPIKeyParams = - | UpdateRestAPIKeyParams - | UpdateCrossClusterAPIKeyParams - | UpdateRestAPIKeyWithKibanaPrivilegesParams; - -export const updateRestApiKeySchema = restApiKeySchema.extends({ - name: null, +export const updateRestApiKeySchema = schema.object({ id: schema.string(), + type: schema.maybe(schema.literal('rest')), + expiration: schema.maybe(schema.string()), + role_descriptors: schema.recordOf(schema.string(), schema.object({}, { unknowns: 'allow' }), { + defaultValue: {}, + }), + metadata: schema.maybe(schema.object({}, { unknowns: 'allow' })), }); -export const updateCrossClusterApiKeySchema = crossClusterApiKeySchema.extends({ - name: null, +export const updateCrossClusterApiKeySchema = schema.object({ id: schema.string(), + type: schema.literal('cross_cluster'), + expiration: schema.maybe(schema.string()), + metadata: schema.maybe(schema.object({}, { unknowns: 'allow' })), + access: schema.object( + { + search: schema.maybe( + schema.arrayOf( + schema.object({ + names: schema.arrayOf(schema.string()), + query: schema.maybe(schema.any()), + field_security: schema.maybe(schema.any()), + allow_restricted_indices: schema.maybe(schema.boolean()), + }) + ) + ), + replication: schema.maybe( + schema.arrayOf( + schema.object({ + names: schema.arrayOf(schema.string()), + }) + ) + ), + }, + { unknowns: 'allow' } + ), }); -export type UpdateRestAPIKeyParams = TypeOf; -export type UpdateCrossClusterAPIKeyParams = TypeOf; -export type UpdateRestAPIKeyWithKibanaPrivilegesParams = TypeOf< - ReturnType ->; - export const getUpdateRestApiKeyWithKibanaPrivilegesSchema = ( getBasePrivilegeNames: Parameters[0] ) => - restApiKeySchema.extends({ - role_descriptors: null, - name: null, + schema.object({ + type: schema.maybe(schema.literal('rest')), + expiration: schema.maybe(schema.string()), + metadata: schema.maybe(schema.object({}, { unknowns: 'allow' })), id: schema.string(), kibana_role_descriptors: schema.recordOf( schema.string(), diff --git a/x-pack/packages/security/plugin_types_server/src/authentication/api_keys/index.ts b/x-pack/packages/security/plugin_types_server/src/authentication/api_keys/index.ts index ec36a99b4da63..1673682052554 100644 --- a/x-pack/packages/security/plugin_types_server/src/authentication/api_keys/index.ts +++ b/x-pack/packages/security/plugin_types_server/src/authentication/api_keys/index.ts @@ -5,23 +5,6 @@ * 2.0. */ -export type { - CreateAPIKeyParams, - CreateAPIKeyResult, - InvalidateAPIKeyResult, - InvalidateAPIKeysParams, - ValidateAPIKeyParams, - CreateRestAPIKeyParams, - CreateRestAPIKeyWithKibanaPrivilegesParams, - CreateCrossClusterAPIKeyParams, - GrantAPIKeyResult, - APIKeys, - UpdateAPIKeyParams, - UpdateAPIKeyResult, - UpdateCrossClusterAPIKeyParams, - UpdateRestAPIKeyParams, - UpdateRestAPIKeyWithKibanaPrivilegesParams, -} from './api_keys'; export { crossClusterApiKeySchema, getRestApiKeyWithKibanaPrivilegesSchema, diff --git a/x-pack/packages/security/plugin_types_server/src/authentication/authentication_service.ts b/x-pack/packages/security/plugin_types_server/src/authentication/authentication_service.ts index 6bc5a73113ae3..5d066bb6565ca 100644 --- a/x-pack/packages/security/plugin_types_server/src/authentication/authentication_service.ts +++ b/x-pack/packages/security/plugin_types_server/src/authentication/authentication_service.ts @@ -6,14 +6,13 @@ */ import type { KibanaRequest } from '@kbn/core/server'; -import type { AuthenticatedUser } from '@kbn/core-security-common'; - -import type { APIKeys } from './api_keys'; +import type { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import type { APIKeysService } from '@kbn/core-security-server'; /** * Authentication services available on the security plugin's start contract. */ export interface AuthenticationServiceStart { - apiKeys: APIKeys; + apiKeys: APIKeysService; getCurrentUser: (request: KibanaRequest) => AuthenticatedUser | null; } diff --git a/x-pack/packages/security/plugin_types_server/src/authentication/index.ts b/x-pack/packages/security/plugin_types_server/src/authentication/index.ts index 6e30f9ebcec24..4a5e7da782baf 100644 --- a/x-pack/packages/security/plugin_types_server/src/authentication/index.ts +++ b/x-pack/packages/security/plugin_types_server/src/authentication/index.ts @@ -5,29 +5,22 @@ * 2.0. */ +export type { AuthenticationServiceStart } from './authentication_service'; + export type { - CreateAPIKeyParams, - CreateAPIKeyResult, - CreateRestAPIKeyParams, - CreateRestAPIKeyWithKibanaPrivilegesParams, - CreateCrossClusterAPIKeyParams, - InvalidateAPIKeyResult, - InvalidateAPIKeysParams, - ValidateAPIKeyParams, - APIKeys, - GrantAPIKeyResult, + APIKeysService as APIKeys, UpdateAPIKeyParams, UpdateAPIKeyResult, UpdateCrossClusterAPIKeyParams, UpdateRestAPIKeyParams, UpdateRestAPIKeyWithKibanaPrivilegesParams, -} from './api_keys'; -export type { AuthenticationServiceStart } from './authentication_service'; +} from '@kbn/core-security-server'; + export { - restApiKeySchema, + crossClusterApiKeySchema, getRestApiKeyWithKibanaPrivilegesSchema, getUpdateRestApiKeyWithKibanaPrivilegesSchema, - crossClusterApiKeySchema, + restApiKeySchema, updateRestApiKeySchema, updateCrossClusterApiKeySchema, } from './api_keys'; diff --git a/x-pack/packages/security/plugin_types_server/src/authorization/index.ts b/x-pack/packages/security/plugin_types_server/src/authorization/index.ts index 54364d7817f31..baeeeddc1fa74 100644 --- a/x-pack/packages/security/plugin_types_server/src/authorization/index.ts +++ b/x-pack/packages/security/plugin_types_server/src/authorization/index.ts @@ -42,7 +42,6 @@ export type { PrivilegeDeprecationsRolesByFeatureIdResponse, } from './deprecations'; export type { AuthorizationMode } from './mode'; -export type { ElasticsearchPrivilegesType, KibanaPrivilegesType } from './role_schema'; export { GLOBAL_RESOURCE } from './constants'; export { elasticsearchRoleSchema, getKibanaRoleSchema } from './role_schema'; diff --git a/x-pack/packages/security/plugin_types_server/tsconfig.json b/x-pack/packages/security/plugin_types_server/tsconfig.json index 04ed00229a3de..2f4ae387ac2b5 100644 --- a/x-pack/packages/security/plugin_types_server/tsconfig.json +++ b/x-pack/packages/security/plugin_types_server/tsconfig.json @@ -10,11 +10,10 @@ "target/**/*" ], "kbn_references": [ - "@kbn/config-schema", "@kbn/core", "@kbn/security-plugin-types-common", "@kbn/core-user-profile-server", "@kbn/core-security-server", - "@kbn/core-security-common" + "@kbn/config-schema", ] } diff --git a/x-pack/plugins/actions/server/actions_client/actions_client.test.ts b/x-pack/plugins/actions/server/actions_client/actions_client.test.ts index 8f08bbb4b2d5a..46e73f7bb3591 100644 --- a/x-pack/plugins/actions/server/actions_client/actions_client.test.ts +++ b/x-pack/plugins/actions/server/actions_client/actions_client.test.ts @@ -8,6 +8,7 @@ import { schema } from '@kbn/config-schema'; import moment from 'moment'; import { ByteSizeValue } from '@kbn/config-schema'; +import { MockedLogger, loggerMock } from '@kbn/logging-mocks'; import { DEFAULT_MICROSOFT_EXCHANGE_URL, DEFAULT_MICROSOFT_GRAPH_API_SCOPE, @@ -47,7 +48,7 @@ import { actionsAuthorizationMock } from '../authorization/actions_authorization import { trackLegacyRBACExemption } from '../lib/track_legacy_rbac_exemption'; import { ConnectorTokenClient } from '../lib/connector_token_client'; import { encryptedSavedObjectsMock } from '@kbn/encrypted-saved-objects-plugin/server/mocks'; -import { Logger, SavedObject } from '@kbn/core/server'; +import { SavedObject } from '@kbn/core/server'; import { connectorTokenClientMock } from '../lib/connector_token_client.mock'; import { inMemoryMetricsMock } from '../monitoring/in_memory_metrics.mock'; import { getOAuthJwtAccessToken } from '../lib/get_oauth_jwt_access_token'; @@ -108,7 +109,6 @@ const request = httpServerMock.createKibanaRequest(); const auditLogger = auditLoggerMock.create(); const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); -const logger = loggingSystemMock.create().get() as jest.Mocked; const mockTaskManager = taskManagerMock.createSetup(); const configurationUtilities = actionsConfigMock.create(); const eventLogClient = eventLogClientMock.create(); @@ -133,8 +133,11 @@ const actionTypeIdFromSavedObjectMock = (actionTypeId: string = 'my-action-type' } as SavedObject; }; +let logger: MockedLogger; + beforeEach(() => { jest.resetAllMocks(); + logger = loggerMock.create(); mockedLicenseState = licenseStateMock.create(); actionTypeRegistryParams = { licensing: licensingMock.createSetup(), @@ -1853,9 +1856,13 @@ describe('getOAuthAccessToken()', () => { tokenUrl: 'https://testurl.service-now.com/oauth_token.do', }); expect(getOAuthClientCredentialsAccessToken).not.toHaveBeenCalled(); - expect(logger.debug).toHaveBeenCalledWith( - `Successfully retrieved access token using JWT OAuth with tokenUrl https://testurl.service-now.com/oauth_token.do and config {\"clientId\":\"abc\",\"jwtKeyId\":\"def\",\"userIdentifierValue\":\"userA\"}` - ); + expect(loggingSystemMock.collect(logger).debug).toMatchInlineSnapshot(` + Array [ + Array [ + "Successfully retrieved access token using JWT OAuth with tokenUrl https://testurl.service-now.com/oauth_token.do and config {\\"clientId\\":\\"abc\\",\\"jwtKeyId\\":\\"def\\",\\"userIdentifierValue\\":\\"userA\\"}", + ], + ] + `); }); test('calls getOAuthClientCredentialsAccessToken when type="client"', async () => { @@ -1892,9 +1899,13 @@ describe('getOAuthAccessToken()', () => { oAuthScope: 'https://graph.microsoft.com/.default', }); expect(getOAuthJwtAccessToken).not.toHaveBeenCalled(); - expect(logger.debug).toHaveBeenCalledWith( - `Successfully retrieved access token using Client Credentials OAuth with tokenUrl https://login.microsoftonline.com/98765/oauth2/v2.0/token, scope https://graph.microsoft.com/.default and config {\"clientId\":\"abc\",\"tenantId\":\"def\"}` - ); + expect(loggingSystemMock.collect(logger).debug).toMatchInlineSnapshot(` + Array [ + Array [ + "Successfully retrieved access token using Client Credentials OAuth with tokenUrl https://login.microsoftonline.com/98765/oauth2/v2.0/token, scope https://graph.microsoft.com/.default and config {\\"clientId\\":\\"abc\\",\\"tenantId\\":\\"def\\"}", + ], + ] + `); }); test('throws when getOAuthJwtAccessToken throws error', async () => { @@ -1919,9 +1930,13 @@ describe('getOAuthAccessToken()', () => { ).rejects.toMatchInlineSnapshot(`[Error: Failed to retrieve access token]`); expect(getOAuthJwtAccessToken as jest.Mock).toHaveBeenCalled(); - expect(logger.debug).toHaveBeenCalledWith( - `Failed to retrieve access token using JWT OAuth with tokenUrl https://testurl.service-now.com/oauth_token.do and config {\"clientId\":\"abc\",\"jwtKeyId\":\"def\",\"userIdentifierValue\":\"userA\"} - Something went wrong!` - ); + expect(loggingSystemMock.collect(logger).debug).toMatchInlineSnapshot(` + Array [ + Array [ + "Failed to retrieve access token using JWT OAuth with tokenUrl https://testurl.service-now.com/oauth_token.do and config {\\"clientId\\":\\"abc\\",\\"jwtKeyId\\":\\"def\\",\\"userIdentifierValue\\":\\"userA\\"} - Something went wrong!", + ], + ] + `); }); test('throws when getOAuthClientCredentialsAccessToken throws error', async () => { @@ -1947,9 +1962,13 @@ describe('getOAuthAccessToken()', () => { ).rejects.toMatchInlineSnapshot(`[Error: Failed to retrieve access token]`); expect(getOAuthClientCredentialsAccessToken as jest.Mock).toHaveBeenCalled(); - expect(logger.debug).toHaveBeenCalledWith( - `Failed to retrieved access token using Client Credentials OAuth with tokenUrl https://login.microsoftonline.com/98765/oauth2/v2.0/token, scope https://graph.microsoft.com/.default and config {\"clientId\":\"abc\",\"tenantId\":\"def\"} - Something went wrong!` - ); + expect(loggingSystemMock.collect(logger).debug).toMatchInlineSnapshot(` + Array [ + Array [ + "Failed to retrieved access token using Client Credentials OAuth with tokenUrl https://login.microsoftonline.com/98765/oauth2/v2.0/token, scope https://graph.microsoft.com/.default and config {\\"clientId\\":\\"abc\\",\\"tenantId\\":\\"def\\"} - Something went wrong!", + ], + ] + `); }); }); diff --git a/x-pack/plugins/actions/server/actions_client/actions_client.ts b/x-pack/plugins/actions/server/actions_client/actions_client.ts index 1187898006f9e..10c47731ef004 100644 --- a/x-pack/plugins/actions/server/actions_client/actions_client.ts +++ b/x-pack/plugins/actions/server/actions_client/actions_client.ts @@ -557,15 +557,17 @@ export class ActionsClient { }); this.context.logger.debug( - `Successfully retrieved access token using JWT OAuth with tokenUrl ${ - tokenOpts.tokenUrl - } and config ${JSON.stringify(tokenOpts.config)}` + () => + `Successfully retrieved access token using JWT OAuth with tokenUrl ${ + tokenOpts.tokenUrl + } and config ${JSON.stringify(tokenOpts.config)}` ); } catch (err) { this.context.logger.debug( - `Failed to retrieve access token using JWT OAuth with tokenUrl ${ - tokenOpts.tokenUrl - } and config ${JSON.stringify(tokenOpts.config)} - ${err.message}` + () => + `Failed to retrieve access token using JWT OAuth with tokenUrl ${ + tokenOpts.tokenUrl + } and config ${JSON.stringify(tokenOpts.config)} - ${err.message}` ); throw Boom.badRequest(`Failed to retrieve access token`); } @@ -584,17 +586,19 @@ export class ActionsClient { }); this.context.logger.debug( - `Successfully retrieved access token using Client Credentials OAuth with tokenUrl ${ - tokenOpts.tokenUrl - }, scope ${tokenOpts.scope} and config ${JSON.stringify(tokenOpts.config)}` + () => + `Successfully retrieved access token using Client Credentials OAuth with tokenUrl ${ + tokenOpts.tokenUrl + }, scope ${tokenOpts.scope} and config ${JSON.stringify(tokenOpts.config)}` ); } catch (err) { this.context.logger.debug( - `Failed to retrieved access token using Client Credentials OAuth with tokenUrl ${ - tokenOpts.tokenUrl - }, scope ${tokenOpts.scope} and config ${JSON.stringify(tokenOpts.config)} - ${ - err.message - }` + () => + `Failed to retrieved access token using Client Credentials OAuth with tokenUrl ${ + tokenOpts.tokenUrl + }, scope ${tokenOpts.scope} and config ${JSON.stringify(tokenOpts.config)} - ${ + err.message + }` ); throw Boom.badRequest(`Failed to retrieve access token`); } diff --git a/x-pack/plugins/actions/server/integration_tests/__snapshots__/connector_types.test.ts.snap b/x-pack/plugins/actions/server/integration_tests/__snapshots__/connector_types.test.ts.snap index e1366f7f9c573..05d74f781c434 100644 --- a/x-pack/plugins/actions/server/integration_tests/__snapshots__/connector_types.test.ts.snap +++ b/x-pack/plugins/actions/server/integration_tests/__snapshots__/connector_types.test.ts.snap @@ -7561,6 +7561,44 @@ Object { ], "type": "alternatives", }, + "scriptType": Object { + "flags": Object { + "default": null, + "error": [Function], + "presence": "optional", + }, + "matches": Array [ + Object { + "schema": Object { + "flags": Object { + "error": [Function], + }, + "rules": Array [ + Object { + "args": Object { + "method": [Function], + }, + "name": "custom", + }, + ], + "type": "string", + }, + }, + Object { + "schema": Object { + "allow": Array [ + null, + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + ], + "type": "alternatives", + }, }, "type": "object", } diff --git a/x-pack/plugins/actions/server/lib/action_executor.test.ts b/x-pack/plugins/actions/server/lib/action_executor.test.ts index bfcedc821368f..b2e6badae3c59 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.test.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.test.ts @@ -1695,10 +1695,35 @@ describe('Event log', () => { { actionTypeId: '.gen-ai', completion_tokens: 9, prompt_tokens: 10, total_tokens: 19 } ); }); + test('reports telemetry for token count events with additional properties', async () => { + const executorMock = setupActionExecutorMock('.gen-ai', {} as ConnectorType['validate'], { + defaultModel: 'gpt-4', + apiProvider: 'OpenAI', + }); + executorMock.mockResolvedValue({ + actionId: '1', + status: 'ok', + // @ts-ignore + data: mockGenAi, + }); + await actionExecutor.execute(executeParams); + expect(actionExecutorInitializationParams.analyticsService.reportEvent).toHaveBeenCalledWith( + GEN_AI_TOKEN_COUNT_EVENT.eventType, + { + actionTypeId: '.gen-ai', + completion_tokens: 9, + prompt_tokens: 10, + total_tokens: 19, + model: 'gpt-4', + provider: 'OpenAI', + } + ); + }); }); function setupActionExecutorMock( actionTypeId = 'test', - validationOverride?: ConnectorType['validate'] + validationOverride?: ConnectorType['validate'], + additionalConfig?: Record ) { const thisConnectorType: jest.Mocked = { ...connectorType, @@ -1712,6 +1737,7 @@ function setupActionExecutorMock( actionTypeId, config: { bar: true, + ...additionalConfig, }, secrets: { baz: true, diff --git a/x-pack/plugins/actions/server/lib/action_executor.ts b/x-pack/plugins/actions/server/lib/action_executor.ts index f8f8f32547c10..685e18c585ae0 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.ts @@ -603,6 +603,7 @@ export class ActionExecutor { ...(actionTypeId === '.gen-ai' && config?.apiProvider != null ? { provider: config?.apiProvider } : {}), + ...(config?.defaultModel != null ? { model: config?.defaultModel } : {}), }); } }) diff --git a/x-pack/plugins/actions/server/lib/event_based_telemetry.ts b/x-pack/plugins/actions/server/lib/event_based_telemetry.ts index eb7ad8dbdfb65..2a8006758489f 100644 --- a/x-pack/plugins/actions/server/lib/event_based_telemetry.ts +++ b/x-pack/plugins/actions/server/lib/event_based_telemetry.ts @@ -13,6 +13,7 @@ export const GEN_AI_TOKEN_COUNT_EVENT: EventTypeOpts<{ prompt_tokens: number; completion_tokens: number; provider?: string; + model?: string; }> = { eventType: 'gen_ai_token_count', schema: { @@ -51,6 +52,13 @@ export const GEN_AI_TOKEN_COUNT_EVENT: EventTypeOpts<{ optional: true, }, }, + model: { + type: 'keyword', + _meta: { + description: 'LLM model', + optional: true, + }, + }, }, }; diff --git a/x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.ts b/x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.ts index 19cc7e90d6254..d5ad5391628bc 100644 --- a/x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.ts +++ b/x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.ts @@ -107,7 +107,7 @@ export abstract class SubActionConnector { responseSchema.validate(data); } catch (resValidationError) { const err = new Error(`Response validation failed (${resValidationError})`); - this.logger.debug(`${err.message}:\n${inspect(data, { depth: 10 })}`); + this.logger.debug(() => `${err.message}:\n${inspect(data, { depth: 10 })}`); throw err; } } diff --git a/x-pack/plugins/aiops/public/plugin.tsx b/x-pack/plugins/aiops/public/plugin.tsx index b1d62c4275180..7d55c3098cfaf 100755 --- a/x-pack/plugins/aiops/public/plugin.tsx +++ b/x-pack/plugins/aiops/public/plugin.tsx @@ -41,7 +41,9 @@ export class AiopsPlugin { registerChangePointChartsAttachment }, [coreStart, pluginStart], ]) => { - if (license.hasAtLeast('platinum')) { + const { canUseAiops } = coreStart.application.capabilities.ml; + + if (license.hasAtLeast('platinum') && canUseAiops) { if (embeddable) { registerEmbeddables(embeddable, core); } diff --git a/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/grouping_handler.ts b/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/grouping_handler.ts index 8fe478a805355..258b94bb12cc6 100644 --- a/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/grouping_handler.ts +++ b/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/grouping_handler.ts @@ -40,7 +40,7 @@ import type { ResponseStreamFetchOptions } from '../response_stream_factory'; export const groupingHandlerFactory = ({ abortSignal, - client, + esClient, requestBody, responseStream, logDebugMessage, @@ -81,24 +81,26 @@ export const groupingHandlerFactory = ); try { - const { fields, itemSets } = await fetchFrequentItemSets( - client, - requestBody.index, - JSON.parse(requestBody.searchQuery) as estypes.QueryDslQueryContainer, - significantTerms, - requestBody.timeFieldName, - requestBody.deviationMin, - requestBody.deviationMax, + const { fields, itemSets } = await fetchFrequentItemSets({ + esClient, logger, - stateHandler.sampleProbability(), - responseStream.pushError, - abortSignal - ); + emitError: responseStream.pushError, + abortSignal, + arguments: { + index: requestBody.index, + searchQuery: JSON.parse(requestBody.searchQuery) as estypes.QueryDslQueryContainer, + significantItems: significantTerms, + timeFieldName: requestBody.timeFieldName, + deviationMin: requestBody.deviationMin, + deviationMax: requestBody.deviationMax, + sampleProbability: stateHandler.sampleProbability(), + }, + }); if (significantCategories.length > 0 && significantTerms.length > 0) { const { fields: significantCategoriesFields, itemSets: significantCategoriesItemSets } = await fetchTerms2CategoriesCounts( - client, + esClient, requestBody, JSON.parse(requestBody.searchQuery) as estypes.QueryDslQueryContainer, significantTerms, @@ -161,27 +163,26 @@ export const groupingHandlerFactory = let cpgTimeSeries: NumericChartData; try { cpgTimeSeries = ( - (await fetchHistogramsForFields( - client, - requestBody.index, - histogramQuery, - // fields - [ - { - fieldName: requestBody.timeFieldName, - type: KBN_FIELD_TYPES.DATE, - interval: overallTimeSeries.interval, - min: overallTimeSeries.stats[0], - max: overallTimeSeries.stats[1], - }, - ], - // samplerShardSize - -1, - undefined, + (await fetchHistogramsForFields({ + esClient, abortSignal, - stateHandler.sampleProbability(), - RANDOM_SAMPLER_SEED - )) as [NumericChartData] + arguments: { + indexPattern: requestBody.index, + query: histogramQuery, + fields: [ + { + fieldName: requestBody.timeFieldName, + type: KBN_FIELD_TYPES.DATE, + interval: overallTimeSeries.interval, + min: overallTimeSeries.stats[0], + max: overallTimeSeries.stats[1], + }, + ], + samplerShardSize: -1, + randomSamplerProbability: stateHandler.sampleProbability(), + randomSamplerSeed: RANDOM_SAMPLER_SEED, + }, + })) as [NumericChartData] )[0]; } catch (e) { if (!isRequestAbortedError(e)) { diff --git a/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/histogram_handler.ts b/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/histogram_handler.ts index e3501a53f5df8..2863d5c6dd427 100644 --- a/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/histogram_handler.ts +++ b/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/histogram_handler.ts @@ -35,7 +35,7 @@ import type { ResponseStreamFetchOptions } from '../response_stream_factory'; export const histogramHandlerFactory = ({ abortSignal, - client, + esClient, logDebugMessage, logger, requestBody, @@ -90,27 +90,26 @@ export const histogramHandlerFactory = try { cpTimeSeries = ( - (await fetchHistogramsForFields( - client, - requestBody.index, - histogramQuery, - // fields - [ - { - fieldName: requestBody.timeFieldName, - type: KBN_FIELD_TYPES.DATE, - interval: overallTimeSeries.interval, - min: overallTimeSeries.stats[0], - max: overallTimeSeries.stats[1], - }, - ], - // samplerShardSize - -1, - undefined, + (await fetchHistogramsForFields({ + esClient, abortSignal, - stateHandler.sampleProbability(), - RANDOM_SAMPLER_SEED - )) as [NumericChartData] + arguments: { + indexPattern: requestBody.index, + query: histogramQuery, + fields: [ + { + fieldName: requestBody.timeFieldName, + type: KBN_FIELD_TYPES.DATE, + interval: overallTimeSeries.interval, + min: overallTimeSeries.stats[0], + max: overallTimeSeries.stats[1], + }, + ], + samplerShardSize: -1, + randomSamplerProbability: stateHandler.sampleProbability(), + randomSamplerSeed: RANDOM_SAMPLER_SEED, + }, + })) as [NumericChartData] )[0]; } catch (e) { logger.error( @@ -183,27 +182,26 @@ export const histogramHandlerFactory = try { catTimeSeries = ( - (await fetchHistogramsForFields( - client, - requestBody.index, - histogramQuery, - // fields - [ - { - fieldName: requestBody.timeFieldName, - type: KBN_FIELD_TYPES.DATE, - interval: overallTimeSeries.interval, - min: overallTimeSeries.stats[0], - max: overallTimeSeries.stats[1], - }, - ], - // samplerShardSize - -1, - undefined, + (await fetchHistogramsForFields({ + esClient, abortSignal, - stateHandler.sampleProbability(), - RANDOM_SAMPLER_SEED - )) as [NumericChartData] + arguments: { + indexPattern: requestBody.index, + query: histogramQuery, + fields: [ + { + fieldName: requestBody.timeFieldName, + type: KBN_FIELD_TYPES.DATE, + interval: overallTimeSeries.interval, + min: overallTimeSeries.stats[0], + max: overallTimeSeries.stats[1], + }, + ], + samplerShardSize: -1, + randomSamplerProbability: stateHandler.sampleProbability(), + randomSamplerSeed: RANDOM_SAMPLER_SEED, + }, + })) as [NumericChartData] )[0]; } catch (e) { logger.error( diff --git a/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/index_info_handler.ts b/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/index_info_handler.ts index 5c326e7821887..1a01d9c543206 100644 --- a/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/index_info_handler.ts +++ b/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/index_info_handler.ts @@ -24,7 +24,7 @@ export const indexInfoHandlerFactory = async () => { const { abortSignal, - client, + esClient, logDebugMessage, logger, requestBody, @@ -56,12 +56,14 @@ export const indexInfoHandlerFactory = ); try { - const indexInfo = await fetchIndexInfo( - client, - requestBody, - ['message', 'error.message'], - abortSignal - ); + const indexInfo = await fetchIndexInfo({ + esClient, + abortSignal, + arguments: { + ...requestBody, + textFieldCandidatesOverrides: ['message', 'error.message'], + }, + }); logDebugMessage(`Baseline document count: ${indexInfo.baselineTotalDocCount}`); logDebugMessage(`Deviation document count: ${indexInfo.deviationTotalDocCount}`); diff --git a/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/overall_histogram_handler.ts b/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/overall_histogram_handler.ts index 7e4114148a4ed..97e56795a9dfc 100644 --- a/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/overall_histogram_handler.ts +++ b/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/overall_histogram_handler.ts @@ -22,7 +22,7 @@ import type { ResponseStreamFetchOptions } from '../response_stream_factory'; export const overallHistogramHandlerFactory = ({ abortSignal, - client, + esClient, requestBody, logDebugMessage, logger, @@ -42,19 +42,18 @@ export const overallHistogramHandlerFactory = try { overallTimeSeries = ( - (await fetchHistogramsForFields( - client, - requestBody.index, - overallHistogramQuery, - // fields - histogramFields, - // samplerShardSize - -1, - undefined, + (await fetchHistogramsForFields({ + esClient, abortSignal, - stateHandler.sampleProbability(), - RANDOM_SAMPLER_SEED - )) as [NumericChartData] + arguments: { + indexPattern: requestBody.index, + query: overallHistogramQuery, + fields: histogramFields, + samplerShardSize: -1, + randomSamplerProbability: stateHandler.sampleProbability(), + randomSamplerSeed: RANDOM_SAMPLER_SEED, + }, + })) as [NumericChartData] )[0]; } catch (e) { if (!isRequestAbortedError(e)) { diff --git a/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/significant_items_handler.ts b/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/significant_items_handler.ts index 92d400b466653..197cc17b77a91 100644 --- a/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/significant_items_handler.ts +++ b/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/significant_items_handler.ts @@ -46,7 +46,7 @@ type Candidate = FieldCandidate | TextFieldCandidate; export const significantItemsHandlerFactory = ({ abortSignal, - client, + esClient, logDebugMessage, logger, requestBody, @@ -110,15 +110,17 @@ export const significantItemsHandlerFactory = let pValues: Awaited>; try { - pValues = await fetchSignificantTermPValues( - client, - requestBody, - [fieldCandidate], + pValues = await fetchSignificantTermPValues({ + esClient, + abortSignal, logger, - stateHandler.sampleProbability(), - responseStream.pushError, - abortSignal - ); + emitError: responseStream.pushError, + arguments: { + ...requestBody, + fieldNames: [fieldCandidate], + sampleProbability: stateHandler.sampleProbability(), + }, + }); } catch (e) { if (!isRequestAbortedError(e)) { logger.error( @@ -144,15 +146,17 @@ export const significantItemsHandlerFactory = } else if (isTextFieldCandidate(payload)) { const { textFieldCandidate } = payload; - const significantCategoriesForField = await fetchSignificantCategories( - client, - requestBody, - [textFieldCandidate], + const significantCategoriesForField = await fetchSignificantCategories({ + esClient, logger, - stateHandler.sampleProbability(), - responseStream.pushError, - abortSignal - ); + emitError: responseStream.pushError, + abortSignal, + arguments: { + ...requestBody, + fieldNames: [textFieldCandidate], + sampleProbability: stateHandler.sampleProbability(), + }, + }); if (significantCategoriesForField.length > 0) { significantCategories.push(...significantCategoriesForField); diff --git a/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/top_items_handler.ts b/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/top_items_handler.ts index 8844bd5082e33..882057bc12cbf 100644 --- a/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/top_items_handler.ts +++ b/x-pack/plugins/aiops/server/routes/log_rate_analysis/analysis_handlers/top_items_handler.ts @@ -33,7 +33,7 @@ import type { ResponseStreamFetchOptions } from '../response_stream_factory'; export const topItemsHandlerFactory = ({ abortSignal, - client, + esClient, logDebugMessage, logger, requestBody, @@ -64,7 +64,7 @@ export const topItemsHandlerFactory = if (textFieldCandidates.length > 0) { topCategories.push( ...(await fetchTopCategories( - client, + esClient, requestBody, textFieldCandidates, logger, @@ -113,7 +113,7 @@ export const topItemsHandlerFactory = try { fetchedTopTerms = await fetchTopTerms( - client, + esClient, requestBody, [fieldCandidate], logger, diff --git a/x-pack/plugins/aiops/server/routes/log_rate_analysis/response_stream_factory.ts b/x-pack/plugins/aiops/server/routes/log_rate_analysis/response_stream_factory.ts index f6ada20d3f4f8..a3e525598ef25 100644 --- a/x-pack/plugins/aiops/server/routes/log_rate_analysis/response_stream_factory.ts +++ b/x-pack/plugins/aiops/server/routes/log_rate_analysis/response_stream_factory.ts @@ -39,7 +39,7 @@ import { streamPushPingWithTimeoutFactory } from './response_stream_utils/stream */ export interface ResponseStreamOptions { version: T; - client: ElasticsearchClient; + esClient: ElasticsearchClient; requestBody: AiopsLogRateAnalysisSchema; events: KibanaRequestEvents; headers: Headers; diff --git a/x-pack/plugins/aiops/server/routes/log_rate_analysis/route_handler_factory.ts b/x-pack/plugins/aiops/server/routes/log_rate_analysis/route_handler_factory.ts index 0864efbcf63da..4c8145043891f 100644 --- a/x-pack/plugins/aiops/server/routes/log_rate_analysis/route_handler_factory.ts +++ b/x-pack/plugins/aiops/server/routes/log_rate_analysis/route_handler_factory.ts @@ -58,14 +58,14 @@ export function routeHandlerFactory( return response.forbidden(); } - const client = (await context.core).elasticsearch.client.asCurrentUser; + const esClient = (await context.core).elasticsearch.client.asCurrentUser; const executionContext = createExecutionContext(coreStart, AIOPS_PLUGIN_ID, request.route.path); return await coreStart.executionContext.withContext(executionContext, () => { const { analysis, logDebugMessage, stateHandler, responseStream, responseWithHeaders } = responseStreamFactory({ version, - client, + esClient, requestBody: request.body, events: request.events, headers: request.headers, diff --git a/x-pack/plugins/alerting/server/alerts_client/alerts_client.ts b/x-pack/plugins/alerting/server/alerts_client/alerts_client.ts index 66cc1a3077481..136d7dd73d32a 100644 --- a/x-pack/plugins/alerting/server/alerts_client/alerts_client.ts +++ b/x-pack/plugins/alerting/server/alerts_client/alerts_client.ts @@ -520,9 +520,10 @@ export class AlertsClient< ); } else { this.options.logger.debug( - `Could not find alert document to update for recovered alert with id ${id} and uuid ${currentRecoveredAlerts[ - id - ].getUuid()}` + () => + `Could not find alert document to update for recovered alert with id ${id} and uuid ${currentRecoveredAlerts[ + id + ].getUuid()}` ); } } diff --git a/x-pack/plugins/alerting/server/alerts_service/lib/data_stream_adapter.ts b/x-pack/plugins/alerting/server/alerts_service/lib/data_stream_adapter.ts index 0a3710ecf1159..98cd0b67ff05a 100644 --- a/x-pack/plugins/alerting/server/alerts_service/lib/data_stream_adapter.ts +++ b/x-pack/plugins/alerting/server/alerts_service/lib/data_stream_adapter.ts @@ -152,9 +152,10 @@ async function createAliasStream(opts: CreateConcreteWriteIndexOpts): Promise + `Found ${concreteIndices.length} concrete indices for ${ + indexPatterns.name + } - ${JSON.stringify(concreteIndices)}` ); } catch (error) { // 404 is expected if no concrete write indices have been created diff --git a/x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.test.ts b/x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.test.ts index da0b65f550deb..bc5cc108dba2b 100644 --- a/x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.test.ts +++ b/x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.test.ts @@ -25,7 +25,7 @@ const esqlQueryRequest = { }, }; -const logger = loggingSystemMock.create().get(); +let logger = loggingSystemMock.create().get(); const rule = { name: 'test-rule', @@ -43,6 +43,10 @@ describe('wrapScopedClusterClient', () => { jest.useRealTimers(); }); + beforeEach(() => { + logger = loggingSystemMock.create().get(); + }); + afterEach(() => { jest.resetAllMocks(); }); @@ -68,7 +72,7 @@ describe('wrapScopedClusterClient', () => { }); expect(scopedClusterClient.asInternalUser.search).not.toHaveBeenCalled(); expect(scopedClusterClient.asCurrentUser.search).not.toHaveBeenCalled(); - expect(logger.debug).toHaveBeenCalledWith( + expect(loggingSystemMock.collect(logger).debug[0][0]).toEqual( `executing query for rule .test-rule-type:abcdefg in space my-space - {\"body\":{\"query\":{\"bool\":{\"filter\":{\"range\":{\"@timestamp\":{\"gte\":0}}}}}}} - with options {} and 5000ms requestTimeout` ); }); @@ -93,7 +97,7 @@ describe('wrapScopedClusterClient', () => { }); expect(scopedClusterClient.asInternalUser.search).not.toHaveBeenCalled(); expect(scopedClusterClient.asCurrentUser.search).not.toHaveBeenCalled(); - expect(logger.debug).toHaveBeenCalledWith( + expect(loggingSystemMock.collect(logger).debug[0][0]).toEqual( `executing query for rule .test-rule-type:abcdefg in space my-space - {\"body\":{\"query\":{\"bool\":{\"filter\":{\"range\":{\"@timestamp\":{\"gte\":0}}}}}}} - with options {} and 5000ms requestTimeout` ); }); @@ -193,7 +197,7 @@ describe('wrapScopedClusterClient', () => { expect(stats.numSearches).toEqual(3); expect(stats.esSearchDurationMs).toEqual(999); - expect(logger.debug).toHaveBeenCalledWith( + expect(loggingSystemMock.collect(logger).debug[0][0]).toEqual( `executing query for rule .test-rule-type:abcdefg in space my-space - {\"body\":{\"query\":{\"bool\":{\"filter\":{\"range\":{\"@timestamp\":{\"gte\":0}}}}}}} - with options {}` ); }); @@ -241,7 +245,7 @@ describe('wrapScopedClusterClient', () => { }); expect(scopedClusterClient.asInternalUser.search).not.toHaveBeenCalled(); expect(scopedClusterClient.asCurrentUser.search).not.toHaveBeenCalled(); - expect(logger.debug).toHaveBeenCalledWith( + expect(loggingSystemMock.collect(logger).debug[0][0]).toEqual( 'executing eql query for rule .test-rule-type:abcdefg in space my-space - {"index":"foo","query":"process where process.name == \\"regsvr32.exe\\""} - with options {} and 5000ms requestTimeout' ); }); @@ -266,7 +270,7 @@ describe('wrapScopedClusterClient', () => { }); expect(scopedClusterClient.asInternalUser.search).not.toHaveBeenCalled(); expect(scopedClusterClient.asCurrentUser.search).not.toHaveBeenCalled(); - expect(logger.debug).toHaveBeenCalledWith( + expect(loggingSystemMock.collect(logger).debug[0][0]).toEqual( 'executing eql query for rule .test-rule-type:abcdefg in space my-space - {"index":"foo","query":"process where process.name == \\"regsvr32.exe\\""} - with options {} and 5000ms requestTimeout' ); }); @@ -340,7 +344,7 @@ describe('wrapScopedClusterClient', () => { expect(stats.numSearches).toEqual(3); expect(stats.esSearchDurationMs).toEqual(999); - expect(logger.debug).toHaveBeenCalledWith( + expect(loggingSystemMock.collect(logger).debug[0][0]).toEqual( `executing eql query for rule .test-rule-type:abcdefg in space my-space - {\"index\":\"foo\",\"query\":\"process where process.name == \\\"regsvr32.exe\\\"\"} - with options {}` ); }); @@ -391,7 +395,7 @@ describe('wrapScopedClusterClient', () => { }); expect(scopedClusterClient.asInternalUser.search).not.toHaveBeenCalled(); expect(scopedClusterClient.asCurrentUser.search).not.toHaveBeenCalled(); - expect(logger.debug).toHaveBeenCalledWith( + expect(loggingSystemMock.collect(logger).debug[0][0]).toEqual( 'executing ES|QL query for rule .test-rule-type:abcdefg in space my-space - {"method":"POST","path":"/_query","body":{"query":"from .kibana_task_manager"}} - with options {} and 5000ms requestTimeout' ); }); @@ -416,7 +420,7 @@ describe('wrapScopedClusterClient', () => { }); expect(scopedClusterClient.asInternalUser.search).not.toHaveBeenCalled(); expect(scopedClusterClient.asCurrentUser.search).not.toHaveBeenCalled(); - expect(logger.debug).toHaveBeenCalledWith( + expect(loggingSystemMock.collect(logger).debug[0][0]).toEqual( 'executing ES|QL query for rule .test-rule-type:abcdefg in space my-space - {"method":"POST","path":"/_query","body":{"query":"from .kibana_task_manager"}} - with options {} and 5000ms requestTimeout' ); }); @@ -490,7 +494,7 @@ describe('wrapScopedClusterClient', () => { expect(stats.numSearches).toEqual(3); expect(stats.totalSearchDurationMs).toBeGreaterThan(-1); - expect(logger.debug).toHaveBeenCalledWith( + expect(loggingSystemMock.collect(logger).debug[0][0]).toEqual( `executing ES|QL query for rule .test-rule-type:abcdefg in space my-space - {\"method\":\"POST\",\"path\":\"/_query\",\"body\":{\"query\":\"from .kibana_task_manager\"}} - with options {}` ); }); diff --git a/x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.ts b/x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.ts index ac5b407e4029c..fb7575891dfc8 100644 --- a/x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.ts +++ b/x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.ts @@ -167,11 +167,12 @@ function getWrappedTransportRequestFn(opts: WrapEsClientOpts) { const requestOptions = options ?? {}; const start = Date.now(); opts.logger.debug( - `executing ES|QL query for rule ${opts.rule.alertTypeId}:${opts.rule.id} in space ${ - opts.rule.spaceId - } - ${JSON.stringify(params)} - with options ${JSON.stringify(requestOptions)}${ - requestTimeout ? ` and ${requestTimeout}ms requestTimeout` : '' - }` + () => + `executing ES|QL query for rule ${opts.rule.alertTypeId}:${opts.rule.id} in space ${ + opts.rule.spaceId + } - ${JSON.stringify(params)} - with options ${JSON.stringify(requestOptions)}${ + requestTimeout ? ` and ${requestTimeout}ms requestTimeout` : '' + }` ); const result = (await originalRequestFn.call(opts.esClient.transport, params, { ...requestOptions, @@ -235,11 +236,12 @@ function getWrappedEqlSearchFn(opts: WrapEsClientOpts) { const searchOptions = options ?? {}; const start = Date.now(); opts.logger.debug( - `executing eql query for rule ${opts.rule.alertTypeId}:${opts.rule.id} in space ${ - opts.rule.spaceId - } - ${JSON.stringify(params)} - with options ${JSON.stringify(searchOptions)}${ - requestTimeout ? ` and ${requestTimeout}ms requestTimeout` : '' - }` + () => + `executing eql query for rule ${opts.rule.alertTypeId}:${opts.rule.id} in space ${ + opts.rule.spaceId + } - ${JSON.stringify(params)} - with options ${JSON.stringify(searchOptions)}${ + requestTimeout ? ` and ${requestTimeout}ms requestTimeout` : '' + }` ); const result = (await originalEqlSearch.call(opts.esClient, params, { ...searchOptions, @@ -316,11 +318,12 @@ function getWrappedSearchFn(opts: WrapEsClientOpts) { const searchOptions = options ?? {}; const start = Date.now(); opts.logger.debug( - `executing query for rule ${opts.rule.alertTypeId}:${opts.rule.id} in space ${ - opts.rule.spaceId - } - ${JSON.stringify(params)} - with options ${JSON.stringify(searchOptions)}${ - requestTimeout ? ` and ${requestTimeout}ms requestTimeout` : '' - }` + () => + `executing query for rule ${opts.rule.alertTypeId}:${opts.rule.id} in space ${ + opts.rule.spaceId + } - ${JSON.stringify(params)} - with options ${JSON.stringify(searchOptions)}${ + requestTimeout ? ` and ${requestTimeout}ms requestTimeout` : '' + }` ); const result = (await originalSearch.call(opts.esClient, params, { ...searchOptions, diff --git a/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts b/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts index 21fe0e7ecb02f..2eb51cfd06f7a 100644 --- a/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts +++ b/x-pack/plugins/alerting/server/lib/wrap_search_source_client.test.ts @@ -11,7 +11,7 @@ import { createSearchSourceMock } from '@kbn/data-plugin/common/search/search_so import { of, throwError } from 'rxjs'; import { wrapSearchSourceClient } from './wrap_search_source_client'; -const logger = loggingSystemMock.create().get(); +let logger: ReturnType; const rule = { name: 'test-rule', @@ -38,6 +38,10 @@ describe('wrapSearchSourceClient', () => { jest.useFakeTimers({ legacyFakeTimers: true }); }); + beforeEach(() => { + logger = loggingSystemMock.createLogger(); + }); + afterAll(() => { jest.useRealTimers(); }); @@ -84,7 +88,7 @@ describe('wrapSearchSourceClient', () => { requestTimeout: 5000, }, }); - expect(logger.debug).toHaveBeenCalledWith( + expect(loggingSystemMock.collect(logger).debug.map((params) => params[0])).toContain( `executing query for rule .test-rule-type:abcdefg in space my-space - with options {} and 5000ms requestTimeout` ); }); @@ -136,7 +140,7 @@ describe('wrapSearchSourceClient', () => { expect(stats.numSearches).toEqual(3); expect(stats.esSearchDurationMs).toEqual(999); - expect(logger.debug).toHaveBeenCalledWith( + expect(loggingSystemMock.collect(logger).debug.map((params) => params[0])).toContain( `executing query for rule .test-rule-type:abcdefg in space my-space - with options {}` ); }); diff --git a/x-pack/plugins/alerting/server/lib/wrap_search_source_client.ts b/x-pack/plugins/alerting/server/lib/wrap_search_source_client.ts index 77d08a969fae0..e1cf3cba0bd24 100644 --- a/x-pack/plugins/alerting/server/lib/wrap_search_source_client.ts +++ b/x-pack/plugins/alerting/server/lib/wrap_search_source_client.ts @@ -153,11 +153,12 @@ function wrapFetch$({ const start = Date.now(); logger.debug( - `executing query for rule ${rule.alertTypeId}:${rule.id} in space ${ - rule.spaceId - } - with options ${JSON.stringify(searchOptions)}${ - requestTimeout ? ` and ${requestTimeout}ms requestTimeout` : '' - }` + () => + `executing query for rule ${rule.alertTypeId}:${rule.id} in space ${ + rule.spaceId + } - with options ${JSON.stringify(searchOptions)}${ + requestTimeout ? ` and ${requestTimeout}ms requestTimeout` : '' + }` ); return pureSearchSource diff --git a/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.test.ts b/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.test.ts index f768f85d17748..84181bb512a78 100644 --- a/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.test.ts @@ -366,6 +366,7 @@ describe('Ad Hoc Task Runner', () => { triggeredActionsStatus: 'complete', }); (RuleRunMetricsStore as jest.Mock).mockImplementation(() => ruleRunMetricsStore); + logger.isLevelEnabled.mockReturnValue(true); logger.get.mockImplementation(() => logger); taskRunnerFactoryInitializerParams.executionContext.withContext.mockImplementation((ctx, fn) => fn() @@ -1244,6 +1245,84 @@ describe('Ad Hoc Task Runner', () => { expect(logger.error).not.toHaveBeenCalled(); }); + test('should handle task cancellation signal due to timeout when for last schedule entry', async () => { + encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValue({ + ...mockedAdHocRunSO, + attributes: { + ...mockedAdHocRunSO.attributes, + schedule: [{ ...schedule1, status: adHocRunStatus.COMPLETE }, schedule2], + }, + }); + const taskRunner = new AdHocTaskRunner({ + context: taskRunnerFactoryInitializerParams, + internalSavedObjectsRepository, + taskInstance: mockedTaskInstance, + }); + + const promise = taskRunner.run(); + await Promise.resolve(); + await taskRunner.cancel(); + await promise; + await taskRunner.cleanup(); + + expect(encryptedSavedObjectsClient.getDecryptedAsInternalUser).toHaveBeenCalledWith( + AD_HOC_RUN_SAVED_OBJECT_TYPE, + 'abc', + {} + ); + expect(ruleTypeRegistry.get).toHaveBeenCalledWith('siem.queryRule'); + expect(ruleTypeRegistry.ensureRuleTypeEnabled).toHaveBeenCalledWith('siem.queryRule'); + expect(mockValidateRuleTypeParams).toHaveBeenCalledWith( + mockedAdHocRunSO.attributes.rule.params, + ruleTypeWithAlerts.validate.params + ); + + // @ts-ignore - accessing private variable + // should run the first entry in the schedule + expect(taskRunner.scheduleToRunIndex).toEqual(1); + expect(RuleRunMetricsStore).toHaveBeenCalledTimes(1); + expect(ruleTypeWithAlerts.executor).toHaveBeenCalledTimes(1); + + expect(internalSavedObjectsRepository.update).toHaveBeenCalledWith( + AD_HOC_RUN_SAVED_OBJECT_TYPE, + mockedAdHocRunSO.id, + { + schedule: [ + { ...schedule1, status: adHocRunStatus.COMPLETE }, + { ...schedule2, status: adHocRunStatus.TIMEOUT }, + ], + }, + { namespace: undefined, refresh: false } + ); + + expect(internalSavedObjectsRepository.delete).toHaveBeenCalledWith( + AD_HOC_RUN_SAVED_OBJECT_TYPE, + mockedAdHocRunSO.id, + { namespace: undefined, refresh: false } + ); + + testAlertingEventLogCalls({ + status: 'ok', + timeout: true, + backfillRunAt: schedule2.runAt, + backfillInterval: schedule2.interval, + }); + expect(logger.debug).toHaveBeenCalledTimes(3); + expect(logger.debug).nthCalledWith( + 1, + `Executing ad hoc run for rule test:rule-id for runAt ${schedule2.runAt}` + ); + expect(logger.debug).nthCalledWith( + 2, + `Cancelling execution for ad hoc run with id abc for rule type test with id rule-id - execution exceeded rule type timeout of 3m` + ); + expect(logger.debug).nthCalledWith( + 3, + `Aborting any in-progress ES searches for rule type test with id rule-id` + ); + expect(logger.error).not.toHaveBeenCalled(); + }); + test('should handle task cancellation that leads to executor throwing error', async () => { ruleTypeWithAlerts.executor.mockImplementationOnce(() => { throw new Error('Search has been aborted due to cancelled execution'); diff --git a/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.ts b/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.ts index bccf28a7cb7bc..61f8f411aef8b 100644 --- a/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/ad_hoc_task_runner.ts @@ -20,7 +20,7 @@ import { TaskErrorSource, } from '@kbn/task-manager-plugin/server'; import { nanosToMillis } from '@kbn/event-log-plugin/common'; -import { RunResult } from '@kbn/task-manager-plugin/server/task'; +import { CancellableTask, RunResult } from '@kbn/task-manager-plugin/server/task'; import { AdHocRunStatus, adHocRunStatus } from '../../common/constants'; import { RuleRunnerErrorStackTraceLog, RuleTaskStateAndMetrics, TaskRunnerContext } from './types'; import { getExecutorServices } from './get_executor_services'; @@ -66,7 +66,7 @@ interface RunParams { validatedParams: RuleTypeParams; } -export class AdHocTaskRunner { +export class AdHocTaskRunner implements CancellableTask { private readonly context: TaskRunnerContext; private readonly executionId: string; private readonly internalSavedObjectsRepository: ISavedObjectsRepository; @@ -573,6 +573,10 @@ export class AdHocTaskRunner { : undefined, }, }); + this.shouldDeleteTask = !this.hasAnyPendingRuns(); + + // cleanup function is not called for timed out tasks + await this.cleanup(); } async cleanup() { diff --git a/x-pack/plugins/alerting/server/task_runner/lib/process_run_result.test.ts b/x-pack/plugins/alerting/server/task_runner/lib/process_run_result.test.ts index e30865028867a..615a0416c8571 100644 --- a/x-pack/plugins/alerting/server/task_runner/lib/process_run_result.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/lib/process_run_result.test.ts @@ -6,12 +6,12 @@ */ import { processRunResults } from './process_run_result'; -import { loggingSystemMock } from '@kbn/core/server/mocks'; +import { loggerMock } from '@kbn/logging-mocks'; import { ruleResultServiceMock } from '../../monitoring/rule_result_service.mock'; import { asErr, asOk } from '../../lib/result_type'; import { ActionsCompletion } from '@kbn/alerting-state-types'; -const logger = loggingSystemMock.create().get(); +const logger = loggerMock.create(); const ruleResultService = ruleResultServiceMock.create(); const executionMetrics = { @@ -32,6 +32,7 @@ const executionMetrics = { describe('processRunResults', () => { beforeEach(() => { jest.resetAllMocks(); + logger.isLevelEnabled.mockReturnValue(true); }); test('should process results as expected when results are successful', () => { diff --git a/x-pack/plugins/alerting/server/task_runner/lib/process_run_result.ts b/x-pack/plugins/alerting/server/task_runner/lib/process_run_result.ts index d419ffeb72a3a..b1d898b1ec074 100644 --- a/x-pack/plugins/alerting/server/task_runner/lib/process_run_result.ts +++ b/x-pack/plugins/alerting/server/task_runner/lib/process_run_result.ts @@ -69,7 +69,7 @@ export function processRunResults({ (err: ElasticsearchError) => lastRunFromError(err) ); - if (logger) { + if (logger && logger.isLevelEnabled('debug')) { logger.debug(`deprecated ruleRunStatus for ${logPrefix}: ${JSON.stringify(executionStatus)}`); logger.debug(`ruleRunStatus for ${logPrefix}: ${JSON.stringify(lastRun)}`); if (executionMetrics) { diff --git a/x-pack/plugins/alerting/server/task_runner/log_alerts.test.ts b/x-pack/plugins/alerting/server/task_runner/log_alerts.test.ts index 8bde8e3abf403..aabd657289e75 100644 --- a/x-pack/plugins/alerting/server/task_runner/log_alerts.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/log_alerts.test.ts @@ -27,6 +27,7 @@ describe('logAlerts', () => { beforeEach(() => { jest.resetAllMocks(); + logger.isLevelEnabled.mockReturnValue(true); ruleRunMetricsStore = new RuleRunMetricsStore(); }); diff --git a/x-pack/plugins/alerting/server/task_runner/log_alerts.ts b/x-pack/plugins/alerting/server/task_runner/log_alerts.ts index 10d3f06dd0de5..a83f8ebb74ac4 100644 --- a/x-pack/plugins/alerting/server/task_runner/log_alerts.ts +++ b/x-pack/plugins/alerting/server/task_runner/log_alerts.ts @@ -58,7 +58,7 @@ export function logAlerts< }); } - if (activeAlertIds.length > 0) { + if (activeAlertIds.length > 0 && logger.isLevelEnabled('debug')) { logger.debug( `rule ${ruleLogPrefix} has ${activeAlertIds.length} active alerts: ${JSON.stringify( activeAlertIds.map((alertId) => ({ @@ -68,7 +68,7 @@ export function logAlerts< )}` ); } - if (recoveredAlertIds.length > 0) { + if (recoveredAlertIds.length > 0 && logger.isLevelEnabled('debug')) { logger.debug( `rule ${ruleLogPrefix} has ${recoveredAlertIds.length} recovered alerts: ${JSON.stringify( recoveredAlertIds 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 d87dbf17f2d89..d6f4e4942da1b 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts @@ -220,6 +220,7 @@ describe('Task Runner', () => { beforeEach(() => { jest.resetAllMocks(); + logger.isLevelEnabled.mockReturnValue(true); jest .requireMock('../lib/wrap_scoped_cluster_client') .createWrappedScopedClusterClientFactory.mockReturnValue({ 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 d5da0a3a8a226..fadd0a944acc8 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.ts @@ -630,11 +630,13 @@ export class TaskRunner< if (outcome === 'failure') { this.inMemoryMetrics.increment(IN_MEMORY_METRICS.RULE_FAILURES); } - this.logger.debug( - `Updating rule task for ${this.ruleType.id} rule with id ${ruleId} - ${JSON.stringify( - executionStatus - )} - ${JSON.stringify(lastRun)}` - ); + if (this.logger.isLevelEnabled('debug')) { + this.logger.debug( + `Updating rule task for ${this.ruleType.id} rule with id ${ruleId} - ${JSON.stringify( + executionStatus + )} - ${JSON.stringify(lastRun)}` + ); + } await this.updateRuleSavedObjectPostRun(ruleId, namespace, { executionStatus: ruleExecutionStatusToRaw(executionStatus), nextRun, 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 0e95ad588eda1..b41b26bd1ea49 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 @@ -198,6 +198,7 @@ describe('Task Runner Cancel', () => { alertingEventLogger.getStartAndDuration.mockImplementation(() => ({ start: new Date() })); (AlertingEventLogger as jest.Mock).mockImplementation(() => alertingEventLogger); logger.get.mockImplementation(() => logger); + logger.isLevelEnabled.mockReturnValue(true); actionsClient.bulkEnqueueExecution.mockResolvedValue({ errors: false, items: [] }); }); diff --git a/x-pack/plugins/alerting/server/usage/lib/get_telemetry_from_event_log.ts b/x-pack/plugins/alerting/server/usage/lib/get_telemetry_from_event_log.ts index 49b7c7374213d..df76929ca5d50 100644 --- a/x-pack/plugins/alerting/server/usage/lib/get_telemetry_from_event_log.ts +++ b/x-pack/plugins/alerting/server/usage/lib/get_telemetry_from_event_log.ts @@ -156,10 +156,10 @@ export async function getExecutionsPerDayCount({ }, }; - logger.debug(`query for getExecutionsPerDayCount - ${JSON.stringify(query)}`); + logger.debug(() => `query for getExecutionsPerDayCount - ${JSON.stringify(query)}`); const results = await esClient.search(query); - logger.debug(`results for getExecutionsPerDayCount query - ${JSON.stringify(results)}`); + logger.debug(() => `results for getExecutionsPerDayCount query - ${JSON.stringify(results)}`); const totalRuleExecutions = typeof results.hits.total === 'number' ? results.hits.total : results.hits.total?.value; @@ -242,10 +242,12 @@ export async function getExecutionTimeoutsPerDayCount({ }, }; - logger.debug(`query for getExecutionTimeoutsPerDayCount - ${JSON.stringify(query)}`); + logger.debug(() => `query for getExecutionTimeoutsPerDayCount - ${JSON.stringify(query)}`); const results = await esClient.search(query); - logger.debug(`results for getExecutionTimeoutsPerDayCount query - ${JSON.stringify(results)}`); + logger.debug( + () => `results for getExecutionTimeoutsPerDayCount query - ${JSON.stringify(results)}` + ); const aggregations = results.aggregations as { by_rule_type_id: AggregationsTermsAggregateBase; diff --git a/x-pack/plugins/alerting/server/usage/lib/get_telemetry_from_kibana.ts b/x-pack/plugins/alerting/server/usage/lib/get_telemetry_from_kibana.ts index ecaf99ffc44a3..fdfdbf1dbcfe6 100644 --- a/x-pack/plugins/alerting/server/usage/lib/get_telemetry_from_kibana.ts +++ b/x-pack/plugins/alerting/server/usage/lib/get_telemetry_from_kibana.ts @@ -272,10 +272,10 @@ export async function getTotalCountAggregations({ }, }; - logger.debug(`query for getTotalCountAggregations - ${JSON.stringify(query)}`); + logger.debug(() => `query for getTotalCountAggregations - ${JSON.stringify(query)}`); const results = await esClient.search(query); - logger.debug(`results for getTotalCountAggregations query - ${JSON.stringify(results)}`); + logger.debug(() => `results for getTotalCountAggregations query - ${JSON.stringify(results)}`); const aggregations = results.aggregations as { by_rule_type_id: AggregationsTermsAggregateBase; @@ -445,10 +445,10 @@ export async function getTotalCountInUse({ }, }; - logger.debug(`query for getTotalCountInUse - ${JSON.stringify(query)}`); + logger.debug(() => `query for getTotalCountInUse - ${JSON.stringify(query)}`); const results = await esClient.search(query); - logger.debug(`results for getTotalCountInUse query - ${JSON.stringify(results)}`); + logger.debug(() => `results for getTotalCountInUse query - ${JSON.stringify(results)}`); const aggregations = results.aggregations as { by_rule_type_id: AggregationsTermsAggregateBase; diff --git a/x-pack/plugins/alerting/server/usage/lib/get_telemetry_from_task_manager.ts b/x-pack/plugins/alerting/server/usage/lib/get_telemetry_from_task_manager.ts index 9b37051db5baf..f3741a086bf9b 100644 --- a/x-pack/plugins/alerting/server/usage/lib/get_telemetry_from_task_manager.ts +++ b/x-pack/plugins/alerting/server/usage/lib/get_telemetry_from_task_manager.ts @@ -99,11 +99,11 @@ export async function getFailedAndUnrecognizedTasksPerDay({ }, }; - logger.debug(`query for getFailedAndUnrecognizedTasksPerDay - ${JSON.stringify(query)}`); + logger.debug(() => `query for getFailedAndUnrecognizedTasksPerDay - ${JSON.stringify(query)}`); const results = await esClient.search(query); logger.debug( - `results for getFailedAndUnrecognizedTasksPerDay query - ${JSON.stringify(results)}` + () => `results for getFailedAndUnrecognizedTasksPerDay query - ${JSON.stringify(results)}` ); const aggregations = results.aggregations as { diff --git a/x-pack/plugins/cases/docs/openapi/bundled.json b/x-pack/plugins/cases/docs/openapi/bundled.json index 152a5c34e87a4..6bc965f7ee5fc 100644 --- a/x-pack/plugins/cases/docs/openapi/bundled.json +++ b/x-pack/plugins/cases/docs/openapi/bundled.json @@ -354,9 +354,9 @@ }, "/api/cases/configure": { "get": { - "summary": "Retrieves external connection details, such as the closure type and default connector for cases in the default space.", + "summary": "Get case settings in the default space", "operationId": "getCaseConfigurationDefaultSpace", - "description": "You must have `read` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration.\n", + "description": "Retrieves setting details such as the closure type, custom fields, templatse, and the default connector for cases in the default space. You must have `read` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where the cases were created.\n", "tags": [ "cases" ], @@ -378,40 +378,6 @@ "closure_type": { "$ref": "#/components/schemas/closure_types" }, - "customFields": { - "type": "array", - "x-technical-preview": true, - "description": "Custom fields configuration details.", - "items": { - "type": "object", - "properties": { - "key": { - "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", - "type": "string", - "minLength": 1, - "maxLength": 36 - }, - "label": { - "description": "The custom field label that is displayed in the case.", - "type": "string", - "minLength": 1, - "maxLength": 50 - }, - "required": { - "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", - "type": "boolean" - }, - "type": { - "description": "The type of the custom field.", - "type": "string", - "enum": [ - "text", - "toggle" - ] - } - } - } - }, "connector": { "type": "object", "properties": { @@ -491,6 +457,51 @@ } } }, + "customFields": { + "type": "array", + "x-technical-preview": true, + "description": "Custom fields configuration details.", + "items": { + "type": "object", + "properties": { + "defaultValue": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean.\n" + }, + "key": { + "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", + "type": "string", + "minLength": 1, + "maxLength": 36 + }, + "label": { + "description": "The custom field label that is displayed in the case.", + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "required": { + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } + }, "error": { "type": [ "string", @@ -535,6 +546,9 @@ "owner": { "$ref": "#/components/schemas/owners" }, + "templates": { + "$ref": "#/components/schemas/templates" + }, "updated_at": { "type": [ "string", @@ -621,9 +635,9 @@ } }, "post": { - "summary": "Creates a case specific configuration that includes external connection details and custom fields.", + "summary": "Add case settings in the default space", "operationId": "setCaseConfigurationDefaultSpace", - "description": "You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details.\n", + "description": "Case settings include external connection details, custom fields, and templates. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details. You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where you are creating cases.\n", "tags": [ "cases" ], @@ -657,40 +671,6 @@ "closure_type": { "$ref": "#/components/schemas/closure_types" }, - "customFields": { - "type": "array", - "x-technical-preview": true, - "description": "Custom fields configuration details.", - "items": { - "type": "object", - "properties": { - "key": { - "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", - "type": "string", - "minLength": 1, - "maxLength": 36 - }, - "label": { - "description": "The custom field label that is displayed in the case.", - "type": "string", - "minLength": 1, - "maxLength": 50 - }, - "required": { - "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", - "type": "boolean" - }, - "type": { - "description": "The type of the custom field.", - "type": "string", - "enum": [ - "text", - "toggle" - ] - } - } - } - }, "connector": { "type": "object", "properties": { @@ -770,6 +750,51 @@ } } }, + "customFields": { + "type": "array", + "x-technical-preview": true, + "description": "Custom fields configuration details.", + "items": { + "type": "object", + "properties": { + "defaultValue": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean.\n" + }, + "key": { + "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", + "type": "string", + "minLength": 1, + "maxLength": 36 + }, + "label": { + "description": "The custom field label that is displayed in the case.", + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "required": { + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } + }, "error": { "type": [ "string", @@ -814,6 +839,9 @@ "owner": { "$ref": "#/components/schemas/owners" }, + "templates": { + "$ref": "#/components/schemas/templates" + }, "updated_at": { "type": [ "string", @@ -901,9 +929,9 @@ }, "/api/cases/configure/{configurationId}": { "patch": { - "summary": "Updates external connection details, such as the closure type and default connector for cases in the default space.", + "summary": "Update case settings in the default space", "operationId": "updateCaseConfigurationDefaultSpace", - "description": "You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API.\n", + "description": "Updates setting details such as the closure type, custom fields, templates, and the default connector for cases in the default space. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where the case was created.\n", "tags": [ "cases" ], @@ -940,40 +968,6 @@ "closure_type": { "$ref": "#/components/schemas/closure_types" }, - "customFields": { - "type": "array", - "x-technical-preview": true, - "description": "Custom fields configuration details.", - "items": { - "type": "object", - "properties": { - "key": { - "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", - "type": "string", - "minLength": 1, - "maxLength": 36 - }, - "label": { - "description": "The custom field label that is displayed in the case.", - "type": "string", - "minLength": 1, - "maxLength": 50 - }, - "required": { - "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", - "type": "boolean" - }, - "type": { - "description": "The type of the custom field.", - "type": "string", - "enum": [ - "text", - "toggle" - ] - } - } - } - }, "connector": { "type": "object", "properties": { @@ -1053,6 +1047,51 @@ } } }, + "customFields": { + "type": "array", + "x-technical-preview": true, + "description": "Custom fields configuration details.", + "items": { + "type": "object", + "properties": { + "defaultValue": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean.\n" + }, + "key": { + "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", + "type": "string", + "minLength": 1, + "maxLength": 36 + }, + "label": { + "description": "The custom field label that is displayed in the case.", + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "required": { + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } + }, "error": { "type": [ "string", @@ -1097,6 +1136,9 @@ "owner": { "$ref": "#/components/schemas/owners" }, + "templates": { + "$ref": "#/components/schemas/templates" + }, "updated_at": { "type": [ "string", @@ -1903,9 +1945,9 @@ }, "/api/cases/configure/connectors/_find": { "get": { - "summary": "Retrieves information about connectors in the default space.", + "summary": "Get case connectors in the default space", "operationId": "findCaseConnectorsDefaultSpace", - "description": "In particular, only the connectors that are supported for use in cases are returned. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", + "description": "Retrieves information about connectors that are supported for use in cases in the default space. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", "tags": [ "cases" ], @@ -2312,9 +2354,9 @@ }, "/s/{spaceId}/api/cases/configure": { "get": { - "summary": "Retrieves external connection details, such as the closure type and default connector for cases.", + "summary": "Get case settings", "operationId": "getCaseConfiguration", - "description": "You must have `read` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration.\n", + "description": "Retrieves setting details such as the closure type, custom fields, templates, and the default connector for cases. You must have `read` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where the cases were created.\n", "tags": [ "cases" ], @@ -2339,40 +2381,6 @@ "closure_type": { "$ref": "#/components/schemas/closure_types" }, - "customFields": { - "type": "array", - "x-technical-preview": true, - "description": "Custom fields configuration details.", - "items": { - "type": "object", - "properties": { - "key": { - "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", - "type": "string", - "minLength": 1, - "maxLength": 36 - }, - "label": { - "description": "The custom field label that is displayed in the case.", - "type": "string", - "minLength": 1, - "maxLength": 50 - }, - "required": { - "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", - "type": "boolean" - }, - "type": { - "description": "The type of the custom field.", - "type": "string", - "enum": [ - "text", - "toggle" - ] - } - } - } - }, "connector": { "type": "object", "properties": { @@ -2452,6 +2460,51 @@ } } }, + "customFields": { + "type": "array", + "x-technical-preview": true, + "description": "Custom fields configuration details.", + "items": { + "type": "object", + "properties": { + "defaultValue": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean.\n" + }, + "key": { + "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", + "type": "string", + "minLength": 1, + "maxLength": 36 + }, + "label": { + "description": "The custom field label that is displayed in the case.", + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "required": { + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } + }, "error": { "type": [ "string", @@ -2496,6 +2549,9 @@ "owner": { "$ref": "#/components/schemas/owners" }, + "templates": { + "$ref": "#/components/schemas/templates" + }, "updated_at": { "type": [ "string", @@ -2582,9 +2638,9 @@ } }, "post": { - "summary": "Creates a case specific configuration that includes external connection details and custom fields.", + "summary": "Add case settings", "operationId": "setCaseConfiguration", - "description": "You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details.\n", + "description": "Case settings include external connection details, custom fields, and templates. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details. You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where you are creating cases.\n", "tags": [ "cases" ], @@ -2621,40 +2677,6 @@ "closure_type": { "$ref": "#/components/schemas/closure_types" }, - "customFields": { - "type": "array", - "x-technical-preview": true, - "description": "Custom fields configuration details.", - "items": { - "type": "object", - "properties": { - "key": { - "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", - "type": "string", - "minLength": 1, - "maxLength": 36 - }, - "label": { - "description": "The custom field label that is displayed in the case.", - "type": "string", - "minLength": 1, - "maxLength": 50 - }, - "required": { - "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", - "type": "boolean" - }, - "type": { - "description": "The type of the custom field.", - "type": "string", - "enum": [ - "text", - "toggle" - ] - } - } - } - }, "connector": { "type": "object", "properties": { @@ -2734,6 +2756,51 @@ } } }, + "customFields": { + "type": "array", + "x-technical-preview": true, + "description": "Custom fields configuration details.", + "items": { + "type": "object", + "properties": { + "defaultValue": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean.\n" + }, + "key": { + "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", + "type": "string", + "minLength": 1, + "maxLength": 36 + }, + "label": { + "description": "The custom field label that is displayed in the case.", + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "required": { + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } + }, "error": { "type": [ "string", @@ -2778,6 +2845,9 @@ "owner": { "$ref": "#/components/schemas/owners" }, + "templates": { + "$ref": "#/components/schemas/templates" + }, "updated_at": { "type": [ "string", @@ -2865,9 +2935,9 @@ }, "/s/{spaceId}/api/cases/configure/{configurationId}": { "patch": { - "summary": "Updates external connection details, such as the closure type and default connector for cases.", + "summary": "Update case settings", "operationId": "updateCaseConfiguration", - "description": "You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API.\n", + "description": "Updates setting details such as the closure type, custom fields, templates, and the default connector for cases. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where the case was created.\n", "tags": [ "cases" ], @@ -2878,68 +2948,34 @@ { "$ref": "#/components/parameters/configuration_id" }, - { - "$ref": "#/components/parameters/space_id" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/update_case_configuration_request" - }, - "examples": { - "updateCaseConfigurationRequest": { - "$ref": "#/components/examples/update_case_configuration_request" - } - } - } - } - }, - "responses": { - "200": { - "description": "Indicates a successful call.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "closure_type": { - "$ref": "#/components/schemas/closure_types" - }, - "customFields": { - "type": "array", - "x-technical-preview": true, - "description": "Custom fields configuration details.", - "items": { - "type": "object", - "properties": { - "key": { - "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", - "type": "string", - "minLength": 1, - "maxLength": 36 - }, - "label": { - "description": "The custom field label that is displayed in the case.", - "type": "string", - "minLength": 1, - "maxLength": 50 - }, - "required": { - "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", - "type": "boolean" - }, - "type": { - "description": "The type of the custom field.", - "type": "string", - "enum": [ - "text", - "toggle" - ] - } - } - } + { + "$ref": "#/components/parameters/space_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/update_case_configuration_request" + }, + "examples": { + "updateCaseConfigurationRequest": { + "$ref": "#/components/examples/update_case_configuration_request" + } + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "closure_type": { + "$ref": "#/components/schemas/closure_types" }, "connector": { "type": "object", @@ -3020,6 +3056,51 @@ } } }, + "customFields": { + "type": "array", + "x-technical-preview": true, + "description": "Custom fields configuration details.", + "items": { + "type": "object", + "properties": { + "defaultValue": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean.\n" + }, + "key": { + "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", + "type": "string", + "minLength": 1, + "maxLength": 36 + }, + "label": { + "description": "The custom field label that is displayed in the case.", + "type": "string", + "minLength": 1, + "maxLength": 50 + }, + "required": { + "description": "Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated.\n", + "type": "boolean" + }, + "type": { + "description": "The type of the custom field.", + "type": "string", + "enum": [ + "text", + "toggle" + ] + } + } + } + }, "error": { "type": [ "string", @@ -3064,6 +3145,9 @@ "owner": { "$ref": "#/components/schemas/owners" }, + "templates": { + "$ref": "#/components/schemas/templates" + }, "updated_at": { "type": [ "string", @@ -3151,9 +3235,9 @@ }, "/s/{spaceId}/api/cases/configure/connectors/_find": { "get": { - "summary": "Retrieves information about connectors.", + "summary": "Get case connectors", "operationId": "findCaseConnectors", - "description": "In particular, only the connectors that are supported for use in cases are returned. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", + "description": "Retrieves information about connectors that are supported for use in cases. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n", "tags": [ "cases" ], @@ -4908,6 +4992,11 @@ } } }, + "case_description": { + "description": "The description for the case.", + "type": "string", + "maxLength": 30000 + }, "owners": { "type": "string", "description": "The application that owns the cases: Stack Management, Observability, or Elastic Security.\n", @@ -4936,7 +5025,7 @@ } } }, - "severity_property": { + "case_severity": { "type": "string", "description": "The severity of the case.", "enum": [ @@ -4947,6 +5036,25 @@ ], "default": "low" }, + "case_tags": { + "description": "The words and phrases that help categorize cases. It can be an empty array.\n", + "type": "array", + "maxItems": 200, + "items": { + "type": "string", + "maxLength": 256 + } + }, + "case_category": { + "description": "A word or phrase that categorizes the case.", + "type": "string", + "maxLength": 50 + }, + "case_title": { + "description": "A title for the case.", + "type": "string", + "maxLength": 160 + }, "create_case_request": { "title": "Create case request", "description": "The create case API request body varies depending on the type of connector.", @@ -4989,9 +5097,7 @@ ] }, "description": { - "description": "The description for the case.", - "type": "string", - "maxLength": 30000 + "$ref": "#/components/schemas/case_description" }, "owner": { "$ref": "#/components/schemas/owners" @@ -5000,26 +5106,16 @@ "$ref": "#/components/schemas/settings" }, "severity": { - "$ref": "#/components/schemas/severity_property" + "$ref": "#/components/schemas/case_severity" }, "tags": { - "description": "The words and phrases that help categorize cases. It can be an empty array.", - "type": "array", - "maxItems": 200, - "items": { - "type": "string", - "maxLength": 256 - } + "$ref": "#/components/schemas/case_tags" }, "category": { - "description": "A word or phrase that categorizes the case.", - "type": "string", - "maxLength": 50 + "$ref": "#/components/schemas/case_category" }, "title": { - "description": "A title for the case.", - "type": "string", - "maxLength": 160 + "$ref": "#/components/schemas/case_title" }, "customFields": { "type": "array", @@ -5625,7 +5721,7 @@ } } }, - "status": { + "case_status": { "type": "string", "description": "The status of the case.", "enum": [ @@ -5822,10 +5918,10 @@ "$ref": "#/components/schemas/settings" }, "severity": { - "$ref": "#/components/schemas/severity_property" + "$ref": "#/components/schemas/case_severity" }, "status": { - "$ref": "#/components/schemas/status" + "$ref": "#/components/schemas/case_status" }, "tags": { "type": "array", @@ -5919,9 +6015,7 @@ "$ref": "#/components/schemas/assignees" }, "category": { - "description": "A word or phrase that categorizes the case.", - "type": "string", - "maxLength": 50 + "$ref": "#/components/schemas/case_category" }, "connector": { "oneOf": [ @@ -5994,8 +6088,7 @@ } }, "description": { - "description": "An updated description for the case.", - "type": "string" + "$ref": "#/components/schemas/case_description" }, "id": { "description": "The identifier for the case.", @@ -6006,24 +6099,16 @@ "$ref": "#/components/schemas/settings" }, "severity": { - "$ref": "#/components/schemas/severity_property" + "$ref": "#/components/schemas/case_severity" }, "status": { - "$ref": "#/components/schemas/status" + "$ref": "#/components/schemas/case_status" }, "tags": { - "description": "The words and phrases that help categorize cases.", - "type": "array", - "maxItems": 200, - "items": { - "type": "string", - "maxLength": 256 - } + "$ref": "#/components/schemas/case_tags" }, "title": { - "description": "A title for the case.", - "type": "string", - "maxLength": 160 + "$ref": "#/components/schemas/case_title" }, "version": { "description": "The current version of the case. To determine this value, use the get case or find cases APIs.", @@ -6069,6 +6154,127 @@ ".none" ] }, + "template_tags": { + "description": "The words and phrases that help categorize templates. It can be an empty array.\n", + "type": "array", + "maxItems": 200, + "items": { + "type": "string", + "maxLength": 256 + } + }, + "templates": { + "type": "array", + "x-technical-preview": true, + "items": { + "type": "object", + "properties": { + "caseFields": { + "type": "object", + "properties": { + "assignees": { + "$ref": "#/components/schemas/assignees" + }, + "category": { + "$ref": "#/components/schemas/case_category" + }, + "connector": { + "type": "object", + "properties": { + "fields": { + "description": "The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to `null`.", + "type": [ + "object", + "null" + ] + }, + "id": { + "description": "The identifier for the connector. If you do not want a default connector, use `none`. To retrieve connector IDs, use the find connectors API.", + "type": "string", + "examples": [ + "none" + ] + }, + "name": { + "description": "The name of the connector. If you do not want a default connector, use `none`. To retrieve connector names, use the find connectors API.", + "type": "string", + "examples": [ + "none" + ] + }, + "type": { + "$ref": "#/components/schemas/connector_types" + } + } + }, + "customFields": { + "type": "array", + "x-technical-preview": true, + "description": "Custom field values in the template.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "The unique key for the custom field." + }, + "type": { + "type": "string", + "enum": [ + "text", + "toggle" + ], + "description": "The type of the custom field." + }, + "value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "The default value for the custom field when a case uses the template. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean.\n" + } + } + } + }, + "description": { + "$ref": "#/components/schemas/case_description" + }, + "settings": { + "$ref": "#/components/schemas/settings" + }, + "severity": { + "$ref": "#/components/schemas/case_severity" + }, + "tags": { + "$ref": "#/components/schemas/case_tags" + }, + "title": { + "$ref": "#/components/schemas/case_title" + } + } + }, + "description": { + "type": "string", + "description": "A description for the template." + }, + "key": { + "type": "string", + "description": "A unique key for the template. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific template.\n" + }, + "name": { + "type": "string", + "description": "The name of the template." + }, + "tags": { + "$ref": "#/components/schemas/template_tags" + } + } + } + }, "set_case_configuration_request": { "title": "Set case configuration request", "description": "External connection details, such as the closure type and default connector for cases.", @@ -6133,6 +6339,17 @@ "type" ], "properties": { + "defaultValue": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean.\n" + }, "key": { "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", "type": "string", @@ -6162,12 +6379,15 @@ }, "owner": { "$ref": "#/components/schemas/owners" + }, + "templates": { + "$ref": "#/components/schemas/templates" } } }, "update_case_configuration_request": { "title": "Update case configuration request", - "description": "External connection details, such as the closure type and default connector for cases.", + "description": "You can update settings such as the closure type, custom fields, templates, and the default connector for cases.\n", "type": "object", "required": [ "version" @@ -6225,6 +6445,17 @@ "type" ], "properties": { + "defaultValue": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean.\n" + }, "key": { "description": "A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field.\n", "type": "string", @@ -6252,6 +6483,9 @@ } } }, + "templates": { + "$ref": "#/components/schemas/templates" + }, "version": { "description": "The version of the connector. To retrieve the version value, use the get configuration API.\n", "type": "string", @@ -6875,10 +7109,10 @@ "$ref": "#/components/schemas/settings" }, "severity": { - "$ref": "#/components/schemas/severity_property" + "$ref": "#/components/schemas/case_severity" }, "status": { - "$ref": "#/components/schemas/status" + "$ref": "#/components/schemas/case_status" }, "tags": { "type": "array", @@ -6931,7 +7165,7 @@ "type": "object", "properties": { "severity": { - "$ref": "#/components/schemas/severity_property" + "$ref": "#/components/schemas/case_severity" } } }, @@ -6939,7 +7173,7 @@ "type": "object", "properties": { "status": { - "$ref": "#/components/schemas/status" + "$ref": "#/components/schemas/case_status" } } }, @@ -7590,13 +7824,14 @@ "customFields": [ { "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "defaultValue": "Custom text field value.", "label": "my-text-field", "required": false, "type": "text" } ], "owner": "cases", - "created_at": "2023-06-01T17:07:17.767Z", + "created_at": "2024-07-01T17:07:17.767Z", "created_by": { "username": "elastic", "email": null, @@ -7611,13 +7846,52 @@ "fields": null }, "mappings": [], - "version": "WzUxLDRd", - "error": null + "version": "WzEyLDNd", + "error": null, + "templates": [ + { + "key": "505932fe-ee3a-4960-a661-c781b5acdb05", + "name": "template-1", + "caseFields": { + "title": "Default case title", + "tags": [ + "Default case tag" + ], + "category": "Default-category", + "description": "A default description for cases.", + "assignees": [ + { + "uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" + } + ], + "connector": { + "id": "none", + "type": ".none", + "fields": null, + "name": "none" + }, + "customFields": [ + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "value": "Default text field value.", + "type": "text" + } + ], + "settings": { + "syncAlerts": false + } + }, + "description": "A description of the template.", + "tags": [ + "Template tag 1" + ] + } + ] } ] }, "set_case_configuration_request": { - "summary": "Set the closure type and default connector for Stack Management cases.", + "summary": "Set the closure type, custom fields, and default connector for Stack Management cases.", "value": { "owner": "cases", "connector": { @@ -7632,7 +7906,38 @@ "key": "d312efda-ec2b-42ec-9e2c-84981795c581", "label": "my-text-field", "required": false, - "type": "text" + "type": "text", + "defaultValue": "My custom field default value." + } + ], + "templates": [ + { + "key": "505932fe-ee3a-4960-a661-c781b5acdb05", + "name": "template-1", + "caseFields": { + "title": "Default case title", + "tags": [ + "Default case tag" + ], + "category": "Default-category", + "description": "A default description for cases.", + "assignees": [ + { + "uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" + } + ], + "customFields": [ + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "type": "text", + "value": "A text field value for the template." + } + ] + }, + "description": "A description of the template.", + "tags": [ + "Template tag 1" + ] } ] } @@ -7646,11 +7951,42 @@ "key": "d312efda-ec2b-42ec-9e2c-84981795c581", "label": "my-text-field", "required": false, - "type": "text" + "type": "text", + "defaultValue": "My custom field default value." + } + ], + "templates": [ + { + "key": "505932fe-ee3a-4960-a661-c781b5acdb05", + "name": "template-1", + "caseFields": { + "title": "Default case title", + "tags": [ + "Default case tag" + ], + "category": "Default-category", + "description": "A default description for cases.", + "assignees": [ + { + "uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" + } + ], + "customFields": [ + { + "key": "d312efda-ec2b-42ec-9e2c-84981795c581", + "type": "text", + "value": "A text field value for the template." + } + ] + }, + "description": "A description of the template.", + "tags": [ + "Template tag 1" + ] } ], "owner": "cases", - "created_at": "2023-10-01T17:07:17.767Z", + "created_at": "2024-07-01T17:07:17.767Z", "created_by": { "username": "elastic", "email": "null,", @@ -7680,6 +8016,11 @@ "source": "comments", "target": "comments", "action_type": "append" + }, + { + "source": "tags", + "target": "labels", + "action_type": "overwrite" } ], "version": "WzIwNzMsMV0=", @@ -7703,7 +8044,8 @@ "key": "d312efda-ec2b-42ec-9e2c-84981795c581", "label": "my-text-field", "required": true, - "type": "text" + "type": "text", + "defaultValue": "A new default value." }, { "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", @@ -7723,7 +8065,8 @@ "key": "d312efda-ec2b-42ec-9e2c-84981795c581", "label": "my-text-field", "required": true, - "type": "text" + "type": "text", + "defaultValue": "A new default value." }, { "key": "fcc6840d-eb14-42df-8aaf-232201a705ec", @@ -7733,14 +8076,14 @@ } ], "owner": "cases", - "created_at": "2023-10-01T17:07:17.767Z", + "created_at": "2024-07-01T17:07:17.767Z", "created_by": { "username": "elastic", - "email": "null,", + "email": null, "full_name": null, "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" }, - "updated_at": "2023-10-19T00:52:42.401Z", + "updated_at": "2024-07-19T00:52:42.401Z", "updated_by": { "username": "elastic", "full_name": null, @@ -7764,15 +8107,21 @@ "target": "description", "action_type": "overwrite" }, + { + "source": "tags", + "target": "labels", + "action_type": "overwrite" + }, { "source": "comments", "target": "comments", "action_type": "append" } ], - "version": "zEzNSw1XQ==", + "version": "WzI2LDNd", "error": null, - "id": "4a97a440-e1cd-11ec-be9b-9b1838238ee6" + "id": "4a97a440-e1cd-11ec-be9b-9b1838238ee6", + "templates": [] } }, "get_reporters_response": { diff --git a/x-pack/plugins/cases/docs/openapi/bundled.yaml b/x-pack/plugins/cases/docs/openapi/bundled.yaml index 407958509f31c..7aeea6de8e052 100644 --- a/x-pack/plugins/cases/docs/openapi/bundled.yaml +++ b/x-pack/plugins/cases/docs/openapi/bundled.yaml @@ -205,10 +205,10 @@ paths: $ref: '#/components/schemas/4xx_response' /api/cases/configure: get: - summary: Retrieves external connection details, such as the closure type and default connector for cases in the default space. + summary: Get case settings in the default space operationId: getCaseConfigurationDefaultSpace description: | - You must have `read` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. + Retrieves setting details such as the closure type, custom fields, templatse, and the default connector for cases in the default space. You must have `read` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where the cases were created. tags: - cases parameters: @@ -225,34 +225,6 @@ paths: properties: closure_type: $ref: '#/components/schemas/closure_types' - customFields: - type: array - x-technical-preview: true - description: Custom fields configuration details. - items: - type: object - properties: - key: - description: | - A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. - type: string - minLength: 1 - maxLength: 36 - label: - description: The custom field label that is displayed in the case. - type: string - minLength: 1 - maxLength: 50 - required: - description: | - Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. - type: boolean - type: - description: The type of the custom field. - type: string - enum: - - text - - toggle connector: type: object properties: @@ -307,6 +279,39 @@ paths: - 'null' examples: - elastic + customFields: + type: array + description: Custom fields configuration details. + items: + type: object + properties: + defaultValue: + oneOf: + - type: string + - type: boolean + description: | + A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean. + key: + description: | + A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. + type: string + minLength: 1 + maxLength: 36 + label: + description: The custom field label that is displayed in the case. + type: string + minLength: 1 + maxLength: 50 + required: + description: | + Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle error: type: - string @@ -336,6 +341,8 @@ paths: - summary owner: $ref: '#/components/schemas/owners' + templates: + $ref: '#/components/schemas/templates' updated_at: type: - string @@ -388,10 +395,10 @@ paths: schema: $ref: '#/components/schemas/4xx_response' post: - summary: Creates a case specific configuration that includes external connection details and custom fields. + summary: Add case settings in the default space operationId: setCaseConfigurationDefaultSpace description: | - You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details. + Case settings include external connection details, custom fields, and templates. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details. You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where you are creating cases. tags: - cases parameters: @@ -414,34 +421,6 @@ paths: properties: closure_type: $ref: '#/components/schemas/closure_types' - customFields: - type: array - x-technical-preview: true - description: Custom fields configuration details. - items: - type: object - properties: - key: - description: | - A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. - type: string - minLength: 1 - maxLength: 36 - label: - description: The custom field label that is displayed in the case. - type: string - minLength: 1 - maxLength: 50 - required: - description: | - Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. - type: boolean - type: - description: The type of the custom field. - type: string - enum: - - text - - toggle connector: type: object properties: @@ -496,6 +475,39 @@ paths: - 'null' examples: - elastic + customFields: + type: array + description: Custom fields configuration details. + items: + type: object + properties: + defaultValue: + oneOf: + - type: string + - type: boolean + description: | + A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean. + key: + description: | + A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. + type: string + minLength: 1 + maxLength: 36 + label: + description: The custom field label that is displayed in the case. + type: string + minLength: 1 + maxLength: 50 + required: + description: | + Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle error: type: - string @@ -525,6 +537,8 @@ paths: - summary owner: $ref: '#/components/schemas/owners' + templates: + $ref: '#/components/schemas/templates' updated_at: type: - string @@ -578,10 +592,10 @@ paths: $ref: '#/components/schemas/4xx_response' /api/cases/configure/{configurationId}: patch: - summary: Updates external connection details, such as the closure type and default connector for cases in the default space. + summary: Update case settings in the default space operationId: updateCaseConfigurationDefaultSpace description: | - You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. + Updates setting details such as the closure type, custom fields, templates, and the default connector for cases in the default space. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where the case was created. tags: - cases parameters: @@ -605,34 +619,6 @@ paths: properties: closure_type: $ref: '#/components/schemas/closure_types' - customFields: - type: array - x-technical-preview: true - description: Custom fields configuration details. - items: - type: object - properties: - key: - description: | - A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. - type: string - minLength: 1 - maxLength: 36 - label: - description: The custom field label that is displayed in the case. - type: string - minLength: 1 - maxLength: 50 - required: - description: | - Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. - type: boolean - type: - description: The type of the custom field. - type: string - enum: - - text - - toggle connector: type: object properties: @@ -687,6 +673,39 @@ paths: - 'null' examples: - elastic + customFields: + type: array + description: Custom fields configuration details. + items: + type: object + properties: + defaultValue: + oneOf: + - type: string + - type: boolean + description: | + A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean. + key: + description: | + A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. + type: string + minLength: 1 + maxLength: 36 + label: + description: The custom field label that is displayed in the case. + type: string + minLength: 1 + maxLength: 50 + required: + description: | + Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle error: type: - string @@ -716,6 +735,8 @@ paths: - summary owner: $ref: '#/components/schemas/owners' + templates: + $ref: '#/components/schemas/templates' updated_at: type: - string @@ -1208,10 +1229,10 @@ paths: $ref: '#/components/schemas/4xx_response' /api/cases/configure/connectors/_find: get: - summary: Retrieves information about connectors in the default space. + summary: Get case connectors in the default space operationId: findCaseConnectorsDefaultSpace description: | - In particular, only the connectors that are supported for use in cases are returned. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. + Retrieves information about connectors that are supported for use in cases in the default space. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. tags: - cases responses: @@ -1447,10 +1468,10 @@ paths: $ref: '#/components/schemas/4xx_response' /s/{spaceId}/api/cases/configure: get: - summary: Retrieves external connection details, such as the closure type and default connector for cases. + summary: Get case settings operationId: getCaseConfiguration description: | - You must have `read` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. + Retrieves setting details such as the closure type, custom fields, templates, and the default connector for cases. You must have `read` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where the cases were created. tags: - cases parameters: @@ -1468,34 +1489,6 @@ paths: properties: closure_type: $ref: '#/components/schemas/closure_types' - customFields: - type: array - x-technical-preview: true - description: Custom fields configuration details. - items: - type: object - properties: - key: - description: | - A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. - type: string - minLength: 1 - maxLength: 36 - label: - description: The custom field label that is displayed in the case. - type: string - minLength: 1 - maxLength: 50 - required: - description: | - Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. - type: boolean - type: - description: The type of the custom field. - type: string - enum: - - text - - toggle connector: type: object properties: @@ -1550,6 +1543,39 @@ paths: - 'null' examples: - elastic + customFields: + type: array + description: Custom fields configuration details. + items: + type: object + properties: + defaultValue: + oneOf: + - type: string + - type: boolean + description: | + A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean. + key: + description: | + A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. + type: string + minLength: 1 + maxLength: 36 + label: + description: The custom field label that is displayed in the case. + type: string + minLength: 1 + maxLength: 50 + required: + description: | + Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle error: type: - string @@ -1579,6 +1605,8 @@ paths: - summary owner: $ref: '#/components/schemas/owners' + templates: + $ref: '#/components/schemas/templates' updated_at: type: - string @@ -1631,10 +1659,10 @@ paths: schema: $ref: '#/components/schemas/4xx_response' post: - summary: Creates a case specific configuration that includes external connection details and custom fields. + summary: Add case settings operationId: setCaseConfiguration description: | - You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details. + Case settings include external connection details, custom fields, and templates. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details. You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where you are creating cases. tags: - cases parameters: @@ -1658,34 +1686,6 @@ paths: properties: closure_type: $ref: '#/components/schemas/closure_types' - customFields: - type: array - x-technical-preview: true - description: Custom fields configuration details. - items: - type: object - properties: - key: - description: | - A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. - type: string - minLength: 1 - maxLength: 36 - label: - description: The custom field label that is displayed in the case. - type: string - minLength: 1 - maxLength: 50 - required: - description: | - Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. - type: boolean - type: - description: The type of the custom field. - type: string - enum: - - text - - toggle connector: type: object properties: @@ -1740,6 +1740,39 @@ paths: - 'null' examples: - elastic + customFields: + type: array + description: Custom fields configuration details. + items: + type: object + properties: + defaultValue: + oneOf: + - type: string + - type: boolean + description: | + A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean. + key: + description: | + A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. + type: string + minLength: 1 + maxLength: 36 + label: + description: The custom field label that is displayed in the case. + type: string + minLength: 1 + maxLength: 50 + required: + description: | + Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle error: type: - string @@ -1769,6 +1802,8 @@ paths: - summary owner: $ref: '#/components/schemas/owners' + templates: + $ref: '#/components/schemas/templates' updated_at: type: - string @@ -1822,10 +1857,10 @@ paths: $ref: '#/components/schemas/4xx_response' /s/{spaceId}/api/cases/configure/{configurationId}: patch: - summary: Updates external connection details, such as the closure type and default connector for cases. + summary: Update case settings operationId: updateCaseConfiguration description: | - You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. Refer to the add connectors API. + Updates setting details such as the closure type, custom fields, templates, and the default connector for cases. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where the case was created. tags: - cases parameters: @@ -1850,34 +1885,6 @@ paths: properties: closure_type: $ref: '#/components/schemas/closure_types' - customFields: - type: array - x-technical-preview: true - description: Custom fields configuration details. - items: - type: object - properties: - key: - description: | - A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. - type: string - minLength: 1 - maxLength: 36 - label: - description: The custom field label that is displayed in the case. - type: string - minLength: 1 - maxLength: 50 - required: - description: | - Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. - type: boolean - type: - description: The type of the custom field. - type: string - enum: - - text - - toggle connector: type: object properties: @@ -1932,6 +1939,39 @@ paths: - 'null' examples: - elastic + customFields: + type: array + description: Custom fields configuration details. + items: + type: object + properties: + defaultValue: + oneOf: + - type: string + - type: boolean + description: | + A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean. + key: + description: | + A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. + type: string + minLength: 1 + maxLength: 36 + label: + description: The custom field label that is displayed in the case. + type: string + minLength: 1 + maxLength: 50 + required: + description: | + Indicates whether the field is required. If `false`, the custom field can be set to null or omitted when a case is created or updated. + type: boolean + type: + description: The type of the custom field. + type: string + enum: + - text + - toggle error: type: - string @@ -1961,6 +2001,8 @@ paths: - summary owner: $ref: '#/components/schemas/owners' + templates: + $ref: '#/components/schemas/templates' updated_at: type: - string @@ -2014,10 +2056,10 @@ paths: $ref: '#/components/schemas/4xx_response' /s/{spaceId}/api/cases/configure/connectors/_find: get: - summary: Retrieves information about connectors. + summary: Get case connectors operationId: findCaseConnectors description: | - In particular, only the connectors that are supported for use in cases are returned. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. + Retrieves information about connectors that are supported for use in cases. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. tags: - cases parameters: @@ -3166,6 +3208,10 @@ components: - .swimlane enum: - .swimlane + case_description: + description: The description for the case. + type: string + maxLength: 30000 owners: type: string description: | @@ -3187,7 +3233,7 @@ components: type: boolean examples: - true - severity_property: + case_severity: type: string description: The severity of the case. enum: @@ -3196,6 +3242,22 @@ components: - low - medium default: low + case_tags: + description: | + The words and phrases that help categorize cases. It can be an empty array. + type: array + maxItems: 200 + items: + type: string + maxLength: 256 + case_category: + description: A word or phrase that categorizes the case. + type: string + maxLength: 50 + case_title: + description: A title for the case. + type: string + maxLength: 160 create_case_request: title: Create case request description: The create case API request body varies depending on the type of connector. @@ -3220,35 +3282,23 @@ components: - $ref: '#/components/schemas/connector_properties_servicenow_sir' - $ref: '#/components/schemas/connector_properties_swimlane' description: - description: The description for the case. - type: string - maxLength: 30000 + $ref: '#/components/schemas/case_description' owner: $ref: '#/components/schemas/owners' settings: $ref: '#/components/schemas/settings' severity: - $ref: '#/components/schemas/severity_property' + $ref: '#/components/schemas/case_severity' tags: - description: The words and phrases that help categorize cases. It can be an empty array. - type: array - maxItems: 200 - items: - type: string - maxLength: 256 + $ref: '#/components/schemas/case_tags' category: - description: A word or phrase that categorizes the case. - type: string - maxLength: 50 + $ref: '#/components/schemas/case_category' title: - description: A title for the case. - type: string - maxLength: 160 + $ref: '#/components/schemas/case_title' customFields: type: array description: | Custom field values for a case. Any optional custom fields that are not specified in the request are set to null. - x-technical-preview: true minItems: 0 maxItems: 10 items: @@ -3656,7 +3706,7 @@ components: - 'null' examples: - elastic - status: + case_status: type: string description: The status of the case. enum: @@ -3747,7 +3797,6 @@ components: customFields: type: array description: Custom field values for the case. - x-technical-preview: true items: type: object properties: @@ -3795,9 +3844,9 @@ components: settings: $ref: '#/components/schemas/settings' severity: - $ref: '#/components/schemas/severity_property' + $ref: '#/components/schemas/case_severity' status: - $ref: '#/components/schemas/status' + $ref: '#/components/schemas/case_status' tags: type: array items: @@ -3862,9 +3911,7 @@ components: assignees: $ref: '#/components/schemas/assignees' category: - description: A word or phrase that categorizes the case. - type: string - maxLength: 50 + $ref: '#/components/schemas/case_category' connector: oneOf: - $ref: '#/components/schemas/connector_properties_none' @@ -3878,7 +3925,6 @@ components: type: array description: | Custom field values for a case. Any optional custom fields that are not specified in the request are set to null. - x-technical-preview: true minItems: 0 maxItems: 10 items: @@ -3910,8 +3956,7 @@ components: maxLength: 160 - type: boolean description: - description: An updated description for the case. - type: string + $ref: '#/components/schemas/case_description' id: description: The identifier for the case. type: string @@ -3919,20 +3964,13 @@ components: settings: $ref: '#/components/schemas/settings' severity: - $ref: '#/components/schemas/severity_property' + $ref: '#/components/schemas/case_severity' status: - $ref: '#/components/schemas/status' + $ref: '#/components/schemas/case_status' tags: - description: The words and phrases that help categorize cases. - type: array - maxItems: 200 - items: - type: string - maxLength: 256 + $ref: '#/components/schemas/case_tags' title: - description: A title for the case. - type: string - maxLength: 160 + $ref: '#/components/schemas/case_title' version: description: The current version of the case. To determine this value, use the get case or find cases APIs. type: string @@ -3963,6 +4001,90 @@ components: - .swimlane examples: - .none + template_tags: + description: | + The words and phrases that help categorize templates. It can be an empty array. + type: array + maxItems: 200 + items: + type: string + maxLength: 256 + templates: + type: array + x-technical-preview: true + items: + type: object + properties: + caseFields: + type: object + properties: + assignees: + $ref: '#/components/schemas/assignees' + category: + $ref: '#/components/schemas/case_category' + connector: + type: object + properties: + fields: + description: The fields specified in the case configuration are not used and are not propagated to individual cases, therefore it is recommended to set it to `null`. + type: + - object + - 'null' + id: + description: The identifier for the connector. If you do not want a default connector, use `none`. To retrieve connector IDs, use the find connectors API. + type: string + examples: + - none + name: + description: The name of the connector. If you do not want a default connector, use `none`. To retrieve connector names, use the find connectors API. + type: string + examples: + - none + type: + $ref: '#/components/schemas/connector_types' + customFields: + type: array + description: Custom field values in the template. + items: + type: object + properties: + key: + type: string + description: The unique key for the custom field. + type: + type: string + enum: + - text + - toggle + description: The type of the custom field. + value: + oneOf: + - type: string + - type: boolean + description: | + The default value for the custom field when a case uses the template. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean. + description: + $ref: '#/components/schemas/case_description' + settings: + $ref: '#/components/schemas/settings' + severity: + $ref: '#/components/schemas/case_severity' + tags: + $ref: '#/components/schemas/case_tags' + title: + $ref: '#/components/schemas/case_title' + description: + type: string + description: A description for the template. + key: + type: string + description: | + A unique key for the template. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific template. + name: + type: string + description: The name of the template. + tags: + $ref: '#/components/schemas/template_tags' set_case_configuration_request: title: Set case configuration request description: External connection details, such as the closure type and default connector for cases. @@ -4003,7 +4125,6 @@ components: customFields: type: array description: Custom fields case configuration. - x-technical-preview: true minItems: 0 maxItems: 10 items: @@ -4014,6 +4135,12 @@ components: - required - type properties: + defaultValue: + oneOf: + - type: string + - type: boolean + description: | + A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean. key: description: | A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. @@ -4037,9 +4164,12 @@ components: - toggle owner: $ref: '#/components/schemas/owners' + templates: + $ref: '#/components/schemas/templates' update_case_configuration_request: title: Update case configuration request - description: External connection details, such as the closure type and default connector for cases. + description: | + You can update settings such as the closure type, custom fields, templates, and the default connector for cases. type: object required: - version @@ -4075,7 +4205,6 @@ components: customFields: type: array description: Custom fields case configuration. - x-technical-preview: true items: type: object required: @@ -4084,6 +4213,12 @@ components: - required - type properties: + defaultValue: + oneOf: + - type: string + - type: boolean + description: | + A default value for the custom field. If the `type` is `text`, the default value must be a string. If the `type` is `toggle`, the default value must be boolean. key: description: | A unique key for the custom field. Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. It is used in API calls to refer to a specific custom field. @@ -4105,6 +4240,8 @@ components: enum: - text - toggle + templates: + $ref: '#/components/schemas/templates' version: description: | The version of the connector. To retrieve the version value, use the get configuration API. @@ -4543,9 +4680,9 @@ components: settings: $ref: '#/components/schemas/settings' severity: - $ref: '#/components/schemas/severity_property' + $ref: '#/components/schemas/case_severity' status: - $ref: '#/components/schemas/status' + $ref: '#/components/schemas/case_status' tags: type: array items: @@ -4578,12 +4715,12 @@ components: type: object properties: severity: - $ref: '#/components/schemas/severity_property' + $ref: '#/components/schemas/case_severity' payload_status: type: object properties: status: - $ref: '#/components/schemas/status' + $ref: '#/components/schemas/case_status' payload_tags: type: object properties: @@ -5024,11 +5161,12 @@ components: closure_type: close-by-user customFields: - key: d312efda-ec2b-42ec-9e2c-84981795c581 + defaultValue: Custom text field value. label: my-text-field required: false type: text owner: cases - created_at: '2023-06-01T17:07:17.767Z' + created_at: '2024-07-01T17:07:17.767Z' created_by: username: elastic email: null @@ -5041,10 +5179,35 @@ components: type: .none fields: null mappings: [] - version: WzUxLDRd + version: WzEyLDNd error: null + templates: + - key: 505932fe-ee3a-4960-a661-c781b5acdb05 + name: template-1 + caseFields: + title: Default case title + tags: + - Default case tag + category: Default-category + description: A default description for cases. + assignees: + - uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + connector: + id: none + type: .none + fields: null + name: none + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + value: Default text field value. + type: text + settings: + syncAlerts: false + description: A description of the template. + tags: + - Template tag 1 set_case_configuration_request: - summary: Set the closure type and default connector for Stack Management cases. + summary: Set the closure type, custom fields, and default connector for Stack Management cases. value: owner: cases connector: @@ -5058,6 +5221,25 @@ components: label: my-text-field required: false type: text + defaultValue: My custom field default value. + templates: + - key: 505932fe-ee3a-4960-a661-c781b5acdb05 + name: template-1 + caseFields: + title: Default case title + tags: + - Default case tag + category: Default-category + description: A default description for cases. + assignees: + - uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: A text field value for the template. + description: A description of the template. + tags: + - Template tag 1 set_case_configuration_response: summary: This is an example response for case settings. value: @@ -5067,8 +5249,27 @@ components: label: my-text-field required: false type: text + defaultValue: My custom field default value. + templates: + - key: 505932fe-ee3a-4960-a661-c781b5acdb05 + name: template-1 + caseFields: + title: Default case title + tags: + - Default case tag + category: Default-category + description: A default description for cases. + assignees: + - uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: A text field value for the template. + description: A description of the template. + tags: + - Template tag 1 owner: cases - created_at: '2023-10-01T17:07:17.767Z' + created_at: '2024-07-01T17:07:17.767Z' created_by: username: elastic email: null, @@ -5091,6 +5292,9 @@ components: - source: comments target: comments action_type: append + - source: tags + target: labels + action_type: overwrite version: WzIwNzMsMV0= error: null id: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 @@ -5109,6 +5313,7 @@ components: label: my-text-field required: true type: text + defaultValue: A new default value. - key: fcc6840d-eb14-42df-8aaf-232201a705ec label: my-toggle required: false @@ -5122,18 +5327,19 @@ components: label: my-text-field required: true type: text + defaultValue: A new default value. - key: fcc6840d-eb14-42df-8aaf-232201a705ec label: my-toggle required: false type: toggle owner: cases - created_at: '2023-10-01T17:07:17.767Z' + created_at: '2024-07-01T17:07:17.767Z' created_by: username: elastic - email: null, + email: null full_name: null profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 - updated_at: '2023-10-19T00:52:42.401Z' + updated_at: '2024-07-19T00:52:42.401Z' updated_by: username: elastic full_name: null @@ -5151,12 +5357,16 @@ components: - source: description target: description action_type: overwrite + - source: tags + target: labels + action_type: overwrite - source: comments target: comments action_type: append - version: zEzNSw1XQ== + version: WzI2LDNd error: null id: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 + templates: [] get_reporters_response: summary: A list of two users that opened cases value: diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/get_case_configuration_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/get_case_configuration_response.yaml index 8b9197600917f..f3cfa44265001 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/get_case_configuration_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/get_case_configuration_response.yaml @@ -4,11 +4,12 @@ value: closure_type: close-by-user customFields: - key: d312efda-ec2b-42ec-9e2c-84981795c581 + defaultValue: Custom text field value. label: my-text-field required: false type: text owner: cases - created_at: 2023-06-01T17:07:17.767Z + created_at: 2024-07-01T17:07:17.767Z created_by: username: elastic email: null @@ -21,5 +22,30 @@ value: type: .none fields: null mappings: [] - version: WzUxLDRd + version: WzEyLDNd error: null + templates: + - key: 505932fe-ee3a-4960-a661-c781b5acdb05 + name: template-1 + caseFields: + title: Default case title + tags: + - Default case tag + category: Default-category + description: A default description for cases. + assignees: + - uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + connector: + id: none + type: .none + fields: null + name: none + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + value: Default text field value. + type: text + settings: + syncAlerts: false + description: A description of the template. + tags: + - Template tag 1 diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_request.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_request.yaml index 472a33d9feacb..e64fb2bc72f99 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_request.yaml @@ -1,4 +1,4 @@ -summary: Set the closure type and default connector for Stack Management cases. +summary: Set the closure type, custom fields, and default connector for Stack Management cases. value: owner: cases connector: @@ -11,4 +11,23 @@ value: - key: d312efda-ec2b-42ec-9e2c-84981795c581 label: my-text-field required: false - type: text \ No newline at end of file + type: text + defaultValue: My custom field default value. + templates: + - key: 505932fe-ee3a-4960-a661-c781b5acdb05 + name: template-1 + caseFields: + title: Default case title + tags: + - Default case tag + category: Default-category + description: A default description for cases. + assignees: + - uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: A text field value for the template. + description: A description of the template. + tags: + - Template tag 1 \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_response.yaml index d5a9f7205e23d..d0518c7c010c5 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/set_case_configuration_response.yaml @@ -6,8 +6,27 @@ value: label: my-text-field required: false type: text + defaultValue: My custom field default value. + templates: + - key: 505932fe-ee3a-4960-a661-c781b5acdb05 + name: template-1 + caseFields: + title: Default case title + tags: + - Default case tag + category: Default-category + description: A default description for cases. + assignees: + - uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 + customFields: + - key: d312efda-ec2b-42ec-9e2c-84981795c581 + type: text + value: A text field value for the template. + description: A description of the template. + tags: + - Template tag 1 owner: cases - created_at: 2023-10-01T17:07:17.767Z + created_at: 2024-07-01T17:07:17.767Z created_by: username: elastic email: null, @@ -30,6 +49,9 @@ value: - source: comments target: comments action_type: append + - source: tags + target: labels + action_type: overwrite version: WzIwNzMsMV0= error: null id: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_request.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_request.yaml index 83d617b17946b..196ef19ba1f07 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_request.yaml @@ -12,6 +12,7 @@ value: label: my-text-field required: true type: text + defaultValue: "A new default value." - key: fcc6840d-eb14-42df-8aaf-232201a705ec label: my-toggle required: false diff --git a/x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_response.yaml b/x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_response.yaml index 6dd1da4d6f1f1..2f34418e214ac 100644 --- a/x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_response.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/examples/update_case_configuration_response.yaml @@ -6,18 +6,19 @@ value: label: my-text-field required: true type: text + defaultValue: A new default value. - key: fcc6840d-eb14-42df-8aaf-232201a705ec label: my-toggle required: false type: toggle owner: cases - created_at: 2023-10-01T17:07:17.767Z + created_at: 2024-07-01T17:07:17.767Z created_by: username: elastic - email: null, + email: null full_name: null profile_uid: u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0 - updated_at: 2023-10-19T00:52:42.401Z + updated_at: 2024-07-19T00:52:42.401Z updated_by: username: elastic full_name: null @@ -35,9 +36,13 @@ value: - source: description target: description action_type: overwrite + - source: tags + target: labels + action_type: overwrite - source: comments target: comments action_type: append - version: zEzNSw1XQ== + version: WzI2LDNd error: null - id: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 \ No newline at end of file + id: 4a97a440-e1cd-11ec-be9b-9b1838238ee6 + templates: [] \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_category.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_category.yaml new file mode 100644 index 0000000000000..ebf0a65319853 --- /dev/null +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_category.yaml @@ -0,0 +1,3 @@ +description: A word or phrase that categorizes the case. +type: string +maxLength: 50 \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_customfields.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_customfields.yaml index 344e17b00617d..71c64225a72ad 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_customfields.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_customfields.yaml @@ -1,3 +1,11 @@ +defaultValue: + oneOf: + - type: string + - type: boolean + description: > + A default value for the custom field. + If the `type` is `text`, the default value must be a string. + If the `type` is `toggle`, the default value must be boolean. key: description: > A unique key for the custom field. diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml index e85179f3053ac..1085e1f8ef974 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_configure_response_properties.yaml @@ -1,14 +1,6 @@ closure_type: $ref: 'closure_types.yaml' -customFields: - type: array - x-technical-preview: true - description: Custom fields configuration details. - items: - type: object - properties: - $ref: 'case_configure_customfields.yaml' -connector: +connector: type: object properties: $ref: 'case_configure_connector_properties.yaml' @@ -20,15 +12,22 @@ created_at: created_by: type: object required: - - email - - full_name - - username + - email + - full_name + - username properties: $ref: 'user_properties.yaml' +customFields: + type: array + description: Custom fields configuration details. + items: + type: object + properties: + $ref: 'case_configure_customfields.yaml' error: type: - - "string" - - "null" + - 'string' + - 'null' examples: - null id: @@ -54,24 +53,26 @@ mappings: - summary owner: $ref: 'owners.yaml' +templates: + $ref: 'templates.yaml' updated_at: type: - - "string" - - "null" + - 'string' + - 'null' format: date-time examples: - 2022-06-01T19:58:48.169Z updated_by: type: - - "object" - - "null" + - 'object' + - 'null' required: - - email - - full_name - - username + - email + - full_name + - username properties: $ref: 'user_properties.yaml' version: type: string examples: - - WzIwNzMsMV0= \ No newline at end of file + - WzIwNzMsMV0= diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_description.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_description.yaml new file mode 100644 index 0000000000000..a7336b64b44ac --- /dev/null +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_description.yaml @@ -0,0 +1,3 @@ +description: The description for the case. +type: string +maxLength: 30000 \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_response_properties.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_response_properties.yaml index bc26dedac8534..a0ef24983502f 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/case_response_properties.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_response_properties.yaml @@ -27,13 +27,13 @@ properties: $ref: 'assignees.yaml' category: type: - - "string" - - "null" + - 'string' + - 'null' description: The case category. closed_at: type: - - "string" - - "null" + - 'string' + - 'null' format: date-time closed_by: $ref: 'case_response_closed_by_properties.yaml' @@ -81,7 +81,6 @@ properties: customFields: type: array description: Custom field values for the case. - x-technical-preview: true items: type: object properties: @@ -92,8 +91,8 @@ properties: - A case description. duration: type: - - "integer" - - "null" + - 'integer' + - 'null' description: > The elapsed time from the creation of the case to its closure (in seconds). If the case has not been closed, the duration is set to null. If the case @@ -112,9 +111,9 @@ properties: settings: $ref: 'settings.yaml' severity: - $ref: 'severity_property.yaml' + $ref: 'case_severity.yaml' status: - $ref: 'status.yaml' + $ref: 'case_status.yaml' tags: type: array items: @@ -135,8 +134,8 @@ properties: - 0 updated_at: type: - - "string" - - "null" + - 'string' + - 'null' format: date-time updated_by: $ref: 'case_response_updated_by_properties.yaml' diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/severity_property.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_severity.yaml similarity index 100% rename from x-pack/plugins/cases/docs/openapi/components/schemas/severity_property.yaml rename to x-pack/plugins/cases/docs/openapi/components/schemas/case_severity.yaml diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/status.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_status.yaml similarity index 100% rename from x-pack/plugins/cases/docs/openapi/components/schemas/status.yaml rename to x-pack/plugins/cases/docs/openapi/components/schemas/case_status.yaml diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_tags.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_tags.yaml new file mode 100644 index 0000000000000..cb0e78901b907 --- /dev/null +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_tags.yaml @@ -0,0 +1,7 @@ +description: > + The words and phrases that help categorize cases. It can be an empty array. +type: array +maxItems: 200 +items: + type: string + maxLength: 256 \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/case_title.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/case_title.yaml new file mode 100644 index 0000000000000..0ed3923a4a9c9 --- /dev/null +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/case_title.yaml @@ -0,0 +1,3 @@ +description: A title for the case. +type: string +maxLength: 160 \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/create_case_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/create_case_request.yaml index 71d3e036ac94b..94e9ecae9254d 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/create_case_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/create_case_request.yaml @@ -22,36 +22,24 @@ properties: - $ref: 'connector_properties_servicenow_sir.yaml' - $ref: 'connector_properties_swimlane.yaml' description: - description: The description for the case. - type: string - maxLength: 30000 + $ref: 'case_description.yaml' owner: $ref: 'owners.yaml' settings: $ref: 'settings.yaml' severity: - $ref: 'severity_property.yaml' + $ref: 'case_severity.yaml' tags: - description: The words and phrases that help categorize cases. It can be an empty array. - type: array - maxItems: 200 - items: - type: string - maxLength: 256 + $ref: 'case_tags.yaml' category: - description: A word or phrase that categorizes the case. - type: string - maxLength: 50 + $ref: 'case_category.yaml' title: - description: A title for the case. - type: string - maxLength: 160 + $ref: 'case_title.yaml' customFields: type: array description: > Custom field values for a case. Any optional custom fields that are not specified in the request are set to null. - x-technical-preview: true minItems: 0 maxItems: 10 items: diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/payload_create_case.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/payload_create_case.yaml index 9bda777bccead..a5483b6412871 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/payload_create_case.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/payload_create_case.yaml @@ -13,9 +13,9 @@ properties: settings: $ref: 'settings.yaml' severity: - $ref: 'severity_property.yaml' + $ref: 'case_severity.yaml' status: - $ref: 'status.yaml' + $ref: 'case_status.yaml' tags: type: array items: diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/payload_severity.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/payload_severity.yaml index 471c309304b99..99dd67b55a43e 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/payload_severity.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/payload_severity.yaml @@ -1,4 +1,4 @@ type: object properties: severity: - $ref: 'severity_property.yaml' \ No newline at end of file + $ref: 'case_severity.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/payload_status.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/payload_status.yaml index 63b67c4e510aa..4ba8eee486fe3 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/payload_status.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/payload_status.yaml @@ -1,4 +1,4 @@ type: object properties: status: - $ref: 'status.yaml' \ No newline at end of file + $ref: 'case_status.yaml' \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/set_case_configuration_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/set_case_configuration_request.yaml index 043febb36c8b6..dd275406264b5 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/set_case_configuration_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/set_case_configuration_request.yaml @@ -21,7 +21,6 @@ properties: customFields: type: array description: Custom fields case configuration. - x-technical-preview: true minItems: 0 maxItems: 10 items: @@ -35,3 +34,5 @@ properties: $ref: 'case_configure_customfields.yaml' owner: $ref: 'owners.yaml' + templates: + $ref: 'templates.yaml' diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/template_tags.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/template_tags.yaml new file mode 100644 index 0000000000000..8dd87c7a35612 --- /dev/null +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/template_tags.yaml @@ -0,0 +1,7 @@ +description: > + The words and phrases that help categorize templates. It can be an empty array. +type: array +maxItems: 200 +items: + type: string + maxLength: 256 \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/templates.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/templates.yaml new file mode 100644 index 0000000000000..b01cf5ad1f34e --- /dev/null +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/templates.yaml @@ -0,0 +1,66 @@ +type: array +x-technical-preview: true +items: + type: object + properties: + caseFields: + type: object + properties: + assignees: + $ref: 'assignees.yaml' + category: + $ref: 'case_category.yaml' + connector: + type: object + properties: + $ref: 'case_configure_connector_properties.yaml' + customFields: + type: array + x-technical-preview: true + description: Custom field values in the template. + items: + type: object + properties: + key: + type: string + description: The unique key for the custom field. + type: + type: string + enum: + - text + - toggle + description: The type of the custom field. + value: + oneOf: + - type: string + - type: boolean + description: > + The default value for the custom field when a case uses the template. + If the `type` is `text`, the default value must be a string. + If the `type` is `toggle`, the default value must be boolean. + description: + $ref: 'case_description.yaml' + settings: + $ref: 'settings.yaml' + severity: + $ref: 'case_severity.yaml' + tags: + $ref: 'case_tags.yaml' + title: + $ref: 'case_title.yaml' + description: + type: string + description: A description for the template. + key: + type: string + description: > + A unique key for the template. + Must be lower case and composed only of a-z, 0-9, '_', and '-' characters. + It is used in API calls to refer to a specific template. + name: + type: string + description: The name of the template. + tags: + $ref: 'template_tags.yaml' + + \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_configuration_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_configuration_request.yaml index 8a6a3aa7f302b..e359eea8e1030 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_configuration_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_configuration_request.yaml @@ -1,7 +1,8 @@ title: Update case configuration request -description: External connection details, such as the closure type and default connector for cases. +description: > + You can update settings such as the closure type, custom fields, templates, and the default connector for cases. type: object -required: +required: - version properties: closure_type: @@ -19,7 +20,6 @@ properties: customFields: type: array description: Custom fields case configuration. - x-technical-preview: true items: type: object required: @@ -29,10 +29,12 @@ properties: - type properties: $ref: 'case_configure_customfields.yaml' + templates: + $ref: 'templates.yaml' version: description: > The version of the connector. To retrieve the version value, use the get configuration API. type: string examples: - - WzIwMiwxXQ== \ No newline at end of file + - WzIwMiwxXQ== diff --git a/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml b/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml index 3fa99d40e5002..8062128c03450 100644 --- a/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml +++ b/x-pack/plugins/cases/docs/openapi/components/schemas/update_case_request.yaml @@ -19,9 +19,7 @@ properties: assignees: $ref: 'assignees.yaml' category: - description: A word or phrase that categorizes the case. - type: string - maxLength: 50 + $ref: 'case_category.yaml' connector: oneOf: - $ref: 'connector_properties_none.yaml' @@ -36,7 +34,6 @@ properties: description: > Custom field values for a case. Any optional custom fields that are not specified in the request are set to null. - x-technical-preview: true minItems: 0 maxItems: 10 items: @@ -48,8 +45,7 @@ properties: properties: $ref: 'case_customfields.yaml' description: - description: An updated description for the case. - type: string + $ref: 'case_description.yaml' id: description: The identifier for the case. type: string @@ -57,20 +53,13 @@ properties: settings: $ref: 'settings.yaml' severity: - $ref: 'severity_property.yaml' + $ref: 'case_severity.yaml' status: - $ref: 'status.yaml' + $ref: 'case_status.yaml' tags: - description: The words and phrases that help categorize cases. - type: array - maxItems: 200 - items: - type: string - maxLength: 256 + $ref: 'case_tags.yaml' title: - description: A title for the case. - type: string - maxLength: 160 + $ref: 'case_title.yaml' version: description: The current version of the case. To determine this value, use the get case or find cases APIs. type: string diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure.yaml index 5de3de67182b0..5618eb08a4b72 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure.yaml @@ -1,10 +1,11 @@ get: - summary: Retrieves external connection details, such as the closure type and default connector for cases in the default space. + summary: Get case settings in the default space operationId: getCaseConfigurationDefaultSpace description: > + Retrieves setting details such as the closure type, custom fields, templatse, and the default connector for cases in the default space. You must have `read` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana - feature privileges, depending on the owner of the case configuration. + feature privileges, depending on where the cases were created. tags: - cases parameters: @@ -31,14 +32,15 @@ get: $ref: '../components/schemas/4xx_response.yaml' post: - summary: Creates a case specific configuration that includes external connection details and custom fields. + summary: Add case settings in the default space operationId: setCaseConfigurationDefaultSpace description: > - You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. + Case settings include external connection details, custom fields, and templates. Connectors are used to interface with external systems. - You must create a connector before you can use it in your cases. Refer to the add connectors API. + You must create a connector before you can use it in your cases. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details. + You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where you are creating cases. tags: - cases parameters: diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@connectors@_find.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@connectors@_find.yaml index 53a5ebf537e57..5ce6113cf699d 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@connectors@_find.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@connectors@_find.yaml @@ -1,10 +1,9 @@ get: - summary: Retrieves information about connectors in the default space. + summary: Get case connectors in the default space operationId: findCaseConnectorsDefaultSpace description: > - In particular, only the connectors that are supported for use in cases are - returned. You must have `read` privileges for the **Actions and Connectors** - feature in the **Management** section of the Kibana feature privileges. + Retrieves information about connectors that are supported for use in cases in the default space. + You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. tags: - cases responses: diff --git a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@{configurationid}.yaml b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@{configurationid}.yaml index d31299128b076..90f75c8d45e45 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@{configurationid}.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/api@cases@configure@{configurationid}.yaml @@ -1,11 +1,13 @@ patch: - summary: Updates external connection details, such as the closure type and default connector for cases in the default space. + summary: Update case settings in the default space operationId: updateCaseConfigurationDefaultSpace description: > - You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the case configuration. + Updates setting details such as the closure type, custom fields, templates, and the default connector for cases in the default space. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. - Refer to the add connectors API. + You must have `all` privileges for the **Cases** feature in the + **Management**, **Observability**, or **Security** section of the Kibana + feature privileges, depending on where the case was created. tags: - cases parameters: diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure.yaml index d12262379df81..7e616ed1c4f14 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure.yaml @@ -1,10 +1,11 @@ get: - summary: Retrieves external connection details, such as the closure type and default connector for cases. + summary: Get case settings operationId: getCaseConfiguration description: > + Retrieves setting details such as the closure type, custom fields, templates, and the default connector for cases. You must have `read` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana - feature privileges, depending on the owner of the case configuration. + feature privileges, depending on where the cases were created. tags: - cases parameters: @@ -32,17 +33,15 @@ get: $ref: '../components/schemas/4xx_response.yaml' post: - summary: Creates a case specific configuration that includes external connection details and custom fields. + summary: Add case settings operationId: setCaseConfiguration description: > - You must have `all` privileges for the **Cases** feature in the - **Management**, **Observability**, or **Security** section of the Kibana - feature privileges, depending on the owner of the case configuration. - Connectors are used to interface with external systems. You must create a - connector before you can use it in your cases. Refer to the add connectors - API. If you set a default connector, it is automatically selected when you - create cases in Kibana. If you use the create case API, however, you must - still specify all of the connector details. + Case settings include external connection details, custom fields, and templates. + Connectors are used to interface with external systems. + You must create a connector before you can use it in your cases. + If you set a default connector, it is automatically selected when you create cases in Kibana. + If you use the create case API, however, you must still specify all of the connector details. + You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where you are creating cases. tags: - cases parameters: diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml index f04f802ba3245..b496bb141f2ee 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@connectors@_find.yaml @@ -1,10 +1,9 @@ get: - summary: Retrieves information about connectors. + summary: Get case connectors operationId: findCaseConnectors description: > - In particular, only the connectors that are supported for use in cases are - returned. You must have `read` privileges for the **Actions and Connectors** - feature in the **Management** section of the Kibana feature privileges. + Retrieves information about connectors that are supported for use in cases. + You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. tags: - cases parameters: diff --git a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml index c8656181aca93..5d31a7e027cb2 100644 --- a/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml +++ b/x-pack/plugins/cases/docs/openapi/paths/s@{spaceid}@api@cases@configure@{configurationid}.yaml @@ -1,12 +1,13 @@ patch: - summary: Updates external connection details, such as the closure type and default connector for cases. + summary: Update case settings operationId: updateCaseConfiguration description: > + Updates setting details such as the closure type, custom fields, templates, and the default connector for cases. + Connectors are used to interface with external systems. + You must create a connector before you can use it in your cases. You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana - feature privileges, depending on the owner of the case configuration. - Connectors are used to interface with external systems. You must create a - connector before you can use it in your cases. Refer to the add connectors API. + feature privileges, depending on where the case was created. tags: - cases parameters: diff --git a/x-pack/plugins/cases/public/common/translations.ts b/x-pack/plugins/cases/public/common/translations.ts index eab026897e3bf..2e11c3a64caae 100644 --- a/x-pack/plugins/cases/public/common/translations.ts +++ b/x-pack/plugins/cases/public/common/translations.ts @@ -22,11 +22,11 @@ export const DELETE_CASE = (quantity: number = 1) => }); export const COPY_ID_ACTION_LABEL = i18n.translate('xpack.cases.caseView.copyID', { - defaultMessage: 'Copy Case ID', + defaultMessage: 'Copy case ID', }); export const COPY_ID_ACTION_SUCCESS = i18n.translate('xpack.cases.caseView.copyIDSuccess', { - defaultMessage: 'Copied Case ID to clipboard', + defaultMessage: 'Copied case ID to clipboard', }); export const NAME = i18n.translate('xpack.cases.caseView.name', { @@ -153,6 +153,14 @@ export const ACTIONS = i18n.translate('xpack.cases.allCases.actions', { defaultMessage: 'Actions', }); +export const ACTIONS_BUTTON_ARIA_LABEL = (title: string) => + i18n.translate('xpack.cases.allCases.actions.button.ariaLabel', { + defaultMessage: 'Actions for "{title}" column', + values: { + title, + }, + }); + export const NO_TAGS_AVAILABLE = i18n.translate('xpack.cases.allCases.noTagsAvailable', { defaultMessage: 'No tags available', }); diff --git a/x-pack/plugins/cases/public/components/actions/copy_id/use_copy_id_action.test.tsx b/x-pack/plugins/cases/public/components/actions/copy_id/use_copy_id_action.test.tsx index 0c33980b3ab63..388b3de940ec5 100644 --- a/x-pack/plugins/cases/public/components/actions/copy_id/use_copy_id_action.test.tsx +++ b/x-pack/plugins/cases/public/components/actions/copy_id/use_copy_id_action.test.tsx @@ -50,7 +50,7 @@ describe('useCopyIDAction', () => { />, "key": "cases-action-copy-id", "name": - Copy Case ID + Copy case ID , "onClick": [Function], } @@ -84,7 +84,7 @@ describe('useCopyIDAction', () => { await waitFor(() => { expect(onActionSuccess).toHaveBeenCalled(); expect(appMockRender.coreStart.notifications.toasts.addSuccess).toHaveBeenCalledWith({ - title: 'Copied Case ID to clipboard', + title: 'Copied case ID to clipboard', className: 'eui-textBreakWord', }); }); diff --git a/x-pack/plugins/cases/public/components/all_cases/severity_filter.test.tsx b/x-pack/plugins/cases/public/components/all_cases/severity_filter.test.tsx index 199b0eebfb2c6..e5efc9463bb26 100644 --- a/x-pack/plugins/cases/public/components/all_cases/severity_filter.test.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/severity_filter.test.tsx @@ -14,7 +14,8 @@ import { screen, waitFor, within } from '@testing-library/react'; import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl'; import { SeverityFilter } from './severity_filter'; -describe('Severity form field', () => { +// Failing: See https://github.com/elastic/kibana/issues/176336 +describe.skip('Severity form field', () => { const onChange = jest.fn(); let appMockRender: AppMockRenderer; const props = { diff --git a/x-pack/plugins/cases/public/components/all_cases/use_actions.tsx b/x-pack/plugins/cases/public/components/all_cases/use_actions.tsx index 70a163bcd69a0..4c43201b1eab4 100644 --- a/x-pack/plugins/cases/public/components/all_cases/use_actions.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/use_actions.tsx @@ -174,7 +174,7 @@ const ActionColumnComponent: React.FC<{ theCase: CaseUI; disableActions: boolean { type: 'toggle', value: true, }, + { + key: 'test_key_3', + type: 'text', + value: null, + }, { key: 'test_key_4', type: 'toggle', @@ -766,7 +771,7 @@ describe('CommonFlyout ', () => { expect(props.onSaveField).not.toHaveBeenCalled(); }); - expect(await screen.findByText('A Template name is required.')).toBeInTheDocument(); + expect(await screen.findByText('Template name is required.')).toBeInTheDocument(); }); it('shows error if template name is too long', async () => { diff --git a/x-pack/plugins/cases/public/components/configure_cases/index.test.tsx b/x-pack/plugins/cases/public/components/configure_cases/index.test.tsx index b424b2ca62fc0..97e43a2ade559 100644 --- a/x-pack/plugins/cases/public/components/configure_cases/index.test.tsx +++ b/x-pack/plugins/cases/public/components/configure_cases/index.test.tsx @@ -724,6 +724,166 @@ describe('ConfigureCases', () => { }); }); + it('deletes a custom field from template while deleting custom field from configuration', async () => { + useGetCaseConfigurationMock.mockImplementation(() => ({ + ...useCaseConfigureResponse, + data: { + ...useCaseConfigureResponse.data, + customFields: customFieldsConfigurationMock, + templates: [ + { + key: 'test_template_4', + name: 'Fourth test template', + caseFields: { + title: 'Case with sample template 4', + description: 'case desc', + customFields: [ + { + key: customFieldsConfigurationMock[0].key, + type: CustomFieldTypes.TEXT, + value: 'this is a text field value', + }, + ], + }, + }, + ], + }, + })); + + appMockRender.render(); + + const list = await screen.findByTestId('custom-fields-list'); + + userEvent.click( + within(list).getByTestId(`${customFieldsConfigurationMock[0].key}-custom-field-delete`) + ); + + expect(await screen.findByTestId('confirm-delete-modal')).toBeInTheDocument(); + + userEvent.click(screen.getByText('Delete')); + + await waitFor(() => { + expect(persistCaseConfigure).toHaveBeenCalledWith({ + connector: { + id: 'none', + name: 'none', + type: ConnectorTypes.none, + fields: null, + }, + closureType: 'close-by-user', + customFields: [ + { ...customFieldsConfigurationMock[1] }, + { ...customFieldsConfigurationMock[2] }, + { ...customFieldsConfigurationMock[3] }, + ], + templates: [ + { + key: 'test_template_4', + name: 'Fourth test template', + caseFields: { + title: 'Case with sample template 4', + description: 'case desc', + customFields: [], + }, + }, + ], + id: '', + version: '', + }); + }); + }); + + it('adds a custom field to template while adding a new custom field', async () => { + useGetCaseConfigurationMock.mockImplementation(() => ({ + ...useCaseConfigureResponse, + data: { + ...useCaseConfigureResponse.data, + customFields: customFieldsConfigurationMock, + templates: [ + { + key: 'test_template_4', + name: 'Fourth test template', + caseFields: null, + }, + ], + }, + })); + + appMockRender.render(); + + userEvent.click(await screen.findByTestId(`add-custom-field`)); + + expect(await screen.findByTestId('common-flyout')).toBeInTheDocument(); + + userEvent.paste(screen.getByTestId('custom-field-label-input'), 'New custom field'); + userEvent.click(screen.getByTestId('text-custom-field-required')); + userEvent.paste( + screen.getByTestId('text-custom-field-default-value'), + 'This is a default value' + ); + + userEvent.click(screen.getByTestId('common-flyout-save')); + + await waitFor(() => { + expect(persistCaseConfigure).toHaveBeenCalledWith({ + connector: { + id: 'none', + name: 'none', + type: ConnectorTypes.none, + fields: null, + }, + closureType: 'close-by-user', + customFields: [ + ...customFieldsConfigurationMock, + { + key: expect.anything(), + label: 'New custom field', + type: CustomFieldTypes.TEXT as const, + required: true, + defaultValue: 'This is a default value', + }, + ], + templates: [ + { + key: 'test_template_4', + name: 'Fourth test template', + caseFields: { + customFields: [ + { + key: customFieldsConfigurationMock[0].key, + type: customFieldsConfigurationMock[0].type, + value: customFieldsConfigurationMock[0].defaultValue, + }, + { + key: customFieldsConfigurationMock[1].key, + type: customFieldsConfigurationMock[1].type, + value: customFieldsConfigurationMock[1].defaultValue, + }, + { + key: customFieldsConfigurationMock[2].key, + type: customFieldsConfigurationMock[2].type, + value: null, + }, + { + key: customFieldsConfigurationMock[3].key, + type: customFieldsConfigurationMock[3].type, + value: false, + }, + { + key: expect.anything(), + type: CustomFieldTypes.TEXT as const, + value: 'This is a default value', + }, + ], + }, + }, + ], + id: '', + version: '', + }); + }); + }); + it('updates a custom field correctly', async () => { useGetCaseConfigurationMock.mockImplementation(() => ({ ...useCaseConfigureResponse, @@ -929,6 +1089,11 @@ describe('ConfigureCases', () => { type: customFieldsConfigurationMock[1].type, value: customFieldsConfigurationMock[1].defaultValue, }, + { + key: customFieldsConfigurationMock[2].key, + type: customFieldsConfigurationMock[2].type, + value: null, + }, { key: customFieldsConfigurationMock[3].key, type: customFieldsConfigurationMock[3].type, diff --git a/x-pack/plugins/cases/public/components/configure_cases/index.tsx b/x-pack/plugins/cases/public/components/configure_cases/index.tsx index 1003a10646e8c..2eadd6ccbe79a 100644 --- a/x-pack/plugins/cases/public/components/configure_cases/index.tsx +++ b/x-pack/plugins/cases/public/components/configure_cases/index.tsx @@ -24,7 +24,11 @@ import { import type { ActionConnectorTableItem } from '@kbn/triggers-actions-ui-plugin/public/types'; import { CasesConnectorFeatureId } from '@kbn/actions-plugin/common'; -import type { CustomFieldConfiguration, TemplateConfiguration } from '../../../common/types/domain'; +import type { + CustomFieldConfiguration, + TemplateConfiguration, + CustomFieldTypes, +} from '../../../common/types/domain'; import { useKibana } from '../../common/lib/kibana'; import { useGetActionTypes } from '../../containers/configure/use_action_types'; import { useGetCaseConfiguration } from '../../containers/configure/use_get_case_configuration'; @@ -48,6 +52,8 @@ import { Templates } from '../templates'; import type { TemplateFormProps } from '../templates/types'; import { CustomFieldsForm } from '../custom_fields/form'; import { TemplateForm } from '../templates/form'; +import type { CasesConfigurationUI, CaseUI } from '../../containers/types'; +import { builderMap as customFieldsBuilderMap } from '../custom_fields/builder'; const sectionWrapperCss = css` box-sizing: content-box; @@ -68,6 +74,40 @@ interface Flyout { visible: boolean; } +const addNewCustomFieldToTemplates = ({ + templates, + customFields, +}: Pick) => { + return templates.map((template) => { + const templateCustomFields = template.caseFields?.customFields ?? []; + + customFields.forEach((field) => { + if ( + !templateCustomFields.length || + !templateCustomFields.find((templateCustomField) => templateCustomField.key === field.key) + ) { + const customFieldFactory = customFieldsBuilderMap[field.type]; + const { getDefaultValue } = customFieldFactory(); + const value = getDefaultValue?.() ?? null; + + templateCustomFields.push({ + key: field.key, + type: field.type as CustomFieldTypes, + value: field.defaultValue ?? value, + } as CaseUI['customFields'][number]); + } + }); + + return { + ...template, + caseFields: { + ...template.caseFields, + customFields: [...templateCustomFields], + }, + }; + }); +}; + export const ConfigureCases: React.FC = React.memo(() => { const { permissions } = useCasesContext(); const { triggersActionsUi } = useKibana().services; @@ -334,10 +374,16 @@ export const ConfigureCases: React.FC = React.memo(() => { (data: CustomFieldConfiguration) => { const updatedCustomFields = addOrReplaceField(customFields, data); + // add the new custom field to each template as well + const updatedTemplates = addNewCustomFieldToTemplates({ + templates, + customFields: updatedCustomFields, + }); + persistCaseConfigure({ connector, customFields: updatedCustomFields, - templates, + templates: updatedTemplates, id: configurationId, version: configurationVersion, closureType, diff --git a/x-pack/plugins/cases/public/components/connector_selector/form.test.tsx b/x-pack/plugins/cases/public/components/connector_selector/form.test.tsx index 9cf77466a225b..70e91af618854 100644 --- a/x-pack/plugins/cases/public/components/connector_selector/form.test.tsx +++ b/x-pack/plugins/cases/public/components/connector_selector/form.test.tsx @@ -6,48 +6,90 @@ */ import React from 'react'; -import { mount } from 'enzyme'; -import type { FormHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; -import { UseField, Form, useForm } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { screen } from '@testing-library/react'; import { ConnectorSelector } from './form'; -import { connectorsMock } from '../../containers/mock'; -import { getFormMock } from '../__mock__/form'; import { useKibana } from '../../common/lib/kibana'; +import type { AppMockRenderer } from '../../common/mock'; +import { createAppMockRenderer } from '../../common/mock'; +import { UseField } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { FormTestComponent } from '../../common/test_utils'; +import { connectorsMock } from '../../containers/mock'; -jest.mock('@kbn/es-ui-shared-plugin/static/forms/hook_form_lib/hooks/use_form'); jest.mock('../../common/lib/kibana'); const useKibanaMock = useKibana as jest.Mocked; -const useFormMock = useForm as jest.Mock; describe('ConnectorSelector', () => { - const formHookMock = getFormMock({ connectorId: connectorsMock[0].id }); + const handleChange = jest.fn(); + const defaultProps = { + connectors: [], + handleChange, + dataTestSubj: 'connectors', + disabled: false, + idAria: 'connectors', + isLoading: false, + }; + + let appMock: AppMockRenderer; + + beforeEach(() => { + appMock = createAppMockRenderer(); + jest.clearAllMocks(); + }); beforeEach(() => { - useFormMock.mockImplementation(() => ({ form: formHookMock })); useKibanaMock().services.triggersActionsUi.actionTypeRegistry.get = jest.fn().mockReturnValue({ actionTypeTitle: 'test', iconClass: 'logoSecurity', }); }); - it('it should render', async () => { - const wrapper = mount( -
    + it('should render', async () => { + appMock.render( + + + + ); + + expect(await screen.findByTestId(defaultProps.dataTestSubj)); + }); + + it('should set the selected connector to none if the connector is not available', async () => { + appMock.render( + + + + ); + + expect(await screen.findByText('No connector selected')); + }); + + it('should set the selected connector correctly', async () => { + appMock.render( + - +
    ); - expect(wrapper.find(`[data-test-subj="caseConnectors"]`).exists()).toBeTruthy(); + expect(await screen.findByText(connectorsMock[0].name)); }); }); diff --git a/x-pack/plugins/cases/public/components/connector_selector/form.tsx b/x-pack/plugins/cases/public/components/connector_selector/form.tsx index 37221edf9048a..fa991bc5b9871 100644 --- a/x-pack/plugins/cases/public/components/connector_selector/form.tsx +++ b/x-pack/plugins/cases/public/components/connector_selector/form.tsx @@ -45,6 +45,10 @@ export const ConnectorSelector = ({ [handleChange, field] ); + const isConnectorAvailable = Boolean( + connectors.find((connector) => connector.id === field.value) + ); + return ( ); diff --git a/x-pack/plugins/cases/public/components/connectors/resilient/use_get_severity.test.tsx b/x-pack/plugins/cases/public/components/connectors/resilient/use_get_severity.test.tsx index 964daacb4a6bf..bf2ba2a4ece3c 100644 --- a/x-pack/plugins/cases/public/components/connectors/resilient/use_get_severity.test.tsx +++ b/x-pack/plugins/cases/public/components/connectors/resilient/use_get_severity.test.tsx @@ -19,7 +19,8 @@ jest.mock('./api'); const useKibanaMock = useKibana as jest.Mocked; -describe('useGetSeverity', () => { +// FLAKY: https://github.com/elastic/kibana/issues/187456 +describe.skip('useGetSeverity', () => { const { http } = useKibanaMock().services; let appMockRender: AppMockRenderer; diff --git a/x-pack/plugins/cases/public/components/create/form.test.tsx b/x-pack/plugins/cases/public/components/create/form.test.tsx index 885e25e959ac9..c93ffbd4cff77 100644 --- a/x-pack/plugins/cases/public/components/create/form.test.tsx +++ b/x-pack/plugins/cases/public/components/create/form.test.tsx @@ -24,7 +24,7 @@ import { useAvailableCasesOwners } from '../app/use_available_owners'; import type { AppMockRenderer } from '../../common/mock'; import { createAppMockRenderer } from '../../common/mock'; import userEvent from '@testing-library/user-event'; -import { CustomFieldTypes } from '../../../common/types/domain'; +import { ConnectorTypes, CustomFieldTypes } from '../../../common/types/domain'; import { useSuggestUserProfiles } from '../../containers/user_profiles/use_suggest_user_profiles'; import { useGetCurrentUserProfile } from '../../containers/user_profiles/use_get_current_user_profile'; import { userProfiles } from '../../containers/user_profiles/api.mock'; @@ -334,5 +334,73 @@ describe('CreateCaseForm', () => { expect(await screen.findByText('No connector selected')).toBeInTheDocument(); }); + + it('selects the placeholder empty template correctly', async () => { + useGetAllCaseConfigurationsMock.mockReturnValue({ + ...useGetAllCaseConfigurationsResponse, + data: [ + { + ...useGetAllCaseConfigurationsResponse.data[0], + customFields: [ + { + key: 'first_custom_field_key', + type: CustomFieldTypes.TEXT, + required: false, + label: 'My test label 1', + defaultValue: 'custom field default value', + }, + ], + templates: templatesConfigurationMock, + connector: { + id: 'servicenow-1', + name: 'My SN connector', + type: ConnectorTypes.serviceNowITSM, + fields: null, + }, + }, + ], + }); + + const license = licensingMock.createLicense({ + license: { type: 'platinum' }, + }); + const firstTemplate = templatesConfigurationMock[4]; + + appMockRenderer = createAppMockRenderer({ license }); + appMockRenderer.render(); + + userEvent.selectOptions( + await screen.findByTestId('create-case-template-select'), + firstTemplate.name + ); + + const title = within(await screen.findByTestId('caseTitle')).getByTestId('input'); + const description = within(await screen.findByTestId('caseDescription')).getByRole('textbox'); + const tags = within(await screen.findByTestId('caseTags')).getByTestId('comboBoxInput'); + const category = within(await screen.findByTestId('caseCategory')).getByTestId( + 'comboBoxSearchInput' + ); + const assignees = within(await screen.findByTestId('caseAssignees')).getByTestId( + 'comboBoxSearchInput' + ); + const severity = await screen.findByTestId('case-severity-selection'); + const customField = await screen.findByTestId( + 'first_custom_field_key-text-create-custom-field' + ); + + userEvent.selectOptions( + await screen.findByTestId('create-case-template-select'), + 'No template selected' + ); + + expect(title).not.toHaveValue(); + expect(description).not.toHaveValue(); + expect(tags).not.toHaveValue(); + expect(category).not.toHaveValue(); + expect(severity).toHaveTextContent('Low'); + expect(assignees).not.toHaveValue(); + expect(customField).toHaveValue('custom field default value'); + expect(await screen.findByText('My SN connector')).toBeInTheDocument(); + }); }); }); diff --git a/x-pack/plugins/cases/public/components/create/form_fields.tsx b/x-pack/plugins/cases/public/components/create/form_fields.tsx index 26189e33b7f12..da81e65b8e0f0 100644 --- a/x-pack/plugins/cases/public/components/create/form_fields.tsx +++ b/x-pack/plugins/cases/public/components/create/form_fields.tsx @@ -17,7 +17,7 @@ import { import { css } from '@emotion/react'; import { useFormContext } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; -import type { CasePostRequest } from '../../../common'; +import type { CasePostRequest, CaseUI } from '../../../common'; import type { ActionConnector } from '../../../common/types/domain'; import { Connector } from '../case_form_fields/connector'; import * as i18n from './translations'; @@ -28,6 +28,7 @@ import { useCasesFeatures } from '../../common/use_cases_features'; import { TemplateSelector } from './templates'; import { getInitialCaseValue } from './utils'; import { CaseFormFields } from '../case_form_fields'; +import { builderMap as customFieldsBuilderMap } from '../custom_fields/builder'; export interface CreateCaseFormFieldsProps { configuration: CasesConfigurationUI; @@ -42,9 +43,26 @@ const transformTemplateCaseFieldsToCaseFormFields = ( caseTemplateFields: CasesConfigurationUITemplate['caseFields'] ): CasePostRequest => { const caseFields = removeEmptyFields(caseTemplateFields ?? {}); - return getInitialCaseValue({ owner, ...caseFields }); + const transFormedCustomFields = caseFields?.customFields?.map((customField) => { + const customFieldFactory = customFieldsBuilderMap[customField.type]; + const { convertNullToEmpty } = customFieldFactory(); + const value = convertNullToEmpty ? convertNullToEmpty(customField.value) : customField.value; + + return { + ...customField, + value, + }; + }); + + return getInitialCaseValue({ + owner, + ...caseFields, + customFields: transFormedCustomFields as CaseUI['customFields'], + }); }; +const DEFAULT_EMPTY_TEMPLATE_KEY = 'defaultEmptyTemplateKey'; + export const CreateCaseFormFields: React.FC = React.memo( ({ configuration, connectors, isLoading, withSteps, draftStorageKey }) => { const { reset, updateFieldValues, isSubmitting, setFieldValue } = useFormContext(); @@ -61,6 +79,18 @@ export const CreateCaseFormFields: React.FC = React.m setFieldValue('connectorId', configuration.connector.id); }, [configuration.connector.id, setFieldValue]); + const defaultTemplate = useMemo( + () => ({ + key: DEFAULT_EMPTY_TEMPLATE_KEY, + name: i18n.DEFAULT_EMPTY_TEMPLATE_NAME, + caseFields: getInitialCaseValue({ + owner: configurationOwner, + connector: configuration.connector, + }), + }), + [configurationOwner, configuration.connector] + ); + const onTemplateChange = useCallback( (caseFields: CasesConfigurationUITemplate['caseFields']) => { const caseFormFields = transformTemplateCaseFieldsToCaseFormFields( @@ -83,12 +113,12 @@ export const CreateCaseFormFields: React.FC = React.m children: ( ), }), - [configuration.templates, isLoading, isSubmitting, onTemplateChange] + [configuration.templates, defaultTemplate, isLoading, isSubmitting, onTemplateChange] ); const secondStep = useMemo( diff --git a/x-pack/plugins/cases/public/components/create/templates.tsx b/x-pack/plugins/cases/public/components/create/templates.tsx index 612a7d8a24a70..3df1504ccf14f 100644 --- a/x-pack/plugins/cases/public/components/create/templates.tsx +++ b/x-pack/plugins/cases/public/components/create/templates.tsx @@ -57,7 +57,6 @@ export const TemplateSelectorComponent: React.FC = ({ isLoading={isLoading} data-test-subj="create-case-template-select" fullWidth - hasNoInitialSelection value={selectedTemplate} /> diff --git a/x-pack/plugins/cases/public/components/create/translations.ts b/x-pack/plugins/cases/public/components/create/translations.ts index aef9c7c525acd..89e384502d3ed 100644 --- a/x-pack/plugins/cases/public/components/create/translations.ts +++ b/x-pack/plugins/cases/public/components/create/translations.ts @@ -55,9 +55,16 @@ export const TEMPLATE_LABEL = i18n.translate('xpack.cases.create.templateLabel', }); export const TEMPLATE_HELP_TEXT = i18n.translate('xpack.cases.create.templateHelpText', { - defaultMessage: 'Selecting a template will pre-fill certain case fields below', + defaultMessage: 'Select a template to use its default field values.', }); export const SOLUTION_SELECTOR_LABEL = i18n.translate('xpack.cases.create.solutionSelectorLabel', { defaultMessage: 'Create case under:', }); + +export const DEFAULT_EMPTY_TEMPLATE_NAME = i18n.translate( + 'xpack.cases.create.defaultEmptyTemplateName', + { + defaultMessage: 'No template selected', + } +); diff --git a/x-pack/plugins/cases/public/components/custom_fields/form.test.tsx b/x-pack/plugins/cases/public/components/custom_fields/form.test.tsx index 89fdca73fefbf..125a5ada01e5f 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/form.test.tsx +++ b/x-pack/plugins/cases/public/components/custom_fields/form.test.tsx @@ -18,7 +18,8 @@ import userEvent from '@testing-library/user-event'; import { customFieldsConfigurationMock } from '../../containers/mock'; import type { FormState } from '../configure_cases/flyout'; -describe('CustomFieldsForm ', () => { +// FLAKY: https://github.com/elastic/kibana/issues/187554 +describe.skip('CustomFieldsForm ', () => { let appMockRender: AppMockRenderer; const onChange = jest.fn(); diff --git a/x-pack/plugins/cases/public/components/custom_fields/index.tsx b/x-pack/plugins/cases/public/components/custom_fields/index.tsx index a5068df682ad1..afe3a4ad04b32 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/index.tsx +++ b/x-pack/plugins/cases/public/components/custom_fields/index.tsx @@ -21,7 +21,6 @@ import { useCasesContext } from '../cases_context/use_cases_context'; import type { CustomFieldsConfiguration } from '../../../common/types/domain'; import { MAX_CUSTOM_FIELDS_PER_CASE } from '../../../common/constants'; import { CustomFieldsList } from './custom_fields_list'; -import { ExperimentalBadge } from '../experimental_badge/experimental_badge'; export interface Props { customFields: CustomFieldsConfiguration; @@ -68,14 +67,7 @@ const CustomFieldsComponent: React.FC = ({ return canAddCustomFields ? ( - {i18n.TITLE} - - - -
    - } + title={

    {i18n.TITLE}

    } description={

    {i18n.DESCRIPTION}

    } data-test-subj="custom-fields-form-group" > diff --git a/x-pack/plugins/cases/public/components/custom_fields/text/configure_text_field.test.ts b/x-pack/plugins/cases/public/components/custom_fields/text/configure_text_field.test.ts index 9ce931b1fa293..46b7518a40fe2 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/text/configure_text_field.test.ts +++ b/x-pack/plugins/cases/public/components/custom_fields/text/configure_text_field.test.ts @@ -20,6 +20,7 @@ describe('configureTextCustomFieldFactory ', () => { label: 'Text', getEuiTableColumn: expect.any(Function), build: expect.any(Function), + convertNullToEmpty: expect.any(Function), }); }); }); diff --git a/x-pack/plugins/cases/public/components/custom_fields/text/configure_text_field.ts b/x-pack/plugins/cases/public/components/custom_fields/text/configure_text_field.ts index 908d7c678d3dd..c0f50820d45f3 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/text/configure_text_field.ts +++ b/x-pack/plugins/cases/public/components/custom_fields/text/configure_text_field.ts @@ -25,4 +25,5 @@ export const configureTextCustomFieldFactory: CustomFieldFactory (value == null ? '' : String(value)), }); diff --git a/x-pack/plugins/cases/public/components/custom_fields/text/create.test.tsx b/x-pack/plugins/cases/public/components/custom_fields/text/create.test.tsx index 0b62466fa6858..86a4aef5ad720 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/text/create.test.tsx +++ b/x-pack/plugins/cases/public/components/custom_fields/text/create.test.tsx @@ -191,7 +191,7 @@ describe('Create ', () => { userEvent.click(await screen.findByText('Submit')); expect( - await screen.findByText(`A ${customFieldConfiguration.label} is required.`) + await screen.findByText(`${customFieldConfiguration.label} is required.`) ).toBeInTheDocument(); await waitFor(() => { diff --git a/x-pack/plugins/cases/public/components/custom_fields/text/edit.test.tsx b/x-pack/plugins/cases/public/components/custom_fields/text/edit.test.tsx index 0c0ff65d5036e..04dee5dc04878 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/text/edit.test.tsx +++ b/x-pack/plugins/cases/public/components/custom_fields/text/edit.test.tsx @@ -380,7 +380,7 @@ describe('Edit ', () => { userEvent.click(await screen.findByTestId('case-text-custom-field-edit-button-test_key_1')); userEvent.clear(await screen.findByTestId('case-text-custom-field-form-field-test_key_1')); - expect(await screen.findByText('A My test label 1 is required.')).toBeInTheDocument(); + expect(await screen.findByText('My test label 1 is required.')).toBeInTheDocument(); }); it('does not shows a validation error if the field is not required', async () => { diff --git a/x-pack/plugins/cases/public/components/custom_fields/toggle/configure_text_field.test.ts b/x-pack/plugins/cases/public/components/custom_fields/toggle/configure_text_field.test.ts index 3ac05ad6b867c..9a9994db2a3d2 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/toggle/configure_text_field.test.ts +++ b/x-pack/plugins/cases/public/components/custom_fields/toggle/configure_text_field.test.ts @@ -24,6 +24,7 @@ describe('configureToggleCustomFieldFactory ', () => { { key: 'on', label: 'On', value: true }, { key: 'off', label: 'Off', value: false }, ], + getDefaultValue: expect.any(Function), }); }); }); diff --git a/x-pack/plugins/cases/public/components/custom_fields/toggle/configure_toggle_field.ts b/x-pack/plugins/cases/public/components/custom_fields/toggle/configure_toggle_field.ts index 6b82f423256cb..0ad2e0fd2a68f 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/toggle/configure_toggle_field.ts +++ b/x-pack/plugins/cases/public/components/custom_fields/toggle/configure_toggle_field.ts @@ -30,4 +30,5 @@ export const configureToggleCustomFieldFactory: CustomFieldFactory false, }); diff --git a/x-pack/plugins/cases/public/components/custom_fields/translations.ts b/x-pack/plugins/cases/public/components/custom_fields/translations.ts index 1f6616ceeb612..5f1a91765193f 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/translations.ts +++ b/x-pack/plugins/cases/public/components/custom_fields/translations.ts @@ -77,7 +77,7 @@ export const REQUIRED = i18n.translate('xpack.cases.customFields.required', { export const REQUIRED_FIELD = (fieldName: string): string => i18n.translate('xpack.cases.customFields.requiredField', { values: { fieldName }, - defaultMessage: 'A {fieldName} is required.', + defaultMessage: '{fieldName} is required.', }); export const EDIT_CUSTOM_FIELDS_ARIA_LABEL = (customFieldLabel: string) => diff --git a/x-pack/plugins/cases/public/components/custom_fields/types.ts b/x-pack/plugins/cases/public/components/custom_fields/types.ts index a1dcffaec6b97..70caeabd8edd2 100644 --- a/x-pack/plugins/cases/public/components/custom_fields/types.ts +++ b/x-pack/plugins/cases/public/components/custom_fields/types.ts @@ -54,6 +54,8 @@ export type CustomFieldFactory = () => { getEuiTableColumn: (params: { label: string }) => CustomFieldEuiTableColumn; build: () => CustomFieldType; filterOptions?: CustomFieldFactoryFilterOption[]; + getDefaultValue?: () => string | boolean | null; + convertNullToEmpty?: (value: string | boolean | null) => string; }; export type CustomFieldBuilderMap = { diff --git a/x-pack/plugins/cases/public/components/templates/form.test.tsx b/x-pack/plugins/cases/public/components/templates/form.test.tsx index a01aa25132cb5..2f04bead5005e 100644 --- a/x-pack/plugins/cases/public/components/templates/form.test.tsx +++ b/x-pack/plugins/cases/public/components/templates/form.test.tsx @@ -561,6 +561,11 @@ describe('TemplateForm', () => { type: 'toggle', value: true, }, + { + key: 'test_key_3', + type: 'text', + value: null, + }, { key: 'test_key_4', type: 'toggle', @@ -645,6 +650,11 @@ describe('TemplateForm', () => { type: 'toggle', value: true, }, + { + key: 'test_key_3', + type: 'text', + value: null, + }, { key: 'test_key_4', type: 'toggle', diff --git a/x-pack/plugins/cases/public/components/templates/form_fields.test.tsx b/x-pack/plugins/cases/public/components/templates/form_fields.test.tsx index 814ba13efe6ed..cdd9ca2814f0a 100644 --- a/x-pack/plugins/cases/public/components/templates/form_fields.test.tsx +++ b/x-pack/plugins/cases/public/components/templates/form_fields.test.tsx @@ -17,6 +17,7 @@ import { useGetChoicesResponse } from '../create/mock'; import { connectorsMock, customFieldsConfigurationMock } from '../../containers/mock'; import { TEMPLATE_FIELDS, CASE_FIELDS, CONNECTOR_FIELDS, CASE_SETTINGS } from './translations'; import { FormFields } from './form_fields'; +import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl'; jest.mock('../connectors/servicenow/use_get_choices'); @@ -395,4 +396,47 @@ describe('form fields', () => { ); }); }); + + it('does not render duplicate template tags', async () => { + const newProps = { + ...defaultProps, + currentConfiguration: { + ...defaultProps.currentConfiguration, + templates: [ + { + key: 'test_template_1', + name: 'Test', + tags: ['one', 'two'], + caseFields: {}, + }, + { + key: 'test_template_2', + name: 'Test 2', + tags: ['one', 'three'], + caseFields: {}, + }, + ], + }, + }; + + appMockRenderer.render( + + + + ); + + const caseTags = await screen.findByTestId('template-tags'); + + userEvent.click(within(caseTags).getByTestId('comboBoxToggleListButton')); + await waitForEuiPopoverOpen(); + + /** + * RTL will throw an error if there are more that one + * element matching the text. This ensures that duplicated + * tags are removed. Docs: https://testing-library.com/docs/queries/about + */ + expect(await screen.findByText('one')); + expect(await screen.findByText('two')); + expect(await screen.findByText('three')); + }); }); diff --git a/x-pack/plugins/cases/public/components/templates/form_fields.tsx b/x-pack/plugins/cases/public/components/templates/form_fields.tsx index 9f28f7b7179b4..9a69d1c4590dc 100644 --- a/x-pack/plugins/cases/public/components/templates/form_fields.tsx +++ b/x-pack/plugins/cases/public/components/templates/form_fields.tsx @@ -9,6 +9,7 @@ import React, { memo, useMemo } from 'react'; import { UseField } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { HiddenField } from '@kbn/es-ui-shared-plugin/static/forms/components'; import { EuiSteps } from '@elastic/eui'; +import { uniq } from 'lodash'; import { CaseFormFields } from '../case_form_fields'; import * as i18n from './translations'; import type { ActionConnector } from '../../containers/configure/types'; @@ -33,9 +34,7 @@ const FormFieldsComponent: React.FC = ({ }) => { const { isSyncAlertsEnabled } = useCasesFeatures(); const { customFields: configurationCustomFields, templates } = currentConfiguration; - const configurationTemplateTags = templates - .map((template) => (template?.tags?.length ? template.tags : [])) - .flat(); + const configurationTemplateTags = getTemplateTags(templates); const firstStep = useMemo( () => ({ @@ -103,3 +102,6 @@ const FormFieldsComponent: React.FC = ({ FormFieldsComponent.displayName = 'FormFields'; export const FormFields = memo(FormFieldsComponent); + +const getTemplateTags = (templates: CasesConfigurationUI['templates']) => + uniq(templates.map((template) => (template?.tags?.length ? template.tags : [])).flat()); diff --git a/x-pack/plugins/cases/public/components/templates/translations.ts b/x-pack/plugins/cases/public/components/templates/translations.ts index 2993070046813..607276180fca8 100644 --- a/x-pack/plugins/cases/public/components/templates/translations.ts +++ b/x-pack/plugins/cases/public/components/templates/translations.ts @@ -14,8 +14,7 @@ export const TEMPLATE_TITLE = i18n.translate('xpack.cases.templates.title', { }); export const TEMPLATE_DESCRIPTION = i18n.translate('xpack.cases.templates.description', { - defaultMessage: - 'Add Case Templates to automatically define the case fields while creating a new case. A user can choose to create an empty case or based on a preset template. Templates allow to auto-populate values when creating new cases.', + defaultMessage: 'Create templates that automatically populate values in new cases.', }); export const NO_TEMPLATES = i18n.translate('xpack.cases.templates.noTemplates', { @@ -37,7 +36,7 @@ export const REQUIRED = i18n.translate('xpack.cases.templates.required', { export const REQUIRED_FIELD = (fieldName: string): string => i18n.translate('xpack.cases.templates.requiredField', { values: { fieldName }, - defaultMessage: 'A {fieldName} is required.', + defaultMessage: '{fieldName} is required.', }); export const TEMPLATE_NAME = i18n.translate('xpack.cases.templates.templateName', { @@ -45,8 +44,7 @@ export const TEMPLATE_NAME = i18n.translate('xpack.cases.templates.templateName' }); export const TEMPLATE_TAGS_HELP = i18n.translate('xpack.cases.templates.templateTagsHelp', { - defaultMessage: - 'Type one or more custom identifying tags for this template. Please enter after each tag to begin a new one', + defaultMessage: 'Separate tags with a line break.', }); export const TEMPLATE_FIELDS = i18n.translate('xpack.cases.templates.templateFields', { diff --git a/x-pack/plugins/cases/public/components/templates/utils.test.ts b/x-pack/plugins/cases/public/components/templates/utils.test.ts index 9e3cd70c120af..639facc690752 100644 --- a/x-pack/plugins/cases/public/components/templates/utils.test.ts +++ b/x-pack/plugins/cases/public/components/templates/utils.test.ts @@ -117,9 +117,9 @@ describe('utils', () => { name: 'template 1', templateDescription: '', customFields: { - custom_field_1: 'foobar', - custom_fields_2: '', - custom_field_3: true, + test_key_1: 'foobar', + test_key_3: '', + test_key_2: true, }, }); @@ -131,7 +131,11 @@ describe('utils', () => { name: 'none', type: '.none', }, - customFields: [], + customFields: [ + { key: 'test_key_1', type: 'text', value: 'foobar' }, + { key: 'test_key_3', type: 'text', value: null }, + { key: 'test_key_2', type: 'toggle', value: true }, + ], settings: { syncAlerts: false, }, diff --git a/x-pack/plugins/cases/public/components/templates/utils.ts b/x-pack/plugins/cases/public/components/templates/utils.ts index 3ee3002388e2d..29dda56fbe0e6 100644 --- a/x-pack/plugins/cases/public/components/templates/utils.ts +++ b/x-pack/plugins/cases/public/components/templates/utils.ts @@ -79,14 +79,19 @@ export const templateSerializer = ( return data; } - const { fields: connectorFields = null, key, name, ...rest } = data; + const { + fields: connectorFields = null, + key, + name, + customFields: templateCustomFields, + ...rest + } = data; const serializedConnectorFields = getConnectorsFormSerializer({ fields: connectorFields }); const nonEmptyFields = removeEmptyFields({ ...rest }); const { connectorId, - customFields: templateCustomFields, syncAlerts = false, templateTags, templateDescription, diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/action_wrapper.test.tsx b/x-pack/plugins/cases/public/components/visualizations/actions/action_wrapper.test.tsx index 31f34de24d5ed..8437da2f28b9c 100644 --- a/x-pack/plugins/cases/public/components/visualizations/actions/action_wrapper.test.tsx +++ b/x-pack/plugins/cases/public/components/visualizations/actions/action_wrapper.test.tsx @@ -11,7 +11,8 @@ import { SECURITY_SOLUTION_OWNER } from '../../../../common'; import { canUseCases } from '../../../client/helpers/can_use_cases'; import CasesProvider from '../../cases_context'; import { ActionWrapper } from './action_wrapper'; -import { getMockCaseUiActionProps } from './mocks'; +import { getMockServices } from './mocks'; +import type { CasesActionContextProps } from './types'; jest.mock('../../cases_context', () => jest.fn().mockImplementation(({ children, ...props }) =>
    {children}
    ) @@ -28,7 +29,11 @@ jest.mock('../../../client/helpers/can_use_cases', () => { const mockCasePermissions = jest.fn().mockReturnValue({ create: true, update: true }); describe('ActionWrapper', () => { - const props = { ...getMockCaseUiActionProps(), currentAppId: 'securitySolutionUI' }; + const props = { + casesActionContextProps: {} as unknown as CasesActionContextProps, + currentAppId: 'securitySolutionUI', + services: getMockServices(), + }; beforeEach(() => { jest.clearAllMocks(); diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/action_wrapper.tsx b/x-pack/plugins/cases/public/components/visualizations/actions/action_wrapper.tsx index 543969c731d36..add06a7badb22 100644 --- a/x-pack/plugins/cases/public/components/visualizations/actions/action_wrapper.tsx +++ b/x-pack/plugins/cases/public/components/visualizations/actions/action_wrapper.tsx @@ -11,7 +11,7 @@ import { Router } from '@kbn/shared-ux-router'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import { SECURITY_SOLUTION_OWNER } from '../../../../common'; -import type { CasesUIActionProps } from './types'; +import type { CasesActionContextProps, Services } from './types'; import { KibanaContextProvider, useKibana } from '../../../common/lib/kibana'; import CasesProvider from '../../cases_context'; import { getCaseOwnerByAppId } from '../../../../common/utils/owner'; @@ -20,13 +20,13 @@ import { canUseCases } from '../../../client/helpers/can_use_cases'; export const DEFAULT_DARK_MODE = 'theme:darkMode' as const; interface Props { - caseContextProps: CasesUIActionProps['caseContextProps']; + casesActionContextProps: CasesActionContextProps; currentAppId?: string; } const ActionWrapperWithContext: React.FC> = ({ children, - caseContextProps, + casesActionContextProps, currentAppId, }) => { const { application, i18n, theme } = useKibana().services; @@ -40,7 +40,7 @@ const ActionWrapperWithContext: React.FC> = ({ > = ({ ActionWrapperWithContext.displayName = 'ActionWrapperWithContext'; -type ActionWrapperComponentProps = PropsWithChildren< - CasesUIActionProps & { currentAppId?: string } ->; +type ActionWrapperComponentProps = PropsWithChildren<{ + casesActionContextProps: CasesActionContextProps; + currentAppId?: string; + services: Services; +}>; const ActionWrapperComponent: React.FC = ({ - core, - plugins, - storage, - history, + casesActionContextProps, children, - caseContextProps, currentAppId, + services, }) => { return ( - - + + {children} diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/add_to_existing_case.test.tsx b/x-pack/plugins/cases/public/components/visualizations/actions/add_to_existing_case.test.tsx deleted file mode 100644 index 07d05f292d722..0000000000000 --- a/x-pack/plugins/cases/public/components/visualizations/actions/add_to_existing_case.test.tsx +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { LENS_EMBEDDABLE_TYPE, type Embeddable as LensEmbeddable } from '@kbn/lens-plugin/public'; -import { ErrorEmbeddable } from '@kbn/embeddable-plugin/public'; -import type { Action } from '@kbn/ui-actions-plugin/public'; -import ReactDOM, { unmountComponentAtNode } from 'react-dom'; - -import { createAddToExistingCaseLensAction } from './add_to_existing_case'; -import type { ActionContext } from './types'; -import { useCasesAddToExistingCaseModal } from '../../all_cases/selector_modal/use_cases_add_to_existing_case_modal'; -import type { PropsWithChildren } from 'react'; -import React from 'react'; -import { toMountPoint } from '@kbn/react-kibana-mount'; -import { - getMockApplications$, - getMockCaseUiActionProps, - getMockCurrentAppId$, - mockAttributes, - MockEmbeddable, - mockTimeRange, -} from './mocks'; -import { useKibana } from '../../../common/lib/kibana'; -import { waitFor } from '@testing-library/react'; -import { canUseCases } from '../../../client/helpers/can_use_cases'; -import { getCaseOwnerByAppId } from '../../../../common/utils/owner'; - -const element = document.createElement('div'); -document.body.appendChild(element); - -jest.mock('../../all_cases/selector_modal/use_cases_add_to_existing_case_modal', () => ({ - useCasesAddToExistingCaseModal: jest.fn(), -})); - -jest.mock('../../../client/helpers/can_use_cases', () => { - const actual = jest.requireActual('../../../client/helpers/can_use_cases'); - return { - ...actual, - canUseCases: jest.fn(), - }; -}); - -jest.mock('@kbn/kibana-react-plugin/public', () => ({ - KibanaThemeProvider: jest - .fn() - .mockImplementation(({ children }: PropsWithChildren) => <>{children}), -})); - -jest.mock('@kbn/react-kibana-mount', () => ({ - toMountPoint: jest.fn(), -})); - -jest.mock('../../../common/lib/kibana', () => { - return { - useKibana: jest.fn(), - KibanaContextProvider: jest - .fn() - .mockImplementation(({ children, ...props }) =>
    {children}
    ), - }; -}); - -jest.mock('react-dom', () => { - const original = jest.requireActual('react-dom'); - return { ...original, unmountComponentAtNode: jest.fn() }; -}); - -jest.mock('./action_wrapper'); - -jest.mock('../../../../common/utils/owner', () => ({ - getCaseOwnerByAppId: jest.fn().mockReturnValue('securitySolution'), -})); - -describe('createAddToExistingCaseLensAction', () => { - const mockEmbeddable = new MockEmbeddable(LENS_EMBEDDABLE_TYPE, { - id: 'mockId', - attributes: mockAttributes, - timeRange: mockTimeRange, - }) as unknown as LensEmbeddable; - - const context = { - embeddable: mockEmbeddable, - } as unknown as ActionContext; - - const caseUiActionProps = getMockCaseUiActionProps(); - - const mockUseCasesAddToExistingCaseModal = useCasesAddToExistingCaseModal as jest.Mock; - const mockOpenModal = jest.fn(); - const mockMount = jest.fn(); - let action: Action; - const mockCasePermissions = jest.fn(); - beforeEach(() => { - mockUseCasesAddToExistingCaseModal.mockReturnValue({ - open: mockOpenModal, - }); - (useKibana as jest.Mock).mockReturnValue({ - services: { - application: { - currentAppId$: getMockCurrentAppId$(), - applications$: getMockApplications$(), - }, - }, - }); - (canUseCases as jest.Mock).mockReturnValue( - mockCasePermissions.mockReturnValue({ create: true, update: true }) - ); - (toMountPoint as jest.Mock).mockImplementation((node) => { - ReactDOM.render(node, element); - return mockMount; - }); - jest.clearAllMocks(); - action = createAddToExistingCaseLensAction(caseUiActionProps); - }); - - test('it should return display name', () => { - expect(action.getDisplayName(context)).toEqual('Add to case'); - }); - - it('should return icon type', () => { - expect(action.getIconType(context)).toEqual('casesApp'); - }); - - describe('isCompatible', () => { - it('should return false if error embeddable', async () => { - expect( - await action.isCompatible({ - ...context, - embeddable: new ErrorEmbeddable('some error', { - id: '123', - }) as unknown as LensEmbeddable, - }) - ).toEqual(false); - }); - - it('should return false if not lens embeddable', async () => { - expect( - await action.isCompatible({ - ...context, - embeddable: new MockEmbeddable('not_lens') as unknown as LensEmbeddable, - }) - ).toEqual(false); - }); - - it('should return false if no permission', async () => { - mockCasePermissions.mockReturnValue({ create: false, update: false }); - expect(await action.isCompatible(context)).toEqual(false); - }); - - it('should return true if is lens embeddable', async () => { - expect(await action.isCompatible(context)).toEqual(true); - }); - - it('should check permission with undefined if owner is not found', async () => { - (getCaseOwnerByAppId as jest.Mock).mockReturnValue(undefined); - await action.isCompatible(context); - expect(mockCasePermissions).toBeCalledWith(undefined); - }); - }); - - describe('execute', () => { - beforeEach(async () => { - await action.execute(context); - }); - - it('should execute', () => { - expect(toMountPoint).toHaveBeenCalled(); - expect(mockMount).toHaveBeenCalled(); - }); - }); - - describe('Add to existing case modal', () => { - beforeEach(async () => { - await action.execute(context); - }); - - it('should open modal with an attachment', async () => { - await waitFor(() => { - expect(mockOpenModal).toHaveBeenCalled(); - - const getAttachments = mockOpenModal.mock.calls[0][0].getAttachments; - expect(getAttachments()).toEqual([ - { - persistableStateAttachmentState: { - attributes: mockAttributes, - timeRange: mockTimeRange, - }, - persistableStateAttachmentTypeId: '.lens', - type: 'persistableState', - }, - ]); - }); - }); - - it('should have correct onClose handler - when close modal clicked', () => { - const onClose = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onClose; - onClose(); - expect(unmountComponentAtNode as jest.Mock).toHaveBeenCalled(); - }); - - it('should have correct onClose handler - when case selected', () => { - const onClose = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onClose; - onClose({ id: 'case-id', title: 'case-title' }); - expect(unmountComponentAtNode as jest.Mock).toHaveBeenCalled(); - }); - - it('should have correct onClose handler - when case created', () => { - const onClose = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onClose; - onClose(null, true); - expect(unmountComponentAtNode as jest.Mock).not.toHaveBeenCalled(); - }); - - it('should have correct onSuccess handler', () => { - const onSuccess = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onSuccess; - onSuccess(); - expect(unmountComponentAtNode as jest.Mock).toHaveBeenCalled(); - }); - }); -}); diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/add_to_existing_case.tsx b/x-pack/plugins/cases/public/components/visualizations/actions/add_to_existing_case.tsx index 647abe8b41f2a..9565417141178 100644 --- a/x-pack/plugins/cases/public/components/visualizations/actions/add_to_existing_case.tsx +++ b/x-pack/plugins/cases/public/components/visualizations/actions/add_to_existing_case.tsx @@ -4,130 +4,39 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { useEffect, useMemo } from 'react'; -import { unmountComponentAtNode } from 'react-dom'; -import type { Embeddable as LensEmbeddable } from '@kbn/lens-plugin/public'; -import { createAction } from '@kbn/ui-actions-plugin/public'; -import { isErrorEmbeddable } from '@kbn/embeddable-plugin/public'; -import { toMountPoint } from '@kbn/react-kibana-mount'; +import { createAction, IncompatibleActionError } from '@kbn/ui-actions-plugin/public'; -import type { CaseUI } from '../../../../common'; -import { isLensEmbeddable, hasInput, getLensCaseAttachment } from './utils'; - -import type { ActionContext, CasesUIActionProps } from './types'; -import { useCasesAddToExistingCaseModal } from '../../all_cases/selector_modal/use_cases_add_to_existing_case_modal'; +import type { EmbeddableApiContext } from '@kbn/presentation-publishing'; +import type { CasesActionContextProps, Services } from './types'; import { ADD_TO_EXISTING_CASE_DISPLAYNAME } from './translations'; -import { ActionWrapper } from './action_wrapper'; -import { canUseCases } from '../../../client/helpers/can_use_cases'; -import { getCaseOwnerByAppId } from '../../../../common/utils/owner'; export const ACTION_ID = 'embeddable_addToExistingCase'; -export const DEFAULT_DARK_MODE = 'theme:darkMode' as const; - -interface Props { - embeddable: LensEmbeddable; - onSuccess: () => void; - onClose: (theCase?: CaseUI) => void; -} - -const AddExistingCaseModalWrapper: React.FC = ({ embeddable, onClose, onSuccess }) => { - const modal = useCasesAddToExistingCaseModal({ - onClose, - onSuccess, - }); - - const attachments = useMemo(() => { - const { timeRange } = embeddable.getInput(); - const attributes = embeddable.getFullAttributes(); - // we've checked attributes exists before rendering (isCompatible), attributes should not be undefined here - return attributes != null ? [getLensCaseAttachment({ attributes, timeRange })] : []; - }, [embeddable]); - useEffect(() => { - modal.open({ getAttachments: () => attachments }); - }, [attachments, modal]); - - return null; -}; - -AddExistingCaseModalWrapper.displayName = 'AddExistingCaseModalWrapper'; - -export const createAddToExistingCaseLensAction = ({ - core, - plugins, - storage, - history, - caseContextProps, -}: CasesUIActionProps) => { - const { application: applicationService, i18n, theme } = core; +export const createAddToExistingCaseLensAction = ( + casesActionContextProps: CasesActionContextProps, + services: Services +) => { let currentAppId: string | undefined; - applicationService?.currentAppId$.subscribe((appId) => { + services.core.application?.currentAppId$.subscribe((appId) => { currentAppId = appId; }); - return createAction({ + return createAction({ id: ACTION_ID, type: 'actionButton', getIconType: () => 'casesApp', getDisplayName: () => ADD_TO_EXISTING_CASE_DISPLAYNAME, isCompatible: async ({ embeddable }) => { - const owner = getCaseOwnerByAppId(currentAppId); - const casePermissions = canUseCases(applicationService.capabilities)( - owner ? [owner] : undefined - ); - - return ( - !isErrorEmbeddable(embeddable) && - isLensEmbeddable(embeddable) && - casePermissions.update && - casePermissions.create && - hasInput(embeddable) - ); + const { isCompatible } = await import('./is_compatible'); + return isCompatible(embeddable, currentAppId, services.core); }, execute: async ({ embeddable }) => { - const targetDomElement = document.createElement('div'); - - const cleanupDom = (shouldCleanup?: boolean) => { - if (targetDomElement != null && shouldCleanup) { - unmountComponentAtNode(targetDomElement); - } - }; - - const onClose = (theCase?: CaseUI, isCreateCase?: boolean) => { - const closeModalClickedScenario = theCase == null && !isCreateCase; - const caseSelectedScenario = theCase != null; - // When `Creating` a case from the `add to existing case modal`, - // we close the modal and then open the flyout. - // If we clean up dom when closing the modal, then the flyout won't open. - // Thus we do not clean up dom when `Creating` a case. - const shouldCleanup = closeModalClickedScenario || caseSelectedScenario; - cleanupDom(shouldCleanup); - }; - - const onSuccess = () => { - cleanupDom(true); - }; - const mount = toMountPoint( - - - , - { i18n, theme } - ); - - mount(targetDomElement); + const { isLensApi } = await import('@kbn/lens-plugin/public'); + if (!isLensApi(embeddable)) throw new IncompatibleActionError(); + const { openModal } = await import('./open_modal'); + openModal(embeddable, currentAppId, casesActionContextProps, services); }, }); }; diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/is_compatible.test.ts b/x-pack/plugins/cases/public/components/visualizations/actions/is_compatible.test.ts new file mode 100644 index 0000000000000..1169ec14648b4 --- /dev/null +++ b/x-pack/plugins/cases/public/components/visualizations/actions/is_compatible.test.ts @@ -0,0 +1,58 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { BehaviorSubject } from 'rxjs'; +import { coreMock } from '@kbn/core/public/mocks'; +import { isCompatible } from './is_compatible'; +import { canUseCases } from '../../../client/helpers/can_use_cases'; +import { mockLensApi } from './mocks'; + +jest.mock('../../../../common/utils/owner', () => ({ + getCaseOwnerByAppId: () => 'securitySolution', +})); + +jest.mock('../../../client/helpers/can_use_cases', () => { + const actual = jest.requireActual('../../../client/helpers/can_use_cases'); + return { + ...actual, + canUseCases: jest.fn(), + }; +}); + +describe('isCompatible', () => { + const appId = 'myAppId'; + const mockCoreStart = coreMock.createStart(); + + const mockCasePermissions = jest.fn(); + beforeEach(() => { + (canUseCases as jest.Mock).mockReturnValue( + mockCasePermissions.mockReturnValue({ create: true, update: true }) + ); + jest.clearAllMocks(); + }); + + test('should return false if error embeddable', async () => { + const errorApi = { + ...mockLensApi, + blockingError: new BehaviorSubject(new Error('Simulated blocking error')), + }; + expect(isCompatible(errorApi, appId, mockCoreStart)).toBe(false); + }); + + test('should return false if not lens embeddable', async () => { + expect(isCompatible({}, appId, mockCoreStart)).toBe(false); + }); + + test('should return false if no permission', async () => { + mockCasePermissions.mockReturnValue({ create: false, update: false }); + expect(isCompatible(mockLensApi, appId, mockCoreStart)).toBe(false); + }); + + test('should return true if is lens embeddable', async () => { + expect(isCompatible(mockLensApi, appId, mockCoreStart)).toBe(true); + }); +}); diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/is_compatible.ts b/x-pack/plugins/cases/public/components/visualizations/actions/is_compatible.ts new file mode 100644 index 0000000000000..64becf44e266e --- /dev/null +++ b/x-pack/plugins/cases/public/components/visualizations/actions/is_compatible.ts @@ -0,0 +1,30 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { CoreStart } from '@kbn/core-lifecycle-browser'; +import { isLensApi } from '@kbn/lens-plugin/public'; +import { hasBlockingError } from '@kbn/presentation-publishing'; +import { canUseCases } from '../../../client/helpers/can_use_cases'; +import { getCaseOwnerByAppId } from '../../../../common/utils/owner'; + +export function isCompatible( + embeddable: unknown, + currentAppId: string | undefined, + core: CoreStart +) { + if (!isLensApi(embeddable) || hasBlockingError(embeddable)) return false; + if (!embeddable.getFullAttributes()) { + return false; + } + const timeRange = embeddable.timeRange$?.value ?? embeddable.parentApi?.timeRange$?.value; + if (!timeRange) { + return false; + } + const owner = getCaseOwnerByAppId(currentAppId); + const casePermissions = canUseCases(core.application.capabilities)(owner ? [owner] : undefined); + return casePermissions.update && casePermissions.create; +} diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/mocks.ts b/x-pack/plugins/cases/public/components/visualizations/actions/mocks.ts index aee3b128d554b..4d28bf6728e0f 100644 --- a/x-pack/plugins/cases/public/components/visualizations/actions/mocks.ts +++ b/x-pack/plugins/cases/public/components/visualizations/actions/mocks.ts @@ -10,36 +10,13 @@ import { BehaviorSubject } from 'rxjs'; import type { PublicAppInfo } from '@kbn/core/public'; import { coreMock } from '@kbn/core/public/mocks'; -import type { TypedLensByValueInput } from '@kbn/lens-plugin/public'; -import type { CasesUIActionProps } from './types'; +import type { LensApi, LensSavedObjectAttributes } from '@kbn/lens-plugin/public'; +import type { AggregateQuery, Filter, Query, TimeRange } from '@kbn/es-query'; +import type { Services } from './types'; const coreStart = coreMock.createStart(); -export class MockEmbeddable { - public type; - private input; - constructor( - type: string, - input?: { - attributes: TypedLensByValueInput['attributes']; - id: string; - timeRange: { from: string; to: string; fromStr: string; toStr: string }; - } - ) { - this.type = type; - this.input = input; - } - getFilters() {} - getQuery() {} - getInput() { - return this.input; - } - getFullAttributes() { - return this.input?.attributes; - } -} - -export const mockAttributes = { +export const mockLensAttributes = { title: 'mockTitle', description: 'mockDescription', references: [], @@ -57,9 +34,26 @@ export const mockAttributes = { }, }, }, -} as unknown as TypedLensByValueInput['attributes']; +} as unknown as LensSavedObjectAttributes; -export const mockTimeRange = { from: '', to: '', fromStr: '', toStr: '' }; +export const mockLensApi = { + type: 'lens', + getSavedVis: () => {}, + canViewUnderlyingData: () => {}, + getViewUnderlyingDataArgs: () => {}, + getFullAttributes: () => { + return mockLensAttributes; + }, + panelTitle: new BehaviorSubject('myPanel'), + hidePanelTitle: new BehaviorSubject('false'), + timeslice$: new BehaviorSubject<[number, number] | undefined>(undefined), + timeRange$: new BehaviorSubject({ + from: 'now-24h', + to: 'now', + }), + filters$: new BehaviorSubject(undefined), + query$: new BehaviorSubject(undefined), +} as unknown as LensApi; export const getMockCurrentAppId$ = () => new BehaviorSubject('securitySolutionUI'); export const getMockApplications$ = () => @@ -67,26 +61,17 @@ export const getMockApplications$ = () => new Map([['securitySolutionUI', { category: { label: 'Test' } } as unknown as PublicAppInfo]]) ); -export const getMockCaseUiActionProps = () => { - const core = { - ...coreStart, - application: { currentAppId$: getMockCurrentAppId$(), capabilities: {} }, - uiSettings: { - get: jest.fn().mockReturnValue(true), +export const getMockServices = () => { + return { + core: { + ...coreStart, + application: { currentAppId$: getMockCurrentAppId$(), capabilities: {} }, + uiSettings: { + get: jest.fn().mockReturnValue(true), + }, }, - }; - const plugins = {}; - const storage = {}; - const history = createBrowserHistory(); - const caseContextProps = {}; - - const caseUiActionProps = { - core, - plugins, - storage, - history, - caseContextProps, - } as unknown as CasesUIActionProps; - - return caseUiActionProps; + plugins: {}, + storage: {}, + history: createBrowserHistory(), + } as unknown as Services; }; diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/open_modal.test.tsx b/x-pack/plugins/cases/public/components/visualizations/actions/open_modal.test.tsx new file mode 100644 index 0000000000000..ac38056b9321e --- /dev/null +++ b/x-pack/plugins/cases/public/components/visualizations/actions/open_modal.test.tsx @@ -0,0 +1,126 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import ReactDOM, { unmountComponentAtNode } from 'react-dom'; +import { useCasesAddToExistingCaseModal } from '../../all_cases/selector_modal/use_cases_add_to_existing_case_modal'; +import type { PropsWithChildren } from 'react'; +import React from 'react'; +import { toMountPoint } from '@kbn/react-kibana-mount'; +import { + getMockApplications$, + getMockCurrentAppId$, + mockLensApi, + mockLensAttributes, + getMockServices, +} from './mocks'; +import { useKibana } from '../../../common/lib/kibana'; +import { waitFor } from '@testing-library/react'; +import { openModal } from './open_modal'; +import type { CasesActionContextProps } from './types'; + +const element = document.createElement('div'); +document.body.appendChild(element); + +jest.mock('../../all_cases/selector_modal/use_cases_add_to_existing_case_modal', () => ({ + useCasesAddToExistingCaseModal: jest.fn(), +})); + +jest.mock('@kbn/kibana-react-plugin/public', () => ({ + KibanaThemeProvider: jest + .fn() + .mockImplementation(({ children }: PropsWithChildren) => <>{children}), +})); + +jest.mock('@kbn/react-kibana-mount', () => ({ + toMountPoint: jest.fn(), +})); + +jest.mock('../../../common/lib/kibana', () => { + return { + useKibana: jest.fn(), + KibanaContextProvider: jest + .fn() + .mockImplementation(({ children, ...props }) =>
    {children}
    ), + }; +}); + +jest.mock('react-dom', () => { + const original = jest.requireActual('react-dom'); + return { ...original, unmountComponentAtNode: jest.fn() }; +}); + +jest.mock('./action_wrapper'); + +describe('openModal', () => { + const mockUseCasesAddToExistingCaseModal = useCasesAddToExistingCaseModal as jest.Mock; + const mockOpenModal = jest.fn(); + const mockMount = jest.fn(); + beforeEach(() => { + mockUseCasesAddToExistingCaseModal.mockReturnValue({ + open: mockOpenModal, + }); + (useKibana as jest.Mock).mockReturnValue({ + services: { + application: { + currentAppId$: getMockCurrentAppId$(), + applications$: getMockApplications$(), + }, + }, + }); + (toMountPoint as jest.Mock).mockImplementation((node) => { + ReactDOM.render(node, element); + return mockMount; + }); + jest.clearAllMocks(); + openModal(mockLensApi, 'myAppId', {} as unknown as CasesActionContextProps, getMockServices()); + }); + + test('should open modal with an attachment', async () => { + await waitFor(() => { + expect(mockOpenModal).toHaveBeenCalled(); + + const getAttachments = mockOpenModal.mock.calls[0][0].getAttachments; + expect(getAttachments()).toEqual([ + { + persistableStateAttachmentState: { + attributes: mockLensAttributes, + timeRange: { + from: 'now-24h', + to: 'now', + }, + }, + persistableStateAttachmentTypeId: '.lens', + type: 'persistableState', + }, + ]); + }); + }); + + test('should have correct onClose handler - when close modal clicked', () => { + const onClose = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onClose; + onClose(); + expect(unmountComponentAtNode as jest.Mock).toHaveBeenCalled(); + }); + + test('should have correct onClose handler - when case selected', () => { + const onClose = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onClose; + onClose({ id: 'case-id', title: 'case-title' }); + expect(unmountComponentAtNode as jest.Mock).toHaveBeenCalled(); + }); + + test('should have correct onClose handler - when case created', () => { + const onClose = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onClose; + onClose(null, true); + expect(unmountComponentAtNode as jest.Mock).not.toHaveBeenCalled(); + }); + + test('should have correct onSuccess handler', () => { + const onSuccess = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onSuccess; + onSuccess(); + expect(unmountComponentAtNode as jest.Mock).toHaveBeenCalled(); + }); +}); diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/open_modal.tsx b/x-pack/plugins/cases/public/components/visualizations/actions/open_modal.tsx new file mode 100644 index 0000000000000..e0871e0710e68 --- /dev/null +++ b/x-pack/plugins/cases/public/components/visualizations/actions/open_modal.tsx @@ -0,0 +1,89 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useEffect, useMemo } from 'react'; +import { unmountComponentAtNode } from 'react-dom'; +import type { LensApi } from '@kbn/lens-plugin/public'; +import { toMountPoint } from '@kbn/react-kibana-mount'; +import { useStateFromPublishingSubject } from '@kbn/presentation-publishing'; +import { ActionWrapper } from './action_wrapper'; +import type { CasesActionContextProps, Services } from './types'; +import type { CaseUI } from '../../../../common'; +import { getLensCaseAttachment } from './utils'; +import { useCasesAddToExistingCaseModal } from '../../all_cases/selector_modal/use_cases_add_to_existing_case_modal'; + +interface Props { + lensApi: LensApi; + onSuccess: () => void; + onClose: (theCase?: CaseUI) => void; +} + +const AddExistingCaseModalWrapper: React.FC = ({ lensApi, onClose, onSuccess }) => { + const modal = useCasesAddToExistingCaseModal({ + onClose, + onSuccess, + }); + + const timeRange = useStateFromPublishingSubject(lensApi.timeRange$); + const parentTimeRange = useStateFromPublishingSubject(lensApi.parentApi?.timeRange$); + + const attachments = useMemo(() => { + const appliedTimeRange = timeRange ?? parentTimeRange; + const attributes = lensApi.getFullAttributes(); + return !attributes || !appliedTimeRange + ? [] + : [getLensCaseAttachment({ attributes, timeRange: appliedTimeRange })]; + }, [lensApi, timeRange, parentTimeRange]); + useEffect(() => { + modal.open({ getAttachments: () => attachments }); + }, [attachments, modal]); + + return null; +}; +AddExistingCaseModalWrapper.displayName = 'AddExistingCaseModalWrapper'; + +export function openModal( + lensApi: LensApi, + currentAppId: string | undefined, + casesActionContextProps: CasesActionContextProps, + services: Services +) { + const targetDomElement = document.createElement('div'); + + const cleanupDom = (shouldCleanup?: boolean) => { + if (targetDomElement != null && shouldCleanup) { + unmountComponentAtNode(targetDomElement); + } + }; + + const onClose = (theCase?: CaseUI, isCreateCase?: boolean) => { + const closeModalClickedScenario = theCase == null && !isCreateCase; + const caseSelectedScenario = theCase != null; + // When `Creating` a case from the `add to existing case modal`, + // we close the modal and then open the flyout. + // If we clean up dom when closing the modal, then the flyout won't open. + // Thus we do not clean up dom when `Creating` a case. + const shouldCleanup = closeModalClickedScenario || caseSelectedScenario; + cleanupDom(shouldCleanup); + }; + + const onSuccess = () => { + cleanupDom(true); + }; + const mount = toMountPoint( + + + , + { i18n: services.core.i18n, theme: services.core.theme } + ); + + mount(targetDomElement); +} diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/register.ts b/x-pack/plugins/cases/public/components/visualizations/actions/register.ts index 70d0d6d7a84d4..d2f3d68e737a5 100644 --- a/x-pack/plugins/cases/public/components/visualizations/actions/register.ts +++ b/x-pack/plugins/cases/public/components/visualizations/actions/register.ts @@ -8,31 +8,15 @@ import { CONTEXT_MENU_TRIGGER } from '@kbn/embeddable-plugin/public'; import { createAddToExistingCaseLensAction } from './add_to_existing_case'; -import type { CasesUIActionProps } from './types'; +import type { CasesActionContextProps, Services } from './types'; -export const registerUIActions = ({ - core, - plugins, - caseContextProps, - history, - storage, -}: CasesUIActionProps) => { - registerLensActions({ core, plugins, caseContextProps, history, storage }); -}; - -const registerLensActions = ({ - core, - plugins, - caseContextProps, - history, - storage, -}: CasesUIActionProps) => { - const addToExistingCaseAction = createAddToExistingCaseLensAction({ - core, - plugins, - caseContextProps, - history, - storage, - }); - plugins.uiActions.addTriggerAction(CONTEXT_MENU_TRIGGER, addToExistingCaseAction); +export const registerUIActions = ( + casesActionContextProps: CasesActionContextProps, + services: Services +) => { + const addToExistingCaseAction = createAddToExistingCaseLensAction( + casesActionContextProps, + services + ); + services.plugins.uiActions.addTriggerAction(CONTEXT_MENU_TRIGGER, addToExistingCaseAction); }; diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/types.ts b/x-pack/plugins/cases/public/components/visualizations/actions/types.ts index 8cbe7fd93585d..b1ccf7bad921c 100644 --- a/x-pack/plugins/cases/public/components/visualizations/actions/types.ts +++ b/x-pack/plugins/cases/public/components/visualizations/actions/types.ts @@ -5,30 +5,23 @@ * 2.0. */ -import type { CoreStart } from '@kbn/core-lifecycle-browser'; -import type { Embeddable } from '@kbn/lens-plugin/public'; +import type { CoreStart } from '@kbn/core/public'; import type * as H from 'history'; import type { Storage } from '@kbn/kibana-utils-plugin/public'; -import type { ActionExecutionContext } from '@kbn/ui-actions-plugin/public'; import type { CasesPublicStartDependencies } from '../../../types'; import type { CasesContextProps } from '../../cases_context'; -export type CasesUIActionContextProps = Pick< +export type CasesActionContextProps = Pick< CasesContextProps, | 'externalReferenceAttachmentTypeRegistry' | 'persistableStateAttachmentTypeRegistry' | 'getFilesClient' >; -export interface CasesUIActionProps { +export interface Services { core: CoreStart; plugins: CasesPublicStartDependencies; - caseContextProps: CasesUIActionContextProps; history: H.History; storage: Storage; } - -export type ActionContext = ActionExecutionContext<{ - embeddable: Embeddable; -}>; diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/utils.test.ts b/x-pack/plugins/cases/public/components/visualizations/actions/utils.test.ts index 591e12dd7a712..d643a668553d3 100644 --- a/x-pack/plugins/cases/public/components/visualizations/actions/utils.test.ts +++ b/x-pack/plugins/cases/public/components/visualizations/actions/utils.test.ts @@ -5,51 +5,9 @@ * 2.0. */ -import { LENS_EMBEDDABLE_TYPE } from '@kbn/lens-plugin/public'; -import { isLensEmbeddable, hasInput, getLensCaseAttachment } from './utils'; +import { getLensCaseAttachment } from './utils'; describe('utils', () => { - describe('isLensEmbeddable', () => { - it('return true if it is a lens embeddable', () => { - // @ts-expect-error: extra attributes are not needed - expect(isLensEmbeddable({ type: LENS_EMBEDDABLE_TYPE })).toBe(true); - }); - - it('return false if it is not a lens embeddable', () => { - // @ts-expect-error: extra attributes are not needed - expect(isLensEmbeddable({ type: 'not-exist' })).toBe(false); - }); - }); - - describe('hasInput', () => { - it('return true if it has correct input', () => { - const embeddable = { - getInput: () => ({ timeRange: {} }), - getFullAttributes: jest.fn().mockReturnValue({}), - }; - - // @ts-expect-error: extra attributes are not needed - expect(hasInput(embeddable)).toBe(true); - }); - - it('return false if attributes are null', () => { - const embeddable = { - getInput: () => ({ timeRange: {} }), - getFullAttributes: jest.fn().mockReturnValue(null), - }; - - // @ts-expect-error: extra attributes are not needed - expect(hasInput(embeddable)).toBe(false); - }); - - it('return false if timeRange is null', () => { - const embeddable = { getInput: () => ({ timeRange: null }), getFullAttributes: () => ({}) }; - - // @ts-expect-error: extra attributes are not needed - expect(hasInput(embeddable)).toBe(false); - }); - }); - describe('getLensCaseAttachment', () => { it('create a case lens attachment correctly', () => { const embeddable = { attributes: {}, timeRange: {} }; diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/utils.ts b/x-pack/plugins/cases/public/components/visualizations/actions/utils.ts index aaabd73dfc884..e51f1fb13bdee 100644 --- a/x-pack/plugins/cases/public/components/visualizations/actions/utils.ts +++ b/x-pack/plugins/cases/public/components/visualizations/actions/utils.ts @@ -4,24 +4,12 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { IEmbeddable } from '@kbn/embeddable-plugin/public'; import type { LensSavedObjectAttributes } from '@kbn/lens-plugin/public'; -import { LENS_EMBEDDABLE_TYPE, type Embeddable as LensEmbeddable } from '@kbn/lens-plugin/public'; import { LENS_ATTACHMENT_TYPE } from '../../../../common/constants/visualizations'; import type { PersistableStateAttachmentPayload } from '../../../../common/types/domain'; import { AttachmentType } from '../../../../common/types/domain'; import type { LensProps } from '../types'; -export const isLensEmbeddable = (embeddable: IEmbeddable): embeddable is LensEmbeddable => { - return embeddable.type === LENS_EMBEDDABLE_TYPE; -}; - -export const hasInput = (embeddable: LensEmbeddable) => { - const { timeRange } = embeddable.getInput(); - const attributes = embeddable.getFullAttributes(); - return attributes != null && timeRange != null; -}; - type PersistableStateAttachmentWithoutOwner = Omit; export const getLensCaseAttachment = ({ diff --git a/x-pack/plugins/cases/public/plugin.ts b/x-pack/plugins/cases/public/plugin.ts index 12308fcc2f8b6..67295a29437db 100644 --- a/x-pack/plugins/cases/public/plugin.ts +++ b/x-pack/plugins/cases/public/plugin.ts @@ -149,17 +149,19 @@ export class CasesUiPlugin getFilesClient: plugins.files.filesClientFactory.asScoped, }); - registerActions({ - core, - plugins, - caseContextProps: { + registerActions( + { externalReferenceAttachmentTypeRegistry: this.externalReferenceAttachmentTypeRegistry, persistableStateAttachmentTypeRegistry: this.persistableStateAttachmentTypeRegistry, getFilesClient: plugins.files.filesClientFactory.asScoped, }, - history: createBrowserHistory(), - storage: this.storage, - }); + { + core, + plugins, + history: createBrowserHistory(), + storage: this.storage, + } + ); return { api: createClientAPI({ http: core.http }), diff --git a/x-pack/plugins/cases/server/client/configure/client.test.ts b/x-pack/plugins/cases/server/client/configure/client.test.ts index 8b312d2d957a2..aab8937591f9e 100644 --- a/x-pack/plugins/cases/server/client/configure/client.test.ts +++ b/x-pack/plugins/cases/server/client/configure/client.test.ts @@ -556,16 +556,32 @@ describe('client', () => { }); describe('customFields', () => { - it('throws when there are no customFields in configure and template has customField in the request', async () => { + it('throws when template has duplicated custom field keys in the request', async () => { clientArgs.services.caseConfigureService.get.mockResolvedValue({ // @ts-ignore: these are all the attributes needed for the test attributes: { + customFields: [ + { + key: 'custom_field_key_1', + label: 'text label', + type: CustomFieldTypes.TEXT, + required: false, + }, + ], templates: [ { key: 'template_1', name: 'template 1', description: 'this is test description', - caseFields: null, + caseFields: { + customFields: [ + { + key: 'custom_field_key_1', + type: CustomFieldTypes.TEXT, + value: 'custom field value 1', + }, + ], + }, }, ], }, @@ -576,11 +592,19 @@ describe('client', () => { 'test-id', { version: 'test-version', + customFields: [ + { + key: 'custom_field_key_1', + label: 'text label', + type: CustomFieldTypes.TEXT, + required: false, + }, + ], templates: [ { key: 'template_1', name: 'template 1', - description: 'this is test description', + description: 'test', caseFields: { customFields: [ { @@ -588,6 +612,11 @@ describe('client', () => { type: CustomFieldTypes.TEXT, value: 'custom field value 1', }, + { + key: 'custom_field_key_1', + type: CustomFieldTypes.TEXT, + value: 'custom field value 2', + }, ], }, }, @@ -597,11 +626,11 @@ describe('client', () => { casesClientInternal ) ).rejects.toThrow( - 'Failed to get patch configure in route: Error: No custom fields configured.' + `Failed to get patch configure in route: Error: Invalid duplicated templates[0]'s customFields keys in request: custom_field_key_1` ); }); - it('throws when template has duplicated custom field keys in the request', async () => { + it('throws when template has customField with invalid type in the request', async () => { clientArgs.services.caseConfigureService.get.mockResolvedValue({ // @ts-ignore: these are all the attributes needed for the test attributes: { @@ -637,22 +666,25 @@ describe('client', () => { 'test-id', { version: 'test-version', + customFields: [ + { + key: 'custom_field_key_1', + label: 'text label', + type: CustomFieldTypes.TEXT, + required: false, + }, + ], templates: [ { key: 'template_1', name: 'template 1', - description: 'test', + description: 'this is test description', caseFields: { customFields: [ { key: 'custom_field_key_1', - type: CustomFieldTypes.TEXT, - value: 'custom field value 1', - }, - { - key: 'custom_field_key_1', - type: CustomFieldTypes.TEXT, - value: 'custom field value 2', + type: CustomFieldTypes.TOGGLE, + value: true, }, ], }, @@ -663,20 +695,40 @@ describe('client', () => { casesClientInternal ) ).rejects.toThrow( - `Failed to get patch configure in route: Error: Invalid duplicated templates[0]'s customFields keys in request: custom_field_key_1` + 'Failed to get patch configure in route: Error: The following custom fields have the wrong type in the request: "text label"' ); }); - it('throws when there are invalid customField keys in the request', async () => { + it('adds new custom field to template when configuration custom fields have new custom field', async () => { clientArgs.services.caseConfigureService.get.mockResolvedValue({ // @ts-ignore: these are all the attributes needed for the test attributes: { + connector: { + id: 'none', + name: 'none', + type: ConnectorTypes.none, + fields: null, + }, + customFields: [], + templates: [], + closure_type: 'close-by-user', + owner: 'cases', + }, + id: 'test-id', + version: 'test-version', + }); + + await update( + 'test-id', + { + version: 'test-version', customFields: [ { key: 'custom_field_key_1', label: 'text label', type: CustomFieldTypes.TEXT, required: false, + defaultValue: 'custom field 1 default value 1', }, ], templates: [ @@ -684,60 +736,82 @@ describe('client', () => { key: 'template_1', name: 'template 1', description: 'this is test description', + caseFields: null, + }, + ], + }, + clientArgs, + casesClientInternal + ); + + expect(clientArgs.services.caseConfigureService.patch).toHaveBeenCalledWith({ + configurationId: 'test-id', + originalConfiguration: { + attributes: { + closure_type: 'close-by-user', + connector: { + fields: null, + id: 'none', + name: 'none', + type: '.none', + }, + customFields: [], + owner: 'cases', + templates: [], + }, + id: 'test-id', + version: 'test-version', + }, + unsecuredSavedObjectsClient: expect.anything(), + updatedAttributes: { + customFields: [ + { + key: 'custom_field_key_1', + label: 'text label', + type: CustomFieldTypes.TEXT, + required: false, + defaultValue: 'custom field 1 default value 1', + }, + ], + templates: [ + { caseFields: { customFields: [ { key: 'custom_field_key_1', type: CustomFieldTypes.TEXT, - value: 'custom field value 1', + value: 'custom field 1 default value 1', }, ], }, + description: 'this is test description', + key: 'template_1', + name: 'template 1', }, ], + updated_at: expect.anything(), + updated_by: expect.anything(), }, }); - - await expect( - update( - 'test-id', - { - version: 'test-version', - templates: [ - { - key: 'template_1', - name: 'template 1', - description: 'this is test description', - caseFields: { - customFields: [ - { - key: 'custom_field_key_2', - type: CustomFieldTypes.TEXT, - value: 'custom field value 1', - }, - ], - }, - }, - ], - }, - clientArgs, - casesClientInternal - ) - ).rejects.toThrow( - 'Failed to get patch configure in route: Error: Invalid custom field keys: custom_field_key_2' - ); }); - it('throws when template has customField with invalid type in the request', async () => { + it('updates default value of existing custom fields in the configuration correctly', async () => { clientArgs.services.caseConfigureService.get.mockResolvedValue({ // @ts-ignore: these are all the attributes needed for the test attributes: { + connector: { + id: 'none', + name: 'none', + type: ConnectorTypes.none, + fields: null, + }, customFields: [ { key: 'custom_field_key_1', label: 'text label', type: CustomFieldTypes.TEXT, required: false, + defaultValue: 'custom field 1 default value 1', }, ], templates: [ @@ -750,20 +824,74 @@ describe('client', () => { { key: 'custom_field_key_1', type: CustomFieldTypes.TEXT, - value: 'custom field value 1', + value: 'custom field 1 default value 1', }, ], }, }, ], + closure_type: 'close-by-user', + owner: 'cases', }, + id: 'test-id', + version: 'test-version', }); - await expect( - update( - 'test-id', - { - version: 'test-version', + await update( + 'test-id', + { + version: 'test-version', + customFields: [ + { + key: 'custom_field_key_1', + label: 'text label', + type: CustomFieldTypes.TEXT, + required: false, + defaultValue: 'updated default value!!', + }, + ], + templates: [ + { + key: 'template_1', + name: 'template 1', + description: 'this is test description', + caseFields: { + customFields: [ + { + key: 'custom_field_key_1', + type: CustomFieldTypes.TEXT, + value: 'custom field 1 default value 1', + }, + ], + }, + }, + ], + }, + clientArgs, + casesClientInternal + ); + + expect(clientArgs.services.caseConfigureService.patch).toHaveBeenCalledWith({ + configurationId: 'test-id', + originalConfiguration: { + attributes: { + closure_type: 'close-by-user', + connector: { + fields: null, + id: 'none', + name: 'none', + type: '.none', + }, + owner: 'cases', + customFields: [ + { + key: 'custom_field_key_1', + label: 'text label', + type: CustomFieldTypes.TEXT, + required: false, + defaultValue: 'custom field 1 default value 1', + }, + ], templates: [ { key: 'template_1', @@ -773,20 +901,130 @@ describe('client', () => { customFields: [ { key: 'custom_field_key_1', - type: CustomFieldTypes.TOGGLE, - value: true, + type: CustomFieldTypes.TEXT, + value: 'custom field 1 default value 1', }, ], }, }, ], }, - clientArgs, - casesClientInternal - ) - ).rejects.toThrow( - 'Failed to get patch configure in route: Error: The following custom fields have the wrong type in the request: "text label"' + id: 'test-id', + version: 'test-version', + }, + unsecuredSavedObjectsClient: expect.anything(), + updatedAttributes: { + customFields: [ + { + key: 'custom_field_key_1', + label: 'text label', + type: CustomFieldTypes.TEXT, + required: false, + defaultValue: 'updated default value!!', + }, + ], + templates: [ + { + caseFields: { + customFields: [ + { + key: 'custom_field_key_1', + type: CustomFieldTypes.TEXT, + value: 'custom field 1 default value 1', + }, + ], + }, + description: 'this is test description', + key: 'template_1', + name: 'template 1', + }, + ], + updated_at: expect.anything(), + updated_by: expect.anything(), + }, + }); + }); + + it('removes custom field from template when there are no customFields in the request', async () => { + clientArgs.services.caseConfigureService.get.mockResolvedValue({ + // @ts-ignore: these are all the attributes needed for the test + attributes: { + connector: { + id: 'none', + name: 'none', + type: ConnectorTypes.none, + fields: null, + }, + customFields: [], + templates: [], + closure_type: 'close-by-user', + owner: 'cases', + }, + id: 'test-id', + version: 'test-version', + }); + + await update( + 'test-id', + { + version: 'test-version', + customFields: [], + templates: [ + { + key: 'template_1', + name: 'template 1', + description: 'this is test description', + caseFields: { + customFields: [ + { + key: 'custom_field_key_1', + type: CustomFieldTypes.TEXT, + value: 'custom field value 1', + }, + ], + }, + }, + ], + }, + clientArgs, + casesClientInternal ); + + expect(clientArgs.services.caseConfigureService.patch).toHaveBeenCalledWith({ + configurationId: 'test-id', + originalConfiguration: { + attributes: { + closure_type: 'close-by-user', + connector: { + fields: null, + id: 'none', + name: 'none', + type: '.none', + }, + customFields: [], + owner: 'cases', + templates: [], + }, + id: 'test-id', + version: 'test-version', + }, + unsecuredSavedObjectsClient: expect.anything(), + updatedAttributes: { + customFields: [], + templates: [ + { + key: 'template_1', + name: 'template 1', + description: 'this is test description', + caseFields: { + customFields: [], + }, + }, + ], + updated_at: expect.anything(), + updated_by: expect.anything(), + }, + }); }); it('removes deleted custom field from template correctly', async () => { @@ -1166,7 +1404,7 @@ describe('client', () => { ).resolves.not.toThrow(); }); - it('throws when there are no customFields in configure and template has customField in the request', async () => { + it('throws error when there are no customFields but template has custom fields in the request', async () => { await expect( create( { @@ -1241,7 +1479,7 @@ describe('client', () => { ); }); - it('throws when there are invalid customField keys in the request', async () => { + it('throw error when there are new customFields in the request but template does not have custom fields', async () => { await expect( create( { @@ -1259,15 +1497,7 @@ describe('client', () => { key: 'template_1', name: 'template 1', description: 'this is test description', - caseFields: { - customFields: [ - { - key: 'custom_field_key_2', - type: CustomFieldTypes.TEXT, - value: 'custom field value 1', - }, - ], - }, + caseFields: null, }, ], }, @@ -1275,7 +1505,7 @@ describe('client', () => { casesClientInternal ) ).rejects.toThrow( - 'Failed to create case configuration: Error: Invalid custom field keys: custom_field_key_2' + 'Failed to create case configuration: Error: No custom fields added to template.' ); }); diff --git a/x-pack/plugins/cases/server/client/configure/client.ts b/x-pack/plugins/cases/server/client/configure/client.ts index 68db617af8bc2..00810cb742323 100644 --- a/x-pack/plugins/cases/server/client/configure/client.ts +++ b/x-pack/plugins/cases/server/client/configure/client.ts @@ -44,7 +44,7 @@ import type { CasesClientArgs } from '../types'; import { getMappings } from './get_mappings'; import { Operations } from '../../authorization'; -import { combineAuthorizedAndOwnerFilter, removeCustomFieldFromTemplates } from '../utils'; +import { combineAuthorizedAndOwnerFilter, transformTemplateCustomFields } from '../utils'; import type { MappingsArgs, CreateMappingsArgs, UpdateMappingsArgs } from './types'; import { createMappings } from './create_mappings'; import { updateMappings } from './update_mappings'; @@ -320,14 +320,14 @@ export async function update( originalCustomFields: configuration.attributes.customFields, }); - await validateTemplates({ + const updatedTemplates = transformTemplateCustomFields({ templates, - clientArgs, - customFields: configuration.attributes.customFields, + customFields: request.customFields, }); - const updatedTemplates = removeCustomFieldFromTemplates({ - templates, + await validateTemplates({ + templates: updatedTemplates, + clientArgs, customFields: request.customFields, }); diff --git a/x-pack/plugins/cases/server/client/configure/validators.test.ts b/x-pack/plugins/cases/server/client/configure/validators.test.ts index ca81926519d37..63dc5b9dd8457 100644 --- a/x-pack/plugins/cases/server/client/configure/validators.test.ts +++ b/x-pack/plugins/cases/server/client/configure/validators.test.ts @@ -198,6 +198,35 @@ describe('validators', () => { ).toThrowErrorMatchingInlineSnapshot(`"No custom fields configured."`); }); + it('throws if configuration has custom fields and template has no custom fields', () => { + expect(() => + validateTemplatesCustomFieldsInRequest({ + templates: [ + { + key: 'template_key_1', + name: 'first template', + description: 'this is a first template value', + caseFields: null, + }, + ], + customFieldsConfiguration: [ + { + key: 'first_key', + type: CustomFieldTypes.TEXT, + label: 'foo', + required: false, + }, + { + key: 'second_key', + type: CustomFieldTypes.TOGGLE, + label: 'foo', + required: false, + }, + ], + }) + ).toThrowErrorMatchingInlineSnapshot(`"No custom fields added to template."`); + }); + it('throws for a single invalid type', () => { expect(() => validateTemplatesCustomFieldsInRequest({ diff --git a/x-pack/plugins/cases/server/client/configure/validators.ts b/x-pack/plugins/cases/server/client/configure/validators.ts index 1dec647561ab8..4075f2edeeb27 100644 --- a/x-pack/plugins/cases/server/client/configure/validators.ts +++ b/x-pack/plugins/cases/server/client/configure/validators.ts @@ -60,20 +60,21 @@ export const validateTemplatesCustomFieldsInRequest = ({ } templates.forEach((template, index) => { - if ( - !template.caseFields || - !template.caseFields.customFields || - !template.caseFields.customFields.length - ) { - return; + if (customFieldsConfiguration === undefined && template.caseFields?.customFields?.length) { + throw Boom.badRequest('No custom fields configured.'); } - if (customFieldsConfiguration === undefined) { - throw Boom.badRequest('No custom fields configured.'); + if ( + (!template.caseFields || + !template.caseFields.customFields || + !template.caseFields.customFields.length) && + customFieldsConfiguration?.length + ) { + throw Boom.badRequest('No custom fields added to template.'); } const params = { - requestCustomFields: template.caseFields.customFields, + requestCustomFields: template?.caseFields?.customFields, customFieldsConfiguration, }; diff --git a/x-pack/plugins/cases/server/client/utils.test.ts b/x-pack/plugins/cases/server/client/utils.test.ts index 56615189d1d5e..eb7aaea6d6938 100644 --- a/x-pack/plugins/cases/server/client/utils.test.ts +++ b/x-pack/plugins/cases/server/client/utils.test.ts @@ -19,7 +19,7 @@ import { constructQueryOptions, constructSearch, convertSortField, - removeCustomFieldFromTemplates, + transformTemplateCustomFields, } from './utils'; import { CasePersistedSeverity, CasePersistedStatus } from '../common/types/case'; import type { CustomFieldsConfiguration } from '../../common/types/domain'; @@ -1132,7 +1132,7 @@ describe('utils', () => { }); }); - describe('removeCustomFieldFromTemplates', () => { + describe('transformTemplateCustomFields', () => { const customFields = [ { type: CustomFieldTypes.TEXT as const, @@ -1204,7 +1204,7 @@ describe('utils', () => { ]; it('removes custom field from template correctly', () => { - const res = removeCustomFieldFromTemplates({ + const res = transformTemplateCustomFields({ templates, customFields: [customFields[0], customFields[1]], }); @@ -1253,7 +1253,7 @@ describe('utils', () => { }); it('removes multiple custom fields from template correctly', () => { - const res = removeCustomFieldFromTemplates({ + const res = transformTemplateCustomFields({ templates, customFields: [customFields[0]], }); @@ -1292,7 +1292,7 @@ describe('utils', () => { }); it('removes all custom fields from templates when custom fields are empty', () => { - const res = removeCustomFieldFromTemplates({ + const res = transformTemplateCustomFields({ templates, customFields: [], }); @@ -1319,7 +1319,7 @@ describe('utils', () => { }); it('removes all custom fields from templates when custom fields are undefined', () => { - const res = removeCustomFieldFromTemplates({ + const res = transformTemplateCustomFields({ templates, customFields: undefined, }); @@ -1330,8 +1330,8 @@ describe('utils', () => { ]); }); - it('does not remove custom field when templates do not have custom fields', () => { - const res = removeCustomFieldFromTemplates({ + it('adds custom fields to templates when templates do not have custom fields', () => { + const res = transformTemplateCustomFields({ templates: [ { key: 'test_template_1', @@ -1353,7 +1353,20 @@ describe('utils', () => { expect(res).toEqual([ { - caseFields: null, + caseFields: { + customFields: [ + { + key: customFields[0].key, + type: customFields[0].type, + value: customFields[0].defaultValue, + }, + { + key: customFields[1].key, + type: customFields[1].type, + value: customFields[1].defaultValue, + }, + ], + }, description: 'This is a first test template', key: 'test_template_1', name: 'First test template', @@ -1364,13 +1377,25 @@ describe('utils', () => { caseFields: { description: 'this is test', title: 'Test title', + customFields: [ + { + key: customFields[0].key, + type: customFields[0].type, + value: customFields[0].defaultValue, + }, + { + key: customFields[1].key, + type: customFields[1].type, + value: customFields[1].defaultValue, + }, + ], }, }, ]); }); - it('does not remove custom field when templates have empty custom fields', () => { - const res = removeCustomFieldFromTemplates({ + it('adds custom fields to templates when template custom fields are empty', () => { + const res = transformTemplateCustomFields({ templates: [ { key: 'test_template_2', @@ -1382,7 +1407,7 @@ describe('utils', () => { }, }, ], - customFields: [customFields[0], customFields[1]], + customFields: [customFields[0], customFields[1], customFields[2]], }); expect(res).toEqual([ @@ -1392,14 +1417,149 @@ describe('utils', () => { caseFields: { title: 'Test title', description: 'this is test', - customFields: [], + customFields: [ + { + key: customFields[0].key, + type: customFields[0].type, + value: customFields[0].defaultValue, + }, + { + key: customFields[1].key, + type: customFields[1].type, + value: customFields[1].defaultValue, + }, + { + key: customFields[2].key, + type: customFields[2].type, + value: null, + }, + ], + }, + }, + ]); + }); + + it('adds custom fields to templates with correct values', () => { + const res = transformTemplateCustomFields({ + templates: [ + { + key: 'test_template_2', + name: 'Second test template', + caseFields: { + title: 'Test title', + description: 'this is test', + customFields: [], + }, + }, + ], + customFields: [ + ...customFields, + { + type: CustomFieldTypes.TOGGLE as const, + key: 'test_key_4', + label: 'My test label 4', + required: true, + }, + ], + }); + + expect(res).toEqual([ + { + key: 'test_template_2', + name: 'Second test template', + caseFields: { + title: 'Test title', + description: 'this is test', + customFields: [ + { + key: customFields[0].key, + type: customFields[0].type, + value: customFields[0].defaultValue, + }, + { + key: customFields[1].key, + type: customFields[1].type, + value: customFields[1].defaultValue, + }, + { + key: customFields[2].key, + type: customFields[2].type, + value: null, + }, + { + type: CustomFieldTypes.TOGGLE as const, + key: 'test_key_4', + value: false, + }, + ], + }, + }, + ]); + }); + + it('does not change the existing template custom field', () => { + const res = transformTemplateCustomFields({ + templates: [ + { + key: 'test_template_2', + name: 'Second test template', + caseFields: { + title: 'Test title', + description: 'this is test', + customFields: [ + { + key: customFields[0].key, + type: CustomFieldTypes.TEXT as const, + value: 'updated text value', + }, + { + key: customFields[1].key, + type: CustomFieldTypes.TOGGLE as const, + value: false, + }, + { + key: customFields[2].key, + type: customFields[2].type, + value: null, + }, + ], + }, + }, + ], + customFields, + }); + + expect(res).toEqual([ + { + key: 'test_template_2', + name: 'Second test template', + caseFields: { + title: 'Test title', + description: 'this is test', + customFields: [ + { + key: customFields[0].key, + type: customFields[0].type, + value: 'updated text value', + }, + { + key: customFields[1].key, + type: customFields[1].type, + value: false, + }, + { + key: customFields[2].key, + type: customFields[2].type, + value: null, + }, + ], }, }, ]); }); it('does not remove custom field from empty templates', () => { - const res = removeCustomFieldFromTemplates({ + const res = transformTemplateCustomFields({ templates: [], customFields: [customFields[0], customFields[1]], }); @@ -1408,7 +1568,7 @@ describe('utils', () => { }); it('returns empty array when templates are undefined', () => { - const res = removeCustomFieldFromTemplates({ + const res = transformTemplateCustomFields({ templates: undefined, customFields: [customFields[0], customFields[1]], }); diff --git a/x-pack/plugins/cases/server/client/utils.ts b/x-pack/plugins/cases/server/client/utils.ts index 258761a563fd3..5f854aa3236fe 100644 --- a/x-pack/plugins/cases/server/client/utils.ts +++ b/x-pack/plugins/cases/server/client/utils.ts @@ -17,11 +17,13 @@ import { nodeBuilder, fromKueryExpression, escapeKuery } from '@kbn/es-query'; import { spaceIdToNamespace } from '@kbn/spaces-plugin/server/lib/utils/namespace'; import type { + CaseCustomField, CaseSeverity, CaseStatuses, CustomFieldsConfiguration, ExternalReferenceAttachmentPayload, TemplatesConfiguration, + CustomFieldTypes, } from '../../common/types/domain'; import { ActionsAttachmentPayloadRt, @@ -607,9 +609,9 @@ export const constructSearch = ( }; /** - * remove deleted custom field from template + * remove deleted custom field from template or add newly added custom field to template */ -export const removeCustomFieldFromTemplates = ({ +export const transformTemplateCustomFields = ({ templates, customFields, }: { @@ -621,21 +623,40 @@ export const removeCustomFieldFromTemplates = ({ } return templates.map((template) => { - if (!template.caseFields?.customFields || !template.caseFields?.customFields.length) { - return template; - } + const templateCustomFields = template.caseFields?.customFields ?? []; - if (!customFields || !customFields?.length) { + if (!customFields || !customFields.length) { return { ...template, caseFields: { ...template.caseFields, customFields: [] } }; } - const templateCustomFields = template.caseFields.customFields.filter((templateCustomField) => + // remove deleted custom field from template + const transformedTemplateCustomFields = templateCustomFields.filter((templateCustomField) => customFields?.find((customField) => customField.key === templateCustomField.key) ); + // add new custom fields to template + if (customFields.length >= transformedTemplateCustomFields.length) { + customFields.forEach((field) => { + if ( + !transformedTemplateCustomFields.find( + (templateCustomField) => templateCustomField.key === field.key + ) + ) { + const { getDefaultValue } = casesCustomFields.get(field.type) ?? {}; + const value = getDefaultValue?.() ?? null; + + transformedTemplateCustomFields.push({ + key: field.key, + type: field.type as CustomFieldTypes, + value: field.defaultValue ?? value, + } as CaseCustomField); + } + }); + } + return { ...template, - caseFields: { ...template.caseFields, customFields: templateCustomFields }, + caseFields: { ...template.caseFields, customFields: transformedTemplateCustomFields }, }; }); }; diff --git a/x-pack/plugins/cases/server/connectors/cases/cases_connector_executor.ts b/x-pack/plugins/cases/server/connectors/cases/cases_connector_executor.ts index 15435cc8be76c..ac9490a814a61 100644 --- a/x-pack/plugins/cases/server/connectors/cases/cases_connector_executor.ts +++ b/x-pack/plugins/cases/server/connectors/cases/cases_connector_executor.ts @@ -173,10 +173,15 @@ export class CasesConnectorExecutor { }: Pick & { params: CasesConnectorRunParams; }): GroupedAlerts[] { - this.logger.debug( - `[CasesConnector][CasesConnectorExecutor][groupAlerts] Grouping ${alerts.length} alerts`, - this.getLogMetadata(params, { labels: { groupingBy }, tags: ['case-connector:groupAlerts'] }) - ); + if (this.logger.isLevelEnabled('debug')) { + this.logger.debug( + `[CasesConnector][CasesConnectorExecutor][groupAlerts] Grouping ${alerts.length} alerts`, + this.getLogMetadata(params, { + labels: { groupingBy }, + tags: ['case-connector:groupAlerts'], + }) + ); + } const uniqueGroupingByFields = Array.from(new Set(groupingBy)); const groupingMap = new Map(); @@ -190,19 +195,23 @@ export class CasesConnectorExecutor { uniqueGroupingByFields.every((groupingByField) => Boolean(get(alert, groupingByField, null))) ); - this.logger.debug( - `[CasesConnector][CasesConnectorExecutor][groupAlerts] Total alerts to be grouped: ${alertsWithAllGroupingFields.length} out of ${alerts.length}`, - this.getLogMetadata(params, { tags: ['case-connector:groupAlerts'] }) - ); + if (this.logger.isLevelEnabled('debug')) { + this.logger.debug( + `[CasesConnector][CasesConnectorExecutor][groupAlerts] Total alerts to be grouped: ${alertsWithAllGroupingFields.length} out of ${alerts.length}`, + this.getLogMetadata(params, { tags: ['case-connector:groupAlerts'] }) + ); + } for (const alert of alertsWithAllGroupingFields) { const alertWithOnlyTheGroupingFields = pick(alert, uniqueGroupingByFields); const groupingKey = stringify(alertWithOnlyTheGroupingFields); - this.logger.debug( - `[CasesConnector][CasesConnectorExecutor][groupAlerts] Alert ${alert._id} got grouped into bucket with ID ${groupingKey}`, - this.getLogMetadata(params, { tags: ['case-connector:groupAlerts', groupingKey] }) - ); + if (this.logger.isLevelEnabled('debug')) { + this.logger.debug( + `[CasesConnector][CasesConnectorExecutor][groupAlerts] Alert ${alert._id} got grouped into bucket with ID ${groupingKey}`, + this.getLogMetadata(params, { tags: ['case-connector:groupAlerts', groupingKey] }) + ); + } if (groupingMap.has(groupingKey)) { groupingMap.get(groupingKey)?.alerts.push(alert); @@ -261,10 +270,12 @@ export class CasesConnectorExecutor { params: CasesConnectorRunParams, groupedAlerts: GroupedAlerts[] ): Map { - this.logger.debug( - `[CasesConnector][CasesConnectorExecutor][generateOracleKeys] Generating ${groupedAlerts.length} oracle keys`, - this.getLogMetadata(params, { tags: ['case-connector:generateOracleKeys'] }) - ); + if (this.logger.isLevelEnabled('debug')) { + this.logger.debug( + `[CasesConnector][CasesConnectorExecutor][generateOracleKeys] Generating ${groupedAlerts.length} oracle keys`, + this.getLogMetadata(params, { tags: ['case-connector:generateOracleKeys'] }) + ); + } const { rule, owner } = params; @@ -280,21 +291,25 @@ export class CasesConnectorExecutor { const oracleKey = this.casesOracleService.getRecordId(getRecordIdParams); - this.logger.debug( - `[CasesConnector][CasesConnectorExecutor][generateOracleKeys] Oracle key ${oracleKey} generated`, - this.getLogMetadata(params, { - labels: { params: getRecordIdParams }, - tags: ['case-connector:generateOracleKeys', oracleKey], - }) - ); + if (this.logger.isLevelEnabled('debug')) { + this.logger.debug( + `[CasesConnector][CasesConnectorExecutor][generateOracleKeys] Oracle key ${oracleKey} generated`, + this.getLogMetadata(params, { + labels: { params: getRecordIdParams }, + tags: ['case-connector:generateOracleKeys', oracleKey], + }) + ); + } oracleMap.set(oracleKey, { oracleKey, grouping, alerts }); } - this.logger.debug( - `[CasesConnector][CasesConnectorExecutor][generateOracleKeys] Total of oracles keys generated ${oracleMap.size}`, - this.getLogMetadata(params, { tags: ['case-connector:generateOracleKeys'] }) - ); + if (this.logger.isLevelEnabled('debug')) { + this.logger.debug( + `[CasesConnector][CasesConnectorExecutor][generateOracleKeys] Total of oracles keys generated ${oracleMap.size}`, + this.getLogMetadata(params, { tags: ['case-connector:generateOracleKeys'] }) + ); + } return oracleMap; } @@ -303,11 +318,12 @@ export class CasesConnectorExecutor { params: CasesConnectorRunParams, groupedAlertsWithOracleKey: Map ): Promise> { - this.logger.debug( - `[CasesConnector][CasesConnectorExecutor][upsertOracleRecords] Upserting ${groupedAlertsWithOracleKey.size} oracle records`, - this.getLogMetadata(params, { tags: ['case-connector:upsertOracleRecords'] }) - ); - + if (this.logger.isLevelEnabled('debug')) { + this.logger.debug( + `[CasesConnector][CasesConnectorExecutor][upsertOracleRecords] Upserting ${groupedAlertsWithOracleKey.size} oracle records`, + this.getLogMetadata(params, { tags: ['case-connector:upsertOracleRecords'] }) + ); + } const bulkCreateReq: BulkCreateOracleRecordRequest = []; const oracleRecordMap = new Map(); @@ -322,25 +338,29 @@ export class CasesConnectorExecutor { const ids = Array.from(groupedAlertsWithOracleKey.values()).map(({ oracleKey }) => oracleKey); - this.logger.debug( - `[CasesConnector][CasesConnectorExecutor][upsertOracleRecords] Getting oracle records with ids ${ids}`, - this.getLogMetadata(params, { tags: ['case-connector:upsertOracleRecords', ...ids] }) - ); + if (this.logger.isLevelEnabled('debug')) { + this.logger.debug( + `[CasesConnector][CasesConnectorExecutor][upsertOracleRecords] Getting oracle records with ids ${ids}`, + this.getLogMetadata(params, { tags: ['case-connector:upsertOracleRecords', ...ids] }) + ); + } const bulkGetRes = await this.casesOracleService.bulkGetRecords(ids); const [bulkGetValidRecords, bulkGetRecordsErrors] = partitionRecordsByError(bulkGetRes); - this.logger.debug( - `[CasesConnector][CasesConnectorExecutor][upsertOracleRecords] The total number of valid oracle records is ${bulkGetValidRecords.length} and the total number of errors while getting the records is ${bulkGetRecordsErrors.length}`, - this.getLogMetadata(params, { - labels: { - total: ids.length, - success: bulkGetValidRecords.length, - errors: bulkGetRecordsErrors.length, - }, - tags: ['case-connector:upsertOracleRecords'], - }) - ); + if (this.logger.isLevelEnabled('debug')) { + this.logger.debug( + `[CasesConnector][CasesConnectorExecutor][upsertOracleRecords] The total number of valid oracle records is ${bulkGetValidRecords.length} and the total number of errors while getting the records is ${bulkGetRecordsErrors.length}`, + this.getLogMetadata(params, { + labels: { + total: ids.length, + success: bulkGetValidRecords.length, + errors: bulkGetRecordsErrors.length, + }, + tags: ['case-connector:upsertOracleRecords'], + }) + ); + } addRecordToMap(bulkGetValidRecords); @@ -350,16 +370,18 @@ export class CasesConnectorExecutor { const [nonFoundErrors, restOfErrors] = partitionByNonFoundErrors(bulkGetRecordsErrors); - this.logger.debug( - `[CasesConnector][CasesConnectorExecutor][upsertOracleRecords] The total number of non found oracle records is ${nonFoundErrors.length} and the total number of the rest of errors while getting the records is ${restOfErrors.length}`, - this.getLogMetadata(params, { - labels: { - nonFoundErrors: nonFoundErrors.length, - restOfErrors: restOfErrors.length, - }, - tags: ['case-connector:upsertOracleRecords'], - }) - ); + if (this.logger.isLevelEnabled('debug')) { + this.logger.debug( + `[CasesConnector][CasesConnectorExecutor][upsertOracleRecords] The total number of non found oracle records is ${nonFoundErrors.length} and the total number of the rest of errors while getting the records is ${restOfErrors.length}`, + this.getLogMetadata(params, { + labels: { + nonFoundErrors: nonFoundErrors.length, + restOfErrors: restOfErrors.length, + }, + tags: ['case-connector:upsertOracleRecords'], + }) + ); + } this.handleAndThrowErrors(restOfErrors); @@ -1073,17 +1095,19 @@ export class CasesConnectorExecutor { * attachments.bulkCreate throws an error on errors */ async (req: BulkCreateAlertsReq) => { - this.logger.debug( - `[CasesConnector][CasesConnectorExecutor][attachAlertsToCases] Attaching ${req.attachments.length} alerts to case with ID ${req.caseId}`, - this.getLogMetadata(params, { - labels: { caseId: req.caseId }, - tags: [ - 'case-connector:attachAlertsToCases', - req.caseId, - ...(req.attachments as Array<{ alertId: string }>).map(({ alertId }) => alertId), - ], - }) - ); + if (this.logger.isLevelEnabled('debug')) { + this.logger.debug( + `[CasesConnector][CasesConnectorExecutor][attachAlertsToCases] Attaching ${req.attachments.length} alerts to case with ID ${req.caseId}`, + this.getLogMetadata(params, { + labels: { caseId: req.caseId }, + tags: [ + 'case-connector:attachAlertsToCases', + req.caseId, + ...(req.attachments as Array<{ alertId: string }>).map(({ alertId }) => alertId), + ], + }) + ); + } await this.casesClient.attachments.bulkCreate(req); }, diff --git a/x-pack/plugins/cases/server/custom_fields/toggle.ts b/x-pack/plugins/cases/server/custom_fields/toggle.ts index c250bf85ea168..512e226badaf5 100644 --- a/x-pack/plugins/cases/server/custom_fields/toggle.ts +++ b/x-pack/plugins/cases/server/custom_fields/toggle.ts @@ -19,4 +19,5 @@ export const getCasesToggleCustomField = () => ({ } }); }, + getDefaultValue: () => false, }); diff --git a/x-pack/plugins/cases/server/custom_fields/types.ts b/x-pack/plugins/cases/server/custom_fields/types.ts index 7a0df91682a68..0999ccb4b90c4 100644 --- a/x-pack/plugins/cases/server/custom_fields/types.ts +++ b/x-pack/plugins/cases/server/custom_fields/types.ts @@ -12,6 +12,7 @@ export interface ICasesCustomField { isSortable: boolean; savedObjectMappingType: string; validateFilteringValues: (values: Array) => void; + getDefaultValue?: () => boolean | string | null; } export interface CasesCustomFieldsMap { diff --git a/x-pack/plugins/cases/server/routes/api/configure/get_configure.ts b/x-pack/plugins/cases/server/routes/api/configure/get_configure.ts index e4d2c75689cd2..21407054bb970 100644 --- a/x-pack/plugins/cases/server/routes/api/configure/get_configure.ts +++ b/x-pack/plugins/cases/server/routes/api/configure/get_configure.ts @@ -15,7 +15,9 @@ export const getCaseConfigureRoute = createCasesRoute({ path: CASE_CONFIGURE_URL, routerOptions: { access: 'public', - summary: `Get case settings`, + summary: 'Get case settings', + description: + 'Retrieves setting details such as the closure type, custom fields, templates, and the default connector for cases. You must have `read` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where the cases were created.', }, handler: async ({ context, request, response }) => { try { diff --git a/x-pack/plugins/cases/server/routes/api/configure/get_connectors.ts b/x-pack/plugins/cases/server/routes/api/configure/get_connectors.ts index 3201cb7005fb4..8c6aa326d4ddb 100644 --- a/x-pack/plugins/cases/server/routes/api/configure/get_connectors.ts +++ b/x-pack/plugins/cases/server/routes/api/configure/get_connectors.ts @@ -18,7 +18,9 @@ export const getConnectorsRoute = createCasesRoute({ routerOptions: { tags: ['access:casesGetConnectorsConfigure'], access: 'public', - summary: `Get case connectors`, + summary: 'Get case connectors', + description: + 'Retrieves information about connectors that are supported for use in cases. You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.', }, handler: async ({ context, response }) => { try { diff --git a/x-pack/plugins/cases/server/routes/api/configure/patch_configure.ts b/x-pack/plugins/cases/server/routes/api/configure/patch_configure.ts index c028013332866..f7f3fa51c7a89 100644 --- a/x-pack/plugins/cases/server/routes/api/configure/patch_configure.ts +++ b/x-pack/plugins/cases/server/routes/api/configure/patch_configure.ts @@ -17,7 +17,9 @@ export const patchCaseConfigureRoute = createCasesRoute({ path: CASE_CONFIGURE_DETAILS_URL, routerOptions: { access: 'public', - summary: `Update case settings`, + summary: 'Update case settings', + description: + 'Updates case settings such as the closure type, custom fields, templates, and the default connector for cases. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where the case was created.', }, handler: async ({ context, request, response }) => { try { diff --git a/x-pack/plugins/cases/server/routes/api/configure/post_configure.ts b/x-pack/plugins/cases/server/routes/api/configure/post_configure.ts index 6b6d6b1e48441..9797f8805d85d 100644 --- a/x-pack/plugins/cases/server/routes/api/configure/post_configure.ts +++ b/x-pack/plugins/cases/server/routes/api/configure/post_configure.ts @@ -17,7 +17,9 @@ export const postCaseConfigureRoute = createCasesRoute({ path: CASE_CONFIGURE_URL, routerOptions: { access: 'public', - summary: `Add case settings`, + summary: 'Add case settings', + description: + 'Case settings include external connection details, custom fields, and templates. Connectors are used to interface with external systems. You must create a connector before you can use it in your cases. If you set a default connector, it is automatically selected when you create cases in Kibana. If you use the create case API, however, you must still specify all of the connector details. You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on where you are creating cases.', }, handler: async ({ context, request, response }) => { try { diff --git a/x-pack/plugins/cases/server/services/cases/index.ts b/x-pack/plugins/cases/server/services/cases/index.ts index d53cbc2edd867..034e369b1c700 100644 --- a/x-pack/plugins/cases/server/services/cases/index.ts +++ b/x-pack/plugins/cases/server/services/cases/index.ts @@ -274,7 +274,7 @@ export class CasesService { options?: SavedObjectsBulkDeleteOptions; }) { try { - this.log.debug(`Attempting to bulk delete case entities ${JSON.stringify(entities)}`); + this.log.debug(() => `Attempting to bulk delete case entities ${JSON.stringify(entities)}`); await this.unsecuredSavedObjectsClient.bulkDelete(entities, options); } catch (error) { this.log.error(`Error bulk deleting case entities ${JSON.stringify(entities)}: ${error}`); diff --git a/x-pack/plugins/cases/tsconfig.json b/x-pack/plugins/cases/tsconfig.json index 535f4e5e106dc..6bbc5cfd4e421 100644 --- a/x-pack/plugins/cases/tsconfig.json +++ b/x-pack/plugins/cases/tsconfig.json @@ -75,6 +75,7 @@ "@kbn/core-logging-browser-mocks", "@kbn/data-views-plugin", "@kbn/core-http-router-server-internal", + "@kbn/presentation-publishing", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/cloud_security_grouping.tsx b/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/cloud_security_grouping.tsx index a95ae51f81eac..a7371851c5712 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/cloud_security_grouping.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/cloud_security_grouping.tsx @@ -77,13 +77,6 @@ export const CloudSecurityGrouping = ({ data-test-subj={CSP_GROUPING} css={css` position: relative; - && [data-test-subj='group-stats'] > .euiFlexItem:last-child { - display: none; - } - && [data-test-subj='group-stats'] > .euiFlexItem:not(:first-child) > span { - border-right: none; - margin-right: 0; - } `} > {groupSelectorComponent && ( diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/use_cloud_security_grouping.ts b/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/use_cloud_security_grouping.ts index d9e7ac07b9dbd..e480233f376fa 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/use_cloud_security_grouping.ts +++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/use_cloud_security_grouping.ts @@ -8,7 +8,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react'; import { isNoneGroup, useGrouping } from '@kbn/grouping'; import * as uuid from 'uuid'; import type { DataView } from '@kbn/data-views-plugin/common'; -import { GroupOption, GroupPanelRenderer, GroupStatsRenderer } from '@kbn/grouping/src'; +import { GroupOption, GroupPanelRenderer, GetGroupStats } from '@kbn/grouping/src'; import { useUrlQuery } from '../../common/hooks/use_url_query'; @@ -28,7 +28,7 @@ export const useCloudSecurityGrouping = ({ getDefaultQuery, unit, groupPanelRenderer, - groupStatsRenderer, + getGroupStats, groupingLevel, groupingLocalStorageKey, maxGroupingLevels = DEFAULT_MAX_GROUPING_LEVELS, @@ -40,7 +40,7 @@ export const useCloudSecurityGrouping = ({ getDefaultQuery: (params: FindingsBaseURLQuery) => FindingsBaseURLQuery; unit: (count: number) => string; groupPanelRenderer?: GroupPanelRenderer; - groupStatsRenderer?: GroupStatsRenderer; + getGroupStats?: GetGroupStats; groupingLevel?: number; groupingLocalStorageKey: string; maxGroupingLevels?: number; @@ -60,7 +60,7 @@ export const useCloudSecurityGrouping = ({ componentProps: { unit, groupPanelRenderer, - groupStatsRenderer, + getGroupStats, groupsUnit, }, defaultGroupingOptions, diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_input_var_fields.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_input_var_fields.tsx index a66bff8bd3506..f4c7fd1b8d501 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_input_var_fields.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_input_var_fields.tsx @@ -30,8 +30,8 @@ export const AwsInputVarFields = ({ }) => { return (
    - {fields.map((field) => ( - <> + {fields.map((field, index) => ( +
    {field.type === 'password' && field.isSecret === true && ( <> @@ -85,7 +85,7 @@ export const AwsInputVarFields = ({ /> )} - +
    ))}
    ); diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form.tsx index 0f3b9916cef1a..02aa0eb679a66 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form.tsx @@ -279,8 +279,8 @@ export const AzureInputVarFields = ({ }) => { return (
    - {fields.map((field) => ( - <> + {fields.map((field, index) => ( +
    {field.type === 'password' && field.isSecret === true && ( <> @@ -332,7 +332,7 @@ export const AzureInputVarFields = ({ /> )} - +
    ))}
    ); diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credential_form.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credential_form.tsx index b31f00c21c867..2b060778933d3 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credential_form.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credential_form.tsx @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { useEffect, useRef } from 'react'; +import React, { Suspense, useEffect, useRef } from 'react'; import semverLt from 'semver/functions/lt'; import semverCoerce from 'semver/functions/coerce'; import semverValid from 'semver/functions/valid'; @@ -15,13 +15,13 @@ import { EuiForm, EuiFormRow, EuiHorizontalRule, + EuiLoadingSpinner, EuiSelect, EuiSpacer, EuiText, - EuiTextArea, EuiTitle, } from '@elastic/eui'; -import type { NewPackagePolicy } from '@kbn/fleet-plugin/public'; +import { LazyPackagePolicyInputVarField, type NewPackagePolicy } from '@kbn/fleet-plugin/public'; import { NewPackagePolicyInput, PackageInfo } from '@kbn/fleet-plugin/common'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; @@ -30,6 +30,7 @@ import { GcpCredentialsType } from '../../../../common/types_old'; import { CLOUDBEAT_GCP } from '../../../../common/constants'; import { CspRadioOption, RadioGroup } from '../csp_boxed_radio_group'; import { + findVariableDef, getCspmCloudShellDefaultValue, getPosturePolicy, NewPackagePolicyPostureInput, @@ -193,7 +194,10 @@ const credentialOptionsList = [ }, ]; -type GcpFields = Record; +type GcpFields = Record< + string, + { label: string; type?: 'password' | 'text'; value?: string; isSecret?: boolean } +>; interface GcpInputFields { fields: GcpFields; } @@ -222,7 +226,8 @@ export const gcpField: GcpInputFields = { label: i18n.translate('xpack.csp.findings.gcpIntegration.gcpInputText.credentialJSONText', { defaultMessage: 'JSON blob containing the credentials and key used to subscribe', }), - type: 'text', + type: 'password', + isSecret: true, }, 'gcp.credentials.type': { label: i18n.translate( @@ -263,6 +268,7 @@ export interface GcpFormProps { setIsValid: (isValid: boolean) => void; onChange: any; disabled: boolean; + isEditPage?: boolean; } export const getInputVarsFields = (input: NewPackagePolicyInput, fields: GcpFields) => @@ -367,6 +373,7 @@ export const GcpCredentialsForm = ({ setIsValid, onChange, disabled, + isEditPage, }: GcpFormProps) => { /* Create a subset of properties from GcpField to use for hiding value of credentials json and credentials file when user switch from Manual to Cloud Shell, we wanna keep Project and Organization ID */ const subsetOfGcpField = (({ ['gcp.credentials.file']: a, ['gcp.credentials.json']: b }) => ({ @@ -489,6 +496,8 @@ export const GcpCredentialsForm = ({ updatePolicy(getPosturePolicy(newPolicy, input.type, { [key]: { value } })) } isOrganization={isOrganization} + packageInfo={packageInfo} + isEditPage={isEditPage} /> )} @@ -504,11 +513,15 @@ export const GcpInputVarFields = ({ onChange, isOrganization, disabled, + packageInfo, + isEditPage, }: { fields: Array; onChange: (key: string, value: string) => void; isOrganization: boolean; disabled: boolean; + packageInfo: PackageInfo; + isEditPage?: boolean; }) => { const getFieldById = (id: keyof GcpInputFields['fields']) => { return fields.find((element) => element.id === id); @@ -581,15 +594,41 @@ export const GcpInputVarFields = ({ )} {credentialsTypeValue === credentialJSONValue && credentialJSONFields && ( - - onChange(credentialJSONFields.id, event.target.value)} - /> - +
    + + + }> + { + onChange(credentialJSONFields.id, value); + }} + errors={[]} + forceShowErrors={false} + isEditPage={isEditPage} + /> + + +
    )} diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credentials_form_agentless.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credentials_form_agentless.tsx index ca25f3ea1469e..d246ea82689bb 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credentials_form_agentless.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credentials_form_agentless.tsx @@ -33,8 +33,8 @@ export const GcpCredentialsFormAgentless = ({ input, newPolicy, updatePolicy, - packageInfo, disabled, + packageInfo, }: GcpFormProps) => { const accountType = input.streams?.[0]?.vars?.['gcp.account_type']?.value; const isOrganization = accountType === ORGANIZATION_ACCOUNT; @@ -102,6 +102,7 @@ export const GcpCredentialsFormAgentless = ({ updatePolicy(getPosturePolicy(newPolicy, input.type, { [key]: { value } })) } isOrganization={isOrganization} + packageInfo={packageInfo} /> diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/mocks.ts b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/mocks.ts index 38e6d5d632cea..d495cee7431fd 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/mocks.ts +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/mocks.ts @@ -6,7 +6,7 @@ */ import type { NewPackagePolicy } from '@kbn/fleet-plugin/public'; import type { PackageInfo, PackagePolicyConfigRecord } from '@kbn/fleet-plugin/common'; -import { createNewPackagePolicyMock, createAgentPolicyMock } from '@kbn/fleet-plugin/common/mocks'; +import { createNewPackagePolicyMock } from '@kbn/fleet-plugin/common/mocks'; import { RegistryRelease, RegistryVarType } from '@kbn/fleet-plugin/common/types'; import { CLOUDBEAT_GCP, @@ -29,9 +29,6 @@ export const getMockPolicyEKS = (vars?: PackagePolicyConfigRecord) => getPolicyMock(CLOUDBEAT_EKS, 'kspm', 'eks', vars); export const getMockPolicyVulnMgmtAWS = () => getPolicyMock(CLOUDBEAT_VULN_MGMT_AWS, 'vuln_mgmt', 'aws'); -export const getMockAgentlessAgentPolicy = () => { - return createAgentPolicyMock({ id: 'agentless' }); -}; export const getMockPackageInfo = () => getPackageInfoMock(); export const getMockPackageInfoVulnMgmtAWS = () => { diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx index d228edf845552..84abf584b5080 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx @@ -16,7 +16,6 @@ import { } from './policy_template_form'; import { TestProvider } from '../../test/test_provider'; import { - getMockAgentlessAgentPolicy, getMockPackageInfo, getMockPackageInfoCspmAWS, getMockPackageInfoCspmAzure, @@ -30,12 +29,7 @@ import { getMockPolicyVulnMgmtAWS, getPackageInfoMock, } from './mocks'; -import type { - AgentPolicy, - NewPackagePolicy, - PackageInfo, - PackagePolicy, -} from '@kbn/fleet-plugin/common'; +import type { NewPackagePolicy, PackageInfo, PackagePolicy } from '@kbn/fleet-plugin/common'; import { getPosturePolicy } from './utils'; import { CLOUDBEAT_AWS, @@ -114,16 +108,14 @@ describe('', () => { const WrappedComponent = ({ newPolicy, edit = false, - agentPolicies, packageInfo = {} as PackageInfo, - agentlessPolicy, + isAgentlessEnabled, }: { edit?: boolean; newPolicy: NewPackagePolicy; - agentPolicies?: AgentPolicy[]; packageInfo?: PackageInfo; onChange?: jest.Mock; - agentlessPolicy?: AgentPolicy; + isAgentlessEnabled?: boolean; }) => { const { AppWrapper: FleetAppWrapper } = createFleetTestRendererMock(); return ( @@ -136,8 +128,7 @@ describe('', () => { onChange={onChange} packageInfo={packageInfo} isEditPage={true} - agentPolicies={agentPolicies} - agentlessPolicy={agentlessPolicy} + isAgentlessEnabled={isAgentlessEnabled} /> )} {!edit && ( @@ -146,8 +137,7 @@ describe('', () => { onChange={onChange} packageInfo={packageInfo} isEditPage={false} - agentPolicies={agentPolicies} - agentlessPolicy={agentlessPolicy} + isAgentlessEnabled={isAgentlessEnabled} /> )} @@ -1236,48 +1226,6 @@ describe('', () => { }); }); - it(`renders ${CLOUDBEAT_GCP} Credentials JSON fields`, () => { - let policy = getMockPolicyGCP(); - policy = getPosturePolicy(policy, CLOUDBEAT_GCP, { - setup_access: { value: 'manual' }, - 'gcp.credentials.type': { value: 'credentials-json' }, - }); - - const { getByRole, getByLabelText } = render( - - ); - - expect(getByRole('option', { name: 'Credentials JSON', selected: true })).toBeInTheDocument(); - - expect( - getByLabelText('JSON blob containing the credentials and key used to subscribe') - ).toBeInTheDocument(); - }); - - it(`updates ${CLOUDBEAT_GCP} Credentials JSON fields`, () => { - let policy = getMockPolicyGCP(); - policy = getPosturePolicy(policy, CLOUDBEAT_GCP, { - 'gcp.project_id': { value: 'a' }, - 'gcp.credentials.type': { value: 'credentials-json' }, - setup_access: { value: 'manual' }, - }); - - const { getByTestId } = render( - - ); - - userEvent.type(getByTestId(CIS_GCP_INPUT_FIELDS_TEST_SUBJECTS.CREDENTIALS_JSON), 'b'); - - policy = getPosturePolicy(policy, CLOUDBEAT_GCP, { - 'gcp.credentials.json': { value: 'b' }, - }); - - expect(onChange).toHaveBeenCalledWith({ - isValid: true, - updatedPolicy: policy, - }); - }); - it(`${CLOUDBEAT_GCP} form do not displays upgrade message for supported versions and gcp organization option is enabled`, () => { let policy = getMockPolicyGCP(); policy = getPosturePolicy(policy, CLOUDBEAT_GCP, { @@ -1500,12 +1448,23 @@ describe('', () => { }); describe('Agentless', () => { + it('should not render setup technology selector if agentless is not available and CSPM integration supports agentless', async () => { + const newPackagePolicy = getMockPolicyAWS(); + + const { queryByTestId } = render( + + ); + + const setupTechnologySelector = queryByTestId(SETUP_TECHNOLOGY_SELECTOR_TEST_SUBJ); + // default state + expect(setupTechnologySelector).not.toBeInTheDocument(); + }); + it('should render setup technology selector for AWS and allow to select agent-based', async () => { - const agentlessPolicy = getMockAgentlessAgentPolicy(); const newPackagePolicy = getMockPolicyAWS(); const { getByTestId, getByRole } = render( - + ); const setupTechnologySelectorAccordion = getByTestId( @@ -1540,14 +1499,13 @@ describe('', () => { }); }); - it('should render setup technology selector for GCP for organisation account type', async () => { - const agentlessPolicy = getMockAgentlessAgentPolicy(); + it.skip('should render setup technology selector for GCP for organisation account type', async () => { const newPackagePolicy = getMockPolicyGCP(); const { getByTestId, queryByTestId, getByRole } = render( ); @@ -1593,8 +1551,7 @@ describe('', () => { }); }); - it('should render setup technology selector for GCP for single-account', async () => { - const agentlessPolicy = getMockAgentlessAgentPolicy(); + it.skip('should render setup technology selector for GCP for single-account', async () => { const newPackagePolicy = getMockPolicyGCP({ 'gcp.account_type': { value: GCP_SINGLE_ACCOUNT, type: 'text' }, }); @@ -1602,7 +1559,7 @@ describe('', () => { const { getByTestId, queryByTestId } = render( ); @@ -1639,13 +1596,12 @@ describe('', () => { }); it('should render setup technology selector for Azure for Organisation type', async () => { - const agentlessPolicy = getMockAgentlessAgentPolicy(); const newPackagePolicy = getMockPolicyAzure(); const { getByTestId, queryByTestId, getByRole } = render( ); @@ -1686,7 +1642,6 @@ describe('', () => { }); it('should render setup technology selector for Azure for Single Subscription type', async () => { - const agentlessPolicy = getMockAgentlessAgentPolicy(); const newPackagePolicy = getMockPolicyAzure({ 'azure.account_type': { value: 'single-account', type: 'text' }, }); @@ -1694,7 +1649,7 @@ describe('', () => { const { getByTestId, queryByTestId } = render( ); @@ -1725,11 +1680,10 @@ describe('', () => { }); it('should not render setup technology selector for KSPM', () => { - const agentlessPolicy = getMockAgentlessAgentPolicy(); const newPackagePolicy = getMockPolicyEKS(); const { queryByTestId } = render( - + ); const setupTechnologySelectorAccordion = queryByTestId( @@ -1740,11 +1694,10 @@ describe('', () => { }); it('should not render setup technology selector for CNVM', () => { - const agentlessPolicy = getMockAgentlessAgentPolicy(); const newPackagePolicy = getMockPolicyVulnMgmtAWS(); const { queryByTestId } = render( - + ); const setupTechnologySelectorAccordion = queryByTestId( diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx index cd49d80ae7281..0bd4c57129cc4 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx @@ -408,7 +408,7 @@ const GcpAccountTypeSelect = ({ @@ -533,14 +533,13 @@ const IntegrationSettings = ({ onChange, fields }: IntegrationInfoFieldsProps) = export const CspPolicyTemplateForm = memo( ({ - agentPolicies, newPolicy, onChange, validationResults, isEditPage, packageInfo, handleSetupTechnologyChange, - agentlessPolicy, + isAgentlessEnabled, }) => { const integrationParam = useParams<{ integration: CloudSecurityPolicyTemplate }>().integration; const integration = SUPPORTED_POLICY_TEMPLATES.includes(integrationParam) @@ -551,8 +550,7 @@ export const CspPolicyTemplateForm = memo diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_selectors.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_selectors.tsx index fd816d03fb507..ee76d40e1dcac 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_selectors.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_selectors.tsx @@ -79,6 +79,7 @@ interface PolicyTemplateVarsFormProps { setIsValid: (isValid: boolean) => void; disabled: boolean; setupTechnology: SetupTechnology; + isEditPage?: boolean; } export const PolicyTemplateVarsForm = ({ diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts index f08b1ad59b9b5..ae0cd7745fecd 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts @@ -33,51 +33,45 @@ describe('useSetupTechnology', () => { }); it('sets to AGENTLESS when agentless is available and AWS cloud', () => { - const agentlessPolicy = { id: 'agentlessPolicyId' } as AgentPolicy; const input = { type: CLOUDBEAT_AWS } as NewPackagePolicyInput; const { result } = renderHook(() => - useSetupTechnology({ input, agentlessPolicy, isEditPage }) + useSetupTechnology({ input, isAgentlessEnabled: true, isEditPage }) ); expect(result.current.isAgentlessAvailable).toBeTruthy(); expect(result.current.setupTechnology).toBe(SetupTechnology.AGENTLESS); }); it('sets to AGENTLESS when agentless is available and GCP cloud', () => { - const agentlessPolicy = { id: 'agentlessPolicyId' } as AgentPolicy; const input = { type: CLOUDBEAT_GCP } as NewPackagePolicyInput; const { result } = renderHook(() => - useSetupTechnology({ input, agentlessPolicy, isEditPage }) + useSetupTechnology({ input, isAgentlessEnabled: true, isEditPage }) ); expect(result.current.isAgentlessAvailable).toBeTruthy(); expect(result.current.setupTechnology).toBe(SetupTechnology.AGENTLESS); }); it('sets to AGENTLESS when agentless is available and Azure cloud', () => { - const agentlessPolicy = { id: 'agentlessPolicyId' } as AgentPolicy; const input = { type: CLOUDBEAT_AZURE } as NewPackagePolicyInput; const { result } = renderHook(() => - useSetupTechnology({ input, agentlessPolicy, isEditPage }) + useSetupTechnology({ input, isAgentlessEnabled: true, isEditPage }) ); expect(result.current.isAgentlessAvailable).toBeTruthy(); expect(result.current.setupTechnology).toBe(SetupTechnology.AGENTLESS); }); it('sets to AGENT_BASED when agentless is available but input is not supported for agentless', () => { - const agentlessPolicy = { id: 'agentlessPolicyId' } as AgentPolicy; const input = { type: CLOUDBEAT_EKS } as NewPackagePolicyInput; const { result } = renderHook(() => - useSetupTechnology({ input, agentlessPolicy, isEditPage }) + useSetupTechnology({ input, isAgentlessEnabled: true, isEditPage }) ); expect(result.current.isAgentlessAvailable).toBeFalsy(); expect(result.current.setupTechnology).toBe(SetupTechnology.AGENT_BASED); }); - it('sets to AGENT_BASED when agentPolicyId differs from agentlessPolicyId', () => { + it('sets to AGENT_BASED when isAgentlessEnabled is false', () => { const input = { type: CLOUDBEAT_AWS } as NewPackagePolicyInput; - const agentPolicies = [{ id: 'agentPolicyId' } as AgentPolicy]; - const agentlessPolicy = { id: 'agentlessPolicyId' } as AgentPolicy; const { result } = renderHook(() => - useSetupTechnology({ input, agentPolicies, agentlessPolicy, isEditPage }) + useSetupTechnology({ input, isAgentlessEnabled: false, isEditPage }) ); expect(result.current.setupTechnology).toBe(SetupTechnology.AGENT_BASED); }); @@ -113,13 +107,12 @@ describe('useSetupTechnology', () => { expect(result.current.setupTechnology).toBe(SetupTechnology.AGENT_BASED); }); - it('initializes with AGENTLESS technology if the agent policy id is "agentless"', () => { + it('initializes with AGENTLESS technology if isAgentlessEnable is true', () => { const input = { type: CLOUDBEAT_AWS } as NewPackagePolicyInput; - const agentPolicies = [{ id: 'agentless' } as AgentPolicy]; const { result } = renderHook(() => useSetupTechnology({ input, - agentPolicies, + isAgentlessEnabled: true, isEditPage, }) ); diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.ts b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.ts index 20c104fc071c9..77b99d42d6411 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.ts +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.ts @@ -6,20 +6,18 @@ */ import { useEffect, useState } from 'react'; -import { AgentPolicy, NewPackagePolicyInput } from '@kbn/fleet-plugin/common'; +import { NewPackagePolicyInput } from '@kbn/fleet-plugin/common'; import { SetupTechnology } from '@kbn/fleet-plugin/public'; import { CLOUDBEAT_AWS, CLOUDBEAT_GCP, CLOUDBEAT_AZURE } from '../../../../common/constants'; export const useSetupTechnology = ({ input, - agentPolicies, - agentlessPolicy, + isAgentlessEnabled, handleSetupTechnologyChange, isEditPage, }: { input: NewPackagePolicyInput; - agentPolicies?: AgentPolicy[]; - agentlessPolicy?: AgentPolicy; + isAgentlessEnabled?: boolean; handleSetupTechnologyChange?: (value: SetupTechnology) => void; isEditPage: boolean; }) => { @@ -27,11 +25,9 @@ export const useSetupTechnology = ({ const isCspmGcp = input.type === CLOUDBEAT_GCP; const isCspmAzure = input.type === CLOUDBEAT_AZURE; const isAgentlessSupportedForCloudProvider = isCspmAws || isCspmGcp || isCspmAzure; - const isAgentlessAvailable = Boolean(isAgentlessSupportedForCloudProvider && agentlessPolicy); - const agentPolicyIds = (agentPolicies || []).map((policy: AgentPolicy) => policy.id); - const agentlessPolicyId = agentlessPolicy?.id; + const isAgentlessAvailable = isAgentlessSupportedForCloudProvider && isAgentlessEnabled; const [setupTechnology, setSetupTechnology] = useState(() => { - if (isEditPage && agentPolicyIds.includes(SetupTechnology.AGENTLESS)) { + if (isEditPage && isAgentlessAvailable) { return SetupTechnology.AGENTLESS; } @@ -50,26 +46,16 @@ export const useSetupTechnology = ({ return; } - const hasAgentPolicies = agentPolicyIds.length > 0; - const agentlessPolicyIsAbsent = - !agentlessPolicyId || !agentPolicyIds.includes(agentlessPolicyId); - - if (hasAgentPolicies && agentlessPolicyIsAbsent) { - /* - handle case when agent policy is coming from outside, - e.g. from the get param or when coming to integration from a specific agent policy - */ + if (!isAgentlessAvailable) { setSetupTechnology(SetupTechnology.AGENT_BASED); - } else if (isAgentlessAvailable) { + } else { /* preselecting agentless when available and resetting to agent-based when switching to another integration type, which doesn't support agentless */ setSetupTechnology(SetupTechnology.AGENTLESS); - } else { - setSetupTechnology(SetupTechnology.AGENT_BASED); } - }, [agentPolicyIds, agentlessPolicyId, isAgentlessAvailable, isDirty, isEditPage]); + }, [isAgentlessAvailable, isDirty, isEditPage]); useEffect(() => { if (isEditPage) { diff --git a/x-pack/plugins/cloud_security_posture/public/components/no_vulnerabilities_states.tsx b/x-pack/plugins/cloud_security_posture/public/components/no_vulnerabilities_states.tsx index e2d453c078115..a2b1aa1d0d831 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/no_vulnerabilities_states.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/no_vulnerabilities_states.tsx @@ -74,8 +74,11 @@ const CnvmIntegrationNotInstalledEmptyPrompt = ({

    , + }} />

    } diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_container.tsx b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_container.tsx index cfb572116e65c..a12cc5bb353e2 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_container.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_container.tsx @@ -41,7 +41,7 @@ const SubGrouping = ({ setActivePageIndex, } = useLatestFindingsGrouping({ groupPanelRenderer, - groupStatsRenderer, + getGroupStats: groupStatsRenderer, groupingLevel, selectedGroup, groupFilters: parentGroupFilters ? JSON.parse(parentGroupFilters) : [], @@ -76,7 +76,7 @@ const SubGrouping = ({ export const LatestFindingsContainer = () => { const { grouping, isFetching, urlQuery, setUrlQuery, onResetFilters, error, isEmptyResults } = - useLatestFindingsGrouping({ groupPanelRenderer, groupStatsRenderer }); + useLatestFindingsGrouping({ groupPanelRenderer, getGroupStats: groupStatsRenderer }); const renderChildComponent = ({ level, diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_group_renderer.tsx b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_group_renderer.tsx index d40037d156d3f..cd49925798b3a 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_group_renderer.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_group_renderer.tsx @@ -14,14 +14,14 @@ import { useEuiTheme, } from '@elastic/eui'; import { css } from '@emotion/react'; -import { GroupPanelRenderer, RawBucket, StatRenderer } from '@kbn/grouping/src'; +import { GroupPanelRenderer, GroupStatsItem, RawBucket } from '@kbn/grouping/src'; import React from 'react'; import { i18n } from '@kbn/i18n'; import { FINDINGS_GROUPING_OPTIONS } from '../../../common/constants'; import { - NullGroup, - LoadingGroup, firstNonNullValue, + LoadingGroup, + NullGroup, } from '../../../components/cloud_security_grouping'; import { getAbbreviatedNumber } from '../../../common/utils/get_abbreviated_number'; import { CISBenchmarkIcon } from '../../../components/cis_benchmark_icon'; @@ -221,21 +221,17 @@ const ComplianceBar = React.memo(ComplianceBarComponent); export const groupStatsRenderer = ( selectedGroup: string, bucket: RawBucket -): StatRenderer[] => { - const defaultBadges = [ - { - title: i18n.translate('xpack.csp.findings.grouping.stats.badges.findings', { - defaultMessage: 'Findings', - }), - renderer: , - }, - { - title: i18n.translate('xpack.csp.findings.grouping.stats.badges.compliance', { - defaultMessage: 'Compliance', - }), - renderer: , - }, - ]; - - return defaultBadges; -}; +): GroupStatsItem[] => [ + { + title: i18n.translate('xpack.csp.findings.grouping.stats.badges.findings', { + defaultMessage: 'Findings', + }), + component: , + }, + { + title: i18n.translate('xpack.csp.findings.grouping.stats.badges.compliance', { + defaultMessage: 'Compliance', + }), + component: , + }, +]; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_grouping.tsx b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_grouping.tsx index 47f00a9a1927a..0235960207e27 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_grouping.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_grouping.tsx @@ -8,7 +8,7 @@ import { getGroupingQuery } from '@kbn/grouping'; import { GroupingAggregation, GroupPanelRenderer, - GroupStatsRenderer, + GetGroupStats, isNoneGroup, NamedAggregation, parseGroupingQuery, @@ -130,13 +130,13 @@ export const isFindingsRootGroupingAggregation = ( */ export const useLatestFindingsGrouping = ({ groupPanelRenderer, - groupStatsRenderer, + getGroupStats, groupingLevel = 0, groupFilters = [], selectedGroup, }: { groupPanelRenderer?: GroupPanelRenderer; - groupStatsRenderer?: GroupStatsRenderer; + getGroupStats?: GetGroupStats; groupingLevel?: number; groupFilters?: Filter[]; selectedGroup?: string; @@ -165,7 +165,7 @@ export const useLatestFindingsGrouping = ({ getDefaultQuery, unit: FINDINGS_UNIT, groupPanelRenderer, - groupStatsRenderer, + getGroupStats, groupingLocalStorageKey: LOCAL_STORAGE_FINDINGS_GROUPING_KEY, groupingLevel, groupsUnit: MISCONFIGURATIONS_GROUPS_UNIT, diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_table_header.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_table_header.tsx index 5aa8aae1dc590..83745e5f5d113 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_table_header.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_table_header.tsx @@ -333,8 +333,13 @@ const CurrentPageOfTotal = ({
    diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_grouping.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_grouping.tsx index 2e1c93f4218f4..e713a0ad6aad9 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_grouping.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_grouping.tsx @@ -8,7 +8,7 @@ import { getGroupingQuery } from '@kbn/grouping'; import { GroupingAggregation, GroupPanelRenderer, - GroupStatsRenderer, + GetGroupStats, isNoneGroup, NamedAggregation, parseGroupingQuery, @@ -109,13 +109,13 @@ export const isVulnerabilitiesRootGroupingAggregation = ( */ export const useLatestVulnerabilitiesGrouping = ({ groupPanelRenderer, - groupStatsRenderer, + getGroupStats, groupingLevel = 0, groupFilters = [], selectedGroup, }: { groupPanelRenderer?: GroupPanelRenderer; - groupStatsRenderer?: GroupStatsRenderer; + getGroupStats?: GetGroupStats; groupingLevel?: number; groupFilters?: Filter[]; selectedGroup?: string; @@ -144,7 +144,7 @@ export const useLatestVulnerabilitiesGrouping = ({ getDefaultQuery, unit: VULNERABILITIES_UNIT, groupPanelRenderer, - groupStatsRenderer, + getGroupStats, groupingLocalStorageKey: LOCAL_STORAGE_VULNERABILITIES_GROUPING_KEY, groupingLevel, groupsUnit: VULNERABILITIES_GROUPS_UNIT, diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_container.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_container.tsx index 6b2ed7aea04db..c5510ea7deaaf 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_container.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_container.tsx @@ -42,7 +42,7 @@ export const LatestVulnerabilitiesContainer = () => { setActivePageIndex, } = useLatestVulnerabilitiesGrouping({ groupPanelRenderer, - groupStatsRenderer, + getGroupStats: groupStatsRenderer, groupingLevel, selectedGroup, groupFilters: parentGroupFilters ? JSON.parse(parentGroupFilters) : [], @@ -138,7 +138,7 @@ export const LatestVulnerabilitiesContainer = () => { }; const { grouping, isFetching, urlQuery, setUrlQuery, onResetFilters, error, isEmptyResults } = - useLatestVulnerabilitiesGrouping({ groupPanelRenderer, groupStatsRenderer }); + useLatestVulnerabilitiesGrouping({ groupPanelRenderer, getGroupStats: groupStatsRenderer }); if (error || isEmptyResults) { return ( diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_group_renderer.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_group_renderer.tsx index 489c8ac0990f8..51dc1e9009502 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_group_renderer.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_group_renderer.tsx @@ -14,7 +14,7 @@ import { useEuiTheme, } from '@elastic/eui'; import { css } from '@emotion/react'; -import { GroupPanelRenderer, RawBucket, StatRenderer } from '@kbn/grouping/src'; +import { GroupPanelRenderer, GroupStatsItem, RawBucket } from '@kbn/grouping/src'; import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { getCloudProviderNameFromAbbreviation } from '../../../common/utils/helpers'; @@ -195,17 +195,13 @@ const SeverityStats = React.memo(SeverityStatsComponent); export const groupStatsRenderer = ( selectedGroup: string, bucket: RawBucket -): StatRenderer[] => { - const defaultBadges = [ - { - title: VULNERABILITIES, - renderer: , - }, - { - title: '', - renderer: , - }, - ]; - - return defaultBadges; -}; +): GroupStatsItem[] => [ + { + title: VULNERABILITIES, + component: , + }, + { + title: '', + component: , + }, +]; diff --git a/x-pack/plugins/data_quality/common/index.ts b/x-pack/plugins/data_quality/common/index.ts index 79bbe59ff35d2..1b174a9efe524 100644 --- a/x-pack/plugins/data_quality/common/index.ts +++ b/x-pack/plugins/data_quality/common/index.ts @@ -13,6 +13,3 @@ export const PLUGIN_NAME = i18n.translate('xpack.dataQuality.name', { }); export { DATA_QUALITY_URL_STATE_KEY, datasetQualityUrlSchemaV1 } from './url_schema'; - -export { DATA_QUALITY_LOCATOR_ID } from './locators'; -export type { DataQualityLocatorParams } from './locators'; diff --git a/x-pack/plugins/data_quality/common/locators/construct_dataset_quality_locator_path.ts b/x-pack/plugins/data_quality/common/locators/construct_dataset_quality_locator_path.ts index 45f58752bd2fc..f5b5b0bf7ce59 100644 --- a/x-pack/plugins/data_quality/common/locators/construct_dataset_quality_locator_path.ts +++ b/x-pack/plugins/data_quality/common/locators/construct_dataset_quality_locator_path.ts @@ -8,9 +8,9 @@ import { setStateToKbnUrl } from '@kbn/kibana-utils-plugin/common'; import { ManagementAppLocatorParams } from '@kbn/management-plugin/common/locator'; import { LocatorPublic } from '@kbn/share-plugin/common'; +import { DataQualityLocatorParams } from '@kbn/deeplinks-observability'; import { datasetQualityUrlSchemaV1, DATA_QUALITY_URL_STATE_KEY } from '../url_schema'; import { deepCompactObject } from '../utils/deep_compact_object'; -import { DataQualityLocatorParams } from './types'; interface LocatorPathConstructionParams { locatorParams: DataQualityLocatorParams; @@ -20,7 +20,7 @@ interface LocatorPathConstructionParams { export const constructDatasetQualityLocatorPath = async (params: LocatorPathConstructionParams) => { const { - locatorParams: { filters }, + locatorParams: { filters, flyout }, useHash, managementLocator, } = params; @@ -29,6 +29,7 @@ export const constructDatasetQualityLocatorPath = async (params: LocatorPathCons deepCompactObject({ v: 1, filters, + flyout, }) ); diff --git a/x-pack/plugins/data_quality/common/locators/dataset_quality_locator.ts b/x-pack/plugins/data_quality/common/locators/dataset_quality_locator.ts index 70e4770090ef3..4bf804955b6bc 100644 --- a/x-pack/plugins/data_quality/common/locators/dataset_quality_locator.ts +++ b/x-pack/plugins/data_quality/common/locators/dataset_quality_locator.ts @@ -6,11 +6,8 @@ */ import type { LocatorDefinition, LocatorPublic } from '@kbn/share-plugin/public'; -import { - DataQualityLocatorDependencies, - DataQualityLocatorParams, - DATA_QUALITY_LOCATOR_ID, -} from './types'; +import { DataQualityLocatorParams, DATA_QUALITY_LOCATOR_ID } from '@kbn/deeplinks-observability'; +import { DataQualityLocatorDependencies } from './types'; import { constructDatasetQualityLocatorPath } from './construct_dataset_quality_locator_path'; export type DatasetQualityLocator = LocatorPublic; diff --git a/x-pack/plugins/data_quality/common/locators/types.ts b/x-pack/plugins/data_quality/common/locators/types.ts index 57067cd0e482a..786b5e1cf567f 100644 --- a/x-pack/plugins/data_quality/common/locators/types.ts +++ b/x-pack/plugins/data_quality/common/locators/types.ts @@ -7,31 +7,6 @@ import { ManagementAppLocatorParams } from '@kbn/management-plugin/common/locator'; import { LocatorPublic } from '@kbn/share-plugin/common'; -import { SerializableRecord } from '@kbn/utility-types'; - -export const DATA_QUALITY_LOCATOR_ID = 'DATA_QUALITY_LOCATOR'; - -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -type RefreshInterval = { - pause: boolean; - value: number; -}; - -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -type TimeRangeConfig = { - from: string; - to: string; - refresh: RefreshInterval; -}; - -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -type Filters = { - timeRange: TimeRangeConfig; -}; - -export interface DataQualityLocatorParams extends SerializableRecord { - filters?: Filters; -} export interface DataQualityLocatorDependencies { useHash: boolean; diff --git a/x-pack/plugins/data_quality/common/url_schema/url_schema_v1.ts b/x-pack/plugins/data_quality/common/url_schema/url_schema_v1.ts index 6fd5781a217e8..076e1b641b7e2 100644 --- a/x-pack/plugins/data_quality/common/url_schema/url_schema_v1.ts +++ b/x-pack/plugins/data_quality/common/url_schema/url_schema_v1.ts @@ -37,11 +37,11 @@ const datasetRT = rt.intersection([ type: rt.string, name: rt.string, namespace: rt.string, - title: rt.string, }), rt.exact( rt.partial({ integration: integrationRT, + title: rt.string, }) ), ]); diff --git a/x-pack/plugins/data_quality/tsconfig.json b/x-pack/plugins/data_quality/tsconfig.json index 7a904e9f95cda..911c4fbfff557 100644 --- a/x-pack/plugins/data_quality/tsconfig.json +++ b/x-pack/plugins/data_quality/tsconfig.json @@ -25,8 +25,8 @@ "@kbn/core-chrome-browser", "@kbn/features-plugin", "@kbn/share-plugin", - "@kbn/utility-types", "@kbn/deeplinks-management", + "@kbn/deeplinks-observability", "@kbn/ebt-tools", ], "exclude": ["target/**/*"] diff --git a/x-pack/plugins/data_visualizer/kibana.jsonc b/x-pack/plugins/data_visualizer/kibana.jsonc index 1ad88eaea4cb4..84fc98d3fb22f 100644 --- a/x-pack/plugins/data_visualizer/kibana.jsonc +++ b/x-pack/plugins/data_visualizer/kibana.jsonc @@ -37,7 +37,7 @@ "fieldFormats", "uiActions", "lens", - "textBasedLanguages", + "esql", "visualizations" ] } diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_esql.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_esql.tsx index 4ffe604c3d352..fd65ed3c7dfa6 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_esql.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_esql.tsx @@ -12,7 +12,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { usePageUrlState } from '@kbn/ml-url-state'; import { FullTimeRangeSelector, DatePickerWrapper } from '@kbn/ml-date-picker'; -import { TextBasedLangEditor } from '@kbn/text-based-languages/public'; +import { TextBasedLangEditor } from '@kbn/esql/public'; import type { AggregateQuery } from '@kbn/es-query'; import { diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/field_stats/field_stats_esql_editor.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/field_stats/field_stats_esql_editor.tsx index bdaee8c1a5ae1..a015d975fdf18 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/field_stats/field_stats_esql_editor.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/field_stats/field_stats_esql_editor.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React, { useRef, useState, useCallback } from 'react'; -import { TextBasedLangEditor } from '@kbn/text-based-languages/public'; +import { TextBasedLangEditor } from '@kbn/esql/public'; import { EuiFlexItem } from '@elastic/eui'; import type { AggregateQuery } from '@kbn/es-query'; diff --git a/x-pack/plugins/data_visualizer/tsconfig.json b/x-pack/plugins/data_visualizer/tsconfig.json index 9616783094354..ed8a3540f6d8a 100644 --- a/x-pack/plugins/data_visualizer/tsconfig.json +++ b/x-pack/plugins/data_visualizer/tsconfig.json @@ -68,7 +68,7 @@ "@kbn/security-plugin", "@kbn/share-plugin", "@kbn/test-jest-helpers", - "@kbn/text-based-languages", + "@kbn/esql", "@kbn/ui-actions-plugin", "@kbn/ui-theme", "@kbn/unified-search-plugin", diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/index.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/index.ts index 680ab17672f61..0360f93b15ee6 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/index.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/index.ts @@ -260,7 +260,7 @@ export class AIAssistantKnowledgeBaseDataClient extends AIAssistantDataClient { }) : undefined; this.options.logger.debug(`created: ${created?.data.hits.hits.length ?? '0'}`); - this.options.logger.debug(`errors: ${JSON.stringify(errors, null, 2)}`); + this.options.logger.debug(() => `errors: ${JSON.stringify(errors, null, 2)}`); return created?.data ? transformESSearchToKnowledgeBaseEntry(created?.data) : []; }; @@ -314,12 +314,14 @@ export class AIAssistantKnowledgeBaseDataClient extends AIAssistantDataClient { ); this.options.logger.debug( - `getKnowledgeBaseDocuments() - Similarity Search Query:\n ${JSON.stringify( - vectorSearchQuery - )}` + () => + `getKnowledgeBaseDocuments() - Similarity Search Query:\n ${JSON.stringify( + vectorSearchQuery + )}` ); this.options.logger.debug( - `getKnowledgeBaseDocuments() - Similarity Search Results:\n ${JSON.stringify(results)}` + () => + `getKnowledgeBaseDocuments() - Similarity Search Results:\n ${JSON.stringify(results)}` ); return results; @@ -347,7 +349,7 @@ export class AIAssistantKnowledgeBaseDataClient extends AIAssistantDataClient { } this.options.logger.debug( - `Creating Knowledge Base Entry:\n ${JSON.stringify(knowledgeBaseEntry, null, 2)}` + () => `Creating Knowledge Base Entry:\n ${JSON.stringify(knowledgeBaseEntry, null, 2)}` ); this.options.logger.debug(`kbIndex: ${this.indexTemplateAndPattern.alias}`); const esClient = await this.options.elasticsearchClientPromise; diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/elasticsearch_store/elasticsearch_store.ts b/x-pack/plugins/elastic_assistant/server/lib/langchain/elasticsearch_store/elasticsearch_store.ts index e076c90526a53..5398abcb8a78e 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/langchain/elasticsearch_store/elasticsearch_store.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/langchain/elasticsearch_store/elasticsearch_store.ts @@ -127,7 +127,7 @@ export class ElasticsearchStore extends VectorStore { try { const response = await this.esClient.bulk({ refresh: true, operations }); - this.logger.debug(`Add Documents Response:\n ${JSON.stringify(response)}`); + this.logger.debug(() => `Add Documents Response:\n ${JSON.stringify(response)}`); const errorIds = response.items.filter((i) => i.index?.error != null); operations.forEach((op, i) => { @@ -268,11 +268,12 @@ export class ElasticsearchStore extends VectorStore { }); this.logger.debug( - `Similarity search metadata source:\n${JSON.stringify( - results.map((r) => r?.metadata?.source ?? '(missing metadata.source)'), - null, - 2 - )}` + () => + `Similarity search metadata source:\n${JSON.stringify( + results.map((r) => r?.metadata?.source ?? '(missing metadata.source)'), + null, + 2 + )}` ); return results; diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/execute_custom_llm_chain/index.ts b/x-pack/plugins/elastic_assistant/server/lib/langchain/execute_custom_llm_chain/index.ts index b6a624b368d82..cd1a032406326 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/langchain/execute_custom_llm_chain/index.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/langchain/execute_custom_llm_chain/index.ts @@ -18,12 +18,12 @@ import { ActionsClientSimpleChatModel, } from '@kbn/langchain/server'; import { MessagesPlaceholder } from '@langchain/core/prompts'; +import { APMTracer } from '@kbn/langchain/server/tracers/apm'; +import { withAssistantSpan } from '../tracers/apm/with_assistant_span'; import { EsAnonymizationFieldsSchema } from '../../../ai_assistant_data_clients/anonymization_fields/types'; import { transformESSearchToAnonymizationFields } from '../../../ai_assistant_data_clients/anonymization_fields/helpers'; import { AgentExecutor } from '../executors/types'; -import { APMTracer } from '../tracers/apm_tracer'; import { AssistantToolParams } from '../../../types'; -import { withAssistantSpan } from '../tracers/with_assistant_span'; export const DEFAULT_AGENT_EXECUTOR_ID = 'Elastic AI Assistant Agent Executor'; /** @@ -119,7 +119,9 @@ export const callAgentExecutor: AgentExecutor = async ({ (tool) => tool.getTool(assistantToolParams) ?? [] ); - logger.debug(`applicable tools: ${JSON.stringify(tools.map((t) => t.name).join(', '), null, 2)}`); + logger.debug( + () => `applicable tools: ${JSON.stringify(tools.map((t) => t.name).join(', '), null, 2)}` + ); const executorArgs = { memory, diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/executors/openai_functions_executor.ts b/x-pack/plugins/elastic_assistant/server/lib/langchain/executors/openai_functions_executor.ts index 6aa1aa3ce7890..edea22a888dff 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/langchain/executors/openai_functions_executor.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/langchain/executors/openai_functions_executor.ts @@ -11,9 +11,9 @@ import { BufferMemory, ChatMessageHistory } from 'langchain/memory'; import { ChainTool } from 'langchain/tools/chain'; import { ActionsClientLlm } from '@kbn/langchain/server'; +import { APMTracer } from '@kbn/langchain/server/tracers/apm'; +import { withAssistantSpan } from '../tracers/apm/with_assistant_span'; import { AgentExecutor } from './types'; -import { withAssistantSpan } from '../tracers/with_assistant_span'; -import { APMTracer } from '../tracers/apm_tracer'; export const OPEN_AI_FUNCTIONS_AGENT_EXECUTOR_ID = 'Elastic AI Assistant Agent Executor (OpenAI Functions)'; diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/helpers.ts b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/helpers.ts index 482c89c10e969..fe46a5deae9fe 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/helpers.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/helpers.ts @@ -11,11 +11,11 @@ import { streamFactory, StreamResponseWithHeaders } from '@kbn/ml-response-strea import { transformError } from '@kbn/securitysolution-es-utils'; import type { KibanaRequest } from '@kbn/core-http-server'; import type { ExecuteConnectorRequestBody, TraceData } from '@kbn/elastic-assistant-common'; +import { APMTracer } from '@kbn/langchain/server/tracers/apm'; +import { withAssistantSpan } from '../../tracers/apm/with_assistant_span'; import { AGENT_NODE_TAG } from './nodes/run_agent'; import { DEFAULT_ASSISTANT_GRAPH_ID, DefaultAssistantGraph } from './graph'; import type { OnLlmResponse, TraceOptions } from '../../executors/types'; -import type { APMTracer } from '../../tracers/apm_tracer'; -import { withAssistantSpan } from '../../tracers/with_assistant_span'; interface StreamGraphParams { apmTracer: APMTracer; diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.ts b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.ts index 517ac10479461..87437a98898d4 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/index.ts @@ -13,11 +13,11 @@ import { ActionsClientSimpleChatModel, } from '@kbn/langchain/server'; import { createOpenAIFunctionsAgent, createStructuredChatAgent } from 'langchain/agents'; +import { APMTracer } from '@kbn/langchain/server/tracers/apm'; import { EsAnonymizationFieldsSchema } from '../../../../ai_assistant_data_clients/anonymization_fields/types'; import { AssistantToolParams } from '../../../../types'; import { AgentExecutor } from '../../executors/types'; import { openAIFunctionAgentPrompt, structuredChatAgentPrompt } from './prompts'; -import { APMTracer } from '../../tracers/apm_tracer'; import { getDefaultAssistantGraph } from './graph'; import { invokeGraph, streamGraph } from './helpers'; import { transformESSearchToAnonymizationFields } from '../../../../ai_assistant_data_clients/anonymization_fields/helpers'; diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/execute_tools.ts b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/execute_tools.ts index b42455e14f6f1..ae33faee3e227 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/execute_tools.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/execute_tools.ts @@ -30,7 +30,7 @@ export const TOOLS_NODE = 'tools'; * @param tools - The tools available to execute */ export const executeTools = async ({ config, logger, state, tools }: ExecuteToolsParams) => { - logger.debug(`Node state:\n${JSON.stringify(state, null, 2)}`); + logger.debug(() => `Node state:\n${JSON.stringify(state, null, 2)}`); const toolExecutor = new ToolExecutor({ tools }); const agentAction = state.agentOutcome; diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/generate_chat_title.ts b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/generate_chat_title.ts index d1d60e9bed9b4..105b625cd5f36 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/generate_chat_title.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/generate_chat_title.ts @@ -35,7 +35,7 @@ export const generateChatTitle = async ({ model, state, }: GenerateChatTitleParams) => { - logger.debug(`Node state:\n ${JSON.stringify(state, null, 2)}`); + logger.debug(() => `Node state:\n ${JSON.stringify(state, null, 2)}`); if (state.messages.length !== 0) { logger.debug('No need to generate chat title, messages already exist'); diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/run_agent.ts b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/run_agent.ts index 0a6ee3b79087c..aeca4dca21ea6 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/run_agent.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/run_agent.ts @@ -38,7 +38,7 @@ export const runAgent = async ({ logger, state, }: RunAgentParams) => { - logger.debug(`Node state:\n${JSON.stringify(state, null, 2)}`); + logger.debug(() => `Node state:\n${JSON.stringify(state, null, 2)}`); const knowledgeHistory = await dataClients?.kbDataClient?.getKnowledgeBaseDocuments({ kbResource: 'user', diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/should_continue.ts b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/should_continue.ts index 046c4a86d4c7a..57fcb5510318b 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/should_continue.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/nodes/should_continue.ts @@ -19,7 +19,7 @@ export interface ShouldContinueParams extends NodeParamsBase { * @param state - The current state of the graph */ export const shouldContinue = ({ logger, state }: ShouldContinueParams) => { - logger.debug(`Node state:\n${JSON.stringify(state, null, 2)}`); + logger.debug(() => `Node state:\n${JSON.stringify(state, null, 2)}`); if (state.agentOutcome && 'returnValues' in state.agentOutcome) { return 'end'; diff --git a/x-pack/plugins/elastic_assistant/server/lib/langchain/tracers/with_assistant_span.ts b/x-pack/plugins/elastic_assistant/server/lib/langchain/tracers/apm/with_assistant_span.ts similarity index 100% rename from x-pack/plugins/elastic_assistant/server/lib/langchain/tracers/with_assistant_span.ts rename to x-pack/plugins/elastic_assistant/server/lib/langchain/tracers/apm/with_assistant_span.ts diff --git a/x-pack/plugins/elastic_assistant/server/lib/model_evaluator/evaluation.ts b/x-pack/plugins/elastic_assistant/server/lib/model_evaluator/evaluation.ts index d6fb04f2a13dc..93f164835876a 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/model_evaluator/evaluation.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/model_evaluator/evaluation.ts @@ -15,9 +15,10 @@ import { ToolingLog } from '@kbn/tooling-log'; import { LangChainTracer } from '@langchain/core/tracers/tracer_langchain'; import { RunCollectorCallbackHandler } from '@langchain/core/tracers/run_collector'; import { Dataset } from '@kbn/elastic-assistant-common'; +import { isLangSmithEnabled } from '@kbn/langchain/server/tracers/langsmith'; import { AgentExecutorEvaluatorWithMetadata } from '../langchain/executors/types'; import { callAgentWithRetry, getMessageFromLangChainResponse } from './utils'; -import { isLangSmithEnabled, writeLangSmithFeedback } from '../../routes/evaluate/utils'; +import { writeLangSmithFeedback } from '../../routes/evaluate/utils'; import { ResponseBody } from '../langchain/types'; export interface PerformEvaluationParams { diff --git a/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/helpers.ts b/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/helpers.ts index 5f5eb8d0d8659..1de3b86e74deb 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/helpers.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/helpers.ts @@ -28,7 +28,7 @@ import type { ActionsClient } from '@kbn/actions-plugin/server'; import moment from 'moment/moment'; import { uniq } from 'lodash/fp'; import { PublicMethodsOf } from '@kbn/utility-types'; -import { getLangSmithTracer } from '../evaluate/utils'; +import { getLangSmithTracer } from '@kbn/langchain/server/tracers/langsmith'; import { getLlmType } from '../utils'; import type { GetRegisteredTools } from '../../services/app_context'; import { diff --git a/x-pack/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts b/x-pack/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts index 990417b799234..79b601ed01073 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts @@ -18,6 +18,7 @@ import { ExecuteConnectorRequestBody, } from '@kbn/elastic-assistant-common'; import { ActionsClientLlm } from '@kbn/langchain/server'; +import { getLangSmithTracer } from '@kbn/langchain/server/tracers/langsmith'; import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/schemas/common'; import { ESQL_RESOURCE, KNOWLEDGE_BASE_INDEX_PATTERN } from '../knowledge_base/constants'; import { buildResponse } from '../../lib/build_response'; @@ -29,7 +30,7 @@ import { indexEvaluations, setupEvaluationIndex, } from '../../lib/model_evaluator/output_index/utils'; -import { fetchLangSmithDataset, getConnectorName, getLangSmithTracer } from './utils'; +import { fetchLangSmithDataset, getConnectorName } from './utils'; import { DEFAULT_PLUGIN_NAME, getPluginNameFromRequest } from '../helpers'; /** diff --git a/x-pack/plugins/elastic_assistant/server/routes/evaluate/utils.ts b/x-pack/plugins/elastic_assistant/server/routes/evaluate/utils.ts index 17757b8778771..46909805510e2 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/evaluate/utils.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/evaluate/utils.ts @@ -10,8 +10,8 @@ import type { ActionResult } from '@kbn/actions-plugin/server'; import type { Logger } from '@kbn/core/server'; import type { Run } from 'langsmith/schemas'; import { ToolingLog } from '@kbn/tooling-log'; -import { LangChainTracer } from '@langchain/core/tracers/tracer_langchain'; import { Dataset } from '@kbn/elastic-assistant-common'; +import { isLangSmithEnabled } from '@kbn/langchain/server/tracers/langsmith'; /** * Return connector name for the given connectorId/connectors @@ -97,56 +97,3 @@ export const writeLangSmithFeedback = async ( return ''; } }; - -/** - * Returns a custom LangChainTracer which adds the `exampleId` so Dataset 'Test' runs are written to LangSmith - * If `exampleId` is present (and a corresponding example exists in LangSmith) trace is written to the Dataset's `Tests` - * section, otherwise it is written to the `Project` provided - * - * @param apiKey API Key for LangSmith (will fetch from env vars if not provided) - * @param projectName Name of project to trace results to - * @param exampleId Dataset exampleId to associate trace with - * @param logger - */ -export const getLangSmithTracer = ({ - apiKey, - projectName, - exampleId, - logger, -}: { - apiKey?: string; - projectName?: string; - exampleId?: string; - logger: Logger | ToolingLog; -}): LangChainTracer[] => { - try { - if (!isLangSmithEnabled() && apiKey == null) { - return []; - } - const lcTracer = new LangChainTracer({ - projectName, // Shows as the 'test' run's 'name' in langsmith ui - exampleId, - client: new Client({ apiKey }), - }); - - return [lcTracer]; - } catch (e) { - // Note: creating a tracer can fail if the LangSmith env vars are not set correctly - logger.error(`Error creating LangSmith tracer: ${e.message}`); - } - - return []; -}; - -/** - * Returns true if LangSmith/tracing is enabled - */ -export const isLangSmithEnabled = (): boolean => { - try { - // Just checking if apiKey is available, if better way to check for enabled that is not env var please update - const config = Client.getDefaultClientConfig(); - return config.apiKey != null; - } catch (e) { - return false; - } -}; diff --git a/x-pack/plugins/elastic_assistant/server/routes/helpers.ts b/x-pack/plugins/elastic_assistant/server/routes/helpers.ts index aa060e24bc5df..a8fe0d0c25d68 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/helpers.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/helpers.ts @@ -27,6 +27,7 @@ import { i18n } from '@kbn/i18n'; import { AwaitedProperties, PublicMethodsOf } from '@kbn/utility-types'; import { ActionsClient } from '@kbn/actions-plugin/server'; import { AssistantFeatureKey } from '@kbn/elastic-assistant-common/impl/capabilities'; +import { getLangSmithTracer } from '@kbn/langchain/server/tracers/langsmith'; import { MINIMUM_AI_ASSISTANT_LICENSE } from '../../common/constants'; import { ESQL_RESOURCE, KNOWLEDGE_BASE_INDEX_PATTERN } from './knowledge_base/constants'; import { callAgentExecutor } from '../lib/langchain/execute_custom_llm_chain'; @@ -39,7 +40,6 @@ import { import { executeAction, StaticResponse } from '../lib/executor'; import { getLangChainMessages } from '../lib/langchain/helpers'; -import { getLangSmithTracer } from './evaluate/utils'; import { ElasticsearchStore } from '../lib/langchain/elasticsearch_store/elasticsearch_store'; import { AIAssistantConversationsDataClient } from '../ai_assistant_data_clients/conversations'; import { INVOKE_ASSISTANT_SUCCESS_EVENT } from '../lib/telemetry/event_based_telemetry'; diff --git a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts index dbd9d83bae3ac..f5fd6305c8b4b 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts @@ -144,7 +144,8 @@ export const bulkActionKnowledgeBaseEntriesRoute = (router: ElasticAssistantPlug } logger.debug( - `Performing bulk action on Knowledge Base Entries:\n${JSON.stringify(request.body)}` + () => + `Performing bulk action on Knowledge Base Entries:\n${JSON.stringify(request.body)}` ); const { body } = request; diff --git a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts index b93ab4e894c8b..2d7bdb93ad2e1 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts @@ -60,7 +60,7 @@ export const createKnowledgeBaseEntryRoute = (router: ElasticAssistantPluginRout return checkResponse; } - logger.debug(`Creating KB Entry:\n${JSON.stringify(request.body)}`); + logger.debug(() => `Creating KB Entry:\n${JSON.stringify(request.body)}`); const documents: Array> = [ { metadata: request.body.metadata, diff --git a/x-pack/plugins/elastic_assistant/server/services/app_context.ts b/x-pack/plugins/elastic_assistant/server/services/app_context.ts index cb425540635d9..6648b12ddb02e 100644 --- a/x-pack/plugins/elastic_assistant/server/services/app_context.ts +++ b/x-pack/plugins/elastic_assistant/server/services/app_context.ts @@ -80,9 +80,10 @@ class AppContextService { this.logger?.debug('AppContextService:registerFeatures'); this.logger?.debug(`pluginName: ${pluginName}`); this.logger?.debug( - `features: ${Object.entries(features) - .map(([feature, enabled]) => `${feature}:${enabled}`) - .join(', ')}` + () => + `features: ${Object.entries(features) + .map(([feature, enabled]) => `${feature}:${enabled}`) + .join(', ')}` ); if (!this.registeredFeatures.has(pluginName)) { @@ -107,9 +108,10 @@ class AppContextService { this.logger?.debug('AppContextService:getRegisteredFeatures'); this.logger?.debug(`pluginName: ${pluginName}`); this.logger?.debug( - `features: ${Object.entries(features) - .map(([feature, enabled]) => `${feature}:${enabled}`) - .join(', ')}` + () => + `features: ${Object.entries(features) + .map(([feature, enabled]) => `${feature}:${enabled}`) + .join(', ')}` ); return features; diff --git a/x-pack/plugins/elastic_assistant/tsconfig.json b/x-pack/plugins/elastic_assistant/tsconfig.json index 8f546d6e5fe01..a2d0ec6c1d68a 100644 --- a/x-pack/plugins/elastic_assistant/tsconfig.json +++ b/x-pack/plugins/elastic_assistant/tsconfig.json @@ -27,7 +27,6 @@ "@kbn/core-elasticsearch-server", "@kbn/logging", "@kbn/ml-plugin", - "@kbn/apm-utils", "@kbn/elastic-assistant-common", "@kbn/core-http-router-server-mocks", "@kbn/data-stream-adapter", @@ -46,6 +45,7 @@ "@kbn/langchain", "@kbn/stack-connectors-plugin", "@kbn/security-plugin", + "@kbn/apm-utils", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/encrypted_saved_objects/server/crypto/encrypted_saved_objects_service.ts b/x-pack/plugins/encrypted_saved_objects/server/crypto/encrypted_saved_objects_service.ts index 7e4f28bbd2093..44072a0828d48 100644 --- a/x-pack/plugins/encrypted_saved_objects/server/crypto/encrypted_saved_objects_service.ts +++ b/x-pack/plugins/encrypted_saved_objects/server/crypto/encrypted_saved_objects_service.ts @@ -308,11 +308,12 @@ export class EncryptedSavedObjectsService { const encryptedAttributesKeys = Object.keys(encryptedAttributes); if (encryptedAttributesKeys.length !== typeDefinition.attributesToEncrypt.size) { this.options.logger.debug( - `The following attributes of saved object "${descriptorToArray( - descriptor - )}" should have been encrypted: ${Array.from( - typeDefinition.attributesToEncrypt - )}, but found only: ${encryptedAttributesKeys}` + () => + `The following attributes of saved object "${descriptorToArray( + descriptor + )}" should have been encrypted: ${Array.from( + typeDefinition.attributesToEncrypt + )}, but found only: ${encryptedAttributesKeys}` ); } @@ -569,11 +570,12 @@ export class EncryptedSavedObjectsService { const decryptedAttributesKeys = Object.keys(decryptedAttributes); if (decryptedAttributesKeys.length !== typeDefinition.attributesToEncrypt.size) { this.options.logger.debug( - `The following attributes of saved object "${descriptorToArray( - descriptor - )}" should have been decrypted: ${Array.from( - typeDefinition.attributesToEncrypt - )}, but found only: ${decryptedAttributesKeys}` + () => + `The following attributes of saved object "${descriptorToArray( + descriptor + )}" should have been decrypted: ${Array.from( + typeDefinition.attributesToEncrypt + )}, but found only: ${decryptedAttributesKeys}` ); } @@ -605,9 +607,10 @@ export class EncryptedSavedObjectsService { if (Object.keys(attributesAAD).length === 0) { this.options.logger.debug( - `The AAD for saved object "${descriptorToArray( - descriptor - )}" does not include any attributes.` + () => + `The AAD for saved object "${descriptorToArray( + descriptor + )}" does not include any attributes.` ); } diff --git a/x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.ts b/x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.ts index c18c7a46c54c4..d8fa12a3e4973 100644 --- a/x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.ts +++ b/x-pack/plugins/encrypted_saved_objects/server/crypto/encryption_key_rotation_service.ts @@ -14,7 +14,7 @@ import type { StartServicesAccessor, } from '@kbn/core/server'; import { ENCRYPTION_EXTENSION_ID } from '@kbn/core-saved-objects-server'; -import type { AuthenticatedUser, SecurityPluginSetup } from '@kbn/security-plugin/server'; +import type { AuthenticatedUser } from '@kbn/core-security-common'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { EncryptedSavedObjectsService } from './encrypted_saved_objects_service'; @@ -25,7 +25,6 @@ interface EncryptionKeyRotationServiceOptions { logger: Logger; service: PublicMethodsOf; getStartServices: StartServicesAccessor; - security?: SecurityPluginSetup; } interface EncryptionKeyRotationParams { @@ -69,7 +68,7 @@ export class EncryptionKeyRotationService { request: KibanaRequest, { batchSize, type }: EncryptionKeyRotationParams ): Promise { - const [{ savedObjects }] = await this.options.getStartServices(); + const [{ security, savedObjects }] = await this.options.getStartServices(); const typeRegistry = savedObjects.getTypeRegistry(); // We need to retrieve all SavedObject types which have encrypted attributes, specifically @@ -105,7 +104,7 @@ export class EncryptionKeyRotationService { // don't want to have Encrypted Saved Objects wrapper so that it doesn't strip encrypted // attributes. But for the update we want to have it so that it automatically re-encrypts // attributes with the new primary encryption key. - const user = this.options.security?.authc.getCurrentUser(request) ?? undefined; + const user = security.authc.getCurrentUser(request) ?? undefined; const retrieveClient = savedObjects.getScopedClient(request, { includedHiddenTypes: registeredHiddenSavedObjectTypes, excludedExtensions: [ENCRYPTION_EXTENSION_ID], diff --git a/x-pack/plugins/encrypted_saved_objects/server/plugin.ts b/x-pack/plugins/encrypted_saved_objects/server/plugin.ts index ba69b00ecb4e1..50514bc619978 100644 --- a/x-pack/plugins/encrypted_saved_objects/server/plugin.ts +++ b/x-pack/plugins/encrypted_saved_objects/server/plugin.ts @@ -60,7 +60,7 @@ export class EncryptedSavedObjectsPlugin this.logger = this.initializerContext.logger.get(); } - public setup(core: CoreSetup, deps: PluginsSetup): EncryptedSavedObjectsPluginSetup { + public setup(core: CoreSetup, _deps: PluginsSetup): EncryptedSavedObjectsPluginSetup { const config = this.initializerContext.config.get(); const canEncrypt = config.encryptionKey !== undefined; if (!canEncrypt) { @@ -95,7 +95,6 @@ export class EncryptedSavedObjectsPlugin this.savedObjectsSetup = setupSavedObjects({ service, savedObjects: core.savedObjects, - security: deps.security, getStartServices: core.getStartServices, }); @@ -110,7 +109,6 @@ export class EncryptedSavedObjectsPlugin logger: this.logger.get('key-rotation-service'), service, getStartServices: core.getStartServices, - security: deps.security, }) ), config, diff --git a/x-pack/plugins/encrypted_saved_objects/server/routes/key_rotation.test.ts b/x-pack/plugins/encrypted_saved_objects/server/routes/key_rotation.test.ts index edcf522987115..83d56a133ea16 100644 --- a/x-pack/plugins/encrypted_saved_objects/server/routes/key_rotation.test.ts +++ b/x-pack/plugins/encrypted_saved_objects/server/routes/key_rotation.test.ts @@ -43,7 +43,10 @@ describe('Key rotation routes', () => { }); it('correctly defines route.', () => { - expect(routeConfig.options).toEqual({ tags: ['access:rotateEncryptionKey'] }); + expect(routeConfig.options).toEqual({ + tags: ['access:rotateEncryptionKey', 'oas-tag:saved objects'], + description: `Rotate a key for encrypted saved objects`, + }); expect(routeConfig.validate).toEqual({ body: undefined, query: expect.any(Type), diff --git a/x-pack/plugins/encrypted_saved_objects/server/routes/key_rotation.ts b/x-pack/plugins/encrypted_saved_objects/server/routes/key_rotation.ts index 9305446767e9d..c9c452cf9a031 100644 --- a/x-pack/plugins/encrypted_saved_objects/server/routes/key_rotation.ts +++ b/x-pack/plugins/encrypted_saved_objects/server/routes/key_rotation.ts @@ -39,7 +39,8 @@ export function defineKeyRotationRoutes({ }), }, options: { - tags: ['access:rotateEncryptionKey'], + tags: ['access:rotateEncryptionKey', 'oas-tag:saved objects'], + description: `Rotate a key for encrypted saved objects`, }, }, async (context, request, response) => { diff --git a/x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.test.ts b/x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.test.ts index dc7cb2a9e52d5..bd8f21d1c8bf9 100644 --- a/x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.test.ts +++ b/x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.test.ts @@ -15,7 +15,7 @@ import { savedObjectsRepositoryMock, savedObjectsTypeRegistryMock, } from '@kbn/core/server/mocks'; -import { securityMock } from '@kbn/security-plugin/server/mocks'; +import { nextTick } from '@kbn/test-jest-helpers'; import type { ClientInstanciator } from '.'; import { setupSavedObjects } from '.'; @@ -47,14 +47,14 @@ describe('#setupSavedObjects', () => { setupContract = setupSavedObjects({ service: mockEncryptedSavedObjectsService, savedObjects: coreSetupMock.savedObjects, - security: securityMock.createSetup(), getStartServices: coreSetupMock.getStartServices, }); }); describe('#setupContract', () => { it('includes hiddenTypes when specified', async () => { - await setupContract({ includedHiddenTypes: ['hiddenType'] }); + setupContract({ includedHiddenTypes: ['hiddenType'] }); + await nextTick(); expect(coreStartMock.savedObjects.createInternalRepository).toHaveBeenCalledWith([ 'hiddenType', ]); diff --git a/x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.ts b/x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.ts index 6c7b9ef5513ac..3fbfec79b1528 100644 --- a/x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.ts +++ b/x-pack/plugins/encrypted_saved_objects/server/saved_objects/index.ts @@ -18,7 +18,6 @@ import type { SavedObjectsServiceSetup, StartServicesAccessor, } from '@kbn/core/server'; -import type { SecurityPluginSetup } from '@kbn/security-plugin/server'; import type { PublicMethodsOf } from '@kbn/utility-types'; import { getDescriptorNamespace, normalizeNamespace } from './get_descriptor_namespace'; @@ -30,7 +29,6 @@ export { normalizeNamespace }; interface SetupSavedObjectsParams { service: PublicMethodsOf; savedObjects: SavedObjectsServiceSetup; - security?: SecurityPluginSetup; getStartServices: StartServicesAccessor; } @@ -78,7 +76,6 @@ export interface EncryptedSavedObjectsClient { export function setupSavedObjects({ service, savedObjects, - security, getStartServices, }: SetupSavedObjectsParams): ClientInstanciator { // Register custom saved object extension that will encrypt, decrypt and strip saved object @@ -87,7 +84,10 @@ export function setupSavedObjects({ return new SavedObjectsEncryptionExtension({ baseTypeRegistry, service, - getCurrentUser: () => security?.authc.getCurrentUser(request) ?? undefined, + getCurrentUser: async () => { + const [{ security }] = await getStartServices(); + return security.authc.getCurrentUser(request) ?? undefined; + }, }); }); diff --git a/x-pack/plugins/encrypted_saved_objects/server/saved_objects/saved_objects_encryption_extension.ts b/x-pack/plugins/encrypted_saved_objects/server/saved_objects/saved_objects_encryption_extension.ts index fe5d00ee4a8fb..01c35c7403fdf 100644 --- a/x-pack/plugins/encrypted_saved_objects/server/saved_objects/saved_objects_encryption_extension.ts +++ b/x-pack/plugins/encrypted_saved_objects/server/saved_objects/saved_objects_encryption_extension.ts @@ -22,13 +22,13 @@ import type { EncryptedSavedObjectsService } from '../crypto'; export interface Params { baseTypeRegistry: ISavedObjectTypeRegistry; service: Readonly; - getCurrentUser: () => AuthenticatedUser | undefined; + getCurrentUser: () => Promise; } export class SavedObjectsEncryptionExtension implements ISavedObjectsEncryptionExtension { readonly _baseTypeRegistry: ISavedObjectTypeRegistry; readonly _service: Readonly; - readonly _getCurrentUser: () => AuthenticatedUser | undefined; + readonly _getCurrentUser: () => Promise; constructor({ baseTypeRegistry, service, getCurrentUser }: Params) { this._baseTypeRegistry = baseTypeRegistry; @@ -51,6 +51,7 @@ export class SavedObjectsEncryptionExtension implements ISavedObjectsEncryptionE type: response.type, namespace: getDescriptorNamespace(this._baseTypeRegistry, response.type, namespace), }; + const user = await this._getCurrentUser(); // Error is returned when decryption fails, and in this case encrypted attributes will be // stripped from the returned attributes collection. That will let consumer decide whether to // fail or handle recovery gracefully. @@ -58,7 +59,7 @@ export class SavedObjectsEncryptionExtension implements ISavedObjectsEncryptionE normalizedDescriptor, response.attributes as Record, originalAttributes as Record, - { user: this._getCurrentUser() } + { user } ); return { ...response, attributes, ...(error && { error }) }; @@ -82,8 +83,7 @@ export class SavedObjectsEncryptionExtension implements ISavedObjectsEncryptionE id, namespace: getDescriptorNamespace(this._baseTypeRegistry, type, namespace), }; - return this._service.encryptAttributes(normalizedDescriptor, attributes, { - user: this._getCurrentUser(), - }); + const user = await this._getCurrentUser(); + return this._service.encryptAttributes(normalizedDescriptor, attributes, { user }); } } diff --git a/x-pack/plugins/encrypted_saved_objects/tsconfig.json b/x-pack/plugins/encrypted_saved_objects/tsconfig.json index 17dea87aca6ee..83cdcd6225850 100644 --- a/x-pack/plugins/encrypted_saved_objects/tsconfig.json +++ b/x-pack/plugins/encrypted_saved_objects/tsconfig.json @@ -12,6 +12,8 @@ "@kbn/core-saved-objects-server", "@kbn/core-saved-objects-base-server-internal", "@kbn/core-saved-objects-api-server-mocks", + "@kbn/core-security-common", + "@kbn/test-jest-helpers", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/enterprise_search/common/constants.ts b/x-pack/plugins/enterprise_search/common/constants.ts index 47c4741e41afc..f2be720d1c04c 100644 --- a/x-pack/plugins/enterprise_search/common/constants.ts +++ b/x-pack/plugins/enterprise_search/common/constants.ts @@ -8,7 +8,7 @@ import { ENTERPRISE_SEARCH_APP_ID, ENTERPRISE_SEARCH_CONTENT_APP_ID, - ENTERPRISE_SEARCH_INFERENCE_ENDPOINTS_APP_ID, + ENTERPRISE_SEARCH_RELEVANCE_APP_ID, ENTERPRISE_SEARCH_APPLICATIONS_APP_ID, ENTERPRISE_SEARCH_ANALYTICS_APP_ID, ENTERPRISE_SEARCH_APPSEARCH_APP_ID, @@ -178,7 +178,7 @@ export const VECTOR_SEARCH_PLUGIN = { }; export const INFERENCE_ENDPOINTS_PLUGIN = { - ID: ENTERPRISE_SEARCH_INFERENCE_ENDPOINTS_APP_ID, + ID: ENTERPRISE_SEARCH_RELEVANCE_APP_ID, NAME: i18n.translate('xpack.enterpriseSearch.inferenceEndpoints.productName', { defaultMessage: 'Inference Endpoints', }), diff --git a/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/licensing_logic.mock.ts b/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/licensing_logic.mock.ts index 0ea858d0f2f50..4f91ddf4cb5c6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/licensing_logic.mock.ts +++ b/x-pack/plugins/enterprise_search/public/applications/__mocks__/kea_logic/licensing_logic.mock.ts @@ -10,6 +10,7 @@ import { licensingMock } from '@kbn/licensing-plugin/public/mocks'; export const mockLicensingValues = { license: licensingMock.createLicense(), hasPlatinumLicense: false, + hasEnterpriseLicense: true, hasGoldLicense: false, isTrial: false, canManageLicense: true, diff --git a/x-pack/plugins/enterprise_search/public/applications/applications/components/playground/playground.tsx b/x-pack/plugins/enterprise_search/public/applications/applications/components/playground/playground.tsx index e6882acb0ac3b..b117518d3a6e0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/applications/components/playground/playground.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/applications/components/playground/playground.tsx @@ -9,11 +9,8 @@ import React from 'react'; import { useValues } from 'kea'; -import { EuiBetaBadge, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; - import { KibanaLogic } from '../../../shared/kibana'; import { EnterpriseSearchApplicationsPageTemplate } from '../layout/page_template'; @@ -31,32 +28,9 @@ export const Playground: React.FC = () => { defaultMessage: 'Playground', }), ]} - pageHeader={{ - pageTitle: ( - - - - - - - - - ), - rightSideItems: [], - }} pageViewTelemetry="Playground" restrictWidth={false} + panelled={false} customPageSections bottomBorder="extended" docLink="playground" 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 77454581c61e7..e39f0f0b71f29 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 @@ -40,6 +40,8 @@ import { import { INFERENCE_ENDPOINTS_PATH } from '../../enterprise_search_relevance/routes'; import { KibanaLogic } from '../kibana'; +import { LicensingLogic } from '../licensing'; + import { generateNavLink } from './nav_link_helpers'; /** @@ -51,7 +53,11 @@ import { generateNavLink } from './nav_link_helpers'; export const useEnterpriseSearchNav = (alwaysReturn = false) => { const { isSearchHomepageEnabled, searchHomepage, isSidebarEnabled, productAccess } = useValues(KibanaLogic); + + const { hasEnterpriseLicense } = useValues(LicensingLogic); + const indicesNavItems = useIndicesNav(); + if (!isSidebarEnabled && !alwaysReturn) return undefined; const navItems: Array> = [ @@ -154,25 +160,29 @@ export const useEnterpriseSearchNav = (alwaysReturn = false) => { defaultMessage: 'Build', }), }, - { - id: 'relevance', - items: [ - { - id: 'inference_endpoints', - name: i18n.translate('xpack.enterpriseSearch.nav.inferenceEndpointsTitle', { - defaultMessage: 'Inference Endpoints', - }), - ...generateNavLink({ - shouldNotCreateHref: true, - shouldShowActiveForSubroutes: true, - to: INFERENCE_ENDPOINTS_PLUGIN.URL + INFERENCE_ENDPOINTS_PATH, - }), - }, - ], - name: i18n.translate('xpack.enterpriseSearch.nav.relevanceTitle', { - defaultMessage: 'Relevance', - }), - }, + ...(hasEnterpriseLicense + ? [ + { + id: 'relevance', + items: [ + { + id: 'inference_endpoints', + name: i18n.translate('xpack.enterpriseSearch.nav.inferenceEndpointsTitle', { + defaultMessage: 'Inference Endpoints', + }), + ...generateNavLink({ + shouldNotCreateHref: true, + shouldShowActiveForSubroutes: true, + to: INFERENCE_ENDPOINTS_PLUGIN.URL + INFERENCE_ENDPOINTS_PATH, + }), + }, + ], + name: i18n.translate('xpack.enterpriseSearch.nav.relevanceTitle', { + defaultMessage: 'Relevance', + }), + }, + ] + : []), { id: 'es_getting_started', items: [ diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/licensing/licensing_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/shared/licensing/licensing_logic.test.ts index 85a26abeef1e1..743483e96fa31 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/licensing/licensing_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/licensing/licensing_logic.test.ts @@ -167,6 +167,38 @@ describe('LicensingLogic', () => { }); }); + describe('hasEnterpriseLicense', () => { + it('is true for enterprise and trial licenses', () => { + updateLicense({ status: 'active', type: 'enterprise' }); + expect(LicensingLogic.values.hasEnterpriseLicense).toEqual(true); + + updateLicense({ status: 'active', type: 'trial' }); + expect(LicensingLogic.values.hasEnterpriseLicense).toEqual(true); + }); + + it('is false if the current license is expired', () => { + updateLicense({ status: 'expired', type: 'enterprise' }); + expect(LicensingLogic.values.hasEnterpriseLicense).toEqual(false); + + updateLicense({ status: 'expired', type: 'trial' }); + expect(LicensingLogic.values.hasEnterpriseLicense).toEqual(false); + }); + + it('is false for licenses below enterprise', () => { + updateLicense({ status: 'active', type: 'gold' }); + expect(LicensingLogic.values.hasEnterpriseLicense).toEqual(false); + + updateLicense({ status: 'active', type: 'platinum' }); + expect(LicensingLogic.values.hasEnterpriseLicense).toEqual(false); + + updateLicense({ status: 'active', type: 'basic' }); + expect(LicensingLogic.values.hasEnterpriseLicense).toEqual(false); + + updateLicense({ status: 'active', type: 'standard' }); + expect(LicensingLogic.values.hasEnterpriseLicense).toEqual(false); + }); + }); + describe('isTrial', () => { it('is true for active trial license', () => { updateLicense({ status: 'active', type: 'trial' }); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/licensing/licensing_logic.ts b/x-pack/plugins/enterprise_search/public/applications/shared/licensing/licensing_logic.ts index 77a09de2c863f..ab3586f6563c1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/licensing/licensing_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/licensing/licensing_logic.ts @@ -13,6 +13,7 @@ import { ILicense } from '@kbn/licensing-plugin/public'; interface LicensingValues { license: ILicense | null; licenseSubscription: Subscription | null; + hasEnterpriseLicense: boolean; hasPlatinumLicense: boolean; hasGoldLicense: boolean; isTrial: boolean; @@ -52,6 +53,13 @@ export const LicensingLogic = kea [selectors.license], + (license) => { + const qualifyingLicenses = ['enterprise', 'trial']; + return license?.isActive && qualifyingLicenses.includes(license?.type); + }, + ], hasGoldLicense: [ (selectors) => [selectors.license], (license) => { diff --git a/x-pack/plugins/enterprise_search/public/navigation_tree.ts b/x-pack/plugins/enterprise_search/public/navigation_tree.ts index 8bb6bf70e603b..d5c640fa67b3e 100644 --- a/x-pack/plugins/enterprise_search/public/navigation_tree.ts +++ b/x-pack/plugins/enterprise_search/public/navigation_tree.ts @@ -211,7 +211,7 @@ export const getNavigationTreeDefinition = ({ }), }, { - children: [{ link: 'searchInferenceEndpoints' }], + children: [{ link: 'enterpriseSearchRelevance:inferenceEndpoints' }], id: 'relevance', title: i18n.translate('xpack.enterpriseSearch.searchNav.relevance', { defaultMessage: 'Relevance', diff --git a/x-pack/plugins/enterprise_search/public/plugin.ts b/x-pack/plugins/enterprise_search/public/plugin.ts index 280de2f04356b..552bb43fbd073 100644 --- a/x-pack/plugins/enterprise_search/public/plugin.ts +++ b/x-pack/plugins/enterprise_search/public/plugin.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { BehaviorSubject, firstValueFrom } from 'rxjs'; +import { BehaviorSubject, firstValueFrom, Subscription } from 'rxjs'; import { ChartsPluginStart } from '@kbn/charts-plugin/public'; import { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public'; @@ -27,6 +27,7 @@ import type { HomePublicPluginSetup } from '@kbn/home-plugin/public'; import { i18n } from '@kbn/i18n'; import type { IndexManagementPluginStart } from '@kbn/index-management'; import { LensPublicStart } from '@kbn/lens-plugin/public'; +import { ILicense } from '@kbn/licensing-plugin/public'; import { LicensingPluginStart } from '@kbn/licensing-plugin/public'; import { MlPluginStart } from '@kbn/ml-plugin/public'; import type { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public'; @@ -84,6 +85,7 @@ export type EnterpriseSearchPublicStart = ReturnType(); @@ -261,7 +264,8 @@ export class EnterpriseSearchPlugin implements Plugin { if (!config.ui?.enabled) { return; } - const { cloud, share } = plugins; + const { cloud, share, licensing } = plugins; + const useSearchHomepage = plugins.searchHomepage && plugins.searchHomepage.isHomepageFeatureEnabled(); @@ -445,29 +449,33 @@ export class EnterpriseSearchPlugin implements Plugin { title: ANALYTICS_PLUGIN.NAME, }); - core.application.register({ - appRoute: INFERENCE_ENDPOINTS_PLUGIN.URL, - category: DEFAULT_APP_CATEGORIES.enterpriseSearch, - deepLinks: relevanceLinks, - euiIconType: INFERENCE_ENDPOINTS_PLUGIN.LOGO, - id: INFERENCE_ENDPOINTS_PLUGIN.ID, - mount: async (params: AppMountParameters) => { - const kibanaDeps = await this.getKibanaDeps(core, params, cloud); - const { chrome, http } = kibanaDeps.core; - chrome.docTitle.change(INFERENCE_ENDPOINTS_PLUGIN.NAME); - - await this.getInitialData(http); - const pluginData = this.getPluginData(); - - const { renderApp } = await import('./applications'); - const { EnterpriseSearchRelevance } = await import( - './applications/enterprise_search_relevance' - ); - - return renderApp(EnterpriseSearchRelevance, kibanaDeps, pluginData); - }, - title: INFERENCE_ENDPOINTS_PLUGIN.NAME, - visibleIn: [], + this.licenseSubscription = licensing?.license$.subscribe((license: ILicense) => { + if (license.isActive && license.hasAtLeast('enterprise')) { + core.application.register({ + appRoute: INFERENCE_ENDPOINTS_PLUGIN.URL, + category: DEFAULT_APP_CATEGORIES.enterpriseSearch, + deepLinks: relevanceLinks, + euiIconType: INFERENCE_ENDPOINTS_PLUGIN.LOGO, + id: INFERENCE_ENDPOINTS_PLUGIN.ID, + mount: async (params: AppMountParameters) => { + const kibanaDeps = await this.getKibanaDeps(core, params, cloud); + const { chrome, http } = kibanaDeps.core; + chrome.docTitle.change(INFERENCE_ENDPOINTS_PLUGIN.NAME); + + await this.getInitialData(http); + const pluginData = this.getPluginData(); + + const { renderApp } = await import('./applications'); + const { EnterpriseSearchRelevance } = await import( + './applications/enterprise_search_relevance' + ); + + return renderApp(EnterpriseSearchRelevance, kibanaDeps, pluginData); + }, + title: INFERENCE_ENDPOINTS_PLUGIN.NAME, + visibleIn: [], + }); + } }); core.application.register({ @@ -645,7 +653,9 @@ export class EnterpriseSearchPlugin implements Plugin { return {}; } - public stop() {} + public stop() { + this.licenseSubscription?.unsubscribe(); + } private updateSideNavDefinition = (items: Partial) => { this.sideNavDynamicItems$.next({ ...this.sideNavDynamicItems$.getValue(), ...items }); diff --git a/x-pack/plugins/enterprise_search/server/lib/ml/fetch_ml_models.test.ts b/x-pack/plugins/enterprise_search/server/lib/ml/fetch_ml_models.test.ts index 9e017424a8f3d..9f1325f2c7a3d 100644 --- a/x-pack/plugins/enterprise_search/server/lib/ml/fetch_ml_models.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/ml/fetch_ml_models.test.ts @@ -9,15 +9,16 @@ import { mockLogger } from '../../__mocks__'; import { MlTrainedModels } from '@kbn/ml-plugin/server'; -import { MlModelDeploymentState } from '../../../common/types/ml'; - -import { fetchMlModels } from './fetch_ml_models'; import { E5_LINUX_OPTIMIZED_MODEL_ID, E5_MODEL_ID, ELSER_LINUX_OPTIMIZED_MODEL_ID, ELSER_MODEL_ID, -} from './utils'; +} from '@kbn/ml-trained-models-utils'; + +import { MlModelDeploymentState } from '../../../common/types/ml'; + +import { fetchMlModels } from './fetch_ml_models'; describe('fetchMlModels', () => { const mockTrainedModelsProvider = { diff --git a/x-pack/plugins/enterprise_search/server/lib/ml/fetch_ml_models.ts b/x-pack/plugins/enterprise_search/server/lib/ml/fetch_ml_models.ts index 595c35b33755e..889b7bb1b89e1 100644 --- a/x-pack/plugins/enterprise_search/server/lib/ml/fetch_ml_models.ts +++ b/x-pack/plugins/enterprise_search/server/lib/ml/fetch_ml_models.ts @@ -11,6 +11,14 @@ import { Logger } from '@kbn/core/server'; import { i18n } from '@kbn/i18n'; import { MlTrainedModels } from '@kbn/ml-plugin/server'; +import { + E5_LINUX_OPTIMIZED_MODEL_ID, + E5_MODEL_ID, + ELSER_LINUX_OPTIMIZED_MODEL_ID, + ELSER_MODEL_ID, + LANG_IDENT_MODEL_ID, +} from '@kbn/ml-trained-models-utils'; + import { getMlModelTypesForModelConfig } from '../../../common/ml_inference_pipeline'; import { MlModelDeploymentState, MlModel } from '../../../common/types/ml'; @@ -18,15 +26,10 @@ import { MlModelDeploymentState, MlModel } from '../../../common/types/ml'; import { BASE_MODEL, ELSER_LINUX_OPTIMIZED_MODEL_PLACEHOLDER, - ELSER_MODEL_ID, ELSER_MODEL_PLACEHOLDER, E5_LINUX_OPTIMIZED_MODEL_PLACEHOLDER, - E5_MODEL_ID, E5_MODEL_PLACEHOLDER, - LANG_IDENT_MODEL_ID, MODEL_TITLES_BY_TYPE, - E5_LINUX_OPTIMIZED_MODEL_ID, - ELSER_LINUX_OPTIMIZED_MODEL_ID, } from './utils'; let compatibleElserModelId = ELSER_MODEL_ID; diff --git a/x-pack/plugins/enterprise_search/server/lib/ml/utils.ts b/x-pack/plugins/enterprise_search/server/lib/ml/utils.ts index d063fd158385a..20c9fe7ce0193 100644 --- a/x-pack/plugins/enterprise_search/server/lib/ml/utils.ts +++ b/x-pack/plugins/enterprise_search/server/lib/ml/utils.ts @@ -8,13 +8,14 @@ import { i18n } from '@kbn/i18n'; import { SUPPORTED_PYTORCH_TASKS } from '@kbn/ml-trained-models-utils'; -import { MlModelDeploymentState, MlModel } from '../../../common/types/ml'; +import { + E5_LINUX_OPTIMIZED_MODEL_ID, + E5_MODEL_ID, + ELSER_LINUX_OPTIMIZED_MODEL_ID, + ELSER_MODEL_ID, +} from '@kbn/ml-trained-models-utils'; -export const ELSER_MODEL_ID = '.elser_model_2'; -export const ELSER_LINUX_OPTIMIZED_MODEL_ID = '.elser_model_2_linux-x86_64'; -export const E5_MODEL_ID = '.multilingual-e5-small'; -export const E5_LINUX_OPTIMIZED_MODEL_ID = '.multilingual-e5-small_linux-x86_64'; -export const LANG_IDENT_MODEL_ID = 'lang_ident_model_1'; +import { MlModelDeploymentState, MlModel } from '../../../common/types/ml'; export const MODEL_TITLES_BY_TYPE: Record = { fill_mask: i18n.translate('xpack.enterpriseSearch.content.ml_inference.fill_mask', { diff --git a/x-pack/plugins/enterprise_search/server/plugin.ts b/x-pack/plugins/enterprise_search/server/plugin.ts index 24298c55fdffa..ee403e223305f 100644 --- a/x-pack/plugins/enterprise_search/server/plugin.ts +++ b/x-pack/plugins/enterprise_search/server/plugin.ts @@ -21,6 +21,7 @@ import { DataPluginStart } from '@kbn/data-plugin/server/plugin'; import { PluginSetupContract as FeaturesPluginSetup } from '@kbn/features-plugin/server'; import { GlobalSearchPluginSetup } from '@kbn/global-search-plugin/server'; import type { GuidedOnboardingPluginSetup } from '@kbn/guided-onboarding-plugin/server'; +import type { LicensingPluginStart } from '@kbn/licensing-plugin/public'; import { LogsSharedPluginSetup } from '@kbn/logs-shared-plugin/server'; import type { MlPluginSetup } from '@kbn/ml-plugin/server'; import { SearchConnectorsPluginSetup } from '@kbn/search-connectors-plugin/server'; @@ -95,6 +96,7 @@ interface PluginsSetup { guidedOnboarding?: GuidedOnboardingPluginSetup; logsShared: LogsSharedPluginSetup; ml?: MlPluginSetup; + licensing: LicensingPluginStart; searchConnectors?: SearchConnectorsPluginSetup; security: SecurityPluginSetup; usageCollection?: UsageCollectionSetup; @@ -148,6 +150,7 @@ export class EnterpriseSearchPlugin implements Plugin { logsShared, customIntegrations, ml, + licensing, guidedOnboarding, cloud, searchConnectors, @@ -262,6 +265,7 @@ export class EnterpriseSearchPlugin implements Plugin { log, enterpriseSearchRequestHandler, ml, + licensing, }; registerConfigDataRoute(dependencies); diff --git a/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts b/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts index 6009c87fcde99..25e67c6857154 100644 --- a/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts +++ b/x-pack/plugins/event_log/server/es/cluster_client_adapter.ts @@ -529,10 +529,11 @@ export function getQueryBodyWithAuthFilter( dslFilterQuery = queryFilter ? toElasticsearchQuery(queryFilter) : undefined; } catch (err) { logger.debug( - `esContext: Invalid kuery syntax for the filter (${filter}) error: ${JSON.stringify({ - message: err.message, - statusCode: err.statusCode, - })}` + () => + `esContext: Invalid kuery syntax for the filter (${filter}) error: ${JSON.stringify({ + message: err.message, + statusCode: err.statusCode, + })}` ); throw err; } @@ -691,10 +692,11 @@ export function getQueryBody( dslFilterQuery = filterKueryNode ? toElasticsearchQuery(filterKueryNode) : undefined; } catch (err) { logger.debug( - `esContext: Invalid kuery syntax for the filter (${filter}) error: ${JSON.stringify({ - message: err.message, - statusCode: err.statusCode, - })}` + () => + `esContext: Invalid kuery syntax for the filter (${filter}) error: ${JSON.stringify({ + message: err.message, + statusCode: err.statusCode, + })}` ); throw err; } diff --git a/x-pack/plugins/fleet/common/authz.ts b/x-pack/plugins/fleet/common/authz.ts index 463ab7dc90c97..7399eb98a583b 100644 --- a/x-pack/plugins/fleet/common/authz.ts +++ b/x-pack/plugins/fleet/common/authz.ts @@ -144,8 +144,7 @@ export const calculateAuthz = ({ // These are currently used by Fleet Server setup setup: fleet.all || fleet.setup, readEnrollmentTokens: (fleet.all || fleet.setup || fleet.agents?.all) ?? false, - readAgentPolicies: - (fleet.all || fleet.read || fleet.setup || fleet.agentPolicies?.read) ?? false, + readAgentPolicies: (fleet.all || fleet.setup) ?? false, }; return { diff --git a/x-pack/plugins/fleet/common/constants/locators.ts b/x-pack/plugins/fleet/common/constants/locators.ts index daa00bcae46e0..cca0687a172d8 100644 --- a/x-pack/plugins/fleet/common/constants/locators.ts +++ b/x-pack/plugins/fleet/common/constants/locators.ts @@ -8,6 +8,7 @@ export const LOCATORS_IDS = { APM_LOCATOR: 'APM_LOCATOR', DASHBOARD_APP: 'DASHBOARD_APP_LOCATOR', + DISCOVER_APP_LOCATOR: 'DISCOVER_APP_LOCATOR', } as const; // Dashboards ids diff --git a/x-pack/plugins/fleet/common/constants/mappings.ts b/x-pack/plugins/fleet/common/constants/mappings.ts index 4c45df62246d1..f804dc872e0d1 100644 --- a/x-pack/plugins/fleet/common/constants/mappings.ts +++ b/x-pack/plugins/fleet/common/constants/mappings.ts @@ -260,6 +260,9 @@ export const AGENT_MAPPINGS = { }, }, }, + namespaces: { + type: 'keyword', + }, packages: { type: 'keyword', }, @@ -290,6 +293,9 @@ export const AGENT_MAPPINGS = { unenrolled_reason: { type: 'keyword', }, + unhealthy_reason: { + type: 'keyword', + }, updated_at: { type: 'date', }, @@ -326,6 +332,9 @@ export const AGENT_MAPPINGS = { download_percent: { type: 'double', }, + download_rate: { + type: 'double', + }, failed_state: { type: 'keyword', }, @@ -337,6 +346,17 @@ export const AGENT_MAPPINGS = { }, }, }, + retry_error_msg: { + type: 'text', + fields: { + keyword: { + type: 'keyword', + }, + }, + }, + retry_until: { + type: 'date', + }, }, }, }, diff --git a/x-pack/plugins/fleet/common/experimental_features.ts b/x-pack/plugins/fleet/common/experimental_features.ts index 5e8679e555908..502d3b603f159 100644 --- a/x-pack/plugins/fleet/common/experimental_features.ts +++ b/x-pack/plugins/fleet/common/experimental_features.ts @@ -22,12 +22,12 @@ const _allowedExperimentalValues = { outputSecretsStorage: true, remoteESOutput: true, agentless: false, - enableStrictKQLValidation: false, + enableStrictKQLValidation: true, subfeaturePrivileges: false, enablePackagesStateMachine: true, advancedPolicySettings: true, useSpaceAwareness: false, - enableReusableIntegrationPolicies: false, + enableReusableIntegrationPolicies: true, }; /** diff --git a/x-pack/plugins/fleet/common/types/models/epm.ts b/x-pack/plugins/fleet/common/types/models/epm.ts index 06a8b979c8eb5..fda07095de95d 100644 --- a/x-pack/plugins/fleet/common/types/models/epm.ts +++ b/x-pack/plugins/fleet/common/types/models/epm.ts @@ -435,6 +435,7 @@ export enum RegistryVarsEntryKeys { os = 'os', secret = 'secret', hide_in_deployment_modes = 'hide_in_deployment_modes', + full_width = 'full_width', } // EPR types this as `[]map[string]interface{}` @@ -457,6 +458,7 @@ export interface RegistryVarsEntry { }; }; [RegistryVarsEntryKeys.hide_in_deployment_modes]?: string[]; + [RegistryVarsEntryKeys.full_width]?: boolean; } // Deprecated as part of the removing public references to saved object schemas diff --git a/x-pack/plugins/fleet/cypress/e2e/package_policy_pipelines_and_mappings_real.cy.ts b/x-pack/plugins/fleet/cypress/e2e/package_policy_pipelines_and_mappings_real.cy.ts index 0478c450ae5a2..269c848f998bf 100644 --- a/x-pack/plugins/fleet/cypress/e2e/package_policy_pipelines_and_mappings_real.cy.ts +++ b/x-pack/plugins/fleet/cypress/e2e/package_policy_pipelines_and_mappings_real.cy.ts @@ -82,8 +82,13 @@ describe('Input package create and edit package policy', () => { cy.getBySel(EXISTING_HOSTS_TAB).click(); - cy.getBySel(POLICY_EDITOR.AGENT_POLICY_SELECT).click().get(`#${agentPolicyId}`).click(); - cy.wait(500); // wait for policy id to be set + cy.getBySel(POLICY_EDITOR.AGENT_POLICY_SELECT).click(); + cy.getBySel('agentPolicyMultiItem').each(($el) => { + if ($el.text() === agentPolicyName) { + $el.trigger('click'); + } + }); + cy.wait(1000); // wait for policy id to be set cy.getBySel(CREATE_PACKAGE_POLICY_SAVE_BTN).click(); cy.getBySel(CONFIRM_MODAL.CANCEL_BUTTON).click(); @@ -150,8 +155,13 @@ describe('Integration package with custom dataset create and edit package policy cy.getBySel(EXISTING_HOSTS_TAB).click(); - cy.getBySel(POLICY_EDITOR.AGENT_POLICY_SELECT).click().get(`#${agentPolicyId}`).click(); - cy.wait(500); // wait for policy id to be set + cy.getBySel(POLICY_EDITOR.AGENT_POLICY_SELECT).click(); + cy.getBySel('agentPolicyMultiItem').each(($el) => { + if ($el.text() === agentPolicyName) { + $el.trigger('click'); + } + }); + cy.wait(1000); // wait for policy id to be set cy.getBySel(CREATE_PACKAGE_POLICY_SAVE_BTN).click(); cy.getBySel(CONFIRM_MODAL.CANCEL_BUTTON).click(); @@ -210,8 +220,13 @@ describe('Integration package with fixed dataset create and edit package policy' cy.getBySel(EXISTING_HOSTS_TAB).click(); - cy.getBySel(POLICY_EDITOR.AGENT_POLICY_SELECT).click().get(`#${agentPolicyId}`).click(); - cy.wait(500); // wait for policy id to be set + cy.getBySel(POLICY_EDITOR.AGENT_POLICY_SELECT).click(); + cy.getBySel('agentPolicyMultiItem').each(($el) => { + if ($el.text() === agentPolicyName) { + $el.trigger('click'); + } + }); + cy.wait(1000); // wait for policy id to be set cy.getBySel(CREATE_PACKAGE_POLICY_SAVE_BTN).click(); cy.getBySel(CONFIRM_MODAL.CANCEL_BUTTON).click(); diff --git a/x-pack/plugins/fleet/cypress/screens/integrations.ts b/x-pack/plugins/fleet/cypress/screens/integrations.ts index 7cc6aefdf89ec..1a31d2dc5de31 100644 --- a/x-pack/plugins/fleet/cypress/screens/integrations.ts +++ b/x-pack/plugins/fleet/cypress/screens/integrations.ts @@ -38,7 +38,7 @@ export const SETTINGS = { export const POLICY_EDITOR = { POLICY_NAME_INPUT: 'packagePolicyNameInput', DATASET_SELECT: 'datasetComboBox', - AGENT_POLICY_SELECT: 'agentPolicySelect', + AGENT_POLICY_SELECT: 'agentPolicyMultiSelect', INSPECT_PIPELINES_BTN: 'datastreamInspectPipelineBtn', EDIT_MAPPINGS_BTN: 'datastreamEditMappingsBtn', CREATE_MAPPINGS_BTN: 'datastreamAddCustomComponentTemplateBtn', diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.test.tsx index d572a00ec2241..22f81b125015e 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.test.tsx @@ -173,7 +173,7 @@ describe('SearchBar', () => { describe('getFieldSpecs', () => { it('returns fieldSpecs for Fleet agents', () => { - expect(getFieldSpecs(AGENTS_INDEX, AGENTS_PREFIX)).toHaveLength(67); + expect(getFieldSpecs(AGENTS_INDEX, AGENTS_PREFIX)).toHaveLength(73); }); it('returns fieldSpecs for Fleet enrollment tokens', () => { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_panel.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_panel.test.tsx index a6bf030ad7fe0..322bbfbaa57e2 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_panel.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_panel.test.tsx @@ -359,10 +359,13 @@ describe('PackagePolicyInputPanel', () => { describe('When agentless is enabled', () => { beforeEach(() => { useAgentlessMock.mockReturnValue({ + agentlessAPIUrl: 'https://agentless.api.url', isAgentlessEnabled: true, isAgentlessPackagePolicy: jest.fn(), isAgentlessAgentPolicy: jest.fn(), isAgentlessIntegration: jest.fn(), + isAgentlessCloudEnabled: true, + isAgentlessServerlessEnabled: false, }); }); @@ -392,10 +395,13 @@ describe('PackagePolicyInputPanel', () => { describe('When agentless not enabled', () => { beforeEach(() => { useAgentlessMock.mockReturnValue({ + agentlessAPIUrl: undefined, isAgentlessEnabled: false, isAgentlessPackagePolicy: jest.fn(), isAgentlessAgentPolicy: jest.fn(), isAgentlessIntegration: jest.fn(), + isAgentlessCloudEnabled: true, + isAgentlessServerlessEnabled: false, }); }); 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 114d973f32541..af0b2dbce2ff1 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 @@ -185,7 +185,7 @@ function getInputComponent({ fieldTestSelector, setIsDirty, }: InputComponentProps) { - const { multi, type, options } = varDef; + const { multi, type, options, full_width: fullWidth } = varDef; if (multi) { return ( setIsDirty(true)} disabled={frozen} resize="vertical" + fullWidth={fullWidth} data-test-subj={`textAreaInput-${fieldTestSelector}`} /> ); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.test.tsx index 30688c7a99b11..237ab76465fdd 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.test.tsx @@ -105,7 +105,7 @@ describe('step select agent policy', () => { const select = renderResult.container.querySelector('[data-test-subj="agentPolicySelect"]'); expect((select as any)?.value).toEqual(''); - expect(renderResult.getByText('An agent policy is required.')).toBeVisible(); + expect(renderResult.getByText('At least one agent policy is required.')).toBeVisible(); }); }); @@ -178,7 +178,7 @@ describe('step select agent policy', () => { ); expect((select as any)?.value).toEqual(undefined); - expect(renderResult.getByText('An agent policy is required.')).toBeVisible(); + expect(renderResult.getByText('At least one agent policy is required.')).toBeVisible(); }); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.tsx index 6238a2cc62a07..ecfd18ef9aac4 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.tsx @@ -101,6 +101,9 @@ export const StepSelectAgentPolicy: React.FunctionComponent<{ updateAgentPolicies([]); } }; + if (isLoading || selectedPolicyIds.length === 0) { + return; + } const agentPoliciesHaveAllSelectedIds = selectedPolicyIds.every((id) => agentPolicies.map((policy) => policy.id).includes(id) ); @@ -110,7 +113,7 @@ export const StepSelectAgentPolicy: React.FunctionComponent<{ setSelectedAgentPolicyError(undefined); updateAgentPolicies(agentPolicies.filter((policy) => selectedPolicyIds.includes(policy.id))); } - }, [selectedPolicyIds, agentPolicies, updateAgentPolicies]); + }, [selectedPolicyIds, agentPolicies, updateAgentPolicies, isLoading]); // Try to select default agent policy useEffect(() => { @@ -192,7 +195,7 @@ export const StepSelectAgentPolicy: React.FunctionComponent<{

    @@ -215,7 +218,7 @@ export const StepSelectAgentPolicy: React.FunctionComponent<{
    @@ -241,7 +244,7 @@ export const StepSelectAgentPolicy: React.FunctionComponent<{ selectedPolicyIds.length === 0 ? ( ) : someNewAgentPoliciesHaveLimitedPackage ? ( { }); waitFor(() => { - expect(renderResult.getByText('An agent policy is required.')).toBeInTheDocument(); + expect(renderResult.getByText('At least one agent policy is required.')).toBeInTheDocument(); }); }); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/form.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/form.test.tsx index 74dd8b52fbb3c..9283a8fa42c39 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/form.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/form.test.tsx @@ -12,12 +12,14 @@ import type { TestRenderer } from '../../../../../../../mock'; import { createFleetTestRendererMock } from '../../../../../../../mock'; import type { PackageInfo } from '../../../../../types'; -import { sendGetPackagePolicies } from '../../../../../hooks'; +import { sendGetPackagePolicies, useConfig } from '../../../../../hooks'; import { SelectedPolicyTab } from '../../components'; import { useOnSubmit } from './form'; +type MockFn = jest.MockedFunction; + jest.mock('../../../../../hooks', () => { return { ...jest.requireActual('../../../../../hooks'), @@ -31,6 +33,7 @@ jest.mock('../../../../../hooks', () => { sendGetStatus: jest .fn() .mockResolvedValue({ data: { isReady: true, missing_requirements: [] } }), + useConfig: jest.fn(), }; }); @@ -86,6 +89,9 @@ describe('useOnSubmit', () => { beforeEach(() => { testRenderer = createFleetTestRendererMock(); + (useConfig as MockFn).mockReturnValue({ + agentless: undefined, + } as any); }); describe('default API response', () => { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology.test.ts b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology.test.ts index 5099cdde2277c..0e1a3db041430 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology.test.ts +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology.test.ts @@ -9,20 +9,149 @@ import { renderHook, act } from '@testing-library/react-hooks'; import { SetupTechnology } from '../../../../../../../../common/types'; import { ExperimentalFeaturesService } from '../../../../../services'; -import { sendGetOneAgentPolicy, useStartServices } from '../../../../../hooks'; +import { sendGetOneAgentPolicy, useStartServices, useConfig } from '../../../../../hooks'; import { SelectedPolicyTab } from '../../components'; +import { generateNewAgentPolicyWithDefaults } from '../../../../../../../../common/services/generate_new_agent_policy'; -import { useSetupTechnology } from './setup_technology'; +import { useAgentless, useSetupTechnology } from './setup_technology'; jest.mock('../../../../../services'); jest.mock('../../../../../hooks', () => ({ ...jest.requireActual('../../../../../hooks'), sendGetOneAgentPolicy: jest.fn(), useStartServices: jest.fn(), + useConfig: jest.fn(), })); +jest.mock('../../../../../../../../common/services/generate_new_agent_policy'); type MockFn = jest.MockedFunction; +describe('useAgentless', () => { + const mockedExperimentalFeaturesService = jest.mocked(ExperimentalFeaturesService); + + beforeEach(() => { + mockedExperimentalFeaturesService.get.mockReturnValue({ + agentless: false, + } as any); + (useConfig as MockFn).mockReturnValue({ + agentless: undefined, + } as any); + (useStartServices as MockFn).mockReturnValue({ + cloud: { + isServerlessEnabled: false, + isCloudEnabled: false, + }, + }); + jest.clearAllMocks(); + }); + + it('should should not return return isAgentless when agentless is not enabled', () => { + const { result } = renderHook(() => useAgentless()); + + expect(result.current.isAgentlessEnabled).toBeFalsy(); + expect(result.current.agentlessAPIUrl).toBeFalsy(); + expect(result.current.isAgentlessCloudEnabled).toBeFalsy(); + expect(result.current.isAgentlessServerlessEnabled).toBeFalsy(); + }); + it('should should return agentlessAPIUrl when agentless config is set', () => { + const agentlessAPIUrl = 'https://agentless.api.url'; + (useConfig as MockFn).mockReturnValue({ + agentless: { + api: { + url: agentlessAPIUrl, + }, + }, + } as any); + + const { result } = renderHook(() => useAgentless()); + + expect(result.current.agentlessAPIUrl).toBeTruthy(); + expect(result.current.agentlessAPIUrl).toBe(agentlessAPIUrl); + expect(result.current.isAgentlessEnabled).toBeFalsy(); + expect(result.current.isAgentlessCloudEnabled).toBeFalsy(); + expect(result.current.isAgentlessServerlessEnabled).toBeFalsy(); + }); + + it('should return isAgentlessEnabled as falsy if agentlessAPIUrl and experimental feature agentless is truthy without cloud or serverless', () => { + const agentlessAPIUrl = 'https://agentless.api.url'; + (useConfig as MockFn).mockReturnValue({ + agentless: { + api: { + url: agentlessAPIUrl, + }, + }, + } as any); + + mockedExperimentalFeaturesService.get.mockReturnValue({ + agentless: false, + } as any); + + const { result } = renderHook(() => useAgentless()); + + expect(result.current.agentlessAPIUrl).toBeTruthy(); + expect(result.current.isAgentlessEnabled).toBeFalsy(); + expect(result.current.isAgentlessCloudEnabled).toBeFalsy(); + expect(result.current.isAgentlessServerlessEnabled).toBeFalsy(); + }); + + it('should return isAgentlessEnabled and isAgentlessCloudEnabled as truthy with isCloudEnabled', () => { + const agentlessAPIUrl = 'https://agentless.api.url'; + (useConfig as MockFn).mockReturnValue({ + agentless: { + api: { + url: agentlessAPIUrl, + }, + }, + } as any); + + mockedExperimentalFeaturesService.get.mockReturnValue({ + agentless: true, + } as any); + + (useStartServices as MockFn).mockReturnValue({ + cloud: { + isServerlessEnabled: false, + isCloudEnabled: true, + }, + }); + + const { result } = renderHook(() => useAgentless()); + + expect(result.current.agentlessAPIUrl).toBeTruthy(); + expect(result.current.isAgentlessEnabled).toBeTruthy(); + expect(result.current.isAgentlessCloudEnabled).toBeTruthy(); + expect(result.current.isAgentlessServerlessEnabled).toBeFalsy(); + }); + it('should return isAgentlessEnabled and isAgentlessServerlessEnabled as truthy with isServerlessEnabled', () => { + const agentlessAPIUrl = 'https://agentless.api.url'; + (useConfig as MockFn).mockReturnValue({ + agentless: { + api: { + url: agentlessAPIUrl, + }, + }, + } as any); + + mockedExperimentalFeaturesService.get.mockReturnValue({ + agentless: true, + } as any); + + (useStartServices as MockFn).mockReturnValue({ + cloud: { + isServerlessEnabled: true, + isCloudEnabled: false, + }, + }); + + const { result } = renderHook(() => useAgentless()); + + expect(result.current.agentlessAPIUrl).toBeTruthy(); + expect(result.current.isAgentlessEnabled).toBeTruthy(); + expect(result.current.isAgentlessCloudEnabled).toBeFalsy(); + expect(result.current.isAgentlessServerlessEnabled).toBeTruthy(); + }); +}); + describe('useSetupTechnology', () => { const updateNewAgentPolicyMock = jest.fn(); const updateAgentPoliciesMock = jest.fn(); @@ -30,6 +159,8 @@ describe('useSetupTechnology', () => { const newAgentPolicyMock = { name: 'mock_new_agent_policy', namespace: 'default', + is_managed: false, + supports_agentless: false, }; const mockedExperimentalFeaturesService = jest.mocked(ExperimentalFeaturesService); @@ -37,6 +168,9 @@ describe('useSetupTechnology', () => { mockedExperimentalFeaturesService.get.mockReturnValue({ agentless: true, } as any); + (useConfig as MockFn).mockReturnValue({ + agentless: undefined, + } as any); (sendGetOneAgentPolicy as MockFn).mockResolvedValue({ data: { item: { id: 'agentless-policy-id' }, @@ -47,6 +181,11 @@ describe('useSetupTechnology', () => { isServerlessEnabled: true, }, }); + + (generateNewAgentPolicyWithDefaults as MockFn).mockReturnValue({ + name: 'mock_new_agentless_policy', + supports_agentless: true, + }); jest.clearAllMocks(); }); @@ -66,11 +205,10 @@ describe('useSetupTechnology', () => { expect(sendGetOneAgentPolicy).not.toHaveBeenCalled(); expect(result.current.selectedSetupTechnology).toBe(SetupTechnology.AGENT_BASED); - expect(result.current.agentlessPolicy).toBeUndefined(); }); - it('should fetch agentless policy if agentless is enabled', async () => { - const { result, waitForNextUpdate } = renderHook(() => + it('should fetch agentless policy if agentless feature is enabled and isServerless is true', async () => { + const { waitForNextUpdate } = renderHook(() => useSetupTechnology({ updateNewAgentPolicy: updateNewAgentPolicyMock, newAgentPolicy: newAgentPolicyMock, @@ -81,7 +219,71 @@ describe('useSetupTechnology', () => { await waitForNextUpdate(); - expect(result.current.agentlessPolicy).toEqual({ id: 'agentless-policy-id' }); + expect(sendGetOneAgentPolicy).toHaveBeenCalled(); + }); + + it('should create agentless policy if agentless feature is enabled and isCloud is true and agentless.api.url', async () => { + (useConfig as MockFn).mockReturnValue({ + agentless: { + api: { + url: 'https://agentless.api.url', + }, + }, + } as any); + (useStartServices as MockFn).mockReturnValue({ + cloud: { + // isServerlessEnabled: false, + isCloudEnabled: true, + }, + }); + const { result, waitForNextUpdate } = renderHook(() => + useSetupTechnology({ + updateNewAgentPolicy: updateNewAgentPolicyMock, + newAgentPolicy: newAgentPolicyMock, + updateAgentPolicies: updateAgentPoliciesMock, + setSelectedPolicyTab: setSelectedPolicyTabMock, + }) + ); + + expect(generateNewAgentPolicyWithDefaults).toHaveBeenCalled(); + + act(() => { + result.current.handleSetupTechnologyChange(SetupTechnology.AGENTLESS); + }); + waitForNextUpdate(); + + expect(result.current.selectedSetupTechnology).toBe(SetupTechnology.AGENTLESS); + expect(updateNewAgentPolicyMock).toHaveBeenCalledWith({ + name: 'mock_new_agentless_policy', + supports_agentless: true, + }); + }); + + it('should not create agentless policy if agentless feature is enabled and isCloud is true and agentless.api.url is not defined', async () => { + (useConfig as MockFn).mockReturnValue({} as any); + (useStartServices as MockFn).mockReturnValue({ + cloud: { + isCloudEnabled: true, + }, + }); + + const { result, waitForNextUpdate } = renderHook(() => + useSetupTechnology({ + updateNewAgentPolicy: updateNewAgentPolicyMock, + newAgentPolicy: newAgentPolicyMock, + updateAgentPolicies: updateAgentPoliciesMock, + setSelectedPolicyTab: setSelectedPolicyTabMock, + }) + ); + + expect(result.current.selectedSetupTechnology).toBe(SetupTechnology.AGENT_BASED); + + act(() => { + result.current.handleSetupTechnologyChange(SetupTechnology.AGENT_BASED); + }); + + waitForNextUpdate(); + expect(updateNewAgentPolicyMock).toHaveBeenCalledTimes(0); }); it('should not fetch agentless policy if agentless is enabled but serverless is disabled', async () => { @@ -102,7 +304,6 @@ describe('useSetupTechnology', () => { expect(sendGetOneAgentPolicy).not.toHaveBeenCalled(); expect(result.current.selectedSetupTechnology).toBe(SetupTechnology.AGENT_BASED); - expect(result.current.agentlessPolicy).toBeUndefined(); }); it('should update agent policy and selected policy tab when setup technology is agentless', async () => { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology.ts b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology.ts index cc67adddeca19..47591102efdbd 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology.ts +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology.ts @@ -6,8 +6,11 @@ */ import { useCallback, useEffect, useState } from 'react'; +import { v4 as uuidv4 } from 'uuid'; +import { useConfig } from '../../../../../hooks'; import { ExperimentalFeaturesService } from '../../../../../services'; +import { generateNewAgentPolicyWithDefaults } from '../../../../../../../../common/services/generate_new_agent_policy'; import type { AgentPolicy, NewAgentPolicy, @@ -20,11 +23,18 @@ import { SelectedPolicyTab } from '../../components'; import { AGENTLESS_POLICY_ID } from '../../../../../../../../common/constants'; export const useAgentless = () => { + const config = useConfig(); const { agentless: agentlessExperimentalFeatureEnabled } = ExperimentalFeaturesService.get(); const { cloud } = useStartServices(); const isServerless = !!cloud?.isServerlessEnabled; + const isCloud = !!cloud?.isCloudEnabled; + const agentlessAPIUrl = config.agentless?.api.url; - const isAgentlessEnabled = agentlessExperimentalFeatureEnabled && isServerless; + const isAgentlessEnabled = + agentlessExperimentalFeatureEnabled && (isServerless || (isCloud && !!agentlessAPIUrl)); + + const isAgentlessCloudEnabled = isCloud && isAgentlessEnabled && !!agentlessAPIUrl; + const isAgentlessServerlessEnabled = isServerless && isAgentlessEnabled; const isAgentlessAgentPolicy = (agentPolicy: AgentPolicy | undefined) => { if (!agentPolicy) return false; @@ -54,6 +64,9 @@ export const useAgentless = () => { return isAgentlessEnabled && packagePolicy.policy_ids.includes(AGENTLESS_POLICY_ID); }; return { + agentlessAPIUrl, + isAgentlessCloudEnabled, + isAgentlessServerlessEnabled, isAgentlessEnabled, isAgentlessAgentPolicy, isAgentlessIntegration, @@ -74,11 +87,24 @@ export function useSetupTechnology({ setSelectedPolicyTab: (tab: SelectedPolicyTab) => void; packageInfo?: PackageInfo; }) { - const { isAgentlessEnabled, isAgentlessIntegration } = useAgentless(); + const { cloud } = useStartServices(); + const { + isAgentlessEnabled, + isAgentlessIntegration, + isAgentlessCloudEnabled, + isAgentlessServerlessEnabled, + } = useAgentless(); + // this is a placeholder for the new agent-BASED policy that will be used when the user switches from agentless to agent-based and back + const [newAgentBasedPolicy] = useState({ ...newAgentPolicy }); const [selectedSetupTechnology, setSelectedSetupTechnology] = useState( SetupTechnology.AGENT_BASED ); - const [agentlessPolicy, setAgentlessPolicy] = useState(); + const [newAgentlessPolicy, setNewAgentlessPolicy] = useState( + generateNewAgentPolicyWithDefaults({ + name: `Agentless policy ${uuidv4()}`, + supports_agentless: true, + }) + ); useEffect(() => { if (isAgentlessEnabled && packageInfo && isAgentlessIntegration(packageInfo)) { @@ -86,34 +112,50 @@ export function useSetupTechnology({ } }, [isAgentlessEnabled, isAgentlessIntegration, packageInfo]); + // tech debt: remove this useEffect when Serverless uses the Agentless API + // https://github.com/elastic/security-team/issues/9781 useEffect(() => { const fetchAgentlessPolicy = async () => { const { data, error } = await sendGetOneAgentPolicy(AGENTLESS_POLICY_ID); const isAgentlessAvailable = !error && data && data.item; if (isAgentlessAvailable) { - setAgentlessPolicy(data.item); + setNewAgentlessPolicy(data.item); } }; if (isAgentlessEnabled) { - fetchAgentlessPolicy(); + if (cloud?.isServerlessEnabled) { + fetchAgentlessPolicy(); + } } - }, [isAgentlessEnabled]); + }, [isAgentlessEnabled, cloud]); const handleSetupTechnologyChange = useCallback( - (setupTechnology) => { + (setupTechnology: SetupTechnology) => { if (!isAgentlessEnabled || setupTechnology === selectedSetupTechnology) { return; } if (setupTechnology === SetupTechnology.AGENTLESS) { - if (agentlessPolicy) { - updateAgentPolicies([agentlessPolicy]); + if (isAgentlessCloudEnabled) { + updateNewAgentPolicy(newAgentlessPolicy as NewAgentPolicy); + setSelectedPolicyTab(SelectedPolicyTab.NEW); + updateAgentPolicies([newAgentlessPolicy] as AgentPolicy[]); + } + // tech debt: remove this when Serverless uses the Agentless API + // https://github.com/elastic/security-team/issues/9781 + if (isAgentlessServerlessEnabled) { + updateNewAgentPolicy(newAgentlessPolicy as AgentPolicy); + updateAgentPolicies([newAgentlessPolicy] as AgentPolicy[]); setSelectedPolicyTab(SelectedPolicyTab.EXISTING); } } else if (setupTechnology === SetupTechnology.AGENT_BASED) { - updateNewAgentPolicy(newAgentPolicy); + updateNewAgentPolicy({ + ...newAgentBasedPolicy, + supports_agentless: false, + is_managed: false, + } as NewAgentPolicy); setSelectedPolicyTab(SelectedPolicyTab.NEW); updateAgentPolicies([]); } @@ -122,17 +164,18 @@ export function useSetupTechnology({ [ isAgentlessEnabled, selectedSetupTechnology, - agentlessPolicy, - updateAgentPolicies, - setSelectedPolicyTab, + isAgentlessCloudEnabled, + isAgentlessServerlessEnabled, updateNewAgentPolicy, - newAgentPolicy, + newAgentlessPolicy, + setSelectedPolicyTab, + updateAgentPolicies, + newAgentBasedPolicy, ] ); return { handleSetupTechnologyChange, - agentlessPolicy, selectedSetupTechnology, }; } diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.test.tsx index 9b235df27b3c9..4109a66a59638 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.test.tsx @@ -25,11 +25,15 @@ import { useStartServices, useGetAgentPolicies, useGetPackageInfoByKeyQuery, + useConfig, } from '../../../../hooks'; jest.mock('../../../../hooks', () => { return { ...jest.requireActual('../../../../hooks'), + useConfig: jest.fn().mockReturnValue({ + agents: { enabled: true }, + }), useFleetStatus: jest.fn().mockReturnValue({ isReady: true } as any), sendGetStatus: jest .fn() @@ -374,7 +378,6 @@ describe('When on the package policy create page', () => { expect(sendCreatePackagePolicy as jest.MockedFunction).toHaveBeenCalledWith({ ...newPackagePolicy, - policy_id: 'agent-policy-1', policy_ids: ['agent-policy-1'], force: false, }); @@ -671,7 +674,7 @@ describe('When on the package policy create page', () => { }); }); - describe('With agentless policy available', () => { + describe('With agentless policy and Serverless available', () => { beforeEach(async () => { (useStartServices as jest.MockedFunction).mockReturnValue({ ...useStartServices(), @@ -769,6 +772,60 @@ describe('When on the package policy create page', () => { expect(sendCreatePackagePolicy as jest.MockedFunction).toHaveBeenCalled(); }); }); + + describe('With agentless Cloud available', () => { + beforeEach(async () => { + (useConfig as jest.MockedFunction).mockReturnValue({ + agentless: { + api: { + url: 'http://agentless-api-url', + }, + }, + agents: { enabled: true }, + }); + (useStartServices as jest.MockedFunction).mockReturnValue({ + ...useStartServices(), + cloud: { + ...useStartServices().cloud, + isServerlessEnabled: false, + isCloudEnabled: true, + }, + }); + (sendCreateAgentPolicy as jest.MockedFunction).mockResolvedValue({ + data: { + item: { id: 'agentless-policy-1', name: 'Agentless policy 1', namespace: 'default' }, + }, + }); + + (sendCreatePackagePolicy as jest.MockedFunction).mockResolvedValue({ + data: { item: { id: 'policy-1', inputs: [], policy_ids: ['agentless-policy-1'] } }, + }); + jest.spyOn(ExperimentalFeaturesService, 'get').mockReturnValue({ agentless: true } as any); + (useGetPackageInfoByKeyQuery as jest.Mock).mockReturnValue( + getMockPackageInfo({ requiresRoot: false, dataStreamRequiresRoot: false }) + ); + + await act(async () => { + render(); + }); + }); + + test('should create create agent and package policy when in cloud and agentless API url is set', async () => { + await act(async () => { + fireEvent.click(renderResult.getByText(/Save and continue/).closest('button')!); + }); + + // tech debt: this should be converted to use MSW to mock the API calls + // https://github.com/elastic/security-team/issues/9816 + expect(sendGetOneAgentPolicy).not.toHaveBeenCalled(); + expect(sendCreateAgentPolicy).toHaveBeenCalled(); + expect(sendCreatePackagePolicy).toHaveBeenCalled(); + + await waitFor(() => { + expect(renderResult.getByText('Nginx integration added')).toBeInTheDocument(); + }); + }); + }); }); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx index 71b9278a6d549..9c24a9a87aecf 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx @@ -81,6 +81,7 @@ import { PostInstallCloudFormationModal } from './components/cloud_security_post import { PostInstallGoogleCloudShellModal } from './components/cloud_security_posture/post_install_google_cloud_shell_modal'; import { PostInstallAzureArmTemplateModal } from './components/cloud_security_posture/post_install_azure_arm_template_modal'; import { RootPrivilegesCallout } from './root_callout'; +import { useAgentless } from './hooks/setup_technology'; export const StepsWithLessPadding = styled(EuiSteps)` .euiStep__content { @@ -341,15 +342,14 @@ export const CreatePackagePolicySinglePage: CreatePackagePolicyParams = ({ "'package-policy-create' and 'package-policy-replace-define-step' cannot both be registered as UI extensions" ); } - - const { agentlessPolicy, handleSetupTechnologyChange, selectedSetupTechnology } = - useSetupTechnology({ - newAgentPolicy, - updateNewAgentPolicy, - updateAgentPolicies, - setSelectedPolicyTab, - packageInfo, - }); + const { isAgentlessEnabled } = useAgentless(); + const { handleSetupTechnologyChange, selectedSetupTechnology } = useSetupTechnology({ + newAgentPolicy, + updateNewAgentPolicy, + updateAgentPolicies, + setSelectedPolicyTab, + packageInfo, + }); const replaceStepConfigurePackagePolicy = replaceDefineStepView && packageInfo?.name ? ( @@ -365,7 +365,7 @@ export const CreatePackagePolicySinglePage: CreatePackagePolicyParams = ({ validationResults={validationResults} isEditPage={false} handleSetupTechnologyChange={handleSetupTechnologyChange} - agentlessPolicy={agentlessPolicy} + isAgentlessEnabled={isAgentlessEnabled} /> ) diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/package_policies_table.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/package_policies_table.tsx index e9bbde2520837..2cecdf37f30f5 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/package_policies_table.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/package_policies_table.tsx @@ -113,7 +113,7 @@ export const PackagePoliciesTable: React.FunctionComponent = ({ sortable: true, truncateText: true, name: i18n.translate('xpack.fleet.policyDetails.packagePoliciesTable.nameColumnTitle', { - defaultMessage: 'Name', + defaultMessage: 'Integration policy', }), render: (value: string, packagePolicy: InMemoryPackagePolicy) => ( diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx index acaf623afa330..98096d02138f9 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx @@ -144,6 +144,13 @@ export const EditPackagePolicyForm = memo<{ const [isFirstLoad, setIsFirstLoad] = useState(true); const [newAgentPolicyName, setNewAgentPolicyName] = useState(); + // make form dirty if new agent policy is selected + useEffect(() => { + if (newAgentPolicyName) { + setIsEdited(true); + } + }, [newAgentPolicyName, setIsEdited]); + const [hasAgentPolicyError, setHasAgentPolicyError] = useState(false); // Retrieve agent count diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_diagnostics/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_diagnostics/index.tsx index 1bb7e1ee0ad00..437051f03398f 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_diagnostics/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_diagnostics/index.tsx @@ -232,32 +232,39 @@ export const AgentDiagnosticsTab: React.FunctionComponent ); }, }, - { - name: i18n.translate('xpack.fleet.requestDiagnostics.tableColumns.actionsLabelText', { - defaultMessage: 'Actions', - }), - width: '70px', - actions: [ - { - type: 'icon', - icon: 'trash', - color: 'danger', - name: i18n.translate('xpack.fleet.requestDiagnostics.tableColumns.deleteButtonText', { - defaultMessage: 'Delete', - }), - available: (item: AgentDiagnostics) => item.status === 'READY', - description: i18n.translate( - 'xpack.fleet.requestDiagnostics.tableColumns.deleteButtonDesc', - { - defaultMessage: 'Delete diagnostics file', - } - ), - onClick: (item: AgentDiagnostics) => { - deleteFile(item.id); + ...((authz.fleet.allAgents + ? [ + { + name: i18n.translate('xpack.fleet.requestDiagnostics.tableColumns.actionsLabelText', { + defaultMessage: 'Actions', + }), + width: '70px', + actions: [ + { + type: 'icon', + icon: 'trash', + color: 'danger', + name: i18n.translate( + 'xpack.fleet.requestDiagnostics.tableColumns.deleteButtonText', + { + defaultMessage: 'Delete', + } + ), + available: (item: AgentDiagnostics) => item.status === 'READY', + description: i18n.translate( + 'xpack.fleet.requestDiagnostics.tableColumns.deleteButtonDesc', + { + defaultMessage: 'Delete diagnostics file', + } + ), + onClick: (item: AgentDiagnostics) => { + deleteFile(item.id); + }, + }, + ], }, - }, - ], - }, + ] + : []) as Array>), ]; const requestDiagnosticsButton = ( diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.test.tsx index 7824b8abd2a5c..78e32727212c9 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.test.tsx @@ -12,8 +12,6 @@ import { createFleetTestRendererMock } from '../../../../../../../mock'; import { AgentLogsUI } from './agent_logs'; -jest.mock('../../../../../../../hooks/use_authz'); - jest.mock('@kbn/kibana-utils-plugin/public', () => { return { ...jest.requireActual('@kbn/kibana-utils-plugin/public'), @@ -28,6 +26,13 @@ jest.mock('@kbn/logs-shared-plugin/public', () => { LogStream: () =>
    , }; }); +jest.mock('@kbn/logs-shared-plugin/common', () => { + return { + getLogsLocatorsFromUrlService: jest.fn().mockReturnValue({ + logsLocator: { getRedirectUrl: jest.fn(() => 'https://discover-redirect-url') }, + }), + }; +}); jest.mock('@kbn/shared-ux-link-redirect-app', () => { return { @@ -52,6 +57,13 @@ jest.mock('../../../../../hooks', () => { ...jest.requireActual('../../../../../hooks'), useLink: jest.fn(), useStartServices: jest.fn(), + useAuthz: jest.fn(), + useDiscoverLocator: jest.fn().mockImplementation(() => { + return { + id: 'DISCOVER_APP_LOCATOR', + getRedirectUrl: jest.fn().mockResolvedValue('app/discover/logs/someview'), + }; + }), }; }); @@ -62,6 +74,7 @@ describe('AgentLogsUI', () => { jest.mocked(useAuthz).mockReturnValue({ fleet: { allAgents: true, + readAgents: true, }, } as any); }); @@ -100,34 +113,36 @@ describe('AgentLogsUI', () => { }, }, }, - http: { - basePath: { - prepend: (url: string) => 'http://localhost:5620' + url, + share: { + url: { + locators: { + get: () => ({ + useUrl: () => 'https://locator.url', + }), + }, }, }, - cloud: { - isServerlessEnabled, - }, }); }; - it('should render Open in Logs UI if capabilities not set', () => { + it('should render Open in Logs button if privileges are set', () => { mockStartServices(); const result = renderComponent(); expect(result.getByTestId('viewInLogsBtn')).toHaveAttribute( 'href', - `http://localhost:5620/app/logs/stream?logPosition=(end%3A'2023-20-04T14%3A20%3A00.340Z'%2Cstart%3A'2023-20-04T14%3A00%3A00.340Z'%2CstreamLive%3A!f)&logFilter=(expression%3A'elastic_agent.id%3Aagent1%20and%20(data_stream.dataset%3Aelastic_agent)%20and%20(log.level%3Ainfo%20or%20log.level%3Aerror)'%2Ckind%3Akuery)` + `https://discover-redirect-url` ); }); - it('should render Open in Discover if serverless enabled', () => { - mockStartServices(true); + it('should not render Open in Logs button if privileges are not set', () => { + jest.mocked(useAuthz).mockReturnValue({ + fleet: { + readAgents: false, + }, + } as any); + mockStartServices(); const result = renderComponent(); - const viewInDiscover = result.getByTestId('viewInDiscoverBtn'); - expect(viewInDiscover).toHaveAttribute( - 'href', - `http://localhost:5620/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:'2023-20-04T14:00:00.340Z',to:'2023-20-04T14:20:00.340Z'))&_a=(columns:!(event.dataset,message),index:'logs-*',query:(language:kuery,query:'elastic_agent.id:agent1 and (data_stream.dataset:elastic_agent) and (log.level:info or log.level:error)'))` - ); + expect(result.queryByTestId('viewInLogsBtn')).not.toBeInTheDocument(); }); it('should show log level dropdown with correct value', () => { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.tsx index 34cc206967d62..5a9bfecd22144 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.tsx @@ -35,7 +35,7 @@ import { LogLevelFilter } from './filter_log_level'; import { LogQueryBar } from './query_bar'; import { buildQuery } from './build_query'; import { SelectLogLevel } from './select_log_level'; -import { ViewLogsButton } from './view_logs_button'; +import { ViewLogsButton, getFormattedRange } from './view_logs_button'; const WrapperFlexGroup = styled(EuiFlexGroup)` height: 100%; @@ -112,9 +112,8 @@ const AgentPolicyLogsNotEnabledCallout: React.FunctionComponent<{ agentPolicy: A export const AgentLogsUI: React.FunctionComponent = memo( ({ agent, agentPolicy, state }) => { - const { data, application, cloud } = useStartServices(); + const { data, application } = useStartServices(); const { update: updateState } = AgentLogsUrlStateHelper.useTransitions(); - const isLogsUIAvailable = !cloud?.isServerlessEnabled; // Util to convert date expressions (returned by datepicker) to timestamps (used by LogStream) const getDateRangeTimestamps = useCallback( @@ -321,10 +320,9 @@ export const AgentLogsUI: React.FunctionComponent = memo( }} > diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/view_logs_button.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/view_logs_button.tsx index 762c34ad7bc36..7b859596987c0 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/view_logs_button.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/view_logs_button.tsx @@ -5,81 +5,61 @@ * 2.0. */ -import url from 'url'; -import { stringify } from 'querystring'; - import React, { useMemo } from 'react'; -import { encode } from '@kbn/rison'; import { EuiButton } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import { useStartServices } from '../../../../../hooks'; +import { getLogsLocatorsFromUrlService } from '@kbn/logs-shared-plugin/common'; + +import moment from 'moment'; + +import { useDiscoverLocator, useStartServices, useAuthz } from '../../../../../hooks'; interface ViewLogsProps { - viewInLogs: boolean; logStreamQuery: string; - startTime: string; - endTime: string; + startTime: number; + endTime: number; } +export const getFormattedRange = (date: string) => new Date(date).getTime(); + /* - Button that takes to the Logs view Ui when that is available, otherwise fallback to the Discover UI - The urls are built using same logStreamQuery (provided by a prop), startTime and endTime, ensuring that they'll both will target same log lines + Button that takes to the Logs view UI or the Discover logs, depending on what's available + If none is available, don't display the button at all */ export const ViewLogsButton: React.FunctionComponent = ({ - viewInLogs, logStreamQuery, startTime, endTime, }) => { - const { http } = useStartServices(); + const discoverLocator = useDiscoverLocator(); - // Generate URL to pass page state to Logs UI - const viewInLogsUrl = useMemo( - () => - http.basePath.prepend( - url.format({ - pathname: '/app/logs/stream', - search: stringify({ - logPosition: encode({ - start: startTime, - end: endTime, - streamLive: false, - }), - logFilter: encode({ - expression: logStreamQuery, - kind: 'kuery', - }), - }), - }) - ), - [http.basePath, startTime, endTime, logStreamQuery] - ); + const { share } = useStartServices(); + const { logsLocator } = getLogsLocatorsFromUrlService(share.url); + const authz = useAuthz(); - const viewInDiscoverUrl = useMemo(() => { - const index = 'logs-*'; - const query = encode({ - query: logStreamQuery, - language: 'kuery', + const logsUrl = useMemo(() => { + const now = moment().toISOString(); + const oneDayAgo = moment().subtract(1, 'day').toISOString(); + const defaultStartTime = getFormattedRange(oneDayAgo); + const defaultEndTime = getFormattedRange(now); + + return logsLocator.getRedirectUrl({ + time: endTime ? endTime : defaultEndTime, + timeRange: { + startTime: startTime ? startTime : defaultStartTime, + endTime: endTime ? endTime : defaultEndTime, + }, + filter: logStreamQuery, }); - return http.basePath.prepend( - `/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:'${startTime}',to:'${endTime}'))&_a=(columns:!(event.dataset,message),index:'${index}',query:${query})` - ); - }, [logStreamQuery, http.basePath, startTime, endTime]); + }, [endTime, logStreamQuery, logsLocator, startTime]); - return viewInLogs ? ( - + return authz.fleet.readAgents && (logsLocator || discoverLocator) ? ( + - ) : ( - - - - ); + ) : null; }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/index.test.tsx index 433cd687208fc..c649b3829a41e 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/index.test.tsx @@ -11,7 +11,7 @@ import { act, render, fireEvent } from '@testing-library/react'; import { IntlProvider } from 'react-intl'; import { useActionStatus } from '../../hooks'; -import { useGetAgentPolicies, useStartServices } from '../../../../../hooks'; +import { useGetAgentPolicies, useStartServices, useAuthz } from '../../../../../hooks'; import { AgentActivityFlyout } from '.'; @@ -25,6 +25,15 @@ jest.mock('@kbn/shared-ux-link-redirect-app', () => ({ const mockUseActionStatus = useActionStatus as jest.Mock; const mockUseGetAgentPolicies = useGetAgentPolicies as jest.Mock; const mockUseStartServices = useStartServices as jest.Mock; +const mockedUseAuthz = useAuthz as jest.Mock; + +jest.mock('@kbn/logs-shared-plugin/common', () => { + return { + getLogsLocatorsFromUrlService: jest.fn().mockReturnValue({ + logsLocator: { getRedirectUrl: jest.fn(() => 'https://discover-redirect-url') }, + }), + }; +}); describe('AgentActivityFlyout', () => { const mockOnClose = jest.fn(); @@ -65,7 +74,22 @@ describe('AgentActivityFlyout', () => { docLinks: { links: { fleet: { upgradeElasticAgent: 'https://elastic.co' } } }, application: { navigateToUrl: jest.fn() }, http: { basePath: { prepend: jest.fn() } }, + share: { + url: { + locators: { + get: () => ({ + useUrl: () => 'https://locator.url', + }), + }, + }, + }, }); + mockedUseAuthz.mockReturnValue({ + fleet: { + readAgents: true, + allAgents: true, + }, + } as any); }); beforeEach(() => { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/view_errors.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/view_errors.test.tsx index b5018f812da4e..e8f73eae3a2b9 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/view_errors.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/view_errors.test.tsx @@ -12,7 +12,7 @@ import { I18nProvider } from '@kbn/i18n-react'; import type { ActionStatus } from '../../../../../../../common/types'; -import { useStartServices } from '../../../../hooks'; +import { useStartServices, useAuthz } from '../../../../hooks'; import { ViewErrors } from './view_errors'; @@ -21,6 +21,13 @@ jest.mock('../../../../hooks', () => { ...jest.requireActual('../../../../hooks'), useLink: jest.fn(), useStartServices: jest.fn(), + useAuthz: jest.fn(), + useDiscoverLocator: jest.fn().mockImplementation(() => { + return { + id: 'DISCOVER_APP_LOCATOR', + getRedirectUrl: jest.fn().mockResolvedValue('app/discover/logs/someview'), + }; + }), }; }); @@ -32,6 +39,14 @@ jest.mock('@kbn/shared-ux-link-redirect-app', () => ({ }, })); +jest.mock('@kbn/logs-shared-plugin/common', () => { + return { + getLogsLocatorsFromUrlService: jest.fn().mockReturnValue({ + logsLocator: { getRedirectUrl: jest.fn(() => 'https://discover-redirect-url') }, + }), + }; +}); + const mockStartServices = (isServerlessEnabled?: boolean) => { mockUseStartServices.mockReturnValue({ application: {}, @@ -47,18 +62,27 @@ const mockStartServices = (isServerlessEnabled?: boolean) => { }, }, }, - http: { - basePath: { - prepend: (url: string) => 'http://localhost:5620' + url, + share: { + url: { + locators: { + get: () => ({ + useUrl: () => 'https://locator.url', + }), + }, }, }, - cloud: { - isServerlessEnabled, - }, }); }; describe('ViewErrors', () => { + beforeEach(() => { + jest.mocked(useAuthz).mockReturnValue({ + fleet: { + allAgents: true, + readAgents: true, + }, + } as any); + }); const renderComponent = (action: ActionStatus) => { return render( @@ -67,7 +91,7 @@ describe('ViewErrors', () => { ); }; - it('should render error message with btn to Logs view if serverless not enabled', () => { + it('should render error message with btn to Logs view', () => { mockStartServices(); const result = renderComponent({ actionId: 'action1', @@ -82,15 +106,32 @@ describe('ViewErrors', () => { const errorText = result.getByTestId('errorText'); expect(errorText.textContent).toEqual('Agent agent1 is not upgradeable'); + }); + + it('should render open in Logs button if correct privileges are set', () => { + mockStartServices(); + const result = renderComponent({ + actionId: 'action1', + latestErrors: [ + { + agentId: 'agent1', + error: 'Agent agent1 is not upgradeable', + timestamp: '2023-03-06T14:51:24.709Z', + }, + ], + } as any); const viewErrorBtn = result.getByTestId('viewInLogsBtn'); - expect(viewErrorBtn.getAttribute('href')).toEqual( - `http://localhost:5620/app/logs/stream?logPosition=(end%3A'2023-03-06T14%3A56%3A24.709Z'%2Cstart%3A'2023-03-06T14%3A46%3A24.709Z'%2CstreamLive%3A!f)&logFilter=(expression%3A'elastic_agent.id%3Aagent1%20and%20(data_stream.dataset%3Aelastic_agent)%20and%20(log.level%3Aerror)'%2Ckind%3Akuery)` - ); + expect(viewErrorBtn.getAttribute('href')).toEqual(`https://discover-redirect-url`); }); - it('should render error message with btn to Discover view if serverless enabled', () => { - mockStartServices(true); + it('should not render open in Logs button if privileges are not set', () => { + jest.mocked(useAuthz).mockReturnValue({ + fleet: { + readAgents: false, + }, + } as any); + mockStartServices(); const result = renderComponent({ actionId: 'action1', latestErrors: [ @@ -102,12 +143,6 @@ describe('ViewErrors', () => { ], } as any); - const errorText = result.getByTestId('errorText'); - expect(errorText.textContent).toEqual('Agent agent1 is not upgradeable'); - - const viewErrorBtn = result.getByTestId('viewInDiscoverBtn'); - expect(viewErrorBtn.getAttribute('href')).toEqual( - `http://localhost:5620/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:'2023-03-06T14:46:24.709Z',to:'2023-03-06T14:56:24.709Z'))&_a=(columns:!(event.dataset,message),index:'logs-*',query:(language:kuery,query:'elastic_agent.id:agent1 and (data_stream.dataset:elastic_agent) and (log.level:error)'))` - ); + expect(result.queryByTestId('viewInLogsBtn')).not.toBeInTheDocument(); }); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/view_errors.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/view_errors.tsx index 4d43c9a60a618..e73d7778d1405 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/view_errors.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/view_errors.tsx @@ -17,7 +17,10 @@ import { i18n } from '@kbn/i18n'; import type { ActionErrorResult } from '../../../../../../../common/types'; import { buildQuery } from '../../agent_details_page/components/agent_logs/build_query'; -import { ViewLogsButton } from '../../agent_details_page/components/agent_logs/view_logs_button'; +import { + ViewLogsButton, + getFormattedRange, +} from '../../agent_details_page/components/agent_logs/view_logs_button'; import type { ActionStatus } from '../../../../types'; import { useStartServices } from '../../../../hooks'; @@ -30,11 +33,12 @@ const TruncatedEuiText = styled(EuiText)` export const ViewErrors: React.FunctionComponent<{ action: ActionStatus }> = ({ action }) => { const coreStart = useStartServices(); - const isLogsUIAvailable = !coreStart.cloud?.isServerlessEnabled; - const getLogsButton = (agentId: string, timestamp: string, viewInLogs: boolean) => { - const startTime = moment(timestamp).subtract(5, 'm').toISOString(); - const endTime = moment(timestamp).add(5, 'm').toISOString(); + const getLogsButton = (agentId: string, timestamp: string) => { + const start = moment(timestamp).subtract(5, 'm').toISOString(); + const end = moment(timestamp).add(5, 'm').toISOString(); + const startTime = getFormattedRange(start); + const endTime = getFormattedRange(end); const logStreamQuery = buildQuery({ agentId, @@ -43,12 +47,7 @@ export const ViewErrors: React.FunctionComponent<{ action: ActionStatus }> = ({ userQuery: '', }); return ( - + ); }; @@ -86,7 +85,7 @@ export const ViewErrors: React.FunctionComponent<{ action: ActionStatus }> = ({ const errorItem = (action.latestErrors ?? []).find((item) => item.agentId === agentId); return ( - {getLogsButton(agentId, errorItem!.timestamp, !!isLogsUIAvailable)} + {getLogsButton(agentId, errorItem!.timestamp)} ); }, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx index 3a21103503ae5..a9adc6140c7c5 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx @@ -128,6 +128,7 @@ export const EnrollmentTokenListPage: React.FunctionComponent<{}> = () => { const agentPolicy = agentPoliciesById[enrollmentKey.policy_id]; return !agentPolicy?.is_managed; }) || []; + const filteredTotal = rowItems.length; const columns = [ { @@ -294,7 +295,7 @@ export const EnrollmentTokenListPage: React.FunctionComponent<{}> = () => { pagination={{ pageIndex: pagination.currentPage - 1, pageSize: pagination.pageSize, - totalItemCount: total, + totalItemCount: filteredTotal, pageSizeOptions, }} onChange={({ page }: { page: { index: number; size: number } }) => { diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx index 9f1d716f6f396..4261d32b6b4b5 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx @@ -23,7 +23,7 @@ import { EuiSwitch, } from '@elastic/eui'; -import { usePutSettingsMutation, useStartServices } from '../../../hooks'; +import { usePutSettingsMutation, useStartServices, useAuthz } from '../../../hooks'; export type IntegrationPreferenceType = 'recommended' | 'beats' | 'agent'; @@ -92,7 +92,7 @@ export const IntegrationPreference = ({ const [prereleaseIntegrationsChecked, setPrereleaseIntegrationsChecked] = React.useState< boolean | undefined >(undefined); - + const authz = useAuthz(); const { docLinks, notifications } = useStartServices(); const { mutateAsync: mutateSettingsAsync } = usePutSettingsMutation(); @@ -153,18 +153,24 @@ export const IntegrationPreference = ({ updateSettings(event.target.checked); }; + const canUpdateBetaSetting = authz.fleet.allSettings; + return ( - - + {canUpdateBetaSetting && ( + <> + + + + )} {title} diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/configs/index.test.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/configs/index.test.tsx new file mode 100644 index 0000000000000..a1de54ae5f9fc --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/configs/index.test.tsx @@ -0,0 +1,143 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { createIntegrationsTestRendererMock } from '../../../../../../../mock'; +import { isPackagePrerelease } from '../../../../../../../../common/services'; +import { useGetInputsTemplatesQuery } from '../../../../../hooks'; +import type { PackageInfo } from '../../../../../types'; + +import { Configs } from '.'; + +jest.mock('../../../../../hooks', () => { + return { + ...jest.requireActual('../../../../../hooks'), + useGetInputsTemplatesQuery: jest.fn(), + useConfirmForceInstall: jest.fn(), + useStartServices: jest.fn().mockReturnValue({ + notifications: { + toasts: { + addError: jest.fn(), + addSuccess: jest.fn(), + }, + }, + docLinks: { + links: { + fleet: {}, + }, + }, + }), + }; +}); +jest.mock('../../../../../../../../common/services'); + +const mockIsPackagePrerelease = isPackagePrerelease as jest.Mock; + +function renderComponent(packageInfo: PackageInfo) { + const renderer = createIntegrationsTestRendererMock(); + + return renderer.render(); +} + +describe('Configs', () => { + beforeEach(() => { + mockIsPackagePrerelease.mockReset(); + (useGetInputsTemplatesQuery as jest.Mock).mockReset(); + }); + + const packageInfo = { + name: 'nginx', + title: 'Nginx', + version: '1.3.0', + release: 'ga', + description: 'Collect logs and metrics from Nginx HTTP servers with Elastic Agent.', + format_version: '', + owner: { github: '' }, + assets: {} as any, + policy_templates: [ + { + name: 'nginx', + title: 'Nginx logs and metrics', + description: 'Collect logs and metrics from Nginx instances', + inputs: [ + { + type: 'logfile', + title: 'Collect logs from Nginx instances', + description: 'Collecting Nginx access and error logs', + }, + ], + multiple: true, + }, + ], + data_streams: [ + { + type: 'logs', + dataset: 'nginx.access', + title: 'Nginx access logs', + release: 'experimental', + ingest_pipeline: 'default', + streams: [ + { + input: 'logfile', + vars: [ + { + name: 'paths', + type: 'text', + title: 'Paths', + multi: true, + required: true, + show_user: true, + default: ['/var/log/nginx/access.log*'], + }, + ], + template_path: 'stream.yml.hbs', + title: 'Nginx access logs', + description: 'Collect Nginx access logs', + enabled: true, + }, + ], + package: 'nginx', + path: 'access', + }, + ], + latestVersion: '1.3.0', + keepPoliciesUpToDate: false, + status: 'not_installed', + } as PackageInfo; + + it('it should display configs tab and a warning if the integration is not installed', () => { + mockIsPackagePrerelease.mockReturnValue(false); + (useGetInputsTemplatesQuery as jest.Mock).mockReturnValue({ data: 'yaml configs' }); + + const result = renderComponent(packageInfo); + expect(result.queryByTestId('configsTab.notInstalled')).toBeInTheDocument(); + expect(result.queryByTestId('configsTab.info')).toBeInTheDocument(); + expect(result.queryByTestId('configsTab.codeblock')?.textContent).toContain('yaml configs'); + expect(result.queryByTestId('prereleaseCallout')).not.toBeInTheDocument(); + }); + + it('it should display prerelease callout if the package is prerelease', () => { + mockIsPackagePrerelease.mockReturnValue(true); + (useGetInputsTemplatesQuery as jest.Mock).mockReturnValue({ data: 'yaml configs' }); + + const result = renderComponent(packageInfo); + expect(result.queryByTestId('configsTab.info')).toBeInTheDocument(); + expect(result.queryByTestId('prereleaseCallout')).toBeInTheDocument(); + expect(result.queryByTestId('configsTab.codeblock')).toBeInTheDocument(); + }); + + it('it should display a warning callout if there is an error', () => { + mockIsPackagePrerelease.mockReturnValue(false); + (useGetInputsTemplatesQuery as jest.Mock).mockReturnValue({ error: 'some error' }); + + const result = renderComponent(packageInfo); + expect(result.queryByTestId('configsTab.errorCallout')).toBeInTheDocument(); + expect(result.queryByTestId('configsTab.codeblock')).not.toBeInTheDocument(); + expect(result.queryByTestId('configsTab.info')).not.toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/configs/index.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/configs/index.tsx index 0167c337d7ddf..e80665631f3ea 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/configs/index.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/configs/index.tsx @@ -17,7 +17,6 @@ import { EuiCode, } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import type { PackageInfo } from '../../../../../types'; @@ -33,7 +32,7 @@ interface ConfigsProps { } export const Configs: React.FC = ({ packageInfo }) => { - const { notifications, docLinks } = useStartServices(); + const { docLinks } = useStartServices(); const { name: pkgName, version: pkgVersion, title: pkgTitle } = packageInfo; const notInstalled = packageInfo.status !== 'installing'; @@ -47,78 +46,100 @@ export const Configs: React.FC = ({ packageInfo }) => { { format: 'yaml', prerelease: isPrerelease } ); - if (error) { - notifications.toasts.addError(error, { - title: i18n.translate('xpack.fleet.epm.InputTemplates.loadingErro', { - defaultMessage: 'Error input templates', - }), - }); - } - return ( - - {isLoading && !configs ? ( - - ) : ( - <> - {isPrerelease && ( - <> - - - - )} - -

    - elastic-agent.yml, - inputsDir: inputs.d, - userGuideLink: ( - - - - ), - }} - /> -

    -
    - {notInstalled && ( - <> - - - } - color="warning" - iconType="warning" - /> - - )} - - - {configs} - - - )} -
    + {error ? ( + + + } + color="warning" + iconType="alert" + > +

    + +

    +
    +
    + ) : ( + + {isLoading && !configs ? ( + + ) : ( + <> + {isPrerelease && ( + <> + + + + )} + +

    + elastic-agent.yml, + inputsDir: inputs.d, + userGuideLink: ( + + + + ), + }} + /> +

    +
    + {notInstalled && ( + <> + + + } + color="warning" + iconType="warning" + /> + + )} + + + {configs} + + + )} +
    + )}
    ); }; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/avc_banner/avc_banner_background.svg b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/avc_banner/avc_banner_background.svg new file mode 100644 index 0000000000000..cd37f26c95f7b --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/avc_banner/avc_banner_background.svg @@ -0,0 +1,329 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/avc_banner/avc_results_banner_2024.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/avc_banner/avc_results_banner_2024.tsx new file mode 100644 index 0000000000000..63a3f68254c6c --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/avc_banner/avc_results_banner_2024.tsx @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { css } from '@emotion/css'; +import { i18n } from '@kbn/i18n'; +import { EuiButton, EuiCallOut, EuiSpacer, useEuiTheme } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; + +import avcBannerBackground from './avc_banner_background.svg'; + +export const AVCResultsBanner2024: React.FC<{ onDismiss: () => void }> = ({ onDismiss }) => { + const { docLinks } = useKibana().services; + const { euiTheme } = useEuiTheme(); + const bannerTitle = i18n.translate( + 'xpack.fleet.integrations.epm.elasticDefend.avcResultsBanner.title', + { + defaultMessage: '100% protection with zero false positives.', + } + ); + + const calloutStyles = css({ + paddingLeft: `${euiTheme.size.xl}`, + backgroundImage: `url(${avcBannerBackground})`, + backgroundRepeat: 'no-repeat', + backgroundPositionX: 'right', + backgroundPositionY: 'bottom', + }); + + return ( + + + + + + + + ); +}; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx index 85899dc8d86c3..f9c2d80d3336e 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx @@ -20,6 +20,8 @@ import { import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; + import { isIntegrationPolicyTemplate, isPackagePrerelease, @@ -36,6 +38,10 @@ import { isPackageUnverified } from '../../../../../../../services'; import type { PackageInfo, RegistryPolicyTemplate } from '../../../../../types'; import { SideBarColumn } from '../../../components/side_bar_column'; +import type { FleetStartServices } from '../../../../../../../plugin'; + +import { AVCResultsBanner2024 } from './avc_banner/avc_results_banner_2024'; + import { Screenshots } from './screenshots'; import { Readme } from './readme'; import { Details } from './details'; @@ -159,9 +165,11 @@ export const OverviewPage: React.FC = memo( () => integrationInfo?.screenshots || packageInfo.screenshots || [], [integrationInfo, packageInfo.screenshots] ); + const { storage } = useKibana().services; const { packageVerificationKeyId } = useGetPackageVerificationKeyId(); const isUnverified = isPackageUnverified(packageInfo, packageVerificationKeyId); const isPrerelease = isPackagePrerelease(packageInfo.version); + const isElasticDefend = packageInfo.name === 'endpoint'; const [markdown, setMarkdown] = useState(undefined); const [selectedItemId, setSelectedItem] = useState(undefined); const [isSideNavOpenOnMobile, setIsSideNavOpenOnMobile] = useState(false); @@ -283,6 +291,14 @@ export const OverviewPage: React.FC = memo( const requireAgentRootPrivileges = isRootPrivilegesRequired(packageInfo); + const [showAVCBanner, setShowAVCBanner] = useState( + storage.get('securitySolution.showAvcBanner') ?? true + ); + const onBannerDismiss = useCallback(() => { + setShowAVCBanner(false); + storage.set('securitySolution.showAvcBanner', false); + }, [storage]); + return ( @@ -297,6 +313,12 @@ export const OverviewPage: React.FC = memo( {isUnverified && } + {isElasticDefend && showAVCBanner && ( + <> + + + + )} {isPrerelease && ( ) => { cleanup(); const renderer = createFleetTestRendererMock(); @@ -47,6 +49,11 @@ describe('', () => { let results: RenderResult; beforeEach(async () => { + jest.mocked(useAuthz).mockReturnValue({ + fleet: { + readAgentPolicies: true, + }, + } as any); jest.mocked(useFleetServerStandalone).mockReturnValue({ isFleetServerStandalone: false }); (useFleetServerUnhealthy as jest.Mock).mockReturnValue({ diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/index.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/index.tsx index 57b3a8e0e0ff5..ef9f9f34a7eda 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/index.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/index.tsx @@ -28,6 +28,7 @@ import { useFleetStatus, useAgentEnrollmentFlyoutData, useFleetServerHostsForPolicy, + useAuthz, } from '../../hooks'; import { FLEET_SERVER_PACKAGE, MAX_FLYOUT_WIDTH } from '../../constants'; import type { PackagePolicy, AgentPolicy } from '../../types'; @@ -61,6 +62,8 @@ export const AgentEnrollmentFlyout: React.FunctionComponent = ({ return policies.find((p) => p.id === id); }; + const authz = useAuthz(); + const fleetStatus = useFleetStatus(); const { docLinks } = useStartServices(); @@ -172,6 +175,8 @@ export const AgentEnrollmentFlyout: React.FunctionComponent = ({ data-test-subj="standaloneTab" isSelected={mode === 'standalone'} onClick={() => setMode('standalone')} + // Standalone need read access to agent policies + disabled={!authz.fleet.readAgentPolicies} > = ({ children, showTooltip }) => { + return showTooltip && children ? ( + + } + > + {children as React.ReactElement} + + ) : ( + <>{children} + ); +}; + export const InstallationModeSelectionStep = ({ selectedPolicyId, mode, @@ -23,6 +43,7 @@ export const InstallationModeSelectionStep = ({ mode: FlyoutMode; setMode: (v: FlyoutMode) => void; }): EuiContainedStepProps => { + const authz = useAuthz(); // radio id has to be unique so that the component works even if appears twice in DOM const radioSuffix = 'installation_mode_agent_selection'; @@ -63,22 +84,26 @@ export const InstallationModeSelectionStep = ({ }, { id: `standalone_${radioSuffix}`, + // Disabled if no agentPolicies read permission + disabled: !authz.fleet.readAgentPolicies, label: ( - - - - ), - }} - /> + + + + + ), + }} + /> + ), }, ]} diff --git a/x-pack/plugins/fleet/public/components/package_policy_delete_provider.tsx b/x-pack/plugins/fleet/public/components/package_policy_delete_provider.tsx index 35f2313f37e0a..6369d344a2d9f 100644 --- a/x-pack/plugins/fleet/public/components/package_policy_delete_provider.tsx +++ b/x-pack/plugins/fleet/public/components/package_policy_delete_provider.tsx @@ -43,6 +43,16 @@ export const PackagePolicyDeleteProvider: React.FunctionComponent = ({ const onSuccessCallback = useRef(null); const { canUseMultipleAgentPolicies } = useMultipleAgentPolicies(); + const isShared = useMemo(() => { + if (agentPolicies?.length !== 1) { + return false; + } + const packagePolicy = agentPolicies[0].package_policies?.find( + (policy) => policy.id === packagePolicies[0] + ); + return (packagePolicy?.policy_ids?.length ?? 0) > 1; + }, [agentPolicies, packagePolicies]); + const hasMultipleAgentPolicies = canUseMultipleAgentPolicies && agentPolicies && agentPolicies.length > 1; @@ -59,7 +69,7 @@ export const PackagePolicyDeleteProvider: React.FunctionComponent = ({ const request = await sendGetAgents({ kuery, - showInactive: false, + showInactive: true, }); setAgentsCount(request.data?.total || 0); setIsLoadingAgentsCount(false); @@ -196,7 +206,7 @@ export const PackagePolicyDeleteProvider: React.FunctionComponent = ({ /> ) : agentsCount && agentPolicies ? ( <> - {hasMultipleAgentPolicies && ( + {(hasMultipleAgentPolicies || isShared) && ( <> { const { http, cloud } = useStartServices(); const isLogsUIAvailable = !cloud?.isServerlessEnabled; // if logs ui is not available, link to discover + // TODO: move away from hardcoded link and use locators instead const logStreamUrl = isLogsUIAvailable ? http.basePath.prepend('/app/logs/stream') : http.basePath.prepend('/app/discover'); diff --git a/x-pack/plugins/fleet/public/hooks/use_locator.ts b/x-pack/plugins/fleet/public/hooks/use_locator.ts index a3fed97679456..25a673b694670 100644 --- a/x-pack/plugins/fleet/public/hooks/use_locator.ts +++ b/x-pack/plugins/fleet/public/hooks/use_locator.ts @@ -21,3 +21,7 @@ export function useLocator( export function useDashboardLocator() { return useLocator(LOCATORS_IDS.DASHBOARD_APP); } + +export function useDiscoverLocator() { + return useLocator(LOCATORS_IDS.DISCOVER_APP_LOCATOR); +} diff --git a/x-pack/plugins/fleet/public/types/ui_extensions.ts b/x-pack/plugins/fleet/public/types/ui_extensions.ts index ec2a5c42e3b0e..ec84b23fa4cac 100644 --- a/x-pack/plugins/fleet/public/types/ui_extensions.ts +++ b/x-pack/plugins/fleet/public/types/ui_extensions.ts @@ -12,7 +12,14 @@ import type { FleetServerAgentComponentUnit } from '../../common/types/models/ag import type { PackagePolicyValidationResults } from '../services'; -import type { Agent, AgentPolicy, NewPackagePolicy, PackageInfo, PackagePolicy } from '.'; +import type { + Agent, + AgentPolicy, + NewPackagePolicy, + PackageInfo, + PackagePolicy, + SetupTechnology, +} from '.'; /** Register a Fleet UI extension */ export type UIExtensionRegistrationCallback = (extensionPoint: UIExtensionPoint) => void; @@ -36,8 +43,8 @@ export type PackagePolicyReplaceDefineStepExtensionComponentProps = ( validationResults?: PackagePolicyValidationResults; agentPolicies?: AgentPolicy[]; packageInfo: PackageInfo; - agentlessPolicy?: AgentPolicy; - handleSetupTechnologyChange?: (setupTechnology: string) => void; + isAgentlessEnabled?: boolean; + handleSetupTechnologyChange?: (setupTechnology: SetupTechnology) => void; }; /** diff --git a/x-pack/plugins/fleet/server/collectors/agent_policies.ts b/x-pack/plugins/fleet/server/collectors/agent_policies.ts index 5210e7f3b229d..190c43f341ff8 100644 --- a/x-pack/plugins/fleet/server/collectors/agent_policies.ts +++ b/x-pack/plugins/fleet/server/collectors/agent_policies.ts @@ -49,9 +49,11 @@ export const getAgentPoliciesUsage = async ( }); const uniqueOutputTypes = new Set( - Array.from(uniqueOutputIds).map((outputId) => { - return outputsById[outputId]?.attributes.type; - }) + Array.from(uniqueOutputIds) + .map((outputId) => { + return outputsById[outputId]?.attributes.type; + }) + .filter((outputType) => outputType) ); const [policiesWithGlobalDataTag, totalNumberOfGlobalDataTagFields] = agentPolicies.reduce( diff --git a/x-pack/plugins/fleet/server/routes/agent/index.ts b/x-pack/plugins/fleet/server/routes/agent/index.ts index 640a9f69ed4d6..6c55835a1ed94 100644 --- a/x-pack/plugins/fleet/server/routes/agent/index.ts +++ b/x-pack/plugins/fleet/server/routes/agent/index.ts @@ -338,7 +338,7 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT .delete({ path: AGENT_API_ROUTES.DELETE_UPLOAD_FILE_PATTERN, fleetAuthz: { - fleet: { readAgents: true }, + fleet: { allAgents: true }, }, }) .addVersion( 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 a26fc6760397c..2fe60943b1909 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 @@ -376,10 +376,43 @@ describe('When calling package policy', () => { it('should not throw if enterprise license and multiple policy_ids is provided', async () => { jest.spyOn(licenseService, 'hasAtLeast').mockReturnValue(true); + jest + .spyOn(appContextService, 'getExperimentalFeatures') + .mockReturnValue({ enableReusableIntegrationPolicies: true } as any); const request = getUpdateKibanaRequest({ policy_ids: ['1', '2'] } as any); await routeHandler(context, request, response); expect(response.ok).toHaveBeenCalled(); }); + + it('should throw if enterprise license and feature flag is disabled and multiple policy_ids is provided', async () => { + jest.spyOn(licenseService, 'hasAtLeast').mockReturnValue(true); + jest + .spyOn(appContextService, 'getExperimentalFeatures') + .mockReturnValue({ enableReusableIntegrationPolicies: false } as any); + const request = getUpdateKibanaRequest({ policy_ids: ['1', '2'] } as any); + await routeHandler(context, request, response); + expect(response.customError).toHaveBeenCalledWith({ + statusCode: 400, + body: { + message: 'Reusable integration policies are not supported', + }, + }); + }); + + it('should throw if empty policy_ids are provided', async () => { + jest.spyOn(licenseService, 'hasAtLeast').mockReturnValue(true); + jest + .spyOn(appContextService, 'getExperimentalFeatures') + .mockReturnValue({ enableReusableIntegrationPolicies: true } as any); + const request = getUpdateKibanaRequest({ policy_ids: [] } as any); + await routeHandler(context, request, response); + expect(response.customError).toHaveBeenCalledWith({ + statusCode: 400, + body: { + message: 'At least one agent policy id must be provided', + }, + }); + }); }); describe('list api handler', () => { 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 abad84ef9db9d..a40b2a41d89db 100644 --- a/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts @@ -421,6 +421,10 @@ export const updatePackagePolicyHandler: FleetRequestHandler< throw new PackagePolicyRequestError(errorMessage); } + if (newData.policy_ids && newData.policy_ids.length === 0) { + throw new PackagePolicyRequestError('At least one agent policy id must be provided'); + } + const updatedPackagePolicy = await packagePolicyService.update( soClient, esClient, diff --git a/x-pack/plugins/fleet/server/routes/package_policy/utils/index.ts b/x-pack/plugins/fleet/server/routes/package_policy/utils/index.ts index da1fca175b9cf..7a88899d8ba28 100644 --- a/x-pack/plugins/fleet/server/routes/package_policy/utils/index.ts +++ b/x-pack/plugins/fleet/server/routes/package_policy/utils/index.ts @@ -8,7 +8,7 @@ import type { TypeOf } from '@kbn/config-schema'; import type { CreatePackagePolicyRequestSchema, PackagePolicyInput } from '../../../types'; -import { licenseService } from '../../../services'; +import { appContextService, licenseService } from '../../../services'; import type { SimplifiedPackagePolicy } from '../../../../common/services/simplified_package_policy_helper'; export function isSimplifiedCreatePackagePolicyRequest( @@ -44,9 +44,12 @@ const LICENCE_FOR_MULTIPLE_AGENT_POLICIES = 'enterprise'; export function canUseMultipleAgentPolicies() { const hasEnterpriseLicence = licenseService.hasAtLeast(LICENCE_FOR_MULTIPLE_AGENT_POLICIES); + const { enableReusableIntegrationPolicies } = appContextService.getExperimentalFeatures(); return { - canUseReusablePolicies: hasEnterpriseLicence, - errorMessage: 'Reusable integration policies are only available with an Enterprise license', + canUseReusablePolicies: hasEnterpriseLicence && enableReusableIntegrationPolicies, + errorMessage: !hasEnterpriseLicence + ? 'Reusable integration policies are only available with an Enterprise license' + : 'Reusable integration policies are not supported', }; } diff --git a/x-pack/plugins/fleet/server/routes/utils/filter_utils.test.ts b/x-pack/plugins/fleet/server/routes/utils/filter_utils.test.ts index c73f7e8762669..5ff0e18ef35f6 100644 --- a/x-pack/plugins/fleet/server/routes/utils/filter_utils.test.ts +++ b/x-pack/plugins/fleet/server/routes/utils/filter_utils.test.ts @@ -388,7 +388,7 @@ describe('Filter Utils', () => { ]); }); - it('Return Error if filter is using an non-existing key null key', () => { + it('Not return error if filter is using an non-existing key null key', () => { const validationObject = validateFilterKueryNode({ astFilter: esKuery.fromKueryExpression('foo.attributes.description: hello AND bye'), types: ['foo'], @@ -405,7 +405,7 @@ describe('Filter Utils', () => { }, { astPath: 'arguments.1', - error: 'Invalid key', + error: null, isSavedObjectAttr: false, key: null, type: null, diff --git a/x-pack/plugins/fleet/server/routes/utils/filter_utils.ts b/x-pack/plugins/fleet/server/routes/utils/filter_utils.ts index fac6e40024e60..4f29f368e5140 100644 --- a/x-pack/plugins/fleet/server/routes/utils/filter_utils.ts +++ b/x-pack/plugins/fleet/server/routes/utils/filter_utils.ts @@ -133,6 +133,9 @@ export const hasFilterKeyError = ( indexMapping: IndexMapping, skipNormalization?: boolean ): string | null => { + if (key === null) { + return null; + } if (!key) { return `Invalid key`; } diff --git a/x-pack/plugins/fleet/server/routes/utils/filter_utils_real_queries.test.ts b/x-pack/plugins/fleet/server/routes/utils/filter_utils_real_queries.test.ts index 45b0995aac078..a8765dc87327b 100644 --- a/x-pack/plugins/fleet/server/routes/utils/filter_utils_real_queries.test.ts +++ b/x-pack/plugins/fleet/server/routes/utils/filter_utils_real_queries.test.ts @@ -551,17 +551,6 @@ describe('validateKuery validates real kueries', () => { expect(validationObj?.isValid).toEqual(true); }); - it('Invalid kuery', async () => { - const validationObj = validateKuery( - 'test%3A', - [AGENT_POLICY_SAVED_OBJECT_TYPE], - AGENT_POLICY_MAPPINGS, - true - ); - expect(validationObj?.isValid).toEqual(false); - expect(validationObj?.error).toContain(`KQLSyntaxError: Invalid key`); - }); - it('Kuery with non existent parameter wrapped by SO', async () => { const validationObj = validateKuery( `${AGENT_POLICY_SAVED_OBJECT_TYPE}.non_existent_parameter: 'test_id'`, @@ -834,15 +823,15 @@ describe('validateKuery validates real kueries', () => { expect(validationObj?.isValid).toEqual(true); }); - it('Invalid search by non existent parameter', async () => { + it('Search without field parameter', async () => { const validationObj = validateKuery( `policyId1`, [FLEET_ENROLLMENT_API_PREFIX], ENROLLMENT_API_KEY_MAPPINGS, true ); - expect(validationObj?.isValid).toEqual(false); - expect(validationObj?.error).toEqual(`KQLSyntaxError: Invalid key`); + expect(validationObj?.isValid).toEqual(true); + expect(validationObj?.error).toEqual(undefined); }); }); describe('Feature flag enableStrictKQLValidation', () => { diff --git a/x-pack/plugins/fleet/server/services/agent_policy.test.ts b/x-pack/plugins/fleet/server/services/agent_policy.test.ts index 4cc816a908cdc..76deafbc12211 100644 --- a/x-pack/plugins/fleet/server/services/agent_policy.test.ts +++ b/x-pack/plugins/fleet/server/services/agent_policy.test.ts @@ -119,6 +119,7 @@ describe('Agent policy', () => { beforeEach(() => { mockedLogger = loggerMock.create(); mockedAppContextService.getLogger.mockReturnValue(mockedLogger); + mockedAppContextService.getExperimentalFeatures.mockReturnValue({ agentless: false } as any); }); afterEach(() => { @@ -230,7 +231,7 @@ describe('Agent policy', () => { ); }); - it('should throw AgentPolicyInvalidError if support_agentless is defined in stateful', async () => { + it('should throw AgentPolicyInvalidError if support_agentless is defined in stateful without agentless feature', async () => { jest .spyOn(appContextService, 'getExperimentalFeatures') .mockReturnValue({ agentless: false } as any); @@ -249,7 +250,7 @@ describe('Agent policy', () => { }) ).rejects.toThrowError( new AgentPolicyInvalidError( - 'supports_agentless is only allowed in serverless environments that support the agentless feature' + 'supports_agentless is only allowed in serverless and cloud environments that support the agentless feature' ) ); }); @@ -273,7 +274,7 @@ describe('Agent policy', () => { }) ).rejects.toThrowError( new AgentPolicyInvalidError( - 'supports_agentless is only allowed in serverless environments that support the agentless feature' + 'supports_agentless is only allowed in serverless and cloud environments that support the agentless feature' ) ); }); @@ -1029,13 +1030,13 @@ describe('Agent policy', () => { ).rejects.toThrowError(new Error('Cannot enable Agent Tamper Protection: reason')); }); - it('should throw AgentPolicyInvalidError if support_agentless is defined in stateful', async () => { + it('should not throw AgentPolicyInvalidError if support_agentless is defined in stateful', async () => { jest .spyOn(appContextService, 'getExperimentalFeatures') - .mockReturnValue({ agentless: false } as any); + .mockReturnValue({ agentless: true } as any); jest .spyOn(appContextService, 'getCloud') - .mockReturnValue({ isServerlessEnabled: false } as any); + .mockReturnValue({ isServerlessEnabled: false, isCloudEnabled: true } as any); const soClient = getAgentPolicyCreateMock(); const esClient = elasticsearchServiceMock.createClusterClient().asInternalUser; @@ -1052,11 +1053,7 @@ describe('Agent policy', () => { namespace: 'default', supports_agentless: true, }) - ).rejects.toThrowError( - new AgentPolicyInvalidError( - 'supports_agentless is only allowed in serverless environments that support the agentless feature' - ) - ); + ).resolves.not.toThrow(); }); it('should throw AgentPolicyInvalidError if agentless flag is disabled in serverless', async () => { @@ -1084,7 +1081,7 @@ describe('Agent policy', () => { }) ).rejects.toThrowError( new AgentPolicyInvalidError( - 'supports_agentless is only allowed in serverless environments that support the agentless feature' + 'supports_agentless is only allowed in serverless and cloud environments that support the agentless feature' ) ); }); diff --git a/x-pack/plugins/fleet/server/services/agent_policy.ts b/x-pack/plugins/fleet/server/services/agent_policy.ts index 9a455fc71640e..ed3cefb2faf94 100644 --- a/x-pack/plugins/fleet/server/services/agent_policy.ts +++ b/x-pack/plugins/fleet/server/services/agent_policy.ts @@ -1570,12 +1570,12 @@ class AgentPolicyService { private checkAgentless(agentPolicy: Partial) { const cloudSetup = appContextService.getCloud(); if ( - (!cloudSetup?.isServerlessEnabled || - !appContextService.getExperimentalFeatures().agentless) && - agentPolicy?.supports_agentless !== undefined + (!cloudSetup?.isServerlessEnabled || !cloudSetup?.isCloudEnabled) && + !appContextService.getExperimentalFeatures().agentless && + agentPolicy?.supports_agentless ) { throw new AgentPolicyInvalidError( - 'supports_agentless is only allowed in serverless environments that support the agentless feature' + 'supports_agentless is only allowed in serverless and cloud environments that support the agentless feature' ); } } diff --git a/x-pack/plugins/fleet/server/services/agent_policy_create.ts b/x-pack/plugins/fleet/server/services/agent_policy_create.ts index dc5a57e81a16a..870cea84b36e1 100644 --- a/x-pack/plugins/fleet/server/services/agent_policy_create.ts +++ b/x-pack/plugins/fleet/server/services/agent_policy_create.ts @@ -67,9 +67,9 @@ async function createPackagePolicy( force: true, user: options.user, }); + throw error; }); - if (!newPackagePolicy) return; newPackagePolicy.policy_id = agentPolicy.id; @@ -82,7 +82,7 @@ async function createPackagePolicy( user: options.user, bumpRevision: false, authorizationHeader: options.authorizationHeader, - force: options.force, + force: options.force || agentPolicy.supports_agentless === true, }); } @@ -170,6 +170,5 @@ export async function createAgentPolicyWithPackages({ await ensureDefaultEnrollmentAPIKeyForAgentPolicy(soClient, esClient, agentPolicy.id); await agentPolicyService.deployPolicy(soClient, agentPolicy.id); - return agentPolicy; } diff --git a/x-pack/plugins/fleet/server/services/agents/update_agent_tags_action_runner.ts b/x-pack/plugins/fleet/server/services/agents/update_agent_tags_action_runner.ts index 1c8db8451ccfa..0a8232d6e5715 100644 --- a/x-pack/plugins/fleet/server/services/agents/update_agent_tags_action_runner.ts +++ b/x-pack/plugins/fleet/server/services/agents/update_agent_tags_action_runner.ts @@ -131,7 +131,9 @@ export async function updateTagsBatch( ); } - appContextService.getLogger().debug(JSON.stringify(res).slice(0, 1000)); + if (appContextService.getLogger().isLevelEnabled('debug')) { + appContextService.getLogger().debug(JSON.stringify(res).slice(0, 1000)); + } // creating unique ids to use as agentId, as we don't have all agent ids in case of action by kuery const getUuidArray = (count: number) => Array.from({ length: count }, () => uuidv4()); diff --git a/x-pack/plugins/fleet/server/services/artifacts/artifacts.ts b/x-pack/plugins/fleet/server/services/artifacts/artifacts.ts index 43cf3f745cc6c..c6173f1eb8e89 100644 --- a/x-pack/plugins/fleet/server/services/artifacts/artifacts.ts +++ b/x-pack/plugins/fleet/server/services/artifacts/artifacts.ts @@ -146,9 +146,10 @@ export const bulkCreateArtifacts = async ( for (let batchN = 0; batchN < batches.length; batchN++) { logger.debug( - `Creating artifacts for batch ${batchN + 1} with ${batches[batchN].length / 2} artifacts` + () => + `Creating artifacts for batch ${batchN + 1} with ${batches[batchN].length / 2} artifacts` ); - logger.debug(`Artifacts in current batch: ${JSON.stringify(batches[batchN])}`); + logger.debug(() => `Artifacts in current batch: ${JSON.stringify(batches[batchN])}`); // Generate a bulk create for the current batch of artifacts const res = await withPackageSpan(`Bulk create fleet artifacts batch [${batchN}]`, () => esClient.bulk({ diff --git a/x-pack/plugins/fleet/server/services/elastic_agent_manifest.ts b/x-pack/plugins/fleet/server/services/elastic_agent_manifest.ts index 8e47180076338..6eff632c06abb 100644 --- a/x-pack/plugins/fleet/server/services/elastic_agent_manifest.ts +++ b/x-pack/plugins/fleet/server/services/elastic_agent_manifest.ts @@ -42,7 +42,7 @@ spec: # - -c # - >- # mkdir -p /usr/share/elastic-agent/state/inputs.d && - # curl -sL https://github.com/elastic/elastic-agent/archive/8.15.tar.gz | tar xz -C /usr/share/elastic-agent/state/inputs.d --strip=5 "elastic-agent-8.15/deploy/kubernetes/elastic-agent/templates.d" + # curl -sL https://github.com/elastic/elastic-agent/archive/8.16.tar.gz | tar xz -C /usr/share/elastic-agent/state/inputs.d --strip=5 "elastic-agent-8.16/deploy/kubernetes/elastic-agent/templates.d" # securityContext: # runAsUser: 0 # volumeMounts: @@ -351,9 +351,6 @@ spec: effect: NoSchedule serviceAccountName: elastic-agent hostNetwork: true - # 'hostPID: true' enables the Elastic Security integration to observe all process exec events on the host. - # Sharing the host process ID namespace gives visibility of all processes running on the same host. - hostPID: true dnsPolicy: ClusterFirstWithHostNet containers: - name: elastic-agent @@ -469,7 +466,7 @@ spec: hostPath: path: /var/lib # Mount /etc/machine-id from the host to determine host ID - # Needed for Elastic Security integration + # Needed for Kubernetes node autodiscovery - name: etc-mid hostPath: path: /etc/machine-id diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts index 654ce7ea8ed81..e44e70b85efe0 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts @@ -39,7 +39,7 @@ import { retryTransientEsErrors } from '../retry'; import { PackageESError, PackageInvalidArchiveError } from '../../../../errors'; import { getDefaultProperties, histogram, keyword, scaledFloat } from './mappings'; -import { isUserSettingsTemplate } from './utils'; +import { isUserSettingsTemplate, fillConstantKeywordValues } from './utils'; interface Properties { [key: string]: any; @@ -986,7 +986,7 @@ const updateAllDataStreams = async ( }); }, { - // Limit concurrent putMapping/rollover requests to avoid overhwhelming ES cluster + // Limit concurrent putMapping/rollover requests to avoid overwhelming ES cluster concurrency: 20, } ); @@ -1017,19 +1017,23 @@ const updateExistingDataStream = async ({ const currentSourceType = currentBackingIndexConfig.mappings?._source?.mode; let settings: IndicesIndexSettings; - let mappings: MappingTypeMapping; + let mappings: MappingTypeMapping = {}; let lifecycle: any; let subobjectsFieldChanged: boolean = false; + let simulateResult: any = {}; try { - const simulateResult = await retryTransientEsErrors(async () => + simulateResult = await retryTransientEsErrors(async () => esClient.indices.simulateTemplate({ name: await getIndexTemplate(esClient, dataStreamName), }) ); settings = simulateResult.template.settings; - mappings = simulateResult.template.mappings; - // @ts-expect-error template is not yet typed with DLM + mappings = fillConstantKeywordValues( + currentBackingIndexConfig?.mappings || {}, + simulateResult.template.mappings + ); + lifecycle = simulateResult.template.lifecycle; // for now, remove from object so as not to update stream or data stream properties of the index until type and name @@ -1063,6 +1067,7 @@ const updateExistingDataStream = async ({ subobjectsFieldChanged ) { logger.info(`Mappings update for ${dataStreamName} failed due to ${err}`); + logger.trace(`Attempted mappings: ${mappings}`); if (options?.skipDataStreamRollover === true) { logger.info( `Skipping rollover for ${dataStreamName} as "skipDataStreamRollover" is enabled` @@ -1075,6 +1080,7 @@ const updateExistingDataStream = async ({ } } logger.error(`Mappings update for ${dataStreamName} failed due to unexpected error: ${err}`); + logger.trace(`Attempted mappings: ${mappings}`); if (options?.ignoreMappingUpdateErrors === true) { logger.info(`Ignore mapping update errors as "ignoreMappingUpdateErrors" is enabled`); return; diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/utils.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/utils.test.ts new file mode 100644 index 0000000000000..a411ba32d2954 --- /dev/null +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/utils.test.ts @@ -0,0 +1,226 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { fillConstantKeywordValues } from './utils'; + +describe('fillConstantKeywordValues', () => { + const oldMappings = { + dynamic: false, + _meta: { + managed_by: 'fleet', + managed: true, + package: { + name: 'elastic_agent', + }, + }, + dynamic_templates: [ + { + ecs_timestamp: { + match: '@timestamp', + mapping: { + ignore_malformed: false, + type: 'date', + }, + }, + }, + ], + date_detection: false, + properties: { + '@timestamp': { + type: 'date', + ignore_malformed: false, + }, + load: { + properties: { + '1': { + type: 'double', + }, + '5': { + type: 'double', + }, + '15': { + type: 'double', + }, + }, + }, + event: { + properties: { + agent_id_status: { + type: 'keyword', + ignore_above: 1024, + }, + dataset: { + type: 'constant_keyword', + value: 'elastic_agent.metricbeat', + }, + ingested: { + type: 'date', + format: 'strict_date_time_no_millis||strict_date_optional_time||epoch_millis', + ignore_malformed: false, + }, + }, + }, + message: { + type: 'match_only_text', + }, + 'dot.field': { + type: 'keyword', + }, + constant_keyword_without_value: { + type: 'constant_keyword', + }, + }, + }; + + const newMappings = { + dynamic: false, + _meta: { + managed_by: 'fleet', + managed: true, + package: { + name: 'elastic_agent', + }, + }, + dynamic_templates: [ + { + ecs_timestamp: { + match: '@timestamp', + mapping: { + ignore_malformed: false, + type: 'date', + }, + }, + }, + ], + date_detection: false, + properties: { + '@timestamp': { + type: 'date', + ignore_malformed: false, + }, + load: { + properties: { + '1': { + type: 'double', + }, + '5': { + type: 'double', + }, + '15': { + type: 'double', + }, + }, + }, + event: { + properties: { + agent_id_status: { + type: 'keyword', + ignore_above: 1024, + }, + dataset: { + type: 'constant_keyword', + }, + ingested: { + type: 'date', + format: 'strict_date_time_no_millis||strict_date_optional_time||epoch_millis', + ignore_malformed: false, + }, + }, + }, + message: { + type: 'match_only_text', + }, + 'dot.field': { + type: 'keyword', + }, + some_new_field: { + type: 'keyword', + }, + constant_keyword_without_value: { + type: 'constant_keyword', + }, + }, + }; + + it('should fill in missing constant_keyword values from old mappings correctly', () => { + // @ts-ignore + expect(fillConstantKeywordValues(oldMappings, newMappings)).toEqual({ + dynamic: false, + _meta: { + managed_by: 'fleet', + managed: true, + package: { + name: 'elastic_agent', + }, + }, + dynamic_templates: [ + { + ecs_timestamp: { + match: '@timestamp', + mapping: { + ignore_malformed: false, + type: 'date', + }, + }, + }, + ], + date_detection: false, + properties: { + '@timestamp': { + type: 'date', + ignore_malformed: false, + }, + load: { + properties: { + '1': { + type: 'double', + }, + '5': { + type: 'double', + }, + '15': { + type: 'double', + }, + }, + }, + event: { + properties: { + agent_id_status: { + type: 'keyword', + ignore_above: 1024, + }, + dataset: { + type: 'constant_keyword', + value: 'elastic_agent.metricbeat', + }, + ingested: { + type: 'date', + format: 'strict_date_time_no_millis||strict_date_optional_time||epoch_millis', + ignore_malformed: false, + }, + }, + }, + message: { + type: 'match_only_text', + }, + 'dot.field': { + type: 'keyword', + }, + some_new_field: { + type: 'keyword', + }, + constant_keyword_without_value: { + type: 'constant_keyword', + }, + }, + }); + }); + + it('should return the same mappings if old mappings are not provided', () => { + // @ts-ignore + expect(fillConstantKeywordValues({}, newMappings)).toMatchObject(newMappings); + }); +}); diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/utils.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/utils.ts index e435e54a828df..6a34beb371082 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/utils.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/utils.ts @@ -4,6 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import type { MappingTypeMapping } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { USER_SETTINGS_TEMPLATE_SUFFIX } from '../../../../constants'; @@ -12,3 +13,34 @@ type UserSettingsTemplateName = `${TemplateBaseName}${typeof USER_SETTINGS_TEMPL export const isUserSettingsTemplate = (name: string): name is UserSettingsTemplateName => name.endsWith(USER_SETTINGS_TEMPLATE_SUFFIX); + +// For any `constant_keyword` fields in `newMappings` that don't have a `value`, access the same field in +// the `oldMappings` and fill in the value from there +export const fillConstantKeywordValues = ( + oldMappings: MappingTypeMapping, + newMappings: MappingTypeMapping +) => { + const filledMappings = JSON.parse(JSON.stringify(newMappings)) as MappingTypeMapping; + const deepGet = (obj: any, keys: string[]) => keys.reduce((xs, x) => xs?.[x] ?? undefined, obj); + + const fillEmptyConstantKeywordFields = (mappings: unknown, currentPath: string[] = []) => { + if (!mappings) return; + for (const [key, potentialField] of Object.entries(mappings)) { + const path = [...currentPath, key]; + if (typeof potentialField === 'object') { + if (potentialField.type === 'constant_keyword' && potentialField.value === undefined) { + const valueFromOldMappings = deepGet(oldMappings.properties, [...path, 'value']); + if (valueFromOldMappings !== undefined) { + potentialField.value = valueFromOldMappings; + } + } else if (potentialField.properties && typeof potentialField.properties === 'object') { + fillEmptyConstantKeywordFields(potentialField.properties, [...path, 'properties']); + } + } + } + }; + + fillEmptyConstantKeywordFields(filledMappings.properties); + + return filledMappings; +}; diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/install.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/install.ts index 740ea2af537e9..c7472c268e29c 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/install.ts @@ -648,9 +648,10 @@ export const installTransforms = async ({ ); if (previousInstalledTransformEsAssets.length > 0) { logger.debug( - `Found previous transform references:\n ${JSON.stringify( - previousInstalledTransformEsAssets - )}` + () => + `Found previous transform references:\n ${JSON.stringify( + previousInstalledTransformEsAssets + )}` ); } } diff --git a/x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts b/x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts index e7e453648a596..2096820e82dad 100644 --- a/x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts @@ -387,9 +387,10 @@ async function retryImportOnConflictError( const retryDelayMs = 1000 + Math.floor(Math.random() * 3000); // 1s + 0-3s of jitter logger?.debug( - `Retrying import operation after [${ - retryDelayMs * 1000 - }s] due to conflict errors: ${JSON.stringify(errors)}` + () => + `Retrying import operation after [${ + retryDelayMs * 1000 + }s] due to conflict errors: ${JSON.stringify(errors)}` ); await setTimeout(retryDelayMs); @@ -458,9 +459,10 @@ export async function installKibanaSavedObjects({ the integrations team. */ if (referenceErrors.length) { logger.debug( - `Resolving ${ - referenceErrors.length - } reference errors creating saved objects: ${formatImportErrorsForLog(referenceErrors)}` + () => + `Resolving ${ + referenceErrors.length + } reference errors creating saved objects: ${formatImportErrorsForLog(referenceErrors)}` ); const retries = toBeSavedObjects.map(({ id, type }) => { diff --git a/x-pack/plugins/fleet/server/services/fleet_server/index.test.ts b/x-pack/plugins/fleet/server/services/fleet_server/index.test.ts index f00d78cd59ad9..7faea8c526819 100644 --- a/x-pack/plugins/fleet/server/services/fleet_server/index.test.ts +++ b/x-pack/plugins/fleet/server/services/fleet_server/index.test.ts @@ -115,6 +115,13 @@ describe('checkFleetServerVersionsForSecretsStorage', () => { version ); expect(result).toBe(true); + expect(mockedGetAgentsByKuery).toHaveBeenCalledWith( + esClientMock, + soClientMock, + expect.objectContaining({ + kuery: 'policy_id:("1" or "2")', + }) + ); }); }); diff --git a/x-pack/plugins/fleet/server/services/fleet_server/index.ts b/x-pack/plugins/fleet/server/services/fleet_server/index.ts index 004a0deeea7b7..a0d508f0929e9 100644 --- a/x-pack/plugins/fleet/server/services/fleet_server/index.ts +++ b/x-pack/plugins/fleet/server/services/fleet_server/index.ts @@ -128,11 +128,19 @@ export async function checkFleetServerVersionsForSecretsStorage( hasMore = false; } } + if (policyIds.size === 0) { + return false; + } + + const kuery = `policy_id:(${Array.from(policyIds) + .map((id) => `"${id}"`) + .join(' or ')})`; const managedAgentPolicies = await agentPolicyService.getAllManagedAgentPolicies(soClient); const fleetServerAgents = await getAgentsByKuery(esClient, soClient, { showInactive: true, perPage: SO_SEARCH_LIMIT, + kuery, }); if (fleetServerAgents.agents.length === 0) { diff --git a/x-pack/plugins/fleet/server/services/fleet_usage_logger.ts b/x-pack/plugins/fleet/server/services/fleet_usage_logger.ts index 76c4aba77038c..9d36020e4655f 100644 --- a/x-pack/plugins/fleet/server/services/fleet_usage_logger.ts +++ b/x-pack/plugins/fleet/server/services/fleet_usage_logger.ts @@ -32,7 +32,9 @@ export function registerFleetUsageLogger( try { const usageData = await fetchUsage(); if (appContextService.getLogger().isLevelEnabled('debug')) { - appContextService.getLogger().debug(`Fleet Usage: ${JSON.stringify(usageData)}`); + appContextService + .getLogger() + .debug(() => `Fleet Usage: ${JSON.stringify(usageData)}`); } else { appContextService.getLogger().info(`Fleet Usage: ${JSON.stringify(usageData)}`); } diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index 8fd71a76355c8..e244be59b8012 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -1678,7 +1678,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { .info( `Package policy upgrade dry run ${hasErrors ? 'resulted in errors' : 'ran successfully'}` ); - appContextService.getLogger().debug(JSON.stringify(upgradeTelemetry)); + appContextService.getLogger().debug(() => JSON.stringify(upgradeTelemetry)); } } @@ -2716,9 +2716,10 @@ export function _validateRestrictedFieldsNotModifiedOrThrow(opts: { appContextService .getLogger() .debug( - `Rejecting package policy update due to dataset change, old val '${ - oldStream?.vars[DATASET_VAR_NAME]?.value - }, new val '${JSON.stringify(stream?.vars?.[DATASET_VAR_NAME]?.value)}'` + () => + `Rejecting package policy update due to dataset change, old val '${ + oldStream.vars![DATASET_VAR_NAME].value + }, new val '${JSON.stringify(stream?.vars?.[DATASET_VAR_NAME]?.value)}'` ); throw new PackagePolicyValidationError( i18n.translate('xpack.fleet.updatePackagePolicy.datasetCannotBeModified', { @@ -2745,7 +2746,10 @@ async function validateIsNotHostedPolicy( throw new AgentPolicyNotFoundError('Agent policy not found'); } - if (agentPolicy.is_managed && !force) { + const isManagedPolicyWithoutServerlessSupport = + agentPolicy.is_managed && !agentPolicy.supports_agentless && !force; + + if (isManagedPolicyWithoutServerlessSupport) { throw new HostedAgentPolicyRestrictionRelatedError( errorMessage ?? `Cannot update integrations of hosted agent policy ${id}` ); @@ -2778,7 +2782,7 @@ export function sendUpdatePackagePolicyTelemetryEvent( upgradeTelemetry ); appContextService.getLogger().info(`Package policy upgraded successfully`); - appContextService.getLogger().debug(JSON.stringify(upgradeTelemetry)); + appContextService.getLogger().debug(() => JSON.stringify(upgradeTelemetry)); } } }); diff --git a/x-pack/plugins/fleet/server/services/preconfiguration.ts b/x-pack/plugins/fleet/server/services/preconfiguration.ts index 0616f15c180f4..a0b633efa3746 100644 --- a/x-pack/plugins/fleet/server/services/preconfiguration.ts +++ b/x-pack/plugins/fleet/server/services/preconfiguration.ts @@ -296,12 +296,13 @@ export async function ensurePreconfiguredPackagesAndPolicies( ); }); logger.debug( - `Adding preconfigured package policies ${JSON.stringify( - packagePoliciesToAdd.map((pol) => ({ - name: pol.packagePolicy.name, - package: pol.installedPackage.name, - })) - )}` + () => + `Adding preconfigured package policies ${JSON.stringify( + packagePoliciesToAdd.map((pol) => ({ + name: pol.packagePolicy.name, + package: pol.installedPackage.name, + })) + )}` ); const s = apm.startSpan('Add preconfigured package policies', 'preconfiguration'); await addPreconfiguredPolicyPackages( diff --git a/x-pack/plugins/fleet/server/services/setup.ts b/x-pack/plugins/fleet/server/services/setup.ts index d1e29147a2104..a1df9c7d9d609 100644 --- a/x-pack/plugins/fleet/server/services/setup.ts +++ b/x-pack/plugins/fleet/server/services/setup.ts @@ -133,7 +133,9 @@ async function createLock( }, { id: FLEET_SETUP_LOCK_TYPE } ); - logger.debug(`Fleet setup lock created: ${JSON.stringify(created)}`); + if (logger.isLevelEnabled('debug')) { + logger.debug(`Fleet setup lock created: ${JSON.stringify(created)}`); + } } catch (error) { logger.info(`Could not create fleet setup lock, abort setup: ${error}`); return { created: false, toReturn: { isInitialized: false, nonFatalErrors: [] } }; diff --git a/x-pack/plugins/fleet/server/services/telemetry/fleet_usage_sender.ts b/x-pack/plugins/fleet/server/services/telemetry/fleet_usage_sender.ts index 2d986b1e7bc6c..41c560084e050 100644 --- a/x-pack/plugins/fleet/server/services/telemetry/fleet_usage_sender.ts +++ b/x-pack/plugins/fleet/server/services/telemetry/fleet_usage_sender.ts @@ -24,7 +24,7 @@ const FLEET_AGENTS_EVENT_TYPE = 'fleet_agents'; export class FleetUsageSender { private taskManager?: TaskManagerStartContract; - private taskVersion = '1.1.6'; + private taskVersion = '1.1.7'; private taskType = 'Fleet-Usage-Sender'; private wasStarted: boolean = false; private interval = '1h'; @@ -93,27 +93,27 @@ export class FleetUsageSender { } = usageData; appContextService .getLogger() - .debug('Fleet usage telemetry: ' + JSON.stringify(fleetUsageData)); + .debug(() => 'Fleet usage telemetry: ' + JSON.stringify(fleetUsageData)); core.analytics.reportEvent(FLEET_USAGES_EVENT_TYPE, fleetUsageData); appContextService .getLogger() - .debug('Agents per privileges telemetry: ' + JSON.stringify(agentsPerPrivileges)); + .debug(() => 'Agents per privileges telemetry: ' + JSON.stringify(agentsPerPrivileges)); core.analytics.reportEvent(FLEET_AGENTS_EVENT_TYPE, { agents_per_privileges: agentsPerPrivileges, }); appContextService .getLogger() - .debug('Agents per version telemetry: ' + JSON.stringify(agentsPerVersion)); + .debug(() => 'Agents per version telemetry: ' + JSON.stringify(agentsPerVersion)); agentsPerVersion.forEach((byVersion) => { core.analytics.reportEvent(FLEET_AGENTS_EVENT_TYPE, { agents_per_version: byVersion }); }); appContextService .getLogger() - .debug('Agents per output type telemetry: ' + JSON.stringify(agentsPerOutputType)); + .debug(() => 'Agents per output type telemetry: ' + JSON.stringify(agentsPerOutputType)); agentsPerOutputType.forEach((byOutputType) => { core.analytics.reportEvent(FLEET_AGENTS_EVENT_TYPE, { agents_per_output_type: byOutputType, @@ -122,7 +122,7 @@ export class FleetUsageSender { appContextService .getLogger() - .debug('Agents upgrade details telemetry: ' + JSON.stringify(upgradeDetails)); + .debug(() => 'Agents upgrade details telemetry: ' + JSON.stringify(upgradeDetails)); upgradeDetails.forEach((upgradeDetailsObj) => { core.analytics.reportEvent(FLEET_AGENTS_EVENT_TYPE, { upgrade_details: upgradeDetailsObj }); }); diff --git a/x-pack/plugins/fleet/server/services/telemetry/fleet_usages_schema.ts b/x-pack/plugins/fleet/server/services/telemetry/fleet_usages_schema.ts index 1720470b65ad8..a579ba69bab83 100644 --- a/x-pack/plugins/fleet/server/services/telemetry/fleet_usages_schema.ts +++ b/x-pack/plugins/fleet/server/services/telemetry/fleet_usages_schema.ts @@ -357,6 +357,7 @@ export const fleetUsagesSchema: RootSchema = { _meta: { description: 'Average number of global data tags defined per agent policy (accross policies using global data tags)', + optional: true, }, }, }, diff --git a/x-pack/plugins/fleet/server/telemetry/sender.ts b/x-pack/plugins/fleet/server/telemetry/sender.ts index a31f97b57fbd5..8fb71683b2c9c 100644 --- a/x-pack/plugins/fleet/server/telemetry/sender.ts +++ b/x-pack/plugins/fleet/server/telemetry/sender.ts @@ -154,7 +154,7 @@ export class TelemetryEventsSender { deployment_id: appContextService.getCloud()?.deploymentId, })); - this.logger.debug(JSON.stringify(toSend)); + this.logger.debug(() => JSON.stringify(toSend)); await this.send( toSend, @@ -199,10 +199,12 @@ export class TelemetryEventsSender { }, timeout: 5000, }); - this.logger.debug(`Events sent!. Response: ${resp.status} ${JSON.stringify(resp.data)}`); + this.logger.debug( + () => `Events sent!. Response: ${resp.status} ${JSON.stringify(resp.data)}` + ); } catch (err) { this.logger.debug( - `Error sending events: ${err?.response?.status} ${JSON.stringify(err.response.data)}` + () => `Error sending events: ${err?.response?.status} ${JSON.stringify(err.response.data)}` ); } } diff --git a/x-pack/plugins/fleet/server/types/models/preconfiguration.test.ts b/x-pack/plugins/fleet/server/types/models/preconfiguration.test.ts index 085714b67244d..a436f799fc171 100644 --- a/x-pack/plugins/fleet/server/types/models/preconfiguration.test.ts +++ b/x-pack/plugins/fleet/server/types/models/preconfiguration.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { PreconfiguredOutputsSchema } from './preconfiguration'; +import { PreconfiguredOutputsSchema, PreconfiguredAgentPoliciesSchema } from './preconfiguration'; describe('Test preconfiguration schema', () => { describe('PreconfiguredOutputsSchema', () => { @@ -147,4 +147,17 @@ describe('Test preconfiguration schema', () => { }).not.toThrowError(); }); }); + + describe('PreconfiguredAgentPoliciesSchema', () => { + it('should allow basic agent policy only with id and name', () => { + expect(() => { + PreconfiguredAgentPoliciesSchema.validate([ + { + id: 'agent-default-policy', + name: 'test agent policy', + }, + ]); + }).not.toThrowError(); + }); + }); }); diff --git a/x-pack/plugins/fleet/server/types/models/preconfiguration.ts b/x-pack/plugins/fleet/server/types/models/preconfiguration.ts index 090d74b38a412..37786ab207249 100644 --- a/x-pack/plugins/fleet/server/types/models/preconfiguration.ts +++ b/x-pack/plugins/fleet/server/types/models/preconfiguration.ts @@ -142,51 +142,53 @@ export const PreconfiguredAgentPoliciesSchema = schema.arrayOf( has_fleet_server: schema.maybe(schema.boolean()), data_output_id: schema.maybe(schema.string()), monitoring_output_id: schema.maybe(schema.string()), - package_policies: schema.arrayOf( - schema.oneOf([ - schema.object({ - id: schema.maybe(schema.oneOf([schema.string(), schema.number()])), - name: schema.string(), - package: schema.object({ - name: schema.string({ - validate: (value) => { - if (value === 'synthetics') { - return i18n.translate('xpack.fleet.config.disableSynthetics', { - defaultMessage: - 'Synthetics package is not supported via kibana.yml config. Please use Synthetics App to create monitors in private locations. https://www.elastic.co/guide/en/observability/current/synthetics-private-location.html', - }); - } - }, + package_policies: schema.maybe( + schema.arrayOf( + schema.oneOf([ + schema.object({ + id: schema.maybe(schema.oneOf([schema.string(), schema.number()])), + name: schema.string(), + package: schema.object({ + name: schema.string({ + validate: (value) => { + if (value === 'synthetics') { + return i18n.translate('xpack.fleet.config.disableSynthetics', { + defaultMessage: + 'Synthetics package is not supported via kibana.yml config. Please use Synthetics App to create monitors in private locations. https://www.elastic.co/guide/en/observability/current/synthetics-private-location.html', + }); + } + }, + }), }), + description: schema.maybe(schema.string()), + namespace: schema.maybe(PackagePolicyNamespaceSchema), + inputs: schema.maybe( + schema.arrayOf( + schema.object({ + type: schema.string(), + enabled: schema.maybe(schema.boolean()), + keep_enabled: schema.maybe(schema.boolean()), + vars: varsSchema, + streams: schema.maybe( + schema.arrayOf( + schema.object({ + data_stream: schema.object({ + type: schema.maybe(schema.string()), + dataset: schema.string(), + }), + enabled: schema.maybe(schema.boolean()), + keep_enabled: schema.maybe(schema.boolean()), + vars: varsSchema, + }) + ) + ), + }) + ) + ), }), - description: schema.maybe(schema.string()), - namespace: schema.maybe(PackagePolicyNamespaceSchema), - inputs: schema.maybe( - schema.arrayOf( - schema.object({ - type: schema.string(), - enabled: schema.maybe(schema.boolean()), - keep_enabled: schema.maybe(schema.boolean()), - vars: varsSchema, - streams: schema.maybe( - schema.arrayOf( - schema.object({ - data_stream: schema.object({ - type: schema.maybe(schema.string()), - dataset: schema.string(), - }), - enabled: schema.maybe(schema.boolean()), - keep_enabled: schema.maybe(schema.boolean()), - vars: varsSchema, - }) - ) - ), - }) - ) - ), - }), - SimplifiedPackagePolicyPreconfiguredSchema, - ]) + SimplifiedPackagePolicyPreconfiguredSchema, + ]) + ) ), }), { diff --git a/x-pack/plugins/fleet/tsconfig.json b/x-pack/plugins/fleet/tsconfig.json index 8986527bed977..b45bd90010b42 100644 --- a/x-pack/plugins/fleet/tsconfig.json +++ b/x-pack/plugins/fleet/tsconfig.json @@ -64,7 +64,6 @@ "@kbn/utility-types-jest", "@kbn/es-query", "@kbn/ui-theme", - "@kbn/rison", "@kbn/config-schema", "@kbn/telemetry-plugin", "@kbn/task-manager-plugin", diff --git a/x-pack/plugins/global_search_bar/kibana.jsonc b/x-pack/plugins/global_search_bar/kibana.jsonc index 552ee46e6e41d..6412f7c8ed890 100644 --- a/x-pack/plugins/global_search_bar/kibana.jsonc +++ b/x-pack/plugins/global_search_bar/kibana.jsonc @@ -4,7 +4,7 @@ "owner": "@elastic/appex-sharedux", "plugin": { "id": "globalSearchBar", - "server": false, + "server": true, "browser": true, "configPath": [ "xpack", diff --git a/x-pack/plugins/global_search_bar/public/components/popover_placeholder.tsx b/x-pack/plugins/global_search_bar/public/components/popover_placeholder.tsx index 7783cc94cfdba..748d3ba18ca03 100644 --- a/x-pack/plugins/global_search_bar/public/components/popover_placeholder.tsx +++ b/x-pack/plugins/global_search_bar/public/components/popover_placeholder.tsx @@ -12,9 +12,13 @@ import { FormattedMessage } from '@kbn/i18n-react'; interface PopoverPlaceholderProps { basePath: string; + customPlaceholderMessage?: React.ReactNode; } -export const PopoverPlaceholder: FC = ({ basePath }) => { +export const PopoverPlaceholder: FC = ({ + basePath, + customPlaceholderMessage, +}) => { const { colorMode } = useEuiTheme(); return ( @@ -37,21 +41,25 @@ export const PopoverPlaceholder: FC = ({ basePath }) => }.svg`} /> - -

    - -

    -
    + {customPlaceholderMessage ?? ( + <> + +

    + +

    +
    -

    - -

    +

    + +

    + + )}
    ); diff --git a/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx b/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx index 479c3e546dc9c..e9faef5e7073d 100644 --- a/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx +++ b/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx @@ -45,6 +45,9 @@ const createResult = (result: Result): GlobalSearchResult => { const createBatch = (...results: Result[]): GlobalSearchBatchedResults => ({ results: results.map(createResult), }); + +const searchCharLimit = 1000; + jest.useFakeTimers({ legacyFakeTimers: true }); describe('SearchBar', () => { @@ -89,6 +92,37 @@ describe('SearchBar', () => { expect(await screen.findAllByTestId('nav-search-option')).toHaveLength(list.length); }; + describe('default behavior', () => { + it('displays an error message without making a network call when the search input exceeds the specified char limit', async () => { + const chromeStyle$ = of('classic'); + + render( + + + + ); + + expect(searchService.find).toHaveBeenCalledTimes(0); + + await focusAndUpdate(); + + expect(searchService.find).toHaveBeenCalledTimes(1); + + simulateTypeChar(Array.from(new Array(searchCharLimit + 1)).reduce((acc) => acc + 'a', '')); + + // we use allBy because EUI renders a screen reader only version, along side the visual one + expect(await screen.findAllByTestId('searchCharLimitExceededMessageHeading')).toHaveLength(2); + + expect(searchService.find).toHaveBeenCalledTimes(1); + }); + }); + describe('chromeStyle: classic', () => { const chromeStyle$ = of('classic'); @@ -105,7 +139,7 @@ describe('SearchBar', () => { render( { render( { render( { render( { render( { return ; }; +const SearchCharLimitExceededMessage = (props: { basePathUrl: string }) => { + const charLimitMessage = ( + <> + +

    + +

    +
    +

    + +

    + + ); + + return ( + + ); +}; + const EmptyMessage = () => ( @@ -72,6 +99,7 @@ export const SearchBar: FC = (opts) => { const [showAppend, setShowAppend] = useState(true); const UNKNOWN_TAG_ID = '__unknown__'; const [isLoading, setIsLoading] = useState(false); + const [searchCharLimitExceeded, setSearchCharLimitExceeded] = useState(false); useEffect(() => { if (initialLoad) { @@ -127,11 +155,20 @@ export const SearchBar: FC = (opts) => { searchSubscription.current = null; } + if (searchValue.length > globalSearch.searchCharLimit) { + // setting this will display an error message to the user + setSearchCharLimitExceeded(true); + return; + } else { + setSearchCharLimitExceeded(false); + } + setIsLoading(true); const suggestions = loadSuggestions(searchValue.toLowerCase()); setIsLoading(false); let aggregatedResults: GlobalSearchResult[] = []; + if (searchValue.length !== 0) { reportEvent.searchRequest(); } @@ -361,6 +398,7 @@ export const SearchBar: FC = (opts) => { fullWidth: true, append: getAppendForChromeStyle(), }} + errorMessage={searchCharLimitExceeded ? : null} emptyMessage={} noMatchesMessage={} popoverProps={{ diff --git a/x-pack/plugins/global_search_bar/public/components/types.ts b/x-pack/plugins/global_search_bar/public/components/types.ts index de0af36624db2..fbcf7c523053b 100644 --- a/x-pack/plugins/global_search_bar/public/components/types.ts +++ b/x-pack/plugins/global_search_bar/public/components/types.ts @@ -14,7 +14,7 @@ import { EventReporter } from '../telemetry'; /* @internal */ export interface SearchBarProps { - globalSearch: GlobalSearchPluginStart; + globalSearch: GlobalSearchPluginStart & { searchCharLimit: number }; navigateToUrl: ApplicationStart['navigateToUrl']; reportEvent: EventReporter; taggingApi?: SavedObjectTaggingPluginStart; diff --git a/x-pack/plugins/global_search_bar/public/index.ts b/x-pack/plugins/global_search_bar/public/index.ts index f6676587f83a4..c092380665563 100644 --- a/x-pack/plugins/global_search_bar/public/index.ts +++ b/x-pack/plugins/global_search_bar/public/index.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { PluginInitializer } from '@kbn/core/public'; +import type { PluginInitializer } from '@kbn/core/public'; import { GlobalSearchBarPlugin } from './plugin'; -export const plugin: PluginInitializer<{}, {}, {}, {}> = () => new GlobalSearchBarPlugin(); +export const plugin: PluginInitializer<{}, {}, {}, {}> = (initializerContext) => + new GlobalSearchBarPlugin(initializerContext); diff --git a/x-pack/plugins/global_search_bar/public/plugin.test.ts b/x-pack/plugins/global_search_bar/public/plugin.test.ts new file mode 100644 index 0000000000000..f665fbb1e2818 --- /dev/null +++ b/x-pack/plugins/global_search_bar/public/plugin.test.ts @@ -0,0 +1,38 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { coreMock } from '@kbn/core/public/mocks'; +import { globalSearchPluginMock } from '@kbn/global-search-plugin/public/mocks'; +import { GlobalSearchBarPlugin } from './plugin'; + +describe('GlobalSearchBarPlugin', () => { + describe('start', () => { + it('registers nav controls', async () => { + const coreSetup = coreMock.createSetup(); + + const service = new GlobalSearchBarPlugin( + coreMock.createPluginInitializerContext({ + input_max_limit: 2000, + }) + ); + + service.setup(coreSetup); + + const coreStart = coreMock.createStart(); + + const navControlsRegisterSpy = jest.spyOn(coreStart.chrome.navControls, 'registerCenter'); + + const start = service.start(coreStart, { + globalSearch: globalSearchPluginMock.createStartContract(), + }); + + expect(start).toEqual({}); + + expect(navControlsRegisterSpy).toHaveBeenCalled(); + }); + }); +}); diff --git a/x-pack/plugins/global_search_bar/public/plugin.tsx b/x-pack/plugins/global_search_bar/public/plugin.tsx index 00cddfb65534f..e8fbe2f7e2bf1 100644 --- a/x-pack/plugins/global_search_bar/public/plugin.tsx +++ b/x-pack/plugins/global_search_bar/public/plugin.tsx @@ -5,7 +5,13 @@ * 2.0. */ -import { ChromeNavControl, CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; +import { + ChromeNavControl, + CoreSetup, + CoreStart, + Plugin, + PluginInitializerContext, +} from '@kbn/core/public'; import { GlobalSearchPluginStart } from '@kbn/global-search-plugin/public'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import { SavedObjectTaggingPluginStart } from '@kbn/saved-objects-tagging-plugin/public'; @@ -13,6 +19,7 @@ import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import React from 'react'; import ReactDOM from 'react-dom'; import { SearchBar } from './components/search_bar'; +import type { GlobalSearchBarConfigType } from './types'; import { EventReporter, eventTypes } from './telemetry'; export interface GlobalSearchBarPluginStartDeps { @@ -22,6 +29,12 @@ export interface GlobalSearchBarPluginStartDeps { } export class GlobalSearchBarPlugin implements Plugin<{}, {}, {}, GlobalSearchBarPluginStartDeps> { + private config: GlobalSearchBarConfigType; + + constructor(initializerContext: PluginInitializerContext) { + this.config = initializerContext.config.get(); + } + public setup({ analytics }: CoreSetup) { eventTypes.forEach((eventType) => { analytics.registerEventType(eventType); @@ -46,7 +59,7 @@ export class GlobalSearchBarPlugin implements Plugin<{}, {}, {}, GlobalSearchBar ReactDOM.render( ({ results: results.map(createResult), }); +const searchCharLimit = 1000; + describe('SearchBar', () => { const usageCollection = usageCollectionPluginMock.createSetupContract(); const core = coreMock.createStart(); @@ -110,7 +112,7 @@ describe('SearchBar', () => { render( { render( { render( { render( { render( { render( { render( ; + +export const config: PluginConfigDescriptor = { + schema: configSchema, + exposeToBrowser: { + input_max_limit: true, + }, +}; diff --git a/x-pack/plugins/global_search_bar/server/index.ts b/x-pack/plugins/global_search_bar/server/index.ts new file mode 100644 index 0000000000000..6d9d80cadf884 --- /dev/null +++ b/x-pack/plugins/global_search_bar/server/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const plugin = async () => { + const { GlobalSearchBarPlugin } = await import('./plugin'); + return new GlobalSearchBarPlugin(); +}; + +export { config } from './config'; diff --git a/x-pack/plugins/global_search_bar/server/plugin.ts b/x-pack/plugins/global_search_bar/server/plugin.ts new file mode 100644 index 0000000000000..6fb323de8a3bf --- /dev/null +++ b/x-pack/plugins/global_search_bar/server/plugin.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Plugin } from '@kbn/core/server'; + +export class GlobalSearchBarPlugin implements Plugin { + setup() {} + + start() {} + + stop() {} +} diff --git a/x-pack/plugins/global_search_bar/tsconfig.json b/x-pack/plugins/global_search_bar/tsconfig.json index f566b0d86eddc..188f9e005c893 100644 --- a/x-pack/plugins/global_search_bar/tsconfig.json +++ b/x-pack/plugins/global_search_bar/tsconfig.json @@ -15,6 +15,7 @@ "@kbn/saved-objects-tagging-oss-plugin", "@kbn/core-chrome-browser", "@kbn/react-kibana-context-render", + "@kbn/config-schema", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/global_search_providers/public/providers/get_app_results.ts b/x-pack/plugins/global_search_providers/public/providers/get_app_results.ts index f83c6405369b7..fdbde1c58de81 100644 --- a/x-pack/plugins/global_search_providers/public/providers/get_app_results.ts +++ b/x-pack/plugins/global_search_providers/public/providers/get_app_results.ts @@ -5,8 +5,8 @@ * 2.0. */ -import levenshtein from 'js-levenshtein'; import { PublicAppInfo, PublicAppDeepLinkInfo, AppCategory } from '@kbn/core/public'; +import { distance } from 'fastest-levenshtein'; import { GlobalSearchProviderResult } from '@kbn/global-search-plugin/public'; /** Type used internally to represent an application unrolled into its separate deepLinks */ @@ -80,10 +80,10 @@ const scoreAppByTerms = (term: string, title: string): number => { return 75; } const length = Math.max(term.length, title.length); - const distance = levenshtein(term, title); + const dist = distance(term, title); // maximum lev distance is length, we compute the match ratio (lower distance is better) - const ratio = Math.floor((1 - distance / length) * 100); + const ratio = Math.floor((1 - dist / length) * 100); if (ratio >= 60) { return ratio; } diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx b/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx index 19490125e8840..633ed96ec8225 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx @@ -86,7 +86,7 @@ const appDependencies = { editableIndexSettings: 'all', enableMappingsSourceFieldSection: true, enableTogglingDataRetention: true, - enableSemanticText: false, + enableSemanticText: true, }, overlays: { openConfirm: jest.fn(), diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/index_details_page.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/index_details_page.helpers.ts index 91dd4d26c2a5b..d80b08b96dacc 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/index_details_page.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/index_details_page.helpers.ts @@ -61,7 +61,7 @@ export interface IndexDetailsPageTestBed extends TestBed { selectInferenceIdButtonExists: () => void; openSelectInferencePopover: () => void; expectDefaultInferenceModelToExists: () => void; - expectCustomInferenceModelToExists: (customInference: string) => Promise; + expectCustomInferenceModelToExists: (customInference: string) => void; }; settings: { getCodeBlockContent: () => string; @@ -317,23 +317,23 @@ export const setup = async ({ expect(exists('fieldTypesOptions-semantic_text')).toBe(false); }); }, - isReferenceFieldVisible: async () => { - expect(exists('referenceField.select')).toBe(true); + isReferenceFieldVisible: () => { + expect(exists('referenceFieldSelect')).toBe(true); }, - selectInferenceIdButtonExists: async () => { + selectInferenceIdButtonExists: () => { expect(exists('selectInferenceId')).toBe(true); expect(exists('inferenceIdButton')).toBe(true); find('inferenceIdButton').simulate('click'); }, - openSelectInferencePopover: async () => { + openSelectInferencePopover: () => { expect(exists('addInferenceEndpointButton')).toBe(true); expect(exists('manageInferenceEndpointButton')).toBe(true); }, - expectDefaultInferenceModelToExists: async () => { - expect(exists('default-inference_elser_model_2')).toBe(true); - expect(exists('default-inference_e5')).toBe(true); + expectDefaultInferenceModelToExists: () => { + expect(exists('custom-inference_elser_model_2')).toBe(true); + expect(exists('custom-inference_e5')).toBe(true); }, - expectCustomInferenceModelToExists: async (customInference: string) => { + expectCustomInferenceModelToExists: (customInference: string) => { expect(exists(customInference)).toBe(true); }, }; diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/index_details_page.test.tsx b/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/index_details_page.test.tsx index c79efbbf53f53..298ad1f9af02c 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/index_details_page.test.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/index_details_page.test.tsx @@ -69,6 +69,7 @@ describe('', () => { httpRequestsMockHelpers.setLoadIndexStatsResponse(testIndexName, testIndexStats); httpRequestsMockHelpers.setLoadIndexMappingResponse(testIndexName, testIndexMappings); httpRequestsMockHelpers.setLoadIndexSettingsResponse(testIndexName, testIndexSettings); + httpRequestsMockHelpers.setInferenceModels([]); await act(async () => { testBed = await setup({ @@ -671,7 +672,6 @@ describe('', () => { testBed = await setup({ httpSetup, dependencies: { - config: { enableSemanticText: true }, docLinks: { links: { ml: '', @@ -693,6 +693,7 @@ describe('', () => { ml: { mlApi: { trainedModels: { + getModelsDownloadStatus: jest.fn().mockResolvedValue({}), getTrainedModels: jest.fn().mockResolvedValue([ { model_id: '.elser_model_2', diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/select_inference_id.test.tsx b/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/select_inference_id.test.tsx index c734943ec4592..43bf8073de0aa 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/select_inference_id.test.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/select_inference_id.test.tsx @@ -5,13 +5,20 @@ * 2.0. */ +import { + Form, + useForm, +} from '../../../public/application/components/mappings_editor/shared_imports'; import { registerTestBed } from '@kbn/test-jest-helpers'; import { act } from 'react-dom/test-utils'; -import { SelectInferenceId } from '../../../public/application/components/mappings_editor/components/document_fields/field_parameters/select_inference_id'; +import { + SelectInferenceId, + SelectInferenceIdProps, +} from '../../../public/application/components/mappings_editor/components/document_fields/field_parameters/select_inference_id'; +import React from 'react'; -const onChangeMock = jest.fn(); -const setValueMock = jest.fn(); -const setNewInferenceEndpointMock = jest.fn(); +const createInferenceEndpointMock = jest.fn(); +const mockDispatch = jest.fn(); jest.mock('../../../public/application/app_context', () => ({ useAppContext: jest.fn().mockReturnValue({ @@ -41,23 +48,40 @@ jest.mock( }), }) ); + +jest.mock('../../../public/application/components/mappings_editor/mappings_state_context', () => ({ + useMappingsState: () => ({ inferenceToModelIdMap: {} }), + useDispatch: () => mockDispatch, +})); + +function getTestForm(Component: React.FC) { + return (defaultProps: SelectInferenceIdProps) => { + const { form } = useForm(); + form.setFieldValue('inference_id', 'elser_model_2'); + return ( +
    + + + ); + }; +} + describe('SelectInferenceId', () => { let exists: any; let find: any; beforeAll(async () => { - const setup = registerTestBed(SelectInferenceId, { - defaultProps: { - onChange: onChangeMock, - 'data-test-subj': 'data-inference-endpoint-list', - setValue: setValueMock, - setNewInferenceEndpoint: setNewInferenceEndpointMock, - }, + const defaultProps: SelectInferenceIdProps = { + 'data-test-subj': 'data-inference-endpoint-list', + createInferenceEndpoint: createInferenceEndpointMock, + }; + const setup = registerTestBed(getTestForm(SelectInferenceId), { + defaultProps, memoryRouter: { wrapComponent: false }, }); await act(async () => { - const testBed = setup(); + const testBed = await setup(); exists = testBed.exists; find = testBed.find; }); diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/trained_models_deployment_modal.test.tsx b/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/trained_models_deployment_modal.test.tsx index 17299a0f04b4f..cd9d099ee92f8 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/trained_models_deployment_modal.test.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_details_page/trained_models_deployment_modal.test.tsx @@ -6,26 +6,159 @@ */ import { registerTestBed } from '@kbn/test-jest-helpers'; -import { TrainedModelsDeploymentModal } from '../../../public/application/sections/home/index_list/details_page/trained_models_deployment_modal'; +import { + TrainedModelsDeploymentModal, + TrainedModelsDeploymentModalProps, +} from '../../../public/application/sections/home/index_list/details_page/trained_models_deployment_modal'; import { act } from 'react-dom/test-utils'; +import * as mappingsContext from '../../../public/application/components/mappings_editor/mappings_state_context'; +import { NormalizedField } from '../../../public/application/components/mappings_editor/types'; -const refreshModal = jest.fn(); -const setIsModalVisible = jest.fn(); -const tryAgainForErrorModal = jest.fn(); -const setIsVisibleForErrorModal = jest.fn(); +jest.mock('../../../public/hooks/use_ml_model_status_toasts', () => ({ + useMLModelNotificationToasts: jest.fn().mockReturnValue({ + showErrorToasts: jest.fn(), + }), +})); -describe('When semantic_text is enabled', () => { - describe('When there is no error in the model deployment', () => { - const setup = registerTestBed(TrainedModelsDeploymentModal, { - defaultProps: { - setIsModalVisible, - refreshModal, - pendingDeployments: ['.elser-test-3'], - errorsInTrainedModelDeployment: [], +jest.mock('../../../public/application/app_context', () => ({ + useAppContext: jest.fn().mockReturnValue({ + url: undefined, + plugins: { + ml: { + mlApi: { + trainedModels: { + getModelsDownloadStatus: jest.fn().mockResolvedValue({}), + getTrainedModels: jest.fn().mockResolvedValue([ + { + model_id: '.elser_model_2', + model_type: 'pytorch', + model_package: { + packaged_model_id: 'elser_model_2', + model_repository: 'https://ml-models.elastic.co', + minimum_version: '11.0.0', + size: 438123914, + sha256: '', + metadata: {}, + tags: [], + vocabulary_file: 'elser_model_2.vocab.json', + }, + description: 'Elastic Learned Sparse EncodeR v2', + tags: ['elastic'], + }, + ]), + getTrainedModelStats: jest.fn().mockResolvedValue({ + count: 1, + trained_model_stats: [ + { + model_id: '.elser_model_2', + + deployment_stats: { + deployment_id: 'elser_model_2', + model_id: '.elser_model_2', + threads_per_allocation: 1, + number_of_allocations: 1, + queue_capacity: 1024, + state: 'started', + }, + }, + ], + }), + }, + }, }, + }, + }), +})); + +jest.mock('../../../public/application/components/mappings_editor/mappings_state_context'); + +const mappingsContextMocked = jest.mocked(mappingsContext); + +const defaultState = { + inferenceToModelIdMap: { + e5: { + isDeployed: false, + isDeployable: true, + trainedModelId: '.multilingual-e5-small', + }, + elser_model_2: { + isDeployed: false, + isDeployable: true, + trainedModelId: '.elser_model_2', + }, + openai: { + isDeployed: false, + isDeployable: false, + trainedModelId: '', + }, + my_elser_endpoint: { + isDeployed: false, + isDeployable: true, + trainedModelId: '.elser_model_2', + }, + }, + fields: { + aliases: {}, + byId: {}, + rootLevelFields: [], + maxNestedDepth: 0, + }, + mappingViewFields: { byId: {} }, +} as any; + +const setErrorsInTrainedModelDeployment = jest.fn().mockReturnValue(undefined); +const fetchData = jest.fn().mockReturnValue(undefined); + +describe('When semantic_text is enabled', () => { + const setup = (defaultProps: Partial) => + registerTestBed(TrainedModelsDeploymentModal, { + defaultProps, memoryRouter: { wrapComponent: false }, + })(); + + beforeEach(() => { + jest.clearAllMocks(); + }); + + describe('When there are no pending deployments and no errors in the model deployment', () => { + mappingsContextMocked.useMappingsState.mockReturnValue(defaultState); + const { exists } = setup({ + errorsInTrainedModelDeployment: {}, + fetchData, + setErrorsInTrainedModelDeployment: () => undefined, + }); + + it('should not display the modal', () => { + expect(exists('trainedModelsDeploymentModal')).toBe(false); + }); + }); + + describe('When there are pending deployments in the model deployment', () => { + mappingsContextMocked.useMappingsState.mockReturnValue({ + ...defaultState, + fields: { + ...defaultState.fields, + byId: { + new_field: { + id: 'new_field', + isMultiField: false, + path: ['new_field'], + source: { + name: 'new_field', + type: 'semantic_text', + reference_field: 'title', + inference_id: 'elser_model_2', + }, + } as NormalizedField, + }, + rootLevelFields: ['new_field'], + }, + } as any); + const { exists, find } = setup({ + errorsInTrainedModelDeployment: {}, + fetchData, + setErrorsInTrainedModelDeployment, }); - const { exists, find } = setup(); it('should display the modal', () => { expect(exists('trainedModelsDeploymentModal')).toBe(true); @@ -37,55 +170,61 @@ describe('When semantic_text is enabled', () => { ); }); - it('should call refresh method if refresh button is pressed', async () => { + it('should call fetch data if refresh button is pressed', async () => { await act(async () => { find('confirmModalConfirmButton').simulate('click'); }); - expect(refreshModal.mock.calls).toHaveLength(1); - }); - - it('should call setIsModalVisible method if cancel button is pressed', async () => { - await act(async () => { - find('confirmModalCancelButton').simulate('click'); - }); - expect(setIsModalVisible).toHaveBeenLastCalledWith(false); + expect(fetchData.mock.calls).toHaveLength(1); }); }); describe('When there is error in the model deployment', () => { - const setup = registerTestBed(TrainedModelsDeploymentModal, { - defaultProps: { - setIsModalVisible: setIsVisibleForErrorModal, - refreshModal: tryAgainForErrorModal, - pendingDeployments: ['.elser-test-3'], - errorsInTrainedModelDeployment: ['.elser-test-3'], + mappingsContextMocked.useMappingsState.mockReturnValue({ + ...defaultState, + fields: { + ...defaultState.fields, + byId: { + new_field: { + id: 'new_field', + isMultiField: false, + path: ['new_field'], + source: { + name: 'new_field', + type: 'semantic_text', + reference_field: 'title', + inference_id: 'elser_model_2', + }, + } as NormalizedField, + }, + rootLevelFields: ['new_field'], }, - memoryRouter: { wrapComponent: false }, + } as any); + const { find } = setup({ + fetchData, + errorsInTrainedModelDeployment: { '.elser_model_2': 'Error' }, + setErrorsInTrainedModelDeployment, }); - const { exists, find } = setup(); - it('should display the modal', () => { - expect(exists('trainedModelsErroredDeploymentModal')).toBe(true); + it('should display text related to errored deployments', () => { + expect(find('trainedModelsDeploymentModalText').text()).toContain('There was an error'); }); - it('should contain content related to semantic_text', () => { - expect(find('trainedModelsErrorDeploymentModalText').text()).toContain( - 'There was an error when trying to deploy' - ); + it('should display only the errored deployment', () => { + expect(find('trainedModelsDeploymentModal').text()).toContain('.elser_model_2'); + expect(find('trainedModelsDeploymentModal').text()).not.toContain('valid-model'); }); it("should call refresh method if 'Try again' button is pressed", async () => { await act(async () => { find('confirmModalConfirmButton').simulate('click'); }); - expect(tryAgainForErrorModal.mock.calls).toHaveLength(1); + expect(fetchData.mock.calls).toHaveLength(1); }); it('should call setIsVisibleForErrorModal method if cancel button is pressed', async () => { await act(async () => { find('confirmModalCancelButton').simulate('click'); }); - expect(setIsVisibleForErrorModal).toHaveBeenLastCalledWith(false); }); }); }); diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.test.tsx b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.test.tsx index eb9e6c793aa5a..dac7dadfa2557 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.test.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_edit.test.tsx @@ -12,7 +12,13 @@ import * as fixtures from '../../../test/fixtures'; import { API_BASE_PATH } from '../../../common/constants'; import { setupEnvironment, kibanaVersion } from '../helpers'; -import { TEMPLATE_NAME, SETTINGS, ALIASES, MAPPINGS as DEFAULT_MAPPING } from './constants'; +import { + TEMPLATE_NAME, + SETTINGS, + ALIASES, + MAPPINGS as DEFAULT_MAPPING, + INDEX_PATTERNS, +} from './constants'; import { setup } from './template_edit.helpers'; import { TemplateFormTestBed } from './template_form.helpers'; @@ -26,6 +32,22 @@ const MAPPING = { }, }, }; +const NONEXISTENT_COMPONENT_TEMPLATE = { + name: 'component_template@custom', + hasMappings: false, + hasAliases: false, + hasSettings: false, + usedBy: [], +}; + +const EXISTING_COMPONENT_TEMPLATE = { + name: 'test_component_template', + hasMappings: true, + hasAliases: false, + hasSettings: false, + usedBy: [], + isManaged: false, +}; jest.mock('@kbn/code-editor', () => { const original = jest.requireActual('@kbn/code-editor'); @@ -70,6 +92,7 @@ describe('', () => { beforeAll(() => { jest.useFakeTimers({ legacyFakeTimers: true }); httpRequestsMockHelpers.setLoadComponentTemplatesResponse([]); + httpRequestsMockHelpers.setLoadComponentTemplatesResponse([EXISTING_COMPONENT_TEMPLATE]); }); afterAll(() => { @@ -296,6 +319,84 @@ describe('', () => { }); }); + describe('when composed of a nonexistent component template', () => { + const templateToEdit = fixtures.getTemplate({ + name: TEMPLATE_NAME, + indexPatterns: INDEX_PATTERNS, + composedOf: [NONEXISTENT_COMPONENT_TEMPLATE.name], + ignoreMissingComponentTemplates: [NONEXISTENT_COMPONENT_TEMPLATE.name], + }); + + beforeAll(() => { + httpRequestsMockHelpers.setLoadTemplateResponse('my_template', templateToEdit); + }); + + beforeEach(async () => { + await act(async () => { + testBed = await setup(httpSetup); + }); + testBed.component.update(); + }); + + it('the nonexistent component template should be selected in the Component templates selector', async () => { + const { actions, exists } = testBed; + + // Complete step 1: Logistics + await actions.completeStepOne(); + jest.advanceTimersByTime(0); // advance timers to allow the form to validate + + // Should be at the Component templates step + expect(exists('stepComponents')).toBe(true); + + const { + actions: { + componentTemplates: { getComponentTemplatesSelected }, + }, + } = testBed; + + expect(exists('componentTemplatesSelection.emptyPrompt')).toBe(false); + expect(getComponentTemplatesSelected()).toEqual([NONEXISTENT_COMPONENT_TEMPLATE.name]); + }); + + it('the composedOf and ignoreMissingComponentTemplates fields should be included in the final payload', async () => { + const { component, actions, find } = testBed; + + // Complete step 1: Logistics + await actions.completeStepOne(); + // Complete step 2: Component templates + await actions.completeStepTwo(); + // Complete step 3: Index settings + await actions.completeStepThree(); + // Complete step 4: Mappings + await actions.completeStepFour(); + // Complete step 5: Aliases + await actions.completeStepFive(); + + expect(find('stepTitle').text()).toEqual(`Review details for '${TEMPLATE_NAME}'`); + + await act(async () => { + actions.clickNextButton(); + }); + component.update(); + + expect(httpSetup.put).toHaveBeenLastCalledWith( + `${API_BASE_PATH}/index_templates/${TEMPLATE_NAME}`, + expect.objectContaining({ + body: JSON.stringify({ + name: TEMPLATE_NAME, + indexPatterns: INDEX_PATTERNS, + version: templateToEdit.version, + allowAutoCreate: templateToEdit.allowAutoCreate, + _kbnMeta: templateToEdit._kbnMeta, + composedOf: [NONEXISTENT_COMPONENT_TEMPLATE.name], + template: {}, + ignoreMissingComponentTemplates: [NONEXISTENT_COMPONENT_TEMPLATE.name], + }), + }) + ); + }); + }); + if (kibanaVersion.major < 8) { describe('legacy index templates', () => { const legacyTemplateToEdit = fixtures.getTemplate({ diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/component_template_details.test.ts b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/component_template_details.test.ts index 49b4e1b201a19..858bd44781683 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/component_template_details.test.ts +++ b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/component_template_details.test.ts @@ -33,6 +33,10 @@ const COMPONENT_TEMPLATE_ONLY_REQUIRED_FIELDS: ComponentTemplateDeserialized = { _kbnMeta: { usedBy: [], isManaged: false }, }; +const CUSTOM_COMPONENT_TEMPLATE = { + name: 'test@custom', +}; + describe('', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); let testBed: ComponentTemplateDetailsTestBed; @@ -204,6 +208,35 @@ describe('', () => { }); }); + describe('Error handling for @custom templates', () => { + const error = { + statusCode: 404, + error: 'Not Found', + message: 'Not Found', + }; + + beforeEach(async () => { + httpRequestsMockHelpers.setLoadComponentTemplateResponse( + encodeURIComponent(CUSTOM_COMPONENT_TEMPLATE.name), + undefined, + error + ); + + await act(async () => { + testBed = setup(httpSetup, { + componentTemplateName: CUSTOM_COMPONENT_TEMPLATE.name, + onClose: () => {}, + }); + }); + + testBed.component.update(); + }); + + test('shows custom callout to create missing @custom template', () => { + expect(testBed.exists('missingCustomComponentTemplate')).toBe(true); + }); + }); + describe('Error handling', () => { const error = { statusCode: 500, diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_details.helpers.ts b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_details.helpers.ts index 98d9003dc307d..f0513dce68abd 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_details.helpers.ts +++ b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/component_template_details.helpers.ts @@ -89,4 +89,5 @@ export type ComponentTemplateDetailsTestSubjects = | 'deprecatedComponentTemplateBadge' | 'manageComponentTemplateButton' | 'manageComponentTemplateContextMenu' + | 'missingCustomComponentTemplate' | 'manageComponentTemplateContextMenu.action'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/setup_environment.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/setup_environment.tsx index ee3c359a8195a..00554b9ec1a14 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/setup_environment.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/__jest__/client_integration/helpers/setup_environment.tsx @@ -6,11 +6,17 @@ */ import React from 'react'; +import { LocationDescriptorObject } from 'history'; import type { CoreStart, HttpSetup } from '@kbn/core/public'; import { docLinksServiceMock } from '@kbn/core-doc-links-browser-mocks'; import { executionContextServiceMock } from '@kbn/core-execution-context-browser-mocks'; -import { notificationServiceMock, applicationServiceMock, coreMock } from '@kbn/core/public/mocks'; +import { + notificationServiceMock, + applicationServiceMock, + coreMock, + scopedHistoryMock, +} from '@kbn/core/public/mocks'; import { GlobalFlyout } from '@kbn/es-ui-shared-plugin/public'; import { breadcrumbService } from '../../../../../services/breadcrumbs'; @@ -23,10 +29,16 @@ import { API_BASE_PATH } from './constants'; const { GlobalFlyoutProvider } = GlobalFlyout; +const history = scopedHistoryMock.create(); +history.createHref.mockImplementation((location: LocationDescriptorObject) => { + return `${location.pathname}?${location.search}`; +}); + // We provide the minimum deps required to make the tests pass const appDependencies = { docLinks: {} as any, plugins: { ml: {} as any }, + history, } as any; export const componentTemplatesDependencies = (httpSetup: HttpSetup, coreStart?: CoreStart) => { diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/component_template_details.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/component_template_details.tsx index 60324997ab11b..0db0c9dd0f7c9 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/component_template_details.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/component_template_details.tsx @@ -19,6 +19,8 @@ import { EuiSpacer, EuiCallOut, EuiBadge, + EuiButton, + EuiCode, } from '@elastic/eui'; import { @@ -27,7 +29,9 @@ import { TabAliases, TabMappings, attemptToURIDecode, + reactRouterNavigate, } from '../shared_imports'; +import { useAppContext } from '../../../app_context'; import { useComponentTemplatesContext } from '../component_templates_context'; import { DeprecatedBadge } from '../components'; import { TabSummary } from './tab_summary'; @@ -46,12 +50,18 @@ export const defaultFlyoutProps = { 'aria-labelledby': 'componentTemplateDetailsFlyoutTitle', }; +// All component templates for integrations end in @custom +const isIntegrationsComponentTemplate = (name: string) => { + return name.toLowerCase().endsWith('@custom'); +}; + export const ComponentTemplateDetailsFlyoutContent: React.FunctionComponent = ({ componentTemplateName, onClose, actions, showSummaryCallToAction, }) => { + const { history } = useAppContext(); const { api } = useComponentTemplatesContext(); const decodedComponentTemplateName = attemptToURIDecode(componentTemplateName)!; @@ -76,21 +86,62 @@ export const ComponentTemplateDetailsFlyoutContent: React.FunctionComponent ); } else if (error) { - content = ( - - } - color="danger" - iconType="warning" - data-test-subj="sectionError" - > -

    {error.message}

    -
    - ); + if ( + error?.error === 'Not Found' && + isIntegrationsComponentTemplate(decodedComponentTemplateName) + ) { + content = ( + + } + color="warning" + iconType="warning" + data-test-subj="missingCustomComponentTemplate" + > +

    + {decodedComponentTemplateName}, + }} + /> +

    + + + +
    + ); + } else { + content = ( + + } + color="danger" + iconType="warning" + data-test-subj="sectionError" + > +

    {error.message}

    +
    + ); + } } else if (componentTemplateDetails) { const { template: { settings, mappings, aliases }, diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/component_templates_selector.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/component_templates_selector.tsx index 71c2f09072dac..1c727265fd1f1 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/component_templates_selector.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/component_templates_selector.tsx @@ -87,8 +87,20 @@ export const ComponentTemplatesSelector = ({ .map((name) => components.find((comp) => comp.name === name)) .filter(Boolean) as ComponentTemplateListItem[]; - setComponentsSelected(nextComponentsSelected); - onChange(nextComponentsSelected.map(({ name }) => name)); + // Add the non-existing templates from the "defaultValue" prop + const missingDefaultComponents: ComponentTemplateListItem[] = defaultValue + .filter((name) => !components.find((comp) => comp.name === name)) + .map((name) => ({ + name, + usedBy: [], + hasMappings: false, + hasAliases: false, + hasSettings: false, + isManaged: false, + })); + + setComponentsSelected([...nextComponentsSelected, ...missingDefaultComponents]); + onChange([...nextComponentsSelected, ...missingDefaultComponents].map(({ name }) => name)); isInitialized.current = true; } else { onChange(componentsSelected.map(({ name }) => name)); diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/helpers/mappings_editor.helpers.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/helpers/mappings_editor.helpers.tsx index e1c3ea7dc6179..094fd40ab1e32 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/helpers/mappings_editor.helpers.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/helpers/mappings_editor.helpers.tsx @@ -380,8 +380,11 @@ export const setup = ( props: any = { onUpdate() {} }, appDependencies?: any ): MappingsEditorTestBed => { + const defaultAppDependencies = { + plugins: {}, + }; const setupTestBed = registerTestBed( - WithAppDependencies(MappingsEditor, appDependencies), + WithAppDependencies(MappingsEditor, appDependencies ?? defaultAppDependencies), { memoryRouter: { wrapComponent: false, diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/mappings_editor.test.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/mappings_editor.test.tsx index 1347aaeade4f8..685aa4963edc4 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/mappings_editor.test.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/__jest__/client_integration/mappings_editor.test.tsx @@ -28,6 +28,7 @@ describe('Mappings editor: core', () => { let onChangeHandler: jest.Mock = jest.fn(); let getMappingsEditorData = getMappingsEditorDataFactory(onChangeHandler); let testBed: MappingsEditorTestBed; + const appDependencies = { plugins: { ml: { mlApi: {} } } }; beforeAll(() => { jest.useFakeTimers({ legacyFakeTimers: true }); @@ -55,7 +56,7 @@ describe('Mappings editor: core', () => { }; await act(async () => { - testBed = setup({ value: defaultMappings, onChange: onChangeHandler }); + testBed = setup({ value: defaultMappings, onChange: onChangeHandler }, appDependencies); }); const { component } = testBed; @@ -95,7 +96,7 @@ describe('Mappings editor: core', () => { }; await act(async () => { - testBed = setup({ onChange: onChangeHandler, value }); + testBed = setup({ onChange: onChangeHandler, value }, appDependencies); }); const { component, exists } = testBed; @@ -115,7 +116,7 @@ describe('Mappings editor: core', () => { }, }; await act(async () => { - testBed = setup({ onChange: onChangeHandler, value }); + testBed = setup({ onChange: onChangeHandler, value }, appDependencies); }); const { component, exists } = testBed; @@ -137,6 +138,7 @@ describe('Mappings editor: core', () => { config: { enableMappingsSourceFieldSection: true, }, + ...appDependencies, }; beforeEach(async () => { @@ -295,6 +297,7 @@ describe('Mappings editor: core', () => { config: { enableMappingsSourceFieldSection: true, }, + ...appDependencies, }; beforeEach(async () => { @@ -472,7 +475,7 @@ describe('Mappings editor: core', () => { }, }; await act(async () => { - testBed = setup({ onChange: onChangeHandler, value }); + testBed = setup({ onChange: onChangeHandler, value }, appDependencies); }); const { component, exists } = testBed; @@ -494,7 +497,7 @@ describe('Mappings editor: core', () => { }, }; await act(async () => { - testBed = setup({ onChange: onChangeHandler, value }); + testBed = setup({ onChange: onChangeHandler, value }, appDependencies); }); const { component } = testBed; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/name_parameter.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/name_parameter.tsx index e895a00b9f6d8..6fe58e7ba26da 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/name_parameter.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/name_parameter.tsx @@ -7,6 +7,7 @@ import React, { useCallback, useMemo } from 'react'; +import { i18n } from '@kbn/i18n'; import { TextField, UseField, FieldConfig } from '../../../shared_imports'; import { validateUniqueName } from '../../../lib'; import { PARAMETERS_DEFINITION } from '../../../constants'; @@ -14,7 +15,11 @@ import { useMappingsState } from '../../../mappings_state_context'; const { validations, ...rest } = PARAMETERS_DEFINITION.name.fieldConfig as FieldConfig; -export const NameParameter = () => { +interface NameParameterProps { + isSemanticText?: boolean; +} + +export const NameParameter: React.FC = ({ isSemanticText }) => { const { fields: { rootLevelFields, byId }, documentFields: { fieldToAddFieldTo, fieldToEdit }, @@ -32,6 +37,11 @@ export const NameParameter = () => { const nameConfig: FieldConfig = useMemo( () => ({ ...rest, + label: isSemanticText + ? i18n.translate('xpack.idxMgmt.mappingsEditor.semanticTextNameFieldLabel', { + defaultMessage: 'New field name', + }) + : rest.label, validations: [ ...validations!, { @@ -39,7 +49,7 @@ export const NameParameter = () => { }, ], }), - [uniqueNameValidator] + [isSemanticText, uniqueNameValidator] ); return ( diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/reference_field_selects.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/reference_field_selects.tsx index b8f5e866b68a9..9d923f529931b 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/reference_field_selects.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/reference_field_selects.tsx @@ -5,65 +5,45 @@ * 2.0. */ -import React, { useEffect } from 'react'; +import React from 'react'; -import { useLoadIndexMappings } from '../../../../../services'; import { getFieldConfig } from '../../../lib'; -import { Form, SuperSelectField, UseField, useForm } from '../../../shared_imports'; +import { useMappingsState } from '../../../mappings_state_context'; +import { SuperSelectField, UseField } from '../../../shared_imports'; import { SuperSelectOption } from '../../../types'; -interface Props { - onChange(value: string): void; - 'data-test-subj'?: string; - indexName?: string; -} +export const ReferenceFieldSelects = () => { + const { fields, mappingViewFields } = useMappingsState(); -export const ReferenceFieldSelects = ({ - onChange, - 'data-test-subj': dataTestSubj, - indexName, -}: Props) => { - const { form } = useForm(); - const { subscribe } = form; + const allFields = { + byId: { + ...mappingViewFields.byId, + ...fields.byId, + }, + rootLevelFields: [], + aliases: {}, + maxNestedDepth: 0, + }; - const { data } = useLoadIndexMappings(indexName ?? ''); - const referenceFieldOptions: SuperSelectOption[] = []; - if (data && data.mappings && data.mappings.properties) { - Object.keys(data.mappings.properties).forEach((key) => { - const field = data.mappings.properties[key]; - if (field.type === 'text') { - referenceFieldOptions.push({ - value: key, - inputDisplay: key, - 'data-test-subj': `select-reference-field-${key}`, - }); - } - }); - } + const referenceFieldOptions: SuperSelectOption[] = Object.values(allFields.byId) + .filter((field) => field.source.type === 'text') + .map((field) => ({ + value: field.path.join('.'), + inputDisplay: field.path.join('.'), + 'data-test-subj': `select-reference-field-${field.path.join('.')}}`, + })); const fieldConfigReferenceField = getFieldConfig('reference_field'); - - useEffect(() => { - const subscription = subscribe((updateData) => { - const formData = updateData.data.internal; - const value = formData.main; - onChange(value); - }); - - return subscription.unsubscribe; - }, [subscribe, onChange]); return ( -
    - - {(field) => ( - - )} - -
    + + {(field) => ( + + )} + ); }; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/select_inference_id.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/select_inference_id.tsx index e9a4387f91206..c4da2d30ac4fd 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/select_inference_id.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/select_inference_id.tsx @@ -24,63 +24,74 @@ import { import { i18n } from '@kbn/i18n'; import React, { useEffect, useState, useCallback, useMemo } from 'react'; -import { - InferenceAPIConfigResponse, - SUPPORTED_PYTORCH_TASKS, - TRAINED_MODEL_TYPE, -} from '@kbn/ml-trained-models-utils'; +import { SUPPORTED_PYTORCH_TASKS, TRAINED_MODEL_TYPE } from '@kbn/ml-trained-models-utils'; import { InferenceTaskType } from '@elastic/elasticsearch/lib/api/types'; -import { - ElasticsearchModelDefaultOptions, - ModelConfig, - Service, -} from '@kbn/inference_integration_flyout/types'; +import { ModelConfig } from '@kbn/inference_integration_flyout/types'; import { InferenceFlyoutWrapper } from '@kbn/inference_integration_flyout/components/inference_flyout_wrapper'; import { TrainedModelConfigResponse } from '@kbn/ml-plugin/common/types/trained_models'; import { getFieldConfig } from '../../../lib'; import { useAppContext } from '../../../../../app_context'; -import { Form, UseField, useForm } from '../../../shared_imports'; import { useLoadInferenceEndpoints } from '../../../../../services/api'; -import { getTrainedModelStats } from '../../../../../../hooks/use_details_page_mappings_model_management'; -import { InferenceToModelIdMap } from '../fields'; import { useMLModelNotificationToasts } from '../../../../../../hooks/use_ml_model_status_toasts'; -import { - CustomInferenceEndpointConfig, - DefaultInferenceModels, - DeploymentState, -} from '../../../types'; +import { CustomInferenceEndpointConfig } from '../../../types'; +import { UseField } from '../../../shared_imports'; -const inferenceServiceTypeElasticsearchModelMap: Record = - { - elser: ElasticsearchModelDefaultOptions.elser, - elasticsearch: ElasticsearchModelDefaultOptions.e5, - }; -const uncheckSelectedModelOption = (options: EuiSelectableOption[]) => { - const checkedOption = options.find(({ checked }) => checked === 'on'); - if (checkedOption) { - checkedOption.checked = undefined; - } -}; -interface Props { - onChange(value: string): void; +export interface SelectInferenceIdProps { + createInferenceEndpoint: ( + trainedModelId: string, + inferenceId: string, + modelConfig: CustomInferenceEndpointConfig + ) => Promise; 'data-test-subj'?: string; - setValue: (value: string) => void; - setNewInferenceEndpoint: ( - newInferenceEndpoint: InferenceToModelIdMap, - customInferenceEndpointConfig: CustomInferenceEndpointConfig - ) => void; } -export const SelectInferenceId = ({ - onChange, + +type SelectInferenceIdContentProps = SelectInferenceIdProps & { + setValue: (value: string) => void; + value: string; +}; + +const defaultEndpoints = [ + { + model_id: 'elser_model_2', + }, + { + model_id: 'e5', + }, +]; + +export const SelectInferenceId: React.FC = ({ + createInferenceEndpoint, + 'data-test-subj': dataTestSubj, +}: SelectInferenceIdProps) => { + const config = getFieldConfig('inference_id'); + return ( + + {(field) => { + return ( + + ); + }} + + ); +}; + +const SelectInferenceIdContent: React.FC = ({ + createInferenceEndpoint, 'data-test-subj': dataTestSubj, setValue, - setNewInferenceEndpoint, -}: Props) => { + value, +}) => { const { core: { application }, docLinks, plugins: { ml }, } = useAppContext(); + const config = getFieldConfig('inference_id'); const getMlTrainedModelPageUrl = useCallback(async () => { return await ml?.locator?.getUrl({ @@ -88,9 +99,6 @@ export const SelectInferenceId = ({ }); }, [ml]); - const { form } = useForm({ defaultValue: { main: DefaultInferenceModels.elser_model_2 } }); - const { subscribe } = form; - const [isInferenceFlyoutVisible, setIsInferenceFlyoutVisible] = useState(false); const [availableTrainedModels, setAvailableTrainedModels] = useState< TrainedModelConfigResponse[] @@ -118,101 +126,57 @@ export const SelectInferenceId = ({ return availableTrainedModelsList; }, [availableTrainedModels]); + const [isSaveInferenceLoading, setIsSaveInferenceLoading] = useState(false); - const fieldConfigModelId = getFieldConfig('inference_id'); - const defaultInferenceIds: EuiSelectableOption[] = useMemo(() => { - return [ - { - checked: 'on', - label: 'elser_model_2', - 'data-test-subj': 'default-inference_elser_model_2', - }, - { - label: 'e5', - 'data-test-subj': 'default-inference_e5', - }, - ]; - }, []); - - const { isLoading, data: models } = useLoadInferenceEndpoints(); - - const [options, setOptions] = useState([...defaultInferenceIds]); - const inferenceIdOptionsFromModels = useMemo(() => { - const inferenceIdOptions = - models?.map((model: InferenceAPIConfigResponse) => ({ - label: model.model_id, - 'data-test-subj': `custom-inference_${model.model_id}`, - })) || []; + const { isLoading, data: endpoints, resendRequest } = useLoadInferenceEndpoints(); - return inferenceIdOptions; - }, [models]); - - useEffect(() => { - const mergedOptions = { - ...inferenceIdOptionsFromModels.reduce( - (acc, option) => ({ ...acc, [option.label]: option }), - {} - ), - ...defaultInferenceIds.reduce((acc, option) => ({ ...acc, [option.label]: option }), {}), - }; - setOptions(Object.values(mergedOptions)); - }, [inferenceIdOptionsFromModels, defaultInferenceIds]); + const options: EuiSelectableOption[] = useMemo(() => { + const missingDefaultEndpoints = defaultEndpoints.filter( + (endpoint) => !(endpoints || []).find((e) => e.model_id === endpoint.model_id) + ); + const newOptions: EuiSelectableOption[] = [ + ...(endpoints || []), + ...missingDefaultEndpoints, + ].map((endpoint) => ({ + label: endpoint.model_id, + 'data-test-subj': `custom-inference_${endpoint.model_id}`, + checked: value === endpoint.model_id ? 'on' : undefined, + })); + if (value && !newOptions.find((option) => option.label === value)) { + // Sometimes we create a new endpoint but the backend is slow in updating so we need to optimistically update + const newOption: EuiSelectableOption = { + label: value, + checked: 'on', + 'data-test-subj': `custom-inference_${value}`, + }; + return [...newOptions, newOption]; + } + return newOptions; + }, [endpoints, value]); const { showErrorToasts } = useMLModelNotificationToasts(); const onSaveInferenceCallback = useCallback( async (inferenceId: string, taskType: InferenceTaskType, modelConfig: ModelConfig) => { - setIsInferenceFlyoutVisible(!isInferenceFlyoutVisible); try { - const isDeployable = - modelConfig.service === Service.elser || modelConfig.service === Service.elasticsearch; - - const newOption: EuiSelectableOption[] = [ - { - label: inferenceId, - checked: 'on', - 'data-test-subj': `custom-inference_${inferenceId}`, - }, - ]; - // uncheck selected endpoint id - uncheckSelectedModelOption(options); - - setOptions([...options, ...newOption]); - - const trainedModelStats = await ml?.mlApi?.trainedModels.getTrainedModelStats(); - const defaultEndpointId = - inferenceServiceTypeElasticsearchModelMap[modelConfig.service] || ''; - const newModelId: InferenceToModelIdMap = {}; - newModelId[inferenceId] = { - trainedModelId: defaultEndpointId, - isDeployable, - isDeployed: - getTrainedModelStats(trainedModelStats)[defaultEndpointId] === DeploymentState.DEPLOYED, - }; - const customInferenceEndpointConfig: CustomInferenceEndpointConfig = { + const trainedModelId = modelConfig.service_settings.model_id || ''; + const customModelConfig = { taskType, modelConfig, }; - setNewInferenceEndpoint(newModelId, customInferenceEndpointConfig); + setIsSaveInferenceLoading(true); + await createInferenceEndpoint(trainedModelId, inferenceId, customModelConfig); + resendRequest(); + setValue(inferenceId); + setIsInferenceFlyoutVisible(!isInferenceFlyoutVisible); + setIsSaveInferenceLoading(false); } catch (error) { showErrorToasts(error); + setIsSaveInferenceLoading(false); } }, - [isInferenceFlyoutVisible, ml, setNewInferenceEndpoint, options, showErrorToasts] + [createInferenceEndpoint, setValue, isInferenceFlyoutVisible, showErrorToasts, resendRequest] ); - useEffect(() => { - const subscription = subscribe((updateData) => { - const formData = updateData.data.internal; - const value = formData.main; - onChange(value); - }); - - return subscription.unsubscribe; - }, [subscribe, onChange]); - const selectedOptionLabel = options.find((option) => option.checked)?.label; - useEffect(() => { - setValue(selectedOptionLabel ?? DefaultInferenceModels.elser_model_2); - }, [selectedOptionLabel, setValue]); const [isInferencePopoverVisible, setIsInferencePopoverVisible] = useState(false); const [inferenceEndpointError, setInferenceEndpointError] = useState( undefined @@ -221,7 +185,15 @@ export const SelectInferenceId = ({ async (inferenceId: string) => { const modelsExist = options.some((i) => i.label === inferenceId); if (modelsExist) { - setInferenceEndpointError('Inference Endpoint id already exists'); + setInferenceEndpointError( + i18n.translate( + 'xpack.idxMgmt.mappingsEditor.parameters.inferenceId.popover.defaultLabel', + { + defaultMessage: 'Inference endpoint {inferenceId} already exists', + values: { inferenceId }, + } + ) + ); } else { setInferenceEndpointError(undefined); } @@ -229,139 +201,133 @@ export const SelectInferenceId = ({ [options] ); - const inferencePopover = () => { - return ( - - - {(field) => ( - <> - -

    - {field.label} -

    -
    - - { - setIsInferencePopoverVisible(!isInferencePopoverVisible); - }} - > - {selectedOptionLabel || - i18n.translate( - 'xpack.idxMgmt.mappingsEditor.parameters.inferenceId.popover.defaultLabel', - { - defaultMessage: 'No model selected', - } - )} - - - )} -
    - - } - isOpen={isInferencePopoverVisible} - panelPaddingSize="m" - closePopover={() => setIsInferencePopoverVisible(!isInferencePopoverVisible)} - > - - option.checked)?.label; + + const inferencePopover = () => ( + + +

    + {config.label} +

    +
    + + { - setIsInferenceFlyoutVisible(!isInferenceFlyoutVisible); - setInferenceEndpointError(undefined); setIsInferencePopoverVisible(!isInferencePopoverVisible); }} > + {selectedOptionLabel || + i18n.translate( + 'xpack.idxMgmt.mappingsEditor.parameters.inferenceId.popover.alreadyExistsLabel', + { + defaultMessage: 'No inference endpoint selected', + } + )} + + + } + isOpen={isInferencePopoverVisible} + panelPaddingSize="m" + closePopover={() => setIsInferencePopoverVisible(!isInferencePopoverVisible)} + > + + { + setIsInferenceFlyoutVisible(!isInferenceFlyoutVisible); + setInferenceEndpointError(undefined); + setIsInferencePopoverVisible(!isInferencePopoverVisible); + }} + > + {i18n.translate( + 'xpack.idxMgmt.mappingsEditor.parameters.inferenceId.popover.addInferenceEndpointButton', + { + defaultMessage: 'Add Inference Endpoint', + } + )} + + + { + const mlTrainedPageUrl = await getMlTrainedModelPageUrl(); + if (typeof mlTrainedPageUrl === 'string') { + application.navigateToUrl(mlTrainedPageUrl); + } + }} + > + {i18n.translate( + 'xpack.idxMgmt.mappingsEditor.parameters.inferenceId.popover.manageInferenceEndpointButton', + { + defaultMessage: 'Manage Inference Endpoints', + } + )} + + + + + +

    {i18n.translate( - 'xpack.idxMgmt.mappingsEditor.parameters.inferenceId.popover.addInferenceEndpointButton', - { - defaultMessage: 'Add inference Endpoint', - } - )} - - - { - const mlTrainedPageUrl = await getMlTrainedModelPageUrl(); - if (typeof mlTrainedPageUrl === 'string') { - application.navigateToUrl(mlTrainedPageUrl); - } - }} - > - {i18n.translate( - 'xpack.idxMgmt.mappingsEditor.parameters.inferenceId.popover.manageInferenceEndpointButton', + 'xpack.idxMgmt.mappingsEditor.parameters.inferenceId.popover.selectable.Label', { - defaultMessage: 'Manage Inference Endpoint', + defaultMessage: 'Existing endpoints', } )} - - - - - -

    - {i18n.translate( - 'xpack.idxMgmt.mappingsEditor.parameters.inferenceId.popover.selectable.Label', - { - defaultMessage: 'Existing endpoints', - } - )} -

    -
    - +

    +
    + - { - setOptions(newOptions); - setIsInferencePopoverVisible(!isInferencePopoverVisible); - }} - > - {(list, search) => ( - <> - {search} - {list} - - )} - -
    -
    - ); - }; + ), + }} + options={options} + onChange={(newOptions) => { + setValue(newOptions.find((option) => option.checked)?.label || ''); + }} + > + {(list, search) => ( + <> + {search} + {list} + + )} + +
    + + ); return ( -
    + <> + {inferencePopover()} @@ -378,6 +344,7 @@ export const SelectInferenceId = ({ supportedNlpModels={docLinks.links.enterpriseSearch.supportedNlpModels} nlpImportModel={docLinks.links.ml.nlpImportModel} setInferenceEndpointError={setInferenceEndpointError} + isCreateInferenceApiLoading={isSaveInferenceLoading} /> )} @@ -395,6 +362,6 @@ export const SelectInferenceId = ({ /> - + ); }; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/create_field.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/create_field.tsx index 4a3f600753dd4..4f8e6557e334f 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/create_field.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/create_field.tsx @@ -14,20 +14,16 @@ import { EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { ElasticsearchModelDefaultOptions } from '@kbn/inference_integration_flyout/types'; +import { TrainedModelStat } from '@kbn/ml-plugin/common/types/trained_models'; import { MlPluginStart } from '@kbn/ml-plugin/public'; import classNames from 'classnames'; -import React, { useCallback, useEffect, useState } from 'react'; +import React, { useEffect } from 'react'; import { EUI_SIZE, TYPE_DEFINITION } from '../../../../constants'; import { fieldSerializer } from '../../../../lib'; -import { useDispatch, useMappingsState } from '../../../../mappings_state_context'; -import { Form, FormDataProvider, UseField, useForm, useFormData } from '../../../../shared_imports'; -import { - CustomInferenceEndpointConfig, - Field, - MainType, - NormalizedFields, -} from '../../../../types'; +import { isSemanticTextField } from '../../../../lib/utils'; +import { useDispatch } from '../../../../mappings_state_context'; +import { Form, FormDataProvider, useForm, useFormData } from '../../../../shared_imports'; +import { Field, MainType, NormalizedFields } from '../../../../types'; import { NameParameter, SubTypeParameter, TypeParameter } from '../../field_parameters'; import { ReferenceFieldSelects } from '../../field_parameters/reference_field_selects'; import { SelectInferenceId } from '../../field_parameters/select_inference_id'; @@ -38,9 +34,11 @@ import { useSemanticText } from './semantic_text/use_semantic_text'; const formWrapper = (props: any) =>
    ; export interface InferenceToModelIdMap { [key: string]: { - trainedModelId: ElasticsearchModelDefaultOptions | string; + trainedModelId: string; isDeployed: boolean; isDeployable: boolean; + isDownloading: boolean; + modelStats?: TrainedModelStat; // third-party models don't have model stats }; } @@ -48,7 +46,9 @@ export interface SemanticTextInfo { isSemanticTextEnabled?: boolean; indexName?: string; ml?: MlPluginStart; - setErrorsInTrainedModelDeployment: React.Dispatch>; + setErrorsInTrainedModelDeployment: React.Dispatch< + React.SetStateAction> + >; } interface Props { allFields: NormalizedFields['byId']; @@ -73,13 +73,13 @@ export const CreateField = React.memo(function CreateFieldComponent({ isAddingFields, semanticTextInfo, }: Props) { - const { isSemanticTextEnabled, indexName, ml, setErrorsInTrainedModelDeployment } = - semanticTextInfo ?? {}; + const { isSemanticTextEnabled, ml, setErrorsInTrainedModelDeployment } = semanticTextInfo ?? {}; const dispatch = useDispatch(); const { form } = useForm({ serializer: fieldSerializer, options: { stripEmptyFields: false }, + id: 'create-field', }); useFormData({ form }); @@ -93,9 +93,6 @@ export const CreateField = React.memo(function CreateFieldComponent({ return subscription.unsubscribe; }, [dispatch, subscribe]); - const [customInferenceEndpointConfig, setCustomInferenceEndpointConfig] = useState< - CustomInferenceEndpointConfig | undefined - >(undefined); const cancel = () => { if (isAddingFields && onCancelAddingNewFields) { onCancelAddingNewFields(); @@ -104,19 +101,14 @@ export const CreateField = React.memo(function CreateFieldComponent({ } }; - const { - referenceFieldComboValue, - nameValue, - inferenceIdComboValue, - setInferenceValue, - semanticFieldType, - handleSemanticText, - } = useSemanticText({ + const { createInferenceEndpoint, handleSemanticText } = useSemanticText({ form, setErrorsInTrainedModelDeployment, ml, }); + const isSemanticText = form.getFormData().type === 'semantic_text'; + const submitForm = async ( e?: React.FormEvent, exitAfter: boolean = false, @@ -128,11 +120,9 @@ export const CreateField = React.memo(function CreateFieldComponent({ const { isValid, data } = await form.submit(); - if (isValid) { - form.reset(); - - if (data.type === 'semantic_text' && !clickOutside) { - handleSemanticText(data, customInferenceEndpointConfig); + if (isValid && !clickOutside) { + if (isSemanticTextField(data)) { + handleSemanticText(data); } else { dispatch({ type: 'field.add', value: data }); } @@ -140,6 +130,7 @@ export const CreateField = React.memo(function CreateFieldComponent({ if (exitAfter) { cancel(); } + form.reset(); } }; @@ -187,23 +178,19 @@ export const CreateField = React.memo(function CreateFieldComponent({ {/* Field reference_field for semantic_text field type */} - + {isSemanticText && ( + + + + )} {/* Field name */} - + ); - const isAddFieldButtonDisabled = (): boolean => { - if (semanticFieldType) { - return !referenceFieldComboValue || !nameValue || !inferenceIdComboValue; - } - - return false; - }; - const renderFormActions = () => ( {(isCancelable !== false || isAddingFields) && ( @@ -222,7 +209,7 @@ export const CreateField = React.memo(function CreateFieldComponent({ onClick={submitForm} type="submit" data-test-subj="addButton" - isDisabled={isAddFieldButtonDisabled()} + isDisabled={form.getErrors().length > 0} > {isMultiField ? i18n.translate('xpack.idxMgmt.mappingsEditor.createField.addMultiFieldButtonLabel', { @@ -289,11 +276,10 @@ export const CreateField = React.memo(function CreateFieldComponent({ ); }} - {/* Field inference_id for semantic_text field type */} - + + {isSemanticText && ( + + )} {renderFormActions()}
    @@ -302,69 +288,3 @@ export const CreateField = React.memo(function CreateFieldComponent({ ); }); - -function ReferenceFieldCombo({ indexName }: { indexName?: string }) { - const [{ type }] = useFormData({ watch: 'type' }); - - if (type === undefined || type[0]?.value !== 'semantic_text') { - return null; - } - - return ( - - - {(field) => } - - - ); -} - -interface InferenceProps { - setValue: (value: string) => void; - setCustomInferenceEndpointConfig: (config: CustomInferenceEndpointConfig) => void; -} - -function InferenceIdCombo({ setValue, setCustomInferenceEndpointConfig }: InferenceProps) { - const { inferenceToModelIdMap } = useMappingsState(); - const dispatch = useDispatch(); - const [{ type }] = useFormData({ watch: 'type' }); - - // update new inferenceEndpoint - const setNewInferenceEndpoint = useCallback( - ( - newInferenceEndpoint: InferenceToModelIdMap, - customInferenceEndpointConfig: CustomInferenceEndpointConfig - ) => { - dispatch({ - type: 'inferenceToModelIdMap.update', - value: { - inferenceToModelIdMap: { - ...inferenceToModelIdMap, - ...newInferenceEndpoint, - }, - }, - }); - setCustomInferenceEndpointConfig(customInferenceEndpointConfig); - }, - [dispatch, inferenceToModelIdMap, setCustomInferenceEndpointConfig] - ); - - if (type === undefined || type[0]?.value !== 'semantic_text') { - return null; - } - - return ( - <> - - - {(field) => ( - - )} - - - ); -} diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/semantic_text/use_semantic_text.test.ts b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/semantic_text/use_semantic_text.test.ts index f9bc12a9022fd..72e007b86f786 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/semantic_text/use_semantic_text.test.ts +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/semantic_text/use_semantic_text.test.ts @@ -6,10 +6,37 @@ */ import { renderHook } from '@testing-library/react-hooks'; -import { CustomInferenceEndpointConfig, Field } from '../../../../../types'; +import { CustomInferenceEndpointConfig, SemanticTextField } from '../../../../../types'; import { useSemanticText } from './use_semantic_text'; import { act } from 'react-dom/test-utils'; +jest.mock('../../../../../../../../hooks/use_details_page_mappings_model_management', () => ({ + useDetailsPageMappingsModelManagement: () => ({ + fetchInferenceToModelIdMap: () => ({ + e5: { + isDeployed: false, + isDeployable: true, + trainedModelId: '.multilingual-e5-small', + }, + elser_model_2: { + isDeployed: false, + isDeployable: true, + trainedModelId: '.elser_model_2', + }, + openai: { + isDeployed: false, + isDeployable: false, + trainedModelId: '', + }, + my_elser_endpoint: { + isDeployed: false, + isDeployable: true, + trainedModelId: '.elser_model_2', + }, + }), + }), +})); + const mlMock: any = { mlApi: { inferenceModels: { @@ -18,26 +45,30 @@ const mlMock: any = { }, }; -const mockField: Record = { +const mockField: Record = { elser_model_2: { name: 'name', type: 'semantic_text', - inferenceId: 'elser_model_2', + inference_id: 'elser_model_2', + reference_field: 'title', }, e5: { name: 'name', type: 'semantic_text', - inferenceId: 'e5', + inference_id: 'e5', + reference_field: 'title', }, openai: { name: 'name', type: 'semantic_text', - inferenceId: 'openai', + inference_id: 'openai', + reference_field: 'title', }, my_elser_endpoint: { name: 'name', type: 'semantic_text', - inferenceId: 'my_elser_endpoint', + inference_id: 'my_elser_endpoint', + reference_field: 'title', }, }; @@ -90,6 +121,10 @@ jest.mock('../../../../../mappings_state_context', () => ({ trainedModelId: '.elser_model_2', }, }, + fields: { + byId: {}, + }, + mappingViewFields: { byId: {} }, }), useDispatch: () => mockDispatch, })); @@ -128,28 +163,31 @@ describe('useSemanticText', () => { jest.clearAllMocks(); mockForm = { form: { - getFields: jest.fn().mockReturnValue({ - referenceField: { value: 'title' }, - name: { value: 'sem' }, - type: { value: [{ value: 'semantic_text' }] }, - inferenceId: { value: 'e5' }, + getFormData: jest.fn().mockReturnValue({ + referenceField: 'title', + name: 'sem', + type: 'semantic_text', + inferenceId: 'e5', }), + setFieldValue: jest.fn(), }, thirdPartyModel: { - getFields: jest.fn().mockReturnValue({ - referenceField: { value: 'title' }, - name: { value: 'semantic_text_openai_endpoint' }, - type: { value: [{ value: 'semantic_text' }] }, - inferenceId: { value: 'openai' }, + getFormData: jest.fn().mockReturnValue({ + referenceField: 'title', + name: 'semantic_text_openai_endpoint', + type: 'semantic_text', + inferenceId: 'openai', }), + setFieldValue: jest.fn(), }, elasticModelEndpointCreatedfromFlyout: { - getFields: jest.fn().mockReturnValue({ - referenceField: { value: 'title' }, - name: { value: 'semantic_text_elserServiceType_endpoint' }, - type: { value: [{ value: 'semantic_text' }] }, - inferenceId: { value: 'my_elser_endpoint' }, + getFormData: jest.fn().mockReturnValue({ + referenceField: 'title', + name: 'semantic_text_elserServiceType_endpoint', + type: 'semantic_text', + inferenceId: 'my_elser_endpoint', }), + setFieldValue: jest.fn(), }, }; }); @@ -162,11 +200,10 @@ describe('useSemanticText', () => { }) ); await act(async () => { - result.current.setInferenceValue('openai'); result.current.handleSemanticText(mockField.openai, mockConfig.openai); }); expect(mockDispatch).toHaveBeenCalledWith({ - type: 'field.addSemanticText', + type: 'field.add', value: mockField.openai, }); expect(mlMock.mlApi.inferenceModels.createInferenceEndpoint).toHaveBeenCalledWith( @@ -184,12 +221,11 @@ describe('useSemanticText', () => { }) ); await act(async () => { - result.current.setInferenceValue('my_elser_endpoint'); result.current.handleSemanticText(mockField.my_elser_endpoint, mockConfig.elser); }); expect(mockDispatch).toHaveBeenCalledWith({ - type: 'field.addSemanticText', + type: 'field.add', value: mockField.my_elser_endpoint, }); expect(mlMock.mlApi.inferenceModels.createInferenceEndpoint).toHaveBeenCalledWith( @@ -198,20 +234,6 @@ describe('useSemanticText', () => { mockConfig.elser.modelConfig ); }); - it('should populate the values from the form', () => { - const { result } = renderHook(() => - useSemanticText({ - form: mockForm.form, - setErrorsInTrainedModelDeployment: jest.fn(), - ml: mlMock, - }) - ); - - expect(result.current.referenceFieldComboValue).toBe('title'); - expect(result.current.nameValue).toBe('sem'); - expect(result.current.inferenceIdComboValue).toBe('e5'); - expect(result.current.semanticFieldType).toBe('semantic_text'); - }); it('should handle semantic text correctly', async () => { const { result } = renderHook(() => @@ -227,7 +249,7 @@ describe('useSemanticText', () => { }); expect(mockDispatch).toHaveBeenCalledWith({ - type: 'field.addSemanticText', + type: 'field.add', value: mockField.elser_model_2, }); expect(mlMock.mlApi.inferenceModels.createInferenceEndpoint).toHaveBeenCalledWith( @@ -253,12 +275,11 @@ describe('useSemanticText', () => { ); await act(async () => { - result.current.setInferenceValue('e5'); result.current.handleSemanticText(mockField.e5); }); expect(mockDispatch).toHaveBeenCalledWith({ - type: 'field.addSemanticText', + type: 'field.add', value: mockField.e5, }); diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/semantic_text/use_semantic_text.ts b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/semantic_text/use_semantic_text.ts index 72be2636329a2..2eb4343d0c7a4 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/semantic_text/use_semantic_text.ts +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/semantic_text/use_semantic_text.ts @@ -5,23 +5,26 @@ * 2.0. */ -import { i18n } from '@kbn/i18n'; import { useCallback } from 'react'; import { MlPluginStart } from '@kbn/ml-plugin/public'; -import React, { useEffect, useState } from 'react'; -import { ElasticsearchModelDefaultOptions } from '@kbn/inference_integration_flyout/types'; +import React, { useEffect } from 'react'; import { InferenceTaskType } from '@elastic/elasticsearch/lib/api/types'; -import { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; +import { ElserModels } from '@kbn/ml-trained-models-utils'; +import { i18n } from '@kbn/i18n'; +import { useDetailsPageMappingsModelManagement } from '../../../../../../../../hooks/use_details_page_mappings_model_management'; import { useDispatch, useMappingsState } from '../../../../../mappings_state_context'; import { FormHook } from '../../../../../shared_imports'; -import { CustomInferenceEndpointConfig, DefaultInferenceModels, Field } from '../../../../../types'; +import { CustomInferenceEndpointConfig, Field, SemanticTextField } from '../../../../../types'; import { useMLModelNotificationToasts } from '../../../../../../../../hooks/use_ml_model_status_toasts'; import { getInferenceEndpoints } from '../../../../../../../services/api'; +import { getFieldByPathName } from '../../../../../lib/utils'; interface UseSemanticTextProps { form: FormHook; ml?: MlPluginStart; - setErrorsInTrainedModelDeployment: React.Dispatch> | undefined; + setErrorsInTrainedModelDeployment?: React.Dispatch< + React.SetStateAction> + >; } interface DefaultInferenceEndpointConfig { taskType: InferenceTaskType; @@ -30,70 +33,52 @@ interface DefaultInferenceEndpointConfig { export function useSemanticText(props: UseSemanticTextProps) { const { form, setErrorsInTrainedModelDeployment, ml } = props; - const { inferenceToModelIdMap } = useMappingsState(); + const { fields, mappingViewFields } = useMappingsState(); + const { fetchInferenceToModelIdMap } = useDetailsPageMappingsModelManagement(); const dispatch = useDispatch(); - const [referenceFieldComboValue, setReferenceFieldComboValue] = useState(); - const [nameValue, setNameValue] = useState(); - const [inferenceIdComboValue, setInferenceIdComboValue] = useState(); - const [semanticFieldType, setSemanticTextFieldType] = useState(); - const [inferenceValue, setInferenceValue] = useState( - DefaultInferenceModels.elser_model_2 - ); - const { showSuccessToasts, showErrorToasts } = useMLModelNotificationToasts(); + const { showSuccessToasts, showErrorToasts, showSuccessfullyDeployedToast } = + useMLModelNotificationToasts(); - const useFieldEffect = ( - semanticTextform: FormHook, - fieldName: string, - setState: React.Dispatch> - ) => { - const fieldValue = semanticTextform.getFields()?.[fieldName]?.value; - useEffect(() => { - if (typeof fieldValue === 'string') { - setState(fieldValue); - } - }, [semanticTextform, fieldValue, setState]); - }; - - useFieldEffect(form, 'referenceField', setReferenceFieldComboValue); - useFieldEffect(form, 'name', setNameValue); - - const fieldTypeValue = form.getFields()?.type?.value; + const fieldTypeValue = form.getFormData()?.type; useEffect(() => { - if (!Array.isArray(fieldTypeValue) || fieldTypeValue.length === 0) { - return; - } - setSemanticTextFieldType( - fieldTypeValue[0]?.value === 'semantic_text' ? fieldTypeValue[0].value : undefined - ); - }, [form, fieldTypeValue]); - - const inferenceId = form.getFields()?.inferenceId?.value; - useEffect(() => { - if (typeof inferenceId === 'string') { - setInferenceIdComboValue(inferenceId); + if (fieldTypeValue === 'semantic_text') { + const allFields = { + byId: { + ...fields.byId, + ...mappingViewFields.byId, + }, + rootLevelFields: [], + aliases: {}, + maxNestedDepth: 0, + }; + const defaultName = getFieldByPathName(allFields, 'semantic_text') ? '' : 'semantic_text'; + const referenceField = + Object.values(allFields.byId) + .find((field) => field.source.type === 'text') + ?.path.join('.') || ''; + if (!form.getFormData().name) { + form.setFieldValue('name', defaultName); + } + if (!form.getFormData().reference_field) { + form.setFieldValue('reference_field', referenceField); + } + if (!form.getFormData().inference_id) { + form.setFieldValue('inference_id', 'elser_model_2'); + } } - }, [form, inferenceId, inferenceToModelIdMap]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [fieldTypeValue]); const createInferenceEndpoint = useCallback( async ( - trainedModelId: ElasticsearchModelDefaultOptions | string, - data: Field, + trainedModelId: string, + inferenceId: string, customInferenceEndpointConfig?: CustomInferenceEndpointConfig ) => { - if (data.inferenceId === undefined) { - throw new Error( - i18n.translate('xpack.idxMgmt.mappingsEditor.createField.undefinedInferenceIdError', { - defaultMessage: 'Inference ID is undefined', - }) - ); - } + const isElser = ElserModels.includes(trainedModelId); const defaultInferenceEndpointConfig: DefaultInferenceEndpointConfig = { - service: - trainedModelId === ElasticsearchModelDefaultOptions.elser ? 'elser' : 'elasticsearch', - taskType: - trainedModelId === ElasticsearchModelDefaultOptions.elser - ? 'sparse_embedding' - : 'text_embedding', + service: isElser ? 'elser' : 'elasticsearch', + taskType: isElser ? 'sparse_embedding' : 'text_embedding', }; const modelConfig = customInferenceEndpointConfig @@ -108,65 +93,69 @@ export function useSemanticText(props: UseSemanticTextProps) { }; const taskType: InferenceTaskType = customInferenceEndpointConfig?.taskType ?? defaultInferenceEndpointConfig.taskType; - try { - await ml?.mlApi?.inferenceModels?.createInferenceEndpoint( - data.inferenceId, - taskType, - modelConfig - ); - } catch (error) { - throw error; - } + + await ml?.mlApi?.inferenceModels?.createInferenceEndpoint(inferenceId, taskType, modelConfig); }, [ml?.mlApi?.inferenceModels] ); const handleSemanticText = async ( - data: Field, + data: SemanticTextField, customInferenceEndpointConfig?: CustomInferenceEndpointConfig ) => { - data.inferenceId = inferenceValue; - if (data.inferenceId === undefined) { - return; - } - const inferenceData = inferenceToModelIdMap?.[data.inferenceId]; + const modelIdMap = await fetchInferenceToModelIdMap(); + const inferenceId = data.inference_id; + const inferenceData = modelIdMap?.[inferenceId]; if (!inferenceData) { - return; + throw new Error( + i18n.translate('xpack.idxMgmt.mappingsEditor.semanticText.inferenceError', { + defaultMessage: 'No inference model found for inference ID {inferenceId}', + }) + ); } const { trainedModelId } = inferenceData; - dispatch({ type: 'field.addSemanticText', value: data }); - + dispatch({ type: 'field.add', value: data }); + const inferenceEndpoints = await getInferenceEndpoints(); + const hasInferenceEndpoint = inferenceEndpoints.data?.some( + (inference) => inference.model_id === inferenceId + ); + // if inference endpoint exists already, do not create new inference endpoint + if (hasInferenceEndpoint) { + return; + } try { - // if inference endpoint exists already, do not create inference endpoint - const inferenceModels = await getInferenceEndpoints(); - const inferenceModel: InferenceAPIConfigResponse[] = inferenceModels.data.some( - (e: InferenceAPIConfigResponse) => e.model_id === inferenceValue - ); - if (inferenceModel) { - return; - } // Only show toast if it's an internal Elastic model that hasn't been deployed yet if (trainedModelId && inferenceData.isDeployable && !inferenceData.isDeployed) { showSuccessToasts(trainedModelId); } - - await createInferenceEndpoint(trainedModelId, data, customInferenceEndpointConfig); + await createInferenceEndpoint( + trainedModelId, + data.inference_id, + customInferenceEndpointConfig + ); + if (trainedModelId) { + // clear error because we've succeeded here + setErrorsInTrainedModelDeployment?.((prevItems) => ({ + ...prevItems, + [trainedModelId]: undefined, + })); + } + showSuccessfullyDeployedToast(trainedModelId); } catch (error) { // trainedModelId is empty string when it's a third party model if (trainedModelId) { - setErrorsInTrainedModelDeployment?.((prevItems) => [...prevItems, trainedModelId]); + setErrorsInTrainedModelDeployment?.((prevItems) => ({ + ...prevItems, + [trainedModelId]: error, + })); } showErrorToasts(error); } }; return { - referenceFieldComboValue, - nameValue, - inferenceIdComboValue, - semanticFieldType, + createInferenceEndpoint, handleSemanticText, - setInferenceValue, }; } diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx index 790b4560000f7..0be09876b63f2 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx @@ -1041,7 +1041,6 @@ export const PARAMETERS_DEFINITION: { [key in ParameterName]: ParameterDefinitio }, schema: t.number, }, - dims: { fieldConfig: { defaultValue: '', @@ -1070,20 +1069,46 @@ export const PARAMETERS_DEFINITION: { [key in ParameterName]: ParameterDefinitio }, reference_field: { fieldConfig: { + defaultValue: '', label: i18n.translate('xpack.idxMgmt.mappingsEditor.parameters.referenceFieldLabel', { defaultMessage: 'Reference field', }), helpText: i18n.translate('xpack.idxMgmt.mappingsEditor.parameters.referenceFieldHelpText', { defaultMessage: 'Reference field for model inference.', }), + validations: [ + { + validator: emptyField( + i18n.translate( + 'xpack.idxMgmt.mappingsEditor.parameters.validations.referenceFieldIsRequiredErrorMessage', + { + defaultMessage: 'Reference field is required.', + } + ) + ), + }, + ], }, schema: t.string, }, inference_id: { fieldConfig: { + defaultValue: 'elser_model_2', label: i18n.translate('xpack.idxMgmt.mappingsEditor.parameters.inferenceIdLabel', { defaultMessage: 'Select an inference endpoint:', }), + validations: [ + { + validator: emptyField( + i18n.translate( + 'xpack.idxMgmt.mappingsEditor.parameters.validations.inferenceIdIsRequiredErrorMessage', + { + defaultMessage: 'Inference ID is required.', + } + ) + ), + }, + ], }, schema: t.string, }, diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.test.ts b/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.test.ts index be00b71b58ea1..3a4f71a8d533b 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.test.ts +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.test.ts @@ -18,6 +18,7 @@ import { getFieldsFromState, getAllFieldTypesFromState, getFieldsMatchingFilterFromState, + getStateWithCopyToFields, } from './utils'; const fieldsWithnestedFields: NormalizedFields = { @@ -420,6 +421,7 @@ describe('utils', () => { selectedDataTypes: ['Boolean'], }, inferenceToModelIdMap: {}, + mappingViewFields: { byId: {}, rootLevelFields: [], aliases: {}, maxNestedDepth: 0 }, }; test('returns list of matching fields with search term', () => { expect(getFieldsMatchingFilterFromState(sampleState, ['Boolean'])).toEqual({ @@ -442,5 +444,203 @@ describe('utils', () => { }, }); }); + describe('getStateWithCopyToFields', () => { + test('returns state if there is no semantic text field', () => { + const state = { + fields: { + byId: { + '88ebcfdb-19b7-4458-9ea2-9488df54453d': { + id: '88ebcfdb-19b7-4458-9ea2-9488df54453d', + isMultiField: false, + source: { + name: 'title', + type: 'text', + }, + }, + }, + }, + } as any; + expect(getStateWithCopyToFields(state)).toEqual(state); + }); + test('returns state if semantic text field has no reference field', () => { + const state = { + fields: { + byId: { + '88ebcfdb-19b7-4458-9ea2-9488df54453d': { + id: '88ebcfdb-19b7-4458-9ea2-9488df54453d', + isMultiField: false, + source: { + name: 'title', + type: 'semantic_text', + inference_id: 'id', + }, + }, + }, + }, + } as any; + expect(getStateWithCopyToFields(state)).toEqual(state); + }); + test('adds text field with copy to to state if semantic text field has reference field', () => { + const state = { + fields: { + byId: { + '88ebcfdb-19b7-4458-9ea2-9488df54453d': { + id: '88ebcfdb-19b7-4458-9ea2-9488df54453d', + isMultiField: false, + path: ['title'], + source: { + name: 'title', + type: 'semantic_text', + inference_id: 'id', + reference_field: 'new', + }, + }, + 'new-field': { + id: 'new-field', + isMultiField: false, + path: ['new'], + source: { + name: 'new', + type: 'text', + }, + }, + }, + rootLevelFields: ['88ebcfdb-19b7-4458-9ea2-9488df54453d'], + }, + } as any; + const expectedState = { + fields: { + byId: { + '88ebcfdb-19b7-4458-9ea2-9488df54453d': { + id: '88ebcfdb-19b7-4458-9ea2-9488df54453d', + isMultiField: false, + path: ['title'], + source: { + name: 'title', + type: 'semantic_text', + inference_id: 'id', + }, + }, + 'new-field': { + id: 'new-field', + isMultiField: false, + path: ['new'], + source: { + name: 'new', + type: 'text', + copy_to: ['title'], + }, + }, + }, + rootLevelFields: ['88ebcfdb-19b7-4458-9ea2-9488df54453d', 'new-field'], + }, + } as any; + expect(getStateWithCopyToFields(state)).toEqual(expectedState); + }); + test('adds nested text field with copy to to state if semantic text field has reference field', () => { + const state = { + fields: { + byId: { + '88ebcfdb-19b7-4458-9ea2-9488df54453d': { + id: '88ebcfdb-19b7-4458-9ea2-9488df54453d', + isMultiField: false, + path: ['title'], + source: { + name: 'title', + type: 'semantic_text', + inference_id: 'id', + reference_field: 'existing.new', + }, + }, + }, + rootLevelFields: ['88ebcfdb-19b7-4458-9ea2-9488df54453d'], + }, + mappingViewFields: { + byId: { + existing: { + id: 'existing', + isMultiField: false, + path: ['existing'], + source: { + name: 'existing', + type: 'object', + }, + }, + 'new-field': { + id: 'new-field', + parentId: 'existing', + isMultiField: false, + path: ['existing', 'new'], + source: { + name: 'new', + type: 'text', + }, + }, + }, + }, + } as any; + const expectedState = { + fields: { + byId: { + '88ebcfdb-19b7-4458-9ea2-9488df54453d': { + id: '88ebcfdb-19b7-4458-9ea2-9488df54453d', + isMultiField: false, + path: ['title'], + source: { + name: 'title', + type: 'semantic_text', + inference_id: 'id', + }, + }, + existing: { + id: 'existing', + isMultiField: false, + path: ['existing'], + source: { + name: 'existing', + type: 'object', + }, + }, + 'new-field': { + id: 'new-field', + isMultiField: false, + parentId: 'existing', + path: ['existing', 'new'], + source: { + name: 'new', + type: 'text', + copy_to: ['title'], + }, + }, + }, + rootLevelFields: ['88ebcfdb-19b7-4458-9ea2-9488df54453d', 'existing'], + }, + mappingViewFields: { + byId: { + existing: { + id: 'existing', + isMultiField: false, + path: ['existing'], + source: { + name: 'existing', + type: 'object', + }, + }, + 'new-field': { + id: 'new-field', + parentId: 'existing', + isMultiField: false, + path: ['existing', 'new'], + source: { + name: 'new', + type: 'text', + }, + }, + }, + }, + } as any; + expect(getStateWithCopyToFields(state)).toEqual(expectedState); + }); + }); }); }); diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.ts b/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.ts index cb95da745a30d..ed966805c0f2e 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.ts +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/lib/utils.ts @@ -7,6 +7,7 @@ import { v4 as uuidv4 } from 'uuid'; +import { cloneDeep } from 'lodash'; import { ChildFieldName, ComboBoxOption, @@ -23,6 +24,7 @@ import { ParameterName, RuntimeFields, SubType, + SemanticTextField, } from '../types'; import { @@ -685,3 +687,88 @@ export const getAllFieldTypesFromState = (allFields: Fields): DataType[] => { const fields: DataType[] = []; return getallFieldsIncludingNestedFields(allFields, fields).filter(filterUnique); }; + +export function isSemanticTextField(field: Partial): field is SemanticTextField { + return Boolean(field.inference_id && field.type === 'semantic_text'); +} + +/** + * Returns deep copy of state with `copy_to` added to text fields that are referenced by new semantic text fields + * @param state + * @returns state + */ + +export function getStateWithCopyToFields(state: State): State { + // Make sure we don't accidentally modify existing state + let updatedState = cloneDeep(state); + for (const field of Object.values(updatedState.fields.byId)) { + if (field.source.type === 'semantic_text' && field.source.reference_field) { + // Check fields already added to the list of to-update fields first + // API will not accept reference_field so removing it now + const { reference_field: referenceField, ...source } = field.source; + if (typeof referenceField !== 'string') { + // should never happen + throw new Error('Reference field is not a string'); + } + field.source = source; + const existingTextField = + getFieldByPathName(updatedState.fields, referenceField) || + getFieldByPathName(updatedState.mappingViewFields || { byId: {} }, referenceField); + if (existingTextField) { + // Add copy_to to existing text field's copy_to array + const updatedTextField: NormalizedField = { + ...existingTextField, + source: { + ...existingTextField.source, + copy_to: existingTextField.source.copy_to + ? [ + ...(Array.isArray(existingTextField.source.copy_to) + ? existingTextField.source.copy_to + : [existingTextField.source.copy_to]), + field.path.join('.'), + ] + : [field.path.join('.')], + }, + }; + updatedState = { + ...updatedState, + fields: { + ...updatedState.fields, + byId: { + ...updatedState.fields.byId, + [existingTextField.id]: updatedTextField, + }, + }, + }; + if (existingTextField.parentId) { + let currentField = existingTextField; + let hasParent = true; + while (hasParent) { + if (!currentField.parentId) { + // reached the top of the tree, push current field to root level fields + updatedState.fields.rootLevelFields.push(currentField.id); + hasParent = false; + } else if (updatedState.fields.byId[currentField.parentId]) { + // parent is already in state, don't need to do anything + hasParent = false; + } else { + // parent is not in state yet + updatedState.fields.byId[currentField.parentId] = + updatedState.mappingViewFields.byId[currentField.parentId]; + currentField = updatedState.fields.byId[currentField.parentId]; + } + } + } else { + updatedState.fields.rootLevelFields.push(existingTextField.id); + } + } else { + throw new Error(`Semantic text field ${field.path.join('.')} has invalid reference field`); + } + } + } + return updatedState; +} + +export const getFieldByPathName = (fields: NormalizedFields, name: string) => { + return Object.values(fields.byId).find((field) => field.path.join('.') === name); +}; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/mappings_state_context.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/mappings_state_context.tsx index 2b132d377918d..ac19c5395f974 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/mappings_state_context.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/mappings_state_context.tsx @@ -60,6 +60,7 @@ export const StateProvider: React.FC<{ children?: React.ReactNode }> = ({ childr selectedDataTypes: [], }, inferenceToModelIdMap: {}, + mappingViewFields: { byId: {}, rootLevelFields: [], aliases: {}, maxNestedDepth: 0 }, }; const [state, dispatch] = useReducer(reducer, initialState); diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/reducer.ts b/x-pack/plugins/index_management/public/application/components/mappings_editor/reducer.ts index 0e972e9900b9c..626ee0e839a8a 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/reducer.ts +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/reducer.ts @@ -214,6 +214,9 @@ export const reducer = (state: State, action: Action): State => { }, }; } + case 'editor.replaceViewMappings': { + return { ...state, mappingViewFields: action.value.fields }; + } case 'configuration.update': { const nextState = { ...state, @@ -323,28 +326,6 @@ export const reducer = (state: State, action: Action): State => { case 'field.add': { return addFieldToState(action.value, state); } - case 'field.addSemanticText': { - const addTexFieldWithCopyToActionValue: Field = { - name: action.value.referenceField as string, - type: 'text', - copy_to: [action.value.name], - }; - - // Add text field to state with copy_to of semantic_text field - let updatedState = addFieldToState(addTexFieldWithCopyToActionValue, state); - - const addSemanticTextFieldActionValue: Field = { - name: action.value.name, - inference_id: action.value.inferenceId, - type: 'semantic_text', - }; - - // Add semantic_text field to state and reset fieldToAddFieldTo - updatedState = addFieldToState(addSemanticTextFieldActionValue, updatedState); - updatedState.documentFields.fieldToAddFieldTo = undefined; - - return updatedState; - } case 'field.remove': { const field = state.fields.byId[action.value]; const { id, hasChildFields, hasMultiFields } = field; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/types/document_fields.ts b/x-pack/plugins/index_management/public/application/components/mappings_editor/types/document_fields.ts index 767d29aaaeda8..7ff156f6817f1 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/types/document_fields.ts +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/types/document_fields.ts @@ -186,9 +186,6 @@ interface FieldBasic { subType?: SubType; properties?: { [key: string]: Omit }; fields?: { [key: string]: Omit }; - referenceField?: string; - inferenceId?: string; - inference_id?: string; // other* exist together as a holder of types that the mappings editor does not yet know about but // enables the user to create mappings with them. @@ -201,6 +198,8 @@ type FieldParams = { export type Field = FieldBasic & Partial; +export type SemanticTextField = Field & { inference_id: string; reference_field: string }; + export interface FieldMeta { childFieldsName: ChildFieldName | undefined; canHaveChildFields: boolean; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/types/state.ts b/x-pack/plugins/index_management/public/application/components/mappings_editor/types/state.ts index a0e7247c39bc1..f40fe420eb3be 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/types/state.ts +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/types/state.ts @@ -108,10 +108,12 @@ export interface State { }; templates: TemplatesFormState; inferenceToModelIdMap?: InferenceToModelIdMap; + mappingViewFields: NormalizedFields; // state of the incoming index mappings, separate from the editor state above } export type Action = | { type: 'editor.replaceMappings'; value: { [key: string]: any } } + | { type: 'editor.replaceViewMappings'; value: { fields: NormalizedFields } } | { type: 'inferenceToModelIdMap.update'; value: { inferenceToModelIdMap?: InferenceToModelIdMap }; @@ -122,7 +124,6 @@ export type Action = | { type: 'templates.save'; value: MappingsTemplates } | { type: 'fieldForm.update'; value: OnFormUpdateArg } | { type: 'field.add'; value: Field } - | { type: 'field.addSemanticText'; value: Field } | { type: 'field.remove'; value: string } | { type: 'field.edit'; value: Field } | { type: 'field.toggleExpand'; value: { fieldId: string; isExpanded?: boolean } } diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/use_state_listener.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/use_state_listener.tsx index 1bd58bcc8e5f0..5c5e1c6a289fa 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/use_state_listener.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/use_state_listener.tsx @@ -8,6 +8,7 @@ import { useEffect, useMemo } from 'react'; import { EuiSelectableOption } from '@elastic/eui'; +import { cloneDeep } from 'lodash'; import { DocumentFieldsStatus, Field, @@ -182,6 +183,12 @@ export const useMappingsStateListener = ({ onChange, value, status }: Args) => { }, }, }); + dispatch({ + type: 'editor.replaceViewMappings', + value: { + fields: cloneDeep(parsedFieldsDefaultValue), + }, + }); }, [ value, parsedFieldsDefaultValue, diff --git a/x-pack/plugins/index_management/public/application/components/template_form/template_form.tsx b/x-pack/plugins/index_management/public/application/components/template_form/template_form.tsx index be1fdbaa47315..ac247500e3248 100644 --- a/x-pack/plugins/index_management/public/application/components/template_form/template_form.tsx +++ b/x-pack/plugins/index_management/public/application/components/template_form/template_form.tsx @@ -218,6 +218,7 @@ export const TemplateForm = ({ ? serializeAsESLifecycle(wizardData.logistics.lifecycle) : undefined, }, + ignoreMissingComponentTemplates: initialTemplate.ignoreMissingComponentTemplates, }; return cleanupTemplateObject(outputTemplate as TemplateDeserialized); diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_mappings_content.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_mappings_content.tsx index 88902ff517c35..f1a625dafbbda 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_mappings_content.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_mappings_content.tsx @@ -29,6 +29,10 @@ import { FormattedMessage } from '@kbn/i18n-react'; import React, { FunctionComponent, useCallback, useEffect, useMemo, useState } from 'react'; import { ILicense } from '@kbn/licensing-plugin/public'; import { useUnsavedChangesPrompt } from '@kbn/unsaved-changes-prompt'; +import { + getStateWithCopyToFields, + isSemanticTextField, +} from '../../../../components/mappings_editor/lib/utils'; import { Index } from '../../../../../../common'; import { useDetailsPageMappingsModelManagement } from '../../../../../hooks/use_details_page_mappings_model_management'; import { useAppContext } from '../../../../app_context'; @@ -73,7 +77,6 @@ export const DetailsPageMappingsContent: FunctionComponent<{ http, }, plugins: { ml, licensing }, - url, config, overlays, history, @@ -89,9 +92,9 @@ export const DetailsPageMappingsContent: FunctionComponent<{ }, [licensing]); const { enableSemanticText: isSemanticTextEnabled } = config; - const [errorsInTrainedModelDeployment, setErrorsInTrainedModelDeployment] = useState( - [] - ); + const [errorsInTrainedModelDeployment, setErrorsInTrainedModelDeployment] = useState< + Record + >({}); const hasMLPermissions = capabilities?.ml?.canGetTrainedModels ? true : false; @@ -151,11 +154,10 @@ export const DetailsPageMappingsContent: FunctionComponent<{ [jsonData] ); + const [hasSavedFields, setHasSavedFields] = useState(false); + useMappingsStateListener({ value: parsedDefaultValue, status: 'disabled' }); - const { fetchInferenceToModelIdMap, pendingDeployments } = useDetailsPageMappingsModelManagement( - state.fields, - state.inferenceToModelIdMap - ); + const { fetchInferenceToModelIdMap } = useDetailsPageMappingsModelManagement(); const onCancelAddingNewFields = useCallback(() => { setAddingFields(!isAddingFields); @@ -198,8 +200,6 @@ export const DetailsPageMappingsContent: FunctionComponent<{ }); }, [dispatch, isAddingFields, state]); - const [isModalVisible, setIsModalVisible] = useState(false); - useEffect(() => { if (!isSemanticTextEnabled || !hasMLPermissions) { return; @@ -213,7 +213,7 @@ export const DetailsPageMappingsContent: FunctionComponent<{ // eslint-disable-next-line react-hooks/exhaustive-deps }, []); - const refreshModal = useCallback(async () => { + const fetchInferenceData = useCallback(async () => { try { if (!isSemanticTextEnabled) { return; @@ -230,35 +230,45 @@ export const DetailsPageMappingsContent: FunctionComponent<{ }, [fetchInferenceToModelIdMap, isSemanticTextEnabled, hasMLPermissions]); const updateMappings = useCallback(async () => { + const hasSemanticText = hasSemanticTextField(state.fields); try { - if (isSemanticTextEnabled && hasMLPermissions) { + if (isSemanticTextEnabled && hasMLPermissions && hasSemanticText) { await fetchInferenceToModelIdMap(); - - if (pendingDeployments.length > 0) { - setIsModalVisible(true); - return; - } } - const denormalizedFields = deNormalize(state.fields); + const fields = hasSemanticText ? getStateWithCopyToFields(state).fields : state.fields; - const { error } = await updateIndexMappings(indexName, denormalizedFields); + const denormalizedFields = deNormalize(fields); - if (!error) { - notificationService.showSuccessToast( - i18n.translate('xpack.idxMgmt.indexDetails.mappings.successfullyUpdatedIndexMappings', { - defaultMessage: 'Updated index mapping', - }) + const inferenceIdsInPendingList = Object.values(deNormalize(fields)) + .filter(isSemanticTextField) + .map((field) => field.inference_id) + .filter( + (inferenceId: string) => + state.inferenceToModelIdMap?.[inferenceId] && + !state.inferenceToModelIdMap?.[inferenceId].isDeployed ); - refetchMapping(); - } else { - setSaveMappingError(error.message); + setHasSavedFields(true); + if (inferenceIdsInPendingList.length === 0) { + const { error } = await updateIndexMappings(indexName, denormalizedFields); + + if (!error) { + notificationService.showSuccessToast( + i18n.translate('xpack.idxMgmt.indexDetails.mappings.successfullyUpdatedIndexMappings', { + defaultMessage: 'Updated index mapping', + }) + ); + refetchMapping(); + setHasSavedFields(false); + } else { + setSaveMappingError(error.message); + } } } catch (exception) { setSaveMappingError(exception.message); } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [state.fields, pendingDeployments]); + }, [state.fields]); const onSearchChange = useCallback( (value: string) => { @@ -494,7 +504,7 @@ export const DetailsPageMappingsContent: FunctionComponent<{ > )} @@ -601,15 +611,17 @@ export const DetailsPageMappingsContent: FunctionComponent<{
    - {isModalVisible && isSemanticTextEnabled && ( + {isSemanticTextEnabled && isAddingFields && hasSavedFields && ( )} ); }; + +function hasSemanticTextField(fields: NormalizedFields): boolean { + return Object.values(fields.byId).some((field) => field.source.type === 'semantic_text'); +} diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/trained_models_deployment_modal.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/trained_models_deployment_modal.tsx index 8c2bfbbbef96d..4bba408197661 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/trained_models_deployment_modal.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/trained_models_deployment_modal.tsx @@ -8,179 +8,175 @@ import { EuiConfirmModal, useGeneratedHtmlId, EuiHealth } from '@elastic/eui'; import React from 'react'; import { EuiLink } from '@elastic/eui'; -import { useEffect, useState } from 'react'; -import type { SharePluginStart } from '@kbn/share-plugin/public'; +import { useEffect, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; +import { isSemanticTextField } from '../../../../components/mappings_editor/lib/utils'; +import { deNormalize } from '../../../../components/mappings_editor/lib'; +import { useMLModelNotificationToasts } from '../../../../../hooks/use_ml_model_status_toasts'; +import { useMappingsState } from '../../../../components/mappings_editor/mappings_state_context'; +import { useAppContext } from '../../../../app_context'; -interface SemanticTextProps { - setIsModalVisible: (isVisible: boolean) => void; - refreshModal: () => void; - pendingDeployments: Array; - errorsInTrainedModelDeployment: string[]; - url?: SharePluginStart['url']; +export interface TrainedModelsDeploymentModalProps { + fetchData: () => void; + errorsInTrainedModelDeployment: Record; + setErrorsInTrainedModelDeployment: React.Dispatch< + React.SetStateAction> + >; } const ML_APP_LOCATOR = 'ML_APP_LOCATOR'; const TRAINED_MODELS_MANAGE = 'trained_models'; export function TrainedModelsDeploymentModal({ - setIsModalVisible, - refreshModal, - pendingDeployments = [], - errorsInTrainedModelDeployment = [], - url, -}: SemanticTextProps) { + errorsInTrainedModelDeployment = {}, + fetchData, + setErrorsInTrainedModelDeployment, +}: TrainedModelsDeploymentModalProps) { + const { fields, inferenceToModelIdMap } = useMappingsState(); + const { + plugins: { ml }, + url, + } = useAppContext(); const modalTitleId = useGeneratedHtmlId(); + const [isModalVisible, setIsModalVisible] = useState(false); const closeModal = () => setIsModalVisible(false); const [mlManagementPageUrl, setMlManagementPageUrl] = useState(''); + const { showErrorToasts } = useMLModelNotificationToasts(); useEffect(() => { - setIsModalVisible(pendingDeployments.length > 0); - }, [pendingDeployments, setIsModalVisible]); - - useEffect(() => { - let isCancelled = false; const mlLocator = url?.locators.get(ML_APP_LOCATOR); const generateUrl = async () => { if (mlLocator) { const mlURL = await mlLocator.getUrl({ page: TRAINED_MODELS_MANAGE, }); - if (!isCancelled) { - setMlManagementPageUrl(mlURL); - } + setMlManagementPageUrl(mlURL); } }; generateUrl(); - return () => { - isCancelled = true; - }; }, [url]); - const ErroredDeployments = pendingDeployments.filter( - (deployment) => deployment !== undefined && errorsInTrainedModelDeployment.includes(deployment) - ); + const inferenceIdsInPendingList = useMemo(() => { + return Object.values(deNormalize(fields)) + .filter(isSemanticTextField) + .map((field) => field.inference_id); + }, [fields]); - const PendingModelsDeploymentModal = () => { - const pendingDeploymentsList = pendingDeployments.map((deployment, index) => ( -
  • - - {deployment} - -
  • - )); + const [pendingDeployments, setPendingDeployments] = useState([]); - return ( - -

    - {i18n.translate( - 'xpack.idxMgmt.indexDetails.trainedModelsDeploymentModal.textAboutDeploymentsNotCompleted', - { - defaultMessage: - 'Some fields are referencing models that have not yet completed deployment. Deployment may take a few minutes to complete.', - } - )} -

    -
      {pendingDeploymentsList}
    - - {i18n.translate( - 'xpack.idxMgmt.indexDetails.trainedModelsDeploymentModal.textTrainedModelManagementLink', - { - defaultMessage: 'Go to Trained Model Management', - } - )} - -
    - ); + const startModelAllocation = async (trainedModelId: string) => { + try { + await ml?.mlApi?.trainedModels.startModelAllocation(trainedModelId); + } catch (error) { + setErrorsInTrainedModelDeployment((previousState) => ({ + ...previousState, + [trainedModelId]: error.message, + })); + showErrorToasts(error); + setIsModalVisible(true); + } }; - const ErroredModelsDeploymentModal = () => { - const pendingDeploymentsList = pendingDeployments.map((deployment, index) => ( -
  • - - {deployment} - -
  • - )); + useEffect(() => { + const models = inferenceIdsInPendingList.map( + (inferenceId) => inferenceToModelIdMap?.[inferenceId] + ); + for (const model of models) { + if (model && !model.isDownloading && !model.isDeployed) { + // Sometimes the model gets stuck in a ready to deploy state, so we need to trigger deployment manually + startModelAllocation(model.trainedModelId); + } + } + const pendingModels = models + .map((model) => { + return model?.trainedModelId && !model?.isDeployed ? model?.trainedModelId : ''; + }) + .filter((trainedModelId) => !!trainedModelId); + const uniqueDeployments = pendingModels.filter( + (deployment, index) => pendingModels.indexOf(deployment) === index + ); + setPendingDeployments(uniqueDeployments); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [inferenceIdsInPendingList, inferenceToModelIdMap]); + + const erroredDeployments = pendingDeployments.filter( + (deployment) => errorsInTrainedModelDeployment[deployment] + ); - return ( - { + if (erroredDeployments.length > 0 || pendingDeployments.length > 0) { + setIsModalVisible(true); + } + }, [erroredDeployments.length, pendingDeployments.length]); + return isModalVisible ? ( + 0 + ? i18n.translate( + 'xpack.idxMgmt.indexDetails.trainedModelsDeploymentModal.deploymentErrorTitle', + { + defaultMessage: 'Models could not be deployed', + } + ) + : i18n.translate('xpack.idxMgmt.indexDetails.trainedModelsDeploymentModal.titleLabel', { + defaultMessage: 'Models still deploying', + }) + } + titleProps={{ id: modalTitleId }} + onCancel={closeModal} + onConfirm={fetchData} + cancelButtonText={i18n.translate( + 'xpack.idxMgmt.indexDetails.trainedModelsDeploymentModal.closeButtonLabel', + { + defaultMessage: 'Close', + } + )} + confirmButtonText={i18n.translate( + 'xpack.idxMgmt.indexDetails.trainedModelsDeploymentModal.refreshButtonLabel', + { + defaultMessage: 'Refresh', + } + )} + defaultFocusedButton="confirm" + data-test-subj="trainedModelsDeploymentModal" + > +

    + {erroredDeployments.length > 0 + ? i18n.translate( + 'xpack.idxMgmt.indexDetails.trainedModelsDeploymentModal.deploymentErrorText', + { + defaultMessage: 'There was an error when trying to deploy the following models.', + } + ) + : i18n.translate( + 'xpack.idxMgmt.indexDetails.trainedModelsDeploymentModal.textAboutDeploymentsNotCompleted', + { + defaultMessage: + 'Some fields are referencing models that have not yet completed deployment. Deployment may take a few minutes to complete.', + } + )} +

    +
      + {(erroredDeployments.length > 0 ? erroredDeployments : pendingDeployments).map( + (deployment) => ( +
    • + + {deployment} + +
    • + ) )} - confirmButtonText={i18n.translate( - 'xpack.idxMgmt.indexDetails.trainedModelsDeploymentModal.deploymentErrorTryAgainButtonLabel', +
    + + {i18n.translate( + 'xpack.idxMgmt.indexDetails.trainedModelsDeploymentModal.textTrainedModelManagementLink', { - defaultMessage: 'Try again', + defaultMessage: 'Go to Trained Model Management', } )} - defaultFocusedButton="confirm" - data-test-subj="trainedModelsErroredDeploymentModal" - > -

    - {i18n.translate( - 'xpack.idxMgmt.indexDetails.trainedModelsDeploymentModal.deploymentErrorText', - { - defaultMessage: 'There was an error when trying to deploy the following models.', - } - )} -

    -
      {pendingDeploymentsList}
    - - {i18n.translate( - 'xpack.idxMgmt.indexDetails.trainedModelsDeploymentModal.deploymentErrorTrainedModelManagementLink', - { - defaultMessage: 'Go to Trained Model Management', - } - )} - -
    - ); - }; - - return ErroredDeployments.length > 0 ? ( - - ) : ( - - ); + +
    + ) : null; } diff --git a/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_summary.tsx b/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_summary.tsx index 3f451217f8413..c2aa548100b57 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_summary.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_summary.tsx @@ -20,6 +20,8 @@ import { EuiCodeBlock, EuiSpacer, } from '@elastic/eui'; +import { reactRouterNavigate } from '../../../../../../shared_imports'; +import { useAppContext } from '../../../../../app_context'; import { serializeAsESLifecycle } from '../../../../../../../common/lib/data_stream_serialization'; import { getLifecycleValue } from '../../../../../lib/data_streams'; import { TemplateDeserialized } from '../../../../../../../common'; @@ -59,6 +61,7 @@ export const TabSummary: React.FunctionComponent = ({ templateDetails }) const numIndexPatterns = indexPatterns.length; + const { history } = useAppContext(); const ilmPolicyLink = useIlmLocator(ILM_PAGES_POLICY_EDIT, ilmPolicy?.name); return ( @@ -135,9 +138,11 @@ export const TabSummary: React.FunctionComponent = ({ templateDetails })
      {composedOf.map((component) => (
    • - + {component} - +
    • ))}
    diff --git a/x-pack/plugins/index_management/public/application/services/api.ts b/x-pack/plugins/index_management/public/application/services/api.ts index e071e0bf3c68c..e68335b8e0ba5 100644 --- a/x-pack/plugins/index_management/public/application/services/api.ts +++ b/x-pack/plugins/index_management/public/application/services/api.ts @@ -434,6 +434,7 @@ export function createIndex(indexName: string) { }), }); } + export function updateIndexMappings(indexName: string, newFields: Fields) { return sendRequest({ path: `${API_BASE_PATH}/mapping/${encodeURIComponent(indexName)}`, @@ -443,7 +444,7 @@ export function updateIndexMappings(indexName: string, newFields: Fields) { } export function getInferenceEndpoints() { - return sendRequest({ + return sendRequest({ path: `${API_BASE_PATH}/inference/all`, method: 'get', }); diff --git a/x-pack/plugins/index_management/public/hooks/use_details_page_mappings_model_management.test.ts b/x-pack/plugins/index_management/public/hooks/use_details_page_mappings_model_management.test.ts index c3d74c21ec528..6e80bcea5c349 100644 --- a/x-pack/plugins/index_management/public/hooks/use_details_page_mappings_model_management.test.ts +++ b/x-pack/plugins/index_management/public/hooks/use_details_page_mappings_model_management.test.ts @@ -6,7 +6,6 @@ */ import { renderHook } from '@testing-library/react-hooks'; -import { InferenceToModelIdMap } from '../application/components/mappings_editor/components/document_fields/fields'; import { NormalizedFields } from '../application/components/mappings_editor/types'; import { useDetailsPageMappingsModelManagement } from './use_details_page_mappings_model_management'; @@ -16,13 +15,24 @@ jest.mock('../application/app_context', () => ({ ml: { mlApi: { trainedModels: { + getModelsDownloadStatus: jest.fn().mockResolvedValue({ + '.elser_model_2_linux-x86_64': {}, + }), getTrainedModelStats: jest.fn().mockResolvedValue({ trained_model_stats: [ { - model_id: '.elser_model_2', + model_id: '.elser_model_2-x86_64', deployment_stats: { deployment_id: 'elser_model_2', - model_id: '.elser_model_2', + model_id: '.elser_model_2-x86_64', + state: 'not started', + }, + }, + { + model_id: '.multilingual-e5-small', + deployment_stats: { + deployment_id: 'e5', + model_id: '.multilingual-e5-small', state: 'started', }, }, @@ -55,68 +65,73 @@ jest.mock('../application/services/api', () => ({ jest.mock('../application/components/mappings_editor/mappings_state_context', () => ({ useDispatch: () => mockDispatch, -})); -const mockDispatch = jest.fn(); -const fields = { - byId: { - '88ebcfdb-19b7-4458-9ea2-9488df54453d': { - id: '88ebcfdb-19b7-4458-9ea2-9488df54453d', - isMultiField: false, - source: { - name: 'title', - type: 'text', - copy_to: ['semantic'], + useMappingsState: () => ({ + fields: { + byId: { + '88ebcfdb-19b7-4458-9ea2-9488df54453d': { + id: '88ebcfdb-19b7-4458-9ea2-9488df54453d', + isMultiField: false, + source: { + name: 'title', + type: 'text', + copy_to: ['semantic'], + }, + path: ['title'], + nestedDepth: 0, + childFieldsName: 'fields', + canHaveChildFields: false, + hasChildFields: false, + canHaveMultiFields: true, + hasMultiFields: false, + isExpanded: false, + }, + 'c5d86c82-ea07-4457-b469-3ffd4b96db81': { + id: 'c5d86c82-ea07-4457-b469-3ffd4b96db81', + isMultiField: false, + source: { + name: 'semantic', + inference_id: 'elser_model_2', + type: 'semantic_text', + }, + path: ['semantic'], + nestedDepth: 0, + childFieldsName: 'fields', + canHaveChildFields: false, + hasChildFields: false, + canHaveMultiFields: true, + hasMultiFields: false, + isExpanded: false, + }, }, - path: ['title'], - nestedDepth: 0, - childFieldsName: 'fields', - canHaveChildFields: false, - hasChildFields: false, - canHaveMultiFields: true, - hasMultiFields: false, - isExpanded: false, - }, - 'c5d86c82-ea07-4457-b469-3ffd4b96db81': { - id: 'c5d86c82-ea07-4457-b469-3ffd4b96db81', - isMultiField: false, - source: { - name: 'semantic', - inference_id: 'elser_model_2', - type: 'semantic_text', + aliases: {}, + rootLevelFields: [ + '88ebcfdb-19b7-4458-9ea2-9488df54453d', + 'c5d86c82-ea07-4457-b469-3ffd4b96db81', + ], + maxNestedDepth: 2, + } as NormalizedFields, + inferenceToModelIdMap: { + elser_model_2: { + trainedModelId: '.elser_model_2', + isDeployed: false, + isDeployable: true, + isDownloading: false, + }, + e5: { + trainedModelId: '.multilingual-e5-small', + isDeployed: true, + isDeployable: true, + isDownloading: false, }, - path: ['semantic'], - nestedDepth: 0, - childFieldsName: 'fields', - canHaveChildFields: false, - hasChildFields: false, - canHaveMultiFields: true, - hasMultiFields: false, - isExpanded: false, }, - }, - aliases: {}, - rootLevelFields: ['88ebcfdb-19b7-4458-9ea2-9488df54453d', 'c5d86c82-ea07-4457-b469-3ffd4b96db81'], - maxNestedDepth: 2, -} as NormalizedFields; + }), +})); -const inferenceToModelIdMap = { - elser_model_2: { - trainedModelId: '.elser_model_2', - isDeployed: true, - isDeployable: true, - }, - e5: { - trainedModelId: '.multilingual-e5-small', - isDeployed: true, - isDeployable: true, - }, -} as InferenceToModelIdMap; +const mockDispatch = jest.fn(); describe('useDetailsPageMappingsModelManagement', () => { it('should call the dispatch with correct parameters', async () => { - const { result } = renderHook(() => - useDetailsPageMappingsModelManagement(fields, inferenceToModelIdMap) - ); + const { result } = renderHook(() => useDetailsPageMappingsModelManagement()); await result.current.fetchInferenceToModelIdMap(); @@ -125,14 +140,22 @@ describe('useDetailsPageMappingsModelManagement', () => { value: { inferenceToModelIdMap: { e5: { - isDeployed: false, + isDeployed: true, isDeployable: true, trainedModelId: '.multilingual-e5-small', + isDownloading: false, + modelStats: { + deployment_id: 'e5', + model_id: '.multilingual-e5-small', + state: 'started', + }, }, elser_model_2: { - isDeployed: true, + isDeployed: false, isDeployable: true, - trainedModelId: '.elser_model_2', + trainedModelId: '.elser_model_2_linux-x86_64', + isDownloading: true, + modelStats: undefined, }, }, }, diff --git a/x-pack/plugins/index_management/public/hooks/use_details_page_mappings_model_management.ts b/x-pack/plugins/index_management/public/hooks/use_details_page_mappings_model_management.ts index 125892bdf6979..2d920a2d18ee0 100644 --- a/x-pack/plugins/index_management/public/hooks/use_details_page_mappings_model_management.ts +++ b/x-pack/plugins/index_management/public/hooks/use_details_page_mappings_model_management.ts @@ -5,134 +5,130 @@ * 2.0. */ -import { ElasticsearchModelDefaultOptions, Service } from '@kbn/inference_integration_flyout/types'; -import { InferenceStatsResponse } from '@kbn/ml-plugin/public/application/services/ml_api_service/trained_models'; -import type { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; -import { useCallback, useMemo } from 'react'; -import { useAppContext } from '../application/app_context'; +import { Service } from '@kbn/inference_integration_flyout/types'; +import { ModelDownloadState, TrainedModelStat } from '@kbn/ml-plugin/common/types/trained_models'; +import { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; +import { + LATEST_ELSER_VERSION, + InferenceServiceSettings, + LocalInferenceServiceSettings, + LATEST_ELSER_MODEL_ID, + LATEST_E5_MODEL_ID, + ElserVersion, +} from '@kbn/ml-trained-models-utils/src/constants/trained_models'; +import { useCallback } from 'react'; +import { AppDependencies, useAppContext } from '../application/app_context'; import { InferenceToModelIdMap } from '../application/components/mappings_editor/components/document_fields/fields'; -import { deNormalize } from '../application/components/mappings_editor/lib'; import { useDispatch } from '../application/components/mappings_editor/mappings_state_context'; -import { - DefaultInferenceModels, - DeploymentState, - NormalizedFields, -} from '../application/components/mappings_editor/types'; +import { DefaultInferenceModels } from '../application/components/mappings_editor/types'; import { getInferenceEndpoints } from '../application/services/api'; -interface InferenceModel { - data: InferenceAPIConfigResponse[]; +function isLocalModel(model: InferenceServiceSettings): model is LocalInferenceServiceSettings { + return Boolean((model as LocalInferenceServiceSettings).service_settings.model_id); } -type DeploymentStatusType = Record; - const getCustomInferenceIdMap = ( - deploymentStatsByModelId: DeploymentStatusType, - models?: InferenceModel -) => { - return models?.data.reduce((inferenceMap, model) => { - const inferenceId = model.model_id; - - const trainedModelId = - 'model_id' in model.service_settings && - (model.service_settings.model_id === ElasticsearchModelDefaultOptions.elser || - model.service_settings.model_id === ElasticsearchModelDefaultOptions.e5) - ? model.service_settings.model_id - : ''; - inferenceMap[inferenceId] = { - trainedModelId, - isDeployable: model.service === Service.elser || model.service === Service.elasticsearch, - isDeployed: deploymentStatsByModelId[trainedModelId] === 'deployed', - }; + models: InferenceAPIConfigResponse[], + modelStatsById: Record, + downloadStates: Record, + elser: string, + e5: string +): InferenceToModelIdMap => { + const inferenceIdMap = models.reduce((inferenceMap, model) => { + const inferenceEntry = isLocalModel(model) + ? { + trainedModelId: model.service_settings.model_id, // third-party models don't have trained model ids + isDeployable: model.service === Service.elser || model.service === Service.elasticsearch, + isDeployed: modelStatsById[model.service_settings.model_id]?.state === 'started', + isDownloading: Boolean(downloadStates[model.service_settings.model_id]), + modelStats: modelStatsById[model.service_settings.model_id], + } + : { + trainedModelId: '', + isDeployable: false, + isDeployed: false, + isDownloading: false, + modelStats: undefined, + }; + inferenceMap[model.model_id] = inferenceEntry; return inferenceMap; }, {}); -}; - -export const getTrainedModelStats = (modelStats?: InferenceStatsResponse): DeploymentStatusType => { - return ( - modelStats?.trained_model_stats.reduce((acc, modelStat) => { - if (modelStat.model_id) { - acc[modelStat.model_id] = - modelStat?.deployment_stats?.state === 'started' - ? DeploymentState.DEPLOYED - : DeploymentState.NOT_DEPLOYED; - } - return acc; - }, {}) || {} - ); -}; - -const getDefaultInferenceIds = (deploymentStatsByModelId: DeploymentStatusType) => { - return { + const defaultInferenceIds = { [DefaultInferenceModels.elser_model_2]: { - trainedModelId: ElasticsearchModelDefaultOptions.elser, + trainedModelId: elser, isDeployable: true, - isDeployed: - deploymentStatsByModelId[ElasticsearchModelDefaultOptions.elser] === - DeploymentState.DEPLOYED, + isDeployed: modelStatsById[elser]?.state === 'started', + isDownloading: Boolean(downloadStates[elser]), + modelStats: modelStatsById[elser], }, [DefaultInferenceModels.e5]: { - trainedModelId: ElasticsearchModelDefaultOptions.e5, + trainedModelId: e5, isDeployable: true, - isDeployed: - deploymentStatsByModelId[ElasticsearchModelDefaultOptions.e5] === DeploymentState.DEPLOYED, + isDeployed: modelStatsById[e5]?.state === 'started', + isDownloading: Boolean(downloadStates[e5]), + modelStats: modelStatsById[e5], }, }; + return { ...defaultInferenceIds, ...inferenceIdMap }; }; -export const useDetailsPageMappingsModelManagement = ( - fields: NormalizedFields, - inferenceToModelIdMap?: InferenceToModelIdMap -) => { +async function getCuratedModelConfig( + ml: AppDependencies['plugins']['ml'] | undefined, + model: string, + version?: ElserVersion +) { + if (ml?.mlApi) { + try { + const result = await ml.mlApi.trainedModels.getCuratedModelConfig( + model, + version ? { version } : undefined + ); + return result.model_id; + } catch (e) { + // pass through and return default models below + } + } + return model === 'elser' ? LATEST_ELSER_MODEL_ID : LATEST_E5_MODEL_ID; +} + +export const useDetailsPageMappingsModelManagement = () => { const { plugins: { ml }, } = useAppContext(); const dispatch = useDispatch(); - const fetchInferenceModelsAndTrainedModelStats = useCallback(async () => { + const fetchInferenceToModelIdMap = useCallback<() => Promise>(async () => { const inferenceModels = await getInferenceEndpoints(); - const trainedModelStats = await ml?.mlApi?.trainedModels.getTrainedModelStats(); - - return { inferenceModels, trainedModelStats }; - }, [ml]); - - const fetchInferenceToModelIdMap = useCallback(async () => { - const { inferenceModels, trainedModelStats } = await fetchInferenceModelsAndTrainedModelStats(); - const deploymentStatsByModelId = getTrainedModelStats(trainedModelStats); - const defaultInferenceIds = getDefaultInferenceIds(deploymentStatsByModelId); - const modelIdMap = getCustomInferenceIdMap(deploymentStatsByModelId, inferenceModels); + const downloadStates = await ml?.mlApi?.trainedModels.getModelsDownloadStatus(); + const elser = await getCuratedModelConfig(ml, 'elser', LATEST_ELSER_VERSION); + const e5 = await getCuratedModelConfig(ml, 'e5'); + const modelStatsById = + trainedModelStats?.trained_model_stats.reduce< + Record + >((acc, { model_id: modelId, deployment_stats: stats }) => { + if (modelId && stats) { + acc[modelId] = stats; + } + return acc; + }, {}) || {}; + const modelIdMap = getCustomInferenceIdMap( + inferenceModels.data || [], + modelStatsById, + downloadStates || {}, + elser, + e5 + ); dispatch({ type: 'inferenceToModelIdMap.update', - value: { inferenceToModelIdMap: { ...defaultInferenceIds, ...modelIdMap } }, + value: { inferenceToModelIdMap: modelIdMap }, }); - }, [dispatch, fetchInferenceModelsAndTrainedModelStats]); - - const inferenceIdsInPendingList = useMemo(() => { - return Object.values(deNormalize(fields)) - .filter((field) => field.type === 'semantic_text' && field.inference_id) - .map((field) => field.inference_id); - }, [fields]); - - const pendingDeployments = useMemo(() => { - return inferenceIdsInPendingList - .map((inferenceId) => { - if (inferenceId === undefined) { - return undefined; - } - const trainedModelId = inferenceToModelIdMap?.[inferenceId]?.trainedModelId ?? ''; - return trainedModelId && !inferenceToModelIdMap?.[inferenceId]?.isDeployed - ? trainedModelId - : undefined; - }) - .filter((trainedModelId) => !!trainedModelId); - }, [inferenceIdsInPendingList, inferenceToModelIdMap]); + return modelIdMap; + }, [dispatch, ml]); return { - pendingDeployments, fetchInferenceToModelIdMap, - fetchInferenceModelsAndTrainedModelStats, }; }; diff --git a/x-pack/plugins/index_management/public/hooks/use_ml_model_status_toasts.ts b/x-pack/plugins/index_management/public/hooks/use_ml_model_status_toasts.ts index cba440186a1d0..7b553f37498d5 100644 --- a/x-pack/plugins/index_management/public/hooks/use_ml_model_status_toasts.ts +++ b/x-pack/plugins/index_management/public/hooks/use_ml_model_status_toasts.ts @@ -27,6 +27,22 @@ export function useMLModelNotificationToasts() { }), }); }; + const showSuccessfullyDeployedToast = (modelName: string) => { + return toasts.addSuccess({ + title: i18n.translate( + 'xpack.idxMgmt.mappingsEditor.createField.modelDeploymentStartedNotification', + { + defaultMessage: 'Model deployment started', + } + ), + text: i18n.translate('xpack.idxMgmt.mappingsEditor.createField.modelDeployedNotification', { + defaultMessage: 'Model {modelName} has been deployed on your machine learning node.', + values: { + modelName, + }, + }), + }); + }; const showErrorToasts = (error: ErrorType) => { const errorObj = extractErrorProperties(error); return toasts.addError(new MLRequestFailure(errorObj, error), { @@ -35,5 +51,5 @@ export function useMLModelNotificationToasts() { }), }); }; - return { showSuccessToasts, showErrorToasts }; + return { showSuccessToasts, showErrorToasts, showSuccessfullyDeployedToast }; } diff --git a/x-pack/plugins/index_management/public/plugin.ts b/x-pack/plugins/index_management/public/plugin.ts index f6ae66d8e52bc..136174dfac165 100644 --- a/x-pack/plugins/index_management/public/plugin.ts +++ b/x-pack/plugins/index_management/public/plugin.ts @@ -74,7 +74,7 @@ export class IndexMgmtUIPlugin editableIndexSettings: editableIndexSettings ?? 'all', enableMappingsSourceFieldSection: enableMappingsSourceFieldSection ?? true, enableTogglingDataRetention: enableTogglingDataRetention ?? true, - enableSemanticText: enableSemanticText ?? false, + enableSemanticText: enableSemanticText ?? true, }; } diff --git a/x-pack/plugins/index_management/server/config.ts b/x-pack/plugins/index_management/server/config.ts index 8625274e31d2a..f2d1808a44286 100644 --- a/x-pack/plugins/index_management/server/config.ts +++ b/x-pack/plugins/index_management/server/config.ts @@ -36,7 +36,7 @@ const schemaLatest = schema.object( // deprecated as unused after index details page has been implemented enableIndexDetailsPage: schema.boolean({ defaultValue: false }), // deprecate as unused after semantic text is enabled everywhere - enableSemanticText: schema.boolean({ defaultValue: false }), + enableSemanticText: schema.boolean({ defaultValue: true }), }), enableIndexStats: offeringBasedSchema({ // Index stats information is disabled in serverless; refer to the serverless.yml file as the source of truth diff --git a/x-pack/plugins/index_management/test/fixtures/template.ts b/x-pack/plugins/index_management/test/fixtures/template.ts index ca7f625d61bb9..54df4410352b6 100644 --- a/x-pack/plugins/index_management/test/fixtures/template.ts +++ b/x-pack/plugins/index_management/test/fixtures/template.ts @@ -67,6 +67,8 @@ export const getTemplate = ({ indexPatterns = [], template: { settings, aliases, mappings } = {}, dataStream, + composedOf, + ignoreMissingComponentTemplates, hasDatastream = false, isLegacy = false, type = 'default', @@ -98,6 +100,8 @@ export const getTemplate = ({ hasDatastream: dataStream !== undefined ? true : hasDatastream, isLegacy, }, + composedOf, + ignoreMissingComponentTemplates, }; return indexTemplate; diff --git a/x-pack/plugins/integration_assistant/__jest__/fixtures/ecs_mapping.ts b/x-pack/plugins/integration_assistant/__jest__/fixtures/ecs_mapping.ts index 167995931b568..bfb05e2980b6a 100644 --- a/x-pack/plugins/integration_assistant/__jest__/fixtures/ecs_mapping.ts +++ b/x-pack/plugins/integration_assistant/__jest__/fixtures/ecs_mapping.ts @@ -86,9 +86,19 @@ export const ecsMappingExpectedResults = { target_field: 'mysql_enterprise.audit', }, }, + { + script: { + description: 'Ensures the date processor does not receive an array value.', + lang: 'painless', + source: + 'if (ctx.mysql_enterprise.audit.timestamp instanceof ArrayList){\n ctx.mysql_enterprise.audit.timestamp = ctx.mysql_enterprise.audit.timestamp[0];\n}\n', + tag: 'script_convert_array_to_string', + }, + }, { date: { field: 'mysql_enterprise.audit.timestamp', + tag: 'date_processor_mysql_enterprise.audit.timestamp', target_field: '@timestamp', formats: ['yyyy-MM-dd HH:mm:ss'], if: 'ctx.mysql_enterprise?.audit?.timestamp != null', diff --git a/x-pack/plugins/integration_assistant/common/api/categorization/categorization_route.schema.yaml b/x-pack/plugins/integration_assistant/common/api/categorization/categorization_route.schema.yaml index 37b5750e01aca..e04a41b88e564 100644 --- a/x-pack/plugins/integration_assistant/common/api/categorization/categorization_route.schema.yaml +++ b/x-pack/plugins/integration_assistant/common/api/categorization/categorization_route.schema.yaml @@ -34,6 +34,8 @@ paths: $ref: "../model/common_attributes.schema.yaml#/components/schemas/Pipeline" connectorId: $ref: "../model/common_attributes.schema.yaml#/components/schemas/Connector" + langSmithOptions: + $ref: "../model/common_attributes.schema.yaml#/components/schemas/LangSmithOptions" responses: 200: description: Indicates a successful call. diff --git a/x-pack/plugins/integration_assistant/common/api/categorization/categorization_route.ts b/x-pack/plugins/integration_assistant/common/api/categorization/categorization_route.ts index 067c3c88a07ed..c8e56a2af2f5e 100644 --- a/x-pack/plugins/integration_assistant/common/api/categorization/categorization_route.ts +++ b/x-pack/plugins/integration_assistant/common/api/categorization/categorization_route.ts @@ -10,6 +10,7 @@ import { z } from 'zod'; import { Connector, DataStreamName, + LangSmithOptions, PackageName, Pipeline, RawSamples, @@ -23,6 +24,7 @@ export const CategorizationRequestBody = z.object({ rawSamples: RawSamples, currentPipeline: Pipeline, connectorId: Connector, + langSmithOptions: LangSmithOptions.optional(), }); export type CategorizationRequestBodyInput = z.input; diff --git a/x-pack/plugins/integration_assistant/common/api/ecs/ecs_route.schema.yaml b/x-pack/plugins/integration_assistant/common/api/ecs/ecs_route.schema.yaml index d539ae5877da8..57505f64ebf2a 100644 --- a/x-pack/plugins/integration_assistant/common/api/ecs/ecs_route.schema.yaml +++ b/x-pack/plugins/integration_assistant/common/api/ecs/ecs_route.schema.yaml @@ -33,6 +33,8 @@ paths: $ref: "../model/common_attributes.schema.yaml#/components/schemas/Mapping" connectorId: $ref: "../model/common_attributes.schema.yaml#/components/schemas/Connector" + langSmithOptions: + $ref: "../model/common_attributes.schema.yaml#/components/schemas/LangSmithOptions" responses: 200: description: Indicates a successful call. diff --git a/x-pack/plugins/integration_assistant/common/api/ecs/ecs_route.ts b/x-pack/plugins/integration_assistant/common/api/ecs/ecs_route.ts index b1973159f9304..fd1dca194ae59 100644 --- a/x-pack/plugins/integration_assistant/common/api/ecs/ecs_route.ts +++ b/x-pack/plugins/integration_assistant/common/api/ecs/ecs_route.ts @@ -10,6 +10,7 @@ import { z } from 'zod'; import { Connector, DataStreamName, + LangSmithOptions, Mapping, PackageName, RawSamples, @@ -23,6 +24,7 @@ export const EcsMappingRequestBody = z.object({ rawSamples: RawSamples, mapping: Mapping.optional(), connectorId: Connector, + langSmithOptions: LangSmithOptions.optional(), }); export type EcsMappingRequestBodyInput = z.input; diff --git a/x-pack/plugins/integration_assistant/common/api/model/common_attributes.schema.yaml b/x-pack/plugins/integration_assistant/common/api/model/common_attributes.schema.yaml index 24cb71ed5274c..527899dc33727 100644 --- a/x-pack/plugins/integration_assistant/common/api/model/common_attributes.schema.yaml +++ b/x-pack/plugins/integration_assistant/common/api/model/common_attributes.schema.yaml @@ -143,3 +143,17 @@ components: logo: type: string description: The logo of the integration. + + LangSmithOptions: + type: object + description: The LangSmith options object. + required: + - projectName + - apiKey + properties: + projectName: + type: string + description: The project name. + apiKey: + type: string + description: The apiKey to use for tracing. diff --git a/x-pack/plugins/integration_assistant/common/api/model/common_attributes.ts b/x-pack/plugins/integration_assistant/common/api/model/common_attributes.ts index fdb20931ccce0..bde01d8bae245 100644 --- a/x-pack/plugins/integration_assistant/common/api/model/common_attributes.ts +++ b/x-pack/plugins/integration_assistant/common/api/model/common_attributes.ts @@ -156,3 +156,18 @@ export const Integration = z.object({ */ logo: z.string().optional(), }); + +/** + * The LangSmith options object. + */ +export type LangSmithOptions = z.infer; +export const LangSmithOptions = z.object({ + /** + * The project name to use with tracing. + */ + projectName: z.string(), + /** + * The api key for the project + */ + apiKey: z.string(), +}); diff --git a/x-pack/plugins/integration_assistant/common/api/related/related_route.schema.yaml b/x-pack/plugins/integration_assistant/common/api/related/related_route.schema.yaml index 13990dc1b66d8..a588ac5852822 100644 --- a/x-pack/plugins/integration_assistant/common/api/related/related_route.schema.yaml +++ b/x-pack/plugins/integration_assistant/common/api/related/related_route.schema.yaml @@ -34,6 +34,8 @@ paths: $ref: "../model/common_attributes.schema.yaml#/components/schemas/Pipeline" connectorId: $ref: "../model/common_attributes.schema.yaml#/components/schemas/Connector" + langSmithOptions: + $ref: "../model/common_attributes.schema.yaml#/components/schemas/LangSmithOptions" responses: 200: description: Indicates a successful call. diff --git a/x-pack/plugins/integration_assistant/common/api/related/related_route.ts b/x-pack/plugins/integration_assistant/common/api/related/related_route.ts index 4c5242e48d2c3..961bc007adcd8 100644 --- a/x-pack/plugins/integration_assistant/common/api/related/related_route.ts +++ b/x-pack/plugins/integration_assistant/common/api/related/related_route.ts @@ -10,6 +10,7 @@ import { z } from 'zod'; import { Connector, DataStreamName, + LangSmithOptions, PackageName, Pipeline, RawSamples, @@ -23,6 +24,7 @@ export const RelatedRequestBody = z.object({ rawSamples: RawSamples, currentPipeline: Pipeline, connectorId: Connector, + langSmithOptions: LangSmithOptions.optional(), }); export type RelatedRequestBodyInput = z.input; diff --git a/x-pack/plugins/integration_assistant/kibana.jsonc b/x-pack/plugins/integration_assistant/kibana.jsonc index b2ef3045e12be..d8d6e17026230 100644 --- a/x-pack/plugins/integration_assistant/kibana.jsonc +++ b/x-pack/plugins/integration_assistant/kibana.jsonc @@ -18,5 +18,8 @@ "actions", "stackConnectors", ], + "requiredBundles": [ + "kibanaUtils", + ] } } diff --git a/x-pack/plugins/integration_assistant/public/common/components/authorization/authorization_wrapper.tsx b/x-pack/plugins/integration_assistant/public/common/components/authorization/authorization_wrapper.tsx index 3890cd3b797cd..36e2fc727d674 100644 --- a/x-pack/plugins/integration_assistant/public/common/components/authorization/authorization_wrapper.tsx +++ b/x-pack/plugins/integration_assistant/public/common/components/authorization/authorization_wrapper.tsx @@ -25,7 +25,11 @@ export const AuthorizationWrapper = React.memo( if (!isAuthorized) { return ( - + ); diff --git a/x-pack/plugins/integration_assistant/public/common/components/buttons_footer.tsx b/x-pack/plugins/integration_assistant/public/common/components/buttons_footer.tsx index d70e2bcb288cb..d27d1381b6e25 100644 --- a/x-pack/plugins/integration_assistant/public/common/components/buttons_footer.tsx +++ b/x-pack/plugins/integration_assistant/public/common/components/buttons_footer.tsx @@ -44,7 +44,12 @@ export const ButtonsFooter = React.memo( const integrationsUrl = useKibana().services.application.getUrlForApp('integrations'); return ( - + ( > {!hideCancel && ( - + {cancelButtonText || ( ( > {onBack && ( - + {backButtonText || ( ( {onNext && ( - + {nextButtonText || ( ({ + canCreateIntegrations: true, + canExecuteConnectors: true, + canCreateConnectors: true, + }) +); + +export const useRoutesAuthorization = jest.fn( + (): RoutesAuthorization => ({ + canUseIntegrationAssistant: true, + canUseIntegrationUpload: true, + }) +); diff --git a/x-pack/plugins/integration_assistant/public/common/hooks/__mocks__/use_availability.ts b/x-pack/plugins/integration_assistant/public/common/hooks/__mocks__/use_availability.ts new file mode 100644 index 0000000000000..4f820b1ae1f52 --- /dev/null +++ b/x-pack/plugins/integration_assistant/public/common/hooks/__mocks__/use_availability.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { Availability } from '../use_availability'; + +export const useAvailability = jest.fn((): Availability => { + return { hasLicense: true, renderUpselling: undefined }; +}); + +export const useIsAvailable = jest.fn((): boolean => true); diff --git a/x-pack/plugins/integration_assistant/public/common/hooks/use_availability.ts b/x-pack/plugins/integration_assistant/public/common/hooks/use_availability.ts index 9681ea7000623..02f523fcde226 100644 --- a/x-pack/plugins/integration_assistant/public/common/hooks/use_availability.ts +++ b/x-pack/plugins/integration_assistant/public/common/hooks/use_availability.ts @@ -11,10 +11,12 @@ import { MINIMUM_LICENSE_TYPE } from '../../../common/constants'; import { useKibana } from './use_kibana'; import type { RenderUpselling } from '../../services'; -export const useAvailability = (): { +export interface Availability { hasLicense: boolean; renderUpselling: RenderUpselling | undefined; -} => { +} + +export const useAvailability = (): Availability => { const { licensing, renderUpselling$ } = useKibana().services; const licenseService = useObservable(licensing.license$); const renderUpselling = useObservable(renderUpselling$); diff --git a/x-pack/plugins/integration_assistant/public/common/lib/api_parsers.test.ts b/x-pack/plugins/integration_assistant/public/common/lib/api_parsers.test.ts new file mode 100644 index 0000000000000..c7d427cb5b01a --- /dev/null +++ b/x-pack/plugins/integration_assistant/public/common/lib/api_parsers.test.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { EpmPackageResponse } from './api'; +import { getIntegrationNameFromResponse } from './api_parsers'; + +describe('getIntegrationNameFromResponse', () => { + it.each([ + ['audit-security.data-stream-1.0.0', 'security-1.0.0'], + ['audit-endpoint_security.data_stream-1.0.0', 'endpoint_security-1.0.0'], + ['audit-endpoint_security_2.data_stream-1.0.0', 'endpoint_security_2-1.0.0'], + ])( + 'should return the integration name from the ingest pipeline name %s', + (ingestPipelineName, expected) => { + const response = { response: [{ id: ingestPipelineName }] } as EpmPackageResponse; + expect(getIntegrationNameFromResponse(response)).toEqual(expected); + } + ); + it('should return an empty string if the response is empty', () => { + const response = { response: [] } as unknown as EpmPackageResponse; + expect(getIntegrationNameFromResponse(response)).toEqual(''); + }); + it('should return an empty string if the response is undefined', () => { + const response = {} as EpmPackageResponse; + expect(getIntegrationNameFromResponse(response)).toEqual(''); + }); + it('should return an empty string if the response is null', () => { + const response = { response: null } as unknown as EpmPackageResponse; + expect(getIntegrationNameFromResponse(response)).toEqual(''); + }); +}); diff --git a/x-pack/plugins/integration_assistant/public/common/lib/lang_smith.ts b/x-pack/plugins/integration_assistant/public/common/lib/lang_smith.ts new file mode 100644 index 0000000000000..7234870439930 --- /dev/null +++ b/x-pack/plugins/integration_assistant/public/common/lib/lang_smith.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + DEFAULT_ASSISTANT_NAMESPACE, + TRACE_OPTIONS_SESSION_STORAGE_KEY, +} from '@kbn/elastic-assistant/impl/assistant_context/constants'; +import { Storage } from '@kbn/kibana-utils-plugin/public'; +import type { TraceOptions } from '@kbn/elastic-assistant/impl/assistant/types'; +import type { LangSmithOptions } from '../../../common/api/model/common_attributes'; + +const sessionStorage = new Storage(window.sessionStorage); + +/** + * Retrieves the LangSmith options from the AI Settings. + */ +export const getLangSmithOptions = ( + nameSpace: string = DEFAULT_ASSISTANT_NAMESPACE +): LangSmithOptions | undefined => { + // Get the LangSmith options stored by the AI Settings using the assistant context + // TODO: Encapsulate all AI Settings logic in a generic place. + const sessionStorageTraceOptions: TraceOptions = sessionStorage.get( + `${nameSpace}.${TRACE_OPTIONS_SESSION_STORAGE_KEY}` + ); + + if (!sessionStorageTraceOptions) { + return; + } + return { + projectName: sessionStorageTraceOptions.langSmithProject, + apiKey: sessionStorageTraceOptions.langSmithApiKey, + }; +}; diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration.test.tsx b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration.test.tsx new file mode 100644 index 0000000000000..dca18a90f3a65 --- /dev/null +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration.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 type { PropsWithChildren } from 'react'; +import React from 'react'; +import { MemoryRouter } from 'react-router-dom'; +import { render } from '@testing-library/react'; +import { TestProvider } from '../../mocks/test_provider'; +import { CreateIntegration } from './create_integration'; +import { mockServices } from '../../services/mocks/services'; +import { useRoutesAuthorization } from '../../common/hooks/use_authorization'; +import { useIsAvailable } from '../../common/hooks/use_availability'; + +jest.mock('../../common/hooks/use_authorization'); +jest.mock('../../common/hooks/use_availability'); +const mockUseRoutesAuthorization = useRoutesAuthorization as jest.Mock; +const mockUseIsAvailable = useIsAvailable as jest.Mock; + +jest.mock('./create_integration_landing', () => ({ + CreateIntegrationLanding: jest.fn(() =>
    ), +})); +jest.mock('./create_integration_upload', () => ({ + CreateIntegrationUpload: jest.fn(() =>
    ), +})); +jest.mock('./create_integration_assistant', () => ({ + CreateIntegrationAssistant: jest.fn(() =>
    ), +})); + +const getWrapper = (pathname: string): React.FC> => + function wrapper({ children }) { + return ( + + {children} + + ); + }; + +const getElement = () => ; + +describe('CreateIntegration', () => { + describe('when url is /create', () => { + let wrapper: React.ComponentType; + beforeEach(() => { + wrapper = getWrapper('/create'); + }); + + it('should render the landing page', () => { + const result = render(getElement(), { wrapper }); + expect(result.queryByTestId('landingMock')).toBeInTheDocument(); + }); + + describe('and user is not authorized', () => { + beforeEach(() => { + mockUseRoutesAuthorization.mockReturnValueOnce({ + canUseIntegrationAssistant: false, + canUseIntegrationUpload: false, + }); + }); + + it('should render the landing page', () => { + const result = render(getElement(), { wrapper }); + expect(result.queryByTestId('landingMock')).toBeInTheDocument(); + }); + }); + + describe('and the product is not available', () => { + beforeEach(() => { + mockUseIsAvailable.mockReturnValueOnce(false); + }); + + it('should render the landing page', () => { + const result = render(getElement(), { wrapper }); + expect(result.queryByTestId('landingMock')).toBeInTheDocument(); + }); + }); + }); + + describe('when url is /create/assistant', () => { + let wrapper: React.ComponentType; + + beforeEach(() => { + wrapper = getWrapper('/create/assistant'); + }); + + it('should render the assistant page', () => { + const result = render(getElement(), { wrapper }); + expect(result.queryByTestId('assistantMock')).toBeInTheDocument(); + }); + + describe('and user is not authorized', () => { + beforeEach(() => { + mockUseRoutesAuthorization.mockReturnValueOnce({ + canUseIntegrationAssistant: false, + canUseIntegrationUpload: true, + }); + }); + + it('should render the landing page', () => { + const result = render(getElement(), { wrapper }); + expect(result.queryByTestId('assistantMock')).not.toBeInTheDocument(); + expect(result.queryByTestId('landingMock')).toBeInTheDocument(); + }); + }); + + describe('and the product is not available', () => { + beforeEach(() => { + mockUseIsAvailable.mockReturnValueOnce(false); + }); + + it('should render the landing page', () => { + const result = render(getElement(), { wrapper }); + expect(result.queryByTestId('assistantMock')).not.toBeInTheDocument(); + expect(result.queryByTestId('landingMock')).toBeInTheDocument(); + }); + }); + }); + + describe('when url is /create/upload', () => { + let wrapper: React.ComponentType; + + beforeEach(() => { + wrapper = getWrapper('/create/upload'); + }); + + it('should render the upload page', () => { + const result = render(getElement(), { wrapper }); + expect(result.queryByTestId('uploadMock')).toBeInTheDocument(); + }); + + describe('and user is not authorized', () => { + beforeEach(() => { + mockUseRoutesAuthorization.mockReturnValueOnce({ + canUseIntegrationAssistant: true, + canUseIntegrationUpload: false, + }); + }); + + it('should render the landing page', () => { + const result = render(getElement(), { wrapper }); + expect(result.queryByTestId('uploadMock')).not.toBeInTheDocument(); + expect(result.queryByTestId('landingMock')).toBeInTheDocument(); + }); + }); + + describe('and the product is not available', () => { + beforeEach(() => { + mockUseIsAvailable.mockReturnValueOnce(false); + }); + + it('should render the landing page', () => { + const result = render(getElement(), { wrapper }); + expect(result.queryByTestId('uploadMock')).not.toBeInTheDocument(); + expect(result.queryByTestId('landingMock')).toBeInTheDocument(); + }); + }); + }); + + describe('when url is not exact', () => { + let wrapper: React.ComponentType; + + beforeEach(() => { + wrapper = getWrapper('/create/something_else'); + }); + + it('should render the landing page', () => { + const result = render(getElement(), { wrapper }); + expect(result.queryByTestId('landingMock')).toBeInTheDocument(); + }); + }); +}); diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.test.tsx b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.test.tsx new file mode 100644 index 0000000000000..496f34a943bed --- /dev/null +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.test.tsx @@ -0,0 +1,140 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { TestProvider } from '../../../mocks/test_provider'; +import { CreateIntegrationAssistant } from './create_integration_assistant'; +import type { State } from './state'; + +export const defaultInitialState: State = { + step: 1, + connector: undefined, + integrationSettings: undefined, + isGenerating: false, + result: undefined, +}; +const mockInitialState = jest.fn((): State => defaultInitialState); +jest.mock('./state', () => ({ + ...jest.requireActual('./state'), + get initialState() { + return mockInitialState(); + }, +})); + +const mockConnectorStep = jest.fn(() =>
    ); +const mockIntegrationStep = jest.fn(() =>
    ); +const mockDataStreamStep = jest.fn(() =>
    ); +const mockReviewStep = jest.fn(() =>
    ); +const mockDeployStep = jest.fn(() =>
    ); + +const mockIsConnectorStepReady = jest.fn(); +const mockIsIntegrationStepReady = jest.fn(); +const mockIsDataStreamStepReady = jest.fn(); +const mockIsReviewStepReady = jest.fn(); + +jest.mock('./steps/connector_step', () => ({ + ConnectorStep: () => mockConnectorStep(), + isConnectorStepReady: () => mockIsConnectorStepReady(), +})); +jest.mock('./steps/integration_step', () => ({ + IntegrationStep: () => mockIntegrationStep(), + isIntegrationStepReady: () => mockIsIntegrationStepReady(), +})); +jest.mock('./steps/data_stream_step', () => ({ + DataStreamStep: () => mockDataStreamStep(), + isDataStreamStepReady: () => mockIsDataStreamStepReady(), +})); +jest.mock('./steps/review_step', () => ({ + ReviewStep: () => mockReviewStep(), + isReviewStepReady: () => mockIsReviewStepReady(), +})); +jest.mock('./steps/deploy_step', () => ({ DeployStep: () => mockDeployStep() })); + +const renderIntegrationAssistant = () => + render(, { wrapper: TestProvider }); + +describe('CreateIntegration', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + describe('when step is 1', () => { + beforeEach(() => { + mockInitialState.mockReturnValueOnce({ ...defaultInitialState, step: 1 }); + }); + + it('should render connector', () => { + const result = renderIntegrationAssistant(); + expect(result.queryByTestId('connectorStepMock')).toBeInTheDocument(); + }); + + it('should call isConnectorStepReady', () => { + renderIntegrationAssistant(); + expect(mockIsConnectorStepReady).toHaveBeenCalled(); + }); + }); + + describe('when step is 2', () => { + beforeEach(() => { + mockInitialState.mockReturnValueOnce({ ...defaultInitialState, step: 2 }); + }); + + it('should render integration', () => { + const result = renderIntegrationAssistant(); + expect(result.queryByTestId('integrationStepMock')).toBeInTheDocument(); + }); + + it('should call isIntegrationStepReady', () => { + renderIntegrationAssistant(); + expect(mockIsIntegrationStepReady).toHaveBeenCalled(); + }); + }); + + describe('when step is 3', () => { + beforeEach(() => { + mockInitialState.mockReturnValueOnce({ ...defaultInitialState, step: 3 }); + }); + + it('should render data stream', () => { + const result = renderIntegrationAssistant(); + expect(result.queryByTestId('dataStreamStepMock')).toBeInTheDocument(); + }); + + it('should call isDataStreamStepReady', () => { + renderIntegrationAssistant(); + expect(mockIsDataStreamStepReady).toHaveBeenCalled(); + }); + }); + + describe('when step is 4', () => { + beforeEach(() => { + mockInitialState.mockReturnValueOnce({ ...defaultInitialState, step: 4 }); + }); + + it('should render review', () => { + const result = renderIntegrationAssistant(); + expect(result.queryByTestId('reviewStepMock')).toBeInTheDocument(); + }); + + it('should call isReviewStepReady', () => { + renderIntegrationAssistant(); + expect(mockIsReviewStepReady).toHaveBeenCalled(); + }); + }); + + describe('when step is 5', () => { + beforeEach(() => { + mockInitialState.mockReturnValueOnce({ ...defaultInitialState, step: 5 }); + }); + + it('should render deploy', () => { + const result = renderIntegrationAssistant(); + expect(result.queryByTestId('deployStepMock')).toBeInTheDocument(); + }); + }); +}); diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.tsx b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.tsx index d2aec8dd2a661..adc8a05654551 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.tsx +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useReducer, useMemo, useCallback, useEffect } from 'react'; +import React, { useReducer, useMemo, useEffect } from 'react'; import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { Header } from './header'; import { Footer } from './footer'; @@ -59,8 +59,6 @@ export const CreateIntegrationAssistant = React.memo(() => { return false; }, [state]); - const onGenerate = useCallback(() => actions.setIsGenerating(true), [actions]); - return ( @@ -92,7 +90,6 @@ export const CreateIntegrationAssistant = React.memo(() => {