diff --git a/.buildkite/ftr_security_serverless_configs.yml b/.buildkite/ftr_security_serverless_configs.yml index d6a92fbb5f446..cf1b374e68c60 100644 --- a/.buildkite/ftr_security_serverless_configs.yml +++ b/.buildkite/ftr_security_serverless_configs.yml @@ -65,6 +65,7 @@ enabled: - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/configs/serverless.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/configs/serverless.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/configs/serverless.config.ts + - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/configs/serverless.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/configs/serverless.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/configs/serverless.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/basic_license_essentials_tier/configs/serverless.config.ts diff --git a/.buildkite/ftr_security_stateful_configs.yml b/.buildkite/ftr_security_stateful_configs.yml index 148d78583a613..a72f5287d189b 100644 --- a/.buildkite/ftr_security_stateful_configs.yml +++ b/.buildkite/ftr_security_stateful_configs.yml @@ -47,6 +47,7 @@ enabled: - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/large_prebuilt_rules_package/trial_license_complete_tier/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/update_prebuilt_rules_package/trial_license_complete_tier/configs/ess.config.ts + - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/trial_license_complete_tier/configs/ess.config.ts - x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_delete/basic_license_essentials_tier/configs/ess.config.ts diff --git a/.buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml b/.buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml index 96ef648a352df..3d9363279507f 100644 --- a/.buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml +++ b/.buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml @@ -14,13 +14,13 @@ steps: RETRY_TESTS_ON_FAIL: "true" message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-qa.yaml)" - # TODO: Uncomment this code when the integration is ready. - # - label: ":pipeline::female-detective::seedling: Trigger Security Solution quality gate script" - # trigger: security-serverless-quality-gate # https://buildkite.com/elastic/security-serverless-quality-gate - # build: - # env: - # ENVIRONMENT: ${ENVIRONMENT} - # message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-qa.yaml)" + - label: ":pipeline::female-detective::seedling: Trigger Security Solution quality gate script" + trigger: security-serverless-quality-gate # https://buildkite.com/elastic/security-serverless-quality-gate + soft_fail: true + build: + env: + ENVIRONMENT: ${ENVIRONMENT} + message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-qa.yaml)" - label: ":ship: Fleet serverless smoke tests for ${ENVIRONMENT}" trigger: fleet-smoke-tests # https://buildkite.com/elastic/fleet-smoke-tests diff --git a/.buildkite/scripts/steps/capture_oas_snapshot.sh b/.buildkite/scripts/steps/capture_oas_snapshot.sh index fadd7276b47cc..2685cd4cd8e7f 100755 --- a/.buildkite/scripts/steps/capture_oas_snapshot.sh +++ b/.buildkite/scripts/steps/capture_oas_snapshot.sh @@ -5,7 +5,7 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Capture OAS snapshot -cmd="node scripts/capture_oas_snapshot --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules" +cmd="node scripts/capture_oas_snapshot --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions" if is_pr && ! is_auto_commit_disabled; then cmd="$cmd --update" fi diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c6beae627cb53..cbffef0027017 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -629,6 +629,7 @@ test/common/plugins/newsfeed @elastic/kibana-core src/plugins/no_data_page @elastic/appex-sharedux x-pack/plugins/notifications @elastic/appex-sharedux packages/kbn-object-versioning @elastic/appex-sharedux +packages/kbn-object-versioning-utils @elastic/appex-sharedux x-pack/plugins/observability_solution/observability_ai_assistant_app @elastic/obs-ai-assistant x-pack/plugins/observability_solution/observability_ai_assistant_management @elastic/obs-ai-assistant x-pack/plugins/observability_solution/observability_ai_assistant @elastic/obs-ai-assistant diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 051cdc35b6507..c9e0b02290564 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -32,14 +32,13 @@ jobs: languages: ${{ matrix.language }} config-file: ./.github/codeql/codeql-config.yml - # TODO: Possibly required to follow all call paths, however, when enabled, the step below runs out of memory. - # Possible workarounds: Apply for access to the GitHub beta where we can use beefier machines, or run it ourselves on Buildkite - # - name: yarn kbn bootstrap - # run: | - # mkdir ~/.npm-global - # npm config set prefix '~/.npm-global' - # export PATH=~/.npm-global/bin:$PATH - # yarn kbn bootstrap --no-validate --no-vscode + - name: setup node + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + - name: yarn kbn bootstrap + run: | + yarn kbn bootstrap --no-validate --no-vscode - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@883d8588e56d1753a8a58c1c86e88976f0c23449 # v3.26.3 diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index 4457571ce94f3..422fb65093bb1 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-08-28 +date: 2024-08-30 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 ea7405e63a9a8..a9ada1c2c3abd 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-08-28 +date: 2024-08-30 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 9566f3ab11147..715ffde6def5b 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-08-28 +date: 2024-08-30 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 f21d3a66c418b..bbc16109e2365 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-08-28 +date: 2024-08-30 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 54e0b21aa1d43..ffc9fcb23eb34 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] --- import alertingObj from './alerting.devdocs.json'; diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index c6e978f6ca917..30c434c00d0c4 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-08-28 +date: 2024-08-30 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 1bd8d8fdae817..0a6fbbd82d296 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apmDataAccess'] --- import apmDataAccessObj from './apm_data_access.devdocs.json'; diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index 9ff4002466854..9f0571b0de0ad 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-08-28 +date: 2024-08-30 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 259b5cae72be5..c77c8442edc60 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-08-28 +date: 2024-08-30 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 7ca49c62b6acd..dbbe9d0ebda05 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-08-28 +date: 2024-08-30 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 18286a63686f2..21de186b08a02 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] --- import casesObj from './cases.devdocs.json'; diff --git a/api_docs/charts.devdocs.json b/api_docs/charts.devdocs.json index 352a691873da8..ad5f7038d72fe 100644 --- a/api_docs/charts.devdocs.json +++ b/api_docs/charts.devdocs.json @@ -609,7 +609,8 @@ "Chart", ">, syncOptions: ", "ActiveCursorSyncOption", - ") => (cursor: any) => void" + ") => ", + "PointerUpdateListener" ], "path": "src/plugins/charts/public/services/active_cursor/use_active_cursor.ts", "deprecated": false, diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index ae187c3a74ef8..4b5985f0be063 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-08-28 +date: 2024-08-30 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 05f55d21091cf..928117f5d1b70 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-08-28 +date: 2024-08-30 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 270070464564a..21e7b6ef41ac4 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudDataMigration'] --- import cloudDataMigrationObj from './cloud_data_migration.devdocs.json'; diff --git a/api_docs/cloud_defend.mdx b/api_docs/cloud_defend.mdx index 4d3da3b9a90c9..a3ebc5796bc97 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-08-28 +date: 2024-08-30 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 224a4e0008510..998bb9817ad86 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-08-28 +date: 2024-08-30 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 28e31a74c3e80..3a2a51bc384a4 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-08-28 +date: 2024-08-30 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 1f7f8b8756a32..5c2445f52b091 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-08-28 +date: 2024-08-30 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 ba1c2e6142eca..9dab2917da4de 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'contentManagement'] --- import contentManagementObj from './content_management.devdocs.json'; diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index 7ba9a7400267c..0c9cd38c8f8e1 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-08-28 +date: 2024-08-30 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 b652965b61903..c7c36bdc8960d 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-08-28 +date: 2024-08-30 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 3a5a539dc0807..805e3041563a0 100644 --- a/api_docs/dashboard.devdocs.json +++ b/api_docs/dashboard.devdocs.json @@ -1721,17 +1721,17 @@ "(id: string, references: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[]) => ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[]" @@ -1765,9 +1765,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[]" @@ -2356,9 +2356,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[] | undefined" diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index acd09ee726292..50068f616b096 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-08-28 +date: 2024-08-30 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 d6d058244748f..ae9fdcaf8467e 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-08-28 +date: 2024-08-30 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 2ee3f08218275..21721d1c3ffc2 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] --- import dataObj from './data.devdocs.json'; diff --git a/api_docs/data_quality.mdx b/api_docs/data_quality.mdx index fcfcd3e76918d..af1a9c639c6ea 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataQuality'] --- import dataQualityObj from './data_quality.devdocs.json'; diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index 5e736856213af..088d12846b090 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-08-28 +date: 2024-08-30 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 45ac273fd7f20..9ad3d404848f0 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-08-28 +date: 2024-08-30 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 9ac845ac5d584..83e30d44cf587 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-08-28 +date: 2024-08-30 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 85796c1937831..91a67ff1c7412 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-08-28 +date: 2024-08-30 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 1c9507f27d38a..6535a8c78c1c1 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewManagement'] --- import dataViewManagementObj from './data_view_management.devdocs.json'; diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index aecc205649f31..9dbbbdc033cd6 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-08-28 +date: 2024-08-30 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 612689cded592..799bcfc7c2581 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] --- import dataVisualizerObj from './data_visualizer.devdocs.json'; diff --git a/api_docs/dataset_quality.mdx b/api_docs/dataset_quality.mdx index f4c0066b664b0..3db7668c2750d 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-08-28 +date: 2024-08-30 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 b8a40cca3f85e..351c037f364fc 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 1fb9c771723b7..349a2bb43da1d 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -978,7 +978,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [register_embeddable_widget.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/investigate_app/public/widgets/embeddable_widget/register_embeddable_widget.tsx#:~:text=getEmbeddableFactory) | - | +| | [register_embeddable_item.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx#:~:text=getEmbeddableFactory) | - | @@ -1374,8 +1374,8 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch) | - | | | [api.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/hooks/eql/api.ts#:~:text=options) | - | | | [create_sourcerer_data_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts#:~:text=title), [create_sourcerer_data_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts#:~:text=title), [create_sourcerer_data_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts#:~:text=title), [validators.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/eql_query_bar/validators.ts#:~:text=title) | - | -| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [endpoint_metadata_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts#:~:text=policy_id), [endpoint_package_policies.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [index.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts#:~:text=policy_id) | - | -| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [endpoint_metadata_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts#:~:text=policy_id), [endpoint_package_policies.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [index.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts#:~:text=policy_id) | - | +| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [endpoint_metadata_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts#:~:text=policy_id), [endpoint_package_policies.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [index.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts#:~:text=policy_id) | - | +| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [endpoint_metadata_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts#:~:text=policy_id), [endpoint_package_policies.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [policy_settings_middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts#:~:text=policy_id), [index.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts#:~:text=policy_id) | - | | | [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 | @@ -1384,7 +1384,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/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) | - | | | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=BeatFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=BeatFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=BeatFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=BeatFields) | - | -| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/timeline/cells/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/timeline/cells/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/header_actions/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/header_actions/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields)+ 76 more | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/timeline/cells/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/timeline/cells/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/header_actions/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/header_actions/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields)+ 74 more | - | | | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyRequest), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyRequest) | - | | | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyResponse), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyResponse) | - | | | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/hooks/types.ts#:~:text=SimpleSavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/hooks/types.ts#:~:text=SimpleSavedObject) | - | diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index 2f3cb0803d93d..967a67086c8c0 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index 9e90bb566c549..3b8f2c3c46bba 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-08-28 +date: 2024-08-30 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 e3c96334b92a4..2c5911e61bd01 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-08-28 +date: 2024-08-30 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 1ba77eba28942..8abd4f4c30bcf 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-08-28 +date: 2024-08-30 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 1989b12548930..1db3c5486e634 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-08-28 +date: 2024-08-30 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 395e5ee21f8a5..3383ff89bd303 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-08-28 +date: 2024-08-30 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 6ce470f6f79ef..3881b9bd9765d 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-08-28 +date: 2024-08-30 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 a8f0320e4e8a1..c0aa77ca3f341 100644 --- a/api_docs/embeddable.devdocs.json +++ b/api_docs/embeddable.devdocs.json @@ -14281,9 +14281,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "" @@ -14874,7 +14874,7 @@ }, { "plugin": "investigateApp", - "path": "x-pack/plugins/observability_solution/investigate_app/public/widgets/embeddable_widget/register_embeddable_widget.tsx" + "path": "x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx" }, { "plugin": "dashboard", diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 4ec24d611d726..334941085f6b8 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-08-28 +date: 2024-08-30 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 3564fff0ccb97..2799a1124edaf 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-08-28 +date: 2024-08-30 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 5c7e0de563200..b4a78a898ddea 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-08-28 +date: 2024-08-30 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 731227f4f53ff..6e0e5e64df722 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] --- import enterpriseSearchObj from './enterprise_search.devdocs.json'; diff --git a/api_docs/entities_data_access.mdx b/api_docs/entities_data_access.mdx index 13f3446eb5d65..73c6e08220887 100644 --- a/api_docs/entities_data_access.mdx +++ b/api_docs/entities_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/entitiesDataAccess title: "entitiesDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the entitiesDataAccess plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'entitiesDataAccess'] --- import entitiesDataAccessObj from './entities_data_access.devdocs.json'; diff --git a/api_docs/entity_manager.mdx b/api_docs/entity_manager.mdx index ae99029ee8f3a..7cc4b184be5b5 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'entityManager'] --- import entityManagerObj from './entity_manager.devdocs.json'; diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index ba15a2cab261e..611209af7f309 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] --- import esUiSharedObj from './es_ui_shared.devdocs.json'; diff --git a/api_docs/esql.mdx b/api_docs/esql.mdx index 31cec7faef2ce..5f0ccafad721e 100644 --- a/api_docs/esql.mdx +++ b/api_docs/esql.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esql title: "esql" image: https://source.unsplash.com/400x175/?github description: API docs for the esql plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esql'] --- import esqlObj from './esql.devdocs.json'; diff --git a/api_docs/esql_data_grid.mdx b/api_docs/esql_data_grid.mdx index 5cf8231c0a120..977048ade5064 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esqlDataGrid'] --- import esqlDataGridObj from './esql_data_grid.devdocs.json'; diff --git a/api_docs/event_annotation.devdocs.json b/api_docs/event_annotation.devdocs.json index 008a69c12c41d..b82e76cd7f98c 100644 --- a/api_docs/event_annotation.devdocs.json +++ b/api_docs/event_annotation.devdocs.json @@ -584,9 +584,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "<", @@ -1102,9 +1102,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.ContentManagementCrudTypes", + "section": "def-server.ContentManagementCrudTypes", "text": "ContentManagementCrudTypes" }, "<\"event-annotation-group\", ", diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index f13c7fe7233e8..41c61f5b926a7 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-08-28 +date: 2024-08-30 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 ad6417689a554..8f6cb2aff88dc 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-08-28 +date: 2024-08-30 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 2982cc5ef9020..20ff4c85af7a9 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-08-28 +date: 2024-08-30 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 6ca103e4be8d1..281ab958e7516 100644 --- a/api_docs/exploratory_view.mdx +++ b/api_docs/exploratory_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/exploratoryView title: "exploratoryView" image: https://source.unsplash.com/400x175/?github description: API docs for the exploratoryView plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'exploratoryView'] --- import exploratoryViewObj from './exploratory_view.devdocs.json'; diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index fc80d871fbfe1..3bf91b93a869c 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-08-28 +date: 2024-08-30 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 5103f749123f8..58aebc7e8c734 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-08-28 +date: 2024-08-30 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 00654dcc9df1f..99b3c6b301de6 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-08-28 +date: 2024-08-30 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 5e9d0afdec154..82b59ce0763cb 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-08-28 +date: 2024-08-30 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 672d7962a76d4..16932181eac00 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-08-28 +date: 2024-08-30 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 63abe0e9ba14f..468454934df5c 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetric'] --- import expressionMetricObj from './expression_metric.devdocs.json'; diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index bf3f90ffb18d1..94f48d9c6e783 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetricVis'] --- import expressionMetricVisObj from './expression_metric_vis.devdocs.json'; diff --git a/api_docs/expression_partition_vis.mdx b/api_docs/expression_partition_vis.mdx index 881f9f476ae49..f1cfa78dcaf4b 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-08-28 +date: 2024-08-30 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 70b9d0c108d47..c483db7b477c3 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-08-28 +date: 2024-08-30 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 38cfb6af09f4f..0981e17927301 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRevealImage'] --- import expressionRevealImageObj from './expression_reveal_image.devdocs.json'; diff --git a/api_docs/expression_shape.mdx b/api_docs/expression_shape.mdx index 95cb1a083521b..72cbaee8feec6 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-08-28 +date: 2024-08-30 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 4dea8fcc24037..57c435b169ee9 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionTagcloud'] --- import expressionTagcloudObj from './expression_tagcloud.devdocs.json'; diff --git a/api_docs/expression_x_y.mdx b/api_docs/expression_x_y.mdx index 72191fb3ab0df..2df6a0ecf94a2 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-08-28 +date: 2024-08-30 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 447dcd0dcb2d6..c4c907b2aa795 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-08-28 +date: 2024-08-30 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 5d7328b0ffc4e..7b4c655798dbf 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-08-28 +date: 2024-08-30 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 d8ddce35586f9..39b084fed1ce5 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-08-28 +date: 2024-08-30 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 3ccbe68bbd5f3..58d230e693f96 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-08-28 +date: 2024-08-30 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 5094afa1c2bec..1aefa9a78b7a9 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-08-28 +date: 2024-08-30 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 5be76becea477..2ca2ec39e34fb 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-08-28 +date: 2024-08-30 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 ee04b19fd8c0d..8b4f41b1a4e72 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-08-28 +date: 2024-08-30 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 6fdb547691329..9583242b66d73 100644 --- a/api_docs/fleet.devdocs.json +++ b/api_docs/fleet.devdocs.json @@ -1491,14 +1491,14 @@ { "parentPluginId": "fleet", "id": "def-public.NewPackagePolicy.policy_id", - "type": "string", + "type": "CompoundType", "tags": [ "deprecated" ], "label": "policy_id", "description": [], "signature": [ - "string | undefined" + "string | null | undefined" ], "path": "x-pack/plugins/fleet/common/types/models/package_policy.ts", "deprecated": true, @@ -1552,6 +1552,10 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx" + }, { "plugin": "cloudDefend", "path": "x-pack/plugins/cloud_defend/public/test/mocks.ts" @@ -2922,7 +2926,7 @@ "The updated Integration Policy to be merged back and included in the API call" ], "signature": [ - "{ id?: string | number | undefined; name?: string | undefined; description?: string | undefined; namespace?: string | undefined; enabled?: boolean | undefined; is_managed?: boolean | undefined; policy_id?: string | undefined; policy_ids?: string[] | undefined; output_id?: string | null | undefined; package?: ", + "{ id?: string | number | undefined; name?: string | undefined; description?: string | undefined; namespace?: string | undefined; enabled?: boolean | undefined; is_managed?: boolean | undefined; policy_id?: string | null | undefined; policy_ids?: string[] | undefined; output_id?: string | null | undefined; package?: ", { "pluginId": "fleet", "scope": "common", @@ -6558,7 +6562,7 @@ "section": "def-server.SavedObjectsClientContract", "text": "SavedObjectsClientContract" }, - ", { perPage, kuery }?: ", + ", { perPage, kuery, spaceId }?: ", "FetchAllAgentPolicyIdsOptions", ") => Promise>" ], @@ -6590,12 +6594,20 @@ { "parentPluginId": "fleet", "id": "def-server.AgentPolicyServiceInterface.fetchAllAgentPolicyIds.$2", - "type": "Object", + "type": "CompoundType", "tags": [], "label": "__1", "description": [], "signature": [ - "{ perPage?: number | undefined; kuery?: string | undefined; }" + "Pick<", + { + "pluginId": "fleet", + "scope": "common", + "docId": "kibFleetPluginApi", + "section": "def-common.ListWithKuery", + "text": "ListWithKuery" + }, + ", \"perPage\" | \"kuery\"> & { spaceId?: string | undefined; }" ], "path": "x-pack/plugins/fleet/server/services/agent_policy.ts", "deprecated": false, @@ -16351,7 +16363,7 @@ "section": "def-common.PackagePolicyPackage", "text": "PackagePolicyPackage" }, - " | undefined; policy_id?: string | undefined; policy_ids?: string[] | undefined; output_id?: string | undefined; statusCode?: number | undefined; body?: { message: string; } | undefined; }>, soClient: ", + " | undefined; policy_id?: string | null | undefined; policy_ids?: string[] | undefined; output_id?: string | undefined; statusCode?: number | undefined; body?: { message: string; } | undefined; }>, soClient: ", { "pluginId": "@kbn/core-saved-objects-api-server", "scope": "server", @@ -16407,7 +16419,7 @@ "section": "def-common.PackagePolicyPackage", "text": "PackagePolicyPackage" }, - " | undefined; policy_id?: string | undefined; policy_ids?: string[] | undefined; output_id?: string | undefined; statusCode?: number | undefined; body?: { message: string; } | undefined; }>" + " | undefined; policy_id?: string | null | undefined; policy_ids?: string[] | undefined; output_id?: string | undefined; statusCode?: number | undefined; body?: { message: string; } | undefined; }>" ], "path": "x-pack/plugins/fleet/server/types/extensions.ts", "deprecated": false, @@ -23839,14 +23851,14 @@ { "parentPluginId": "fleet", "id": "def-common.NewPackagePolicy.policy_id", - "type": "string", + "type": "CompoundType", "tags": [ "deprecated" ], "label": "policy_id", "description": [], "signature": [ - "string | undefined" + "string | null | undefined" ], "path": "x-pack/plugins/fleet/common/types/models/package_policy.ts", "deprecated": true, @@ -23900,6 +23912,10 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx" + }, { "plugin": "cloudDefend", "path": "x-pack/plugins/cloud_defend/public/test/mocks.ts" @@ -28017,7 +28033,7 @@ "section": "def-common.PackagePolicyPackage", "text": "PackagePolicyPackage" }, - " | undefined; policy_id?: string | undefined; policy_ids?: string[] | undefined; output_id?: string | undefined; statusCode?: number | undefined; body?: { message: string; } | undefined; }[]" + " | undefined; policy_id?: string | null | undefined; policy_ids?: string[] | undefined; output_id?: string | undefined; statusCode?: number | undefined; body?: { message: string; } | undefined; }[]" ], "path": "x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts", "deprecated": false, diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 8f42cb55c77bd..bab4afb05ff11 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] --- import fleetObj from './fleet.devdocs.json'; diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index ccf972157447e..68e7b9c777686 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-08-28 +date: 2024-08-30 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 cae2196329f56..6e97c705bd888 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-08-28 +date: 2024-08-30 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 b80e24b3ee0a7..f79bd5c0a74b4 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-08-28 +date: 2024-08-30 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 75338dcd8418d..34e27f9ea76b6 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-08-28 +date: 2024-08-30 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 208a9d63bb7ce..51f625e3448cc 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-08-28 +date: 2024-08-30 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 5d2ca61e790b5..e06e170a143c8 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] --- import indexManagementObj from './index_management.devdocs.json'; diff --git a/api_docs/inference.mdx b/api_docs/inference.mdx index f5b5593da4217..9fb0fc6ac1582 100644 --- a/api_docs/inference.mdx +++ b/api_docs/inference.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/inference title: "inference" image: https://source.unsplash.com/400x175/?github description: API docs for the inference plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inference'] --- import inferenceObj from './inference.devdocs.json'; diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index 043bad6e5e526..fa860fc8610b1 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-08-28 +date: 2024-08-30 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 b53c897a962e6..50ae45df94cfe 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-08-28 +date: 2024-08-30 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 098f230aac610..c5aca8e13fbd1 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] --- import inspectorObj from './inspector.devdocs.json'; diff --git a/api_docs/integration_assistant.mdx b/api_docs/integration_assistant.mdx index aa2b5d0c87c5f..caaf23d22f258 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-08-28 +date: 2024-08-30 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 5353dba14cdf3..9303ecb641469 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] --- import interactiveSetupObj from './interactive_setup.devdocs.json'; diff --git a/api_docs/investigate.devdocs.json b/api_docs/investigate.devdocs.json index 8febc4c6ac5f4..6027d5241e210 100644 --- a/api_docs/investigate.devdocs.json +++ b/api_docs/investigate.devdocs.json @@ -3,109 +3,6 @@ "client": { "classes": [], "functions": [ - { - "parentPluginId": "investigate", - "id": "def-public.createEsqlWidget", - "type": "Function", - "tags": [], - "label": "createEsqlWidget", - "description": [], - "signature": [ - ", \"type\">>(widgetCreate: T) => Pick<", - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidgetCreate", - "text": "InvestigateWidgetCreate" - }, - "<", - { - "pluginId": "investigate", - "scope": "public", - "docId": "kibInvestigatePluginApi", - "section": "def-public.EsqlWidgetParameters", - "text": "EsqlWidgetParameters" - }, - ">, \"type\"> & Omit & { parameters: T[\"parameters\"] & ", - "_DeepPartialObject", - "<", - "GlobalWidgetParameters", - ">; }" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/esql_widget/create_esql_widget.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.createEsqlWidget.$1", - "type": "Uncategorized", - "tags": [], - "label": "widgetCreate", - "description": [], - "signature": [ - "T" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/create_widget.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.createWidgetFactory", - "type": "Function", - "tags": [], - "label": "createWidgetFactory", - "description": [], - "signature": [ - "(type: string) => ", - "WidgetFactory", - "" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/create_widget.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.createWidgetFactory.$1", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/create_widget.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "investigate", "id": "def-public.getEsFilterFromGlobalParameters", @@ -393,45 +290,6 @@ } ], "interfaces": [ - { - "parentPluginId": "investigate", - "id": "def-public.EsqlWidgetParameters", - "type": "Interface", - "tags": [], - "label": "EsqlWidgetParameters", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/public/esql_widget/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.EsqlWidgetParameters.esql", - "type": "string", - "tags": [], - "label": "esql", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/public/esql_widget/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.EsqlWidgetParameters.suggestion", - "type": "Object", - "tags": [], - "label": "suggestion", - "description": [], - "signature": [ - "Suggestion | undefined" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/esql_widget/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, { "parentPluginId": "investigate", "id": "def-public.GlobalWidgetParameters", @@ -459,316 +317,10 @@ } ], "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget", - "type": "Interface", - "tags": [], - "label": "InvestigateWidget", - "description": [], - "signature": [ - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.createdAt", - "type": "number", - "tags": [], - "label": "createdAt", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.createdBy", - "type": "string", - "tags": [], - "label": "createdBy", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.parameters", - "type": "CompoundType", - "tags": [], - "label": "parameters", - "description": [], - "signature": [ - "GlobalWidgetParameters", - " & TParameters" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidget.data", - "type": "Uncategorized", - "tags": [], - "label": "data", - "description": [], - "signature": [ - "TData" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.Investigation", - "type": "Interface", - "tags": [], - "label": "Investigation", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.Investigation.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.Investigation.createdAt", - "type": "number", - "tags": [], - "label": "createdAt", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.Investigation.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.Investigation.items", - "type": "Array", - "tags": [], - "label": "items", - "description": [], - "signature": [ - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "<{}, {}>[]" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.Investigation.notes", - "type": "Array", - "tags": [], - "label": "notes", - "description": [], - "signature": [ - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigationNote", - "text": "InvestigationNote" - }, - "[]" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.Investigation.parameters", - "type": "Object", - "tags": [], - "label": "parameters", - "description": [], - "signature": [ - "GlobalWidgetParameters" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false } ], "enums": [], - "misc": [ - { - "parentPluginId": "investigate", - "id": "def-public.ESQL_WIDGET_NAME", - "type": "string", - "tags": [], - "label": "ESQL_WIDGET_NAME", - "description": [], - "signature": [ - "\"esql\"" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/esql_widget/constants.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigateWidgetCreate", - "type": "Type", - "tags": [], - "label": "InvestigateWidgetCreate", - "description": [], - "signature": [ - "Pick<", - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "<{}, {}>, \"type\" | \"title\"> & { parameters: ", - "_DeepPartialObject", - "<", - "GlobalWidgetParameters", - "> & TParameters; }" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.OnWidgetAdd", - "type": "Type", - "tags": [], - "label": "OnWidgetAdd", - "description": [], - "signature": [ - "(create: ", - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidgetCreate", - "text": "InvestigateWidgetCreate" - }, - "<{}>) => Promise" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.OnWidgetAdd.$1", - "type": "CompoundType", - "tags": [], - "label": "create", - "description": [], - "signature": [ - "Pick<", - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "<{}, {}>, \"type\" | \"title\"> & { parameters: ", - "_DeepPartialObject", - "<", - "GlobalWidgetParameters", - ">; }" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - } - ], + "misc": [], "objects": [], "setup": { "parentPluginId": "investigate", @@ -783,15 +335,19 @@ "children": [ { "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicSetup.register", + "id": "def-public.InvestigatePublicSetup.registerItemDefinition", "type": "Function", "tags": [], - "label": "register", + "label": "registerItemDefinition", "description": [], "signature": [ - "(callback: (registerWidget: ", - "RegisterWidget", - ") => Promise) => void" + "(itemDefinition: ", + "ItemDefinition", + ") => void" ], "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", "deprecated": false, @@ -799,15 +355,14 @@ "children": [ { "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicSetup.register.$1", - "type": "Function", + "id": "def-public.InvestigatePublicSetup.registerItemDefinition.$1", + "type": "Object", "tags": [], - "label": "callback", + "label": "itemDefinition", "description": [], "signature": [ - "(registerWidget: ", - "RegisterWidget", - ") => Promise" + "ItemDefinition", + "" ], "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", "deprecated": false, @@ -834,15 +389,15 @@ "children": [ { "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicStart.getWidgetDefinitions", + "id": "def-public.InvestigatePublicStart.getItemDefinitions", "type": "Function", "tags": [], - "label": "getWidgetDefinitions", + "label": "getItemDefinitions", "description": [], "signature": [ "() => ", - "WidgetDefinition", - "[]" + "ItemDefinition", + "<{}, {}>[]" ], "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", "deprecated": false, @@ -852,22 +407,15 @@ }, { "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicStart.useInvestigation", + "id": "def-public.InvestigatePublicStart.getItemDefinitionByType", "type": "Function", "tags": [], - "label": "useInvestigation", + "label": "getItemDefinitionByType", "description": [], "signature": [ - "({}: { user: ", - { - "pluginId": "@kbn/core-security-common", - "scope": "common", - "docId": "kibKbnCoreSecurityCommonPluginApi", - "section": "def-common.AuthenticatedUser", - "text": "AuthenticatedUser" - }, - "; investigationData?: { id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: \"esql\"; params: { esql: string; suggestion: any; }; })[]; } | undefined; }) => ", - "UseInvestigationApi" + "(type: string) => ", + "ItemDefinition", + "<{}, {}> | undefined" ], "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", "deprecated": false, @@ -875,50 +423,18 @@ "children": [ { "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicStart.useInvestigation.$1", - "type": "Object", + "id": "def-public.InvestigatePublicStart.getItemDefinitionByType.$1", + "type": "string", "tags": [], - "label": "{}", + "label": "type", "description": [], + "signature": [ + "string" + ], "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", "deprecated": false, "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicStart.useInvestigation.$1.user", - "type": "Object", - "tags": [], - "label": "user", - "description": [], - "signature": [ - { - "pluginId": "@kbn/core-security-common", - "scope": "common", - "docId": "kibKbnCoreSecurityCommonPluginApi", - "section": "def-common.AuthenticatedUser", - "text": "AuthenticatedUser" - } - ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-public.InvestigatePublicStart.useInvestigation.$1.investigationData", - "type": "Object", - "tags": [], - "label": "investigationData", - "description": [], - "signature": [ - "{ id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: \"esql\"; params: { esql: string; suggestion: any; }; })[]; } | undefined" - ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", - "deprecated": false, - "trackAdoption": false - } - ] + "isRequired": true } ], "returnComment": [] @@ -1208,307 +724,9 @@ "initialIsOpen": false } ], - "interfaces": [ - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget", - "type": "Interface", - "tags": [], - "label": "InvestigateWidget", - "description": [], - "signature": [ - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.createdAt", - "type": "number", - "tags": [], - "label": "createdAt", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.createdBy", - "type": "string", - "tags": [], - "label": "createdBy", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.parameters", - "type": "CompoundType", - "tags": [], - "label": "parameters", - "description": [], - "signature": [ - "GlobalWidgetParameters", - " & TParameters" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidget.data", - "type": "Uncategorized", - "tags": [], - "label": "data", - "description": [], - "signature": [ - "TData" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.Investigation", - "type": "Interface", - "tags": [], - "label": "Investigation", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-common.Investigation.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.Investigation.createdAt", - "type": "number", - "tags": [], - "label": "createdAt", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.Investigation.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.Investigation.items", - "type": "Array", - "tags": [], - "label": "items", - "description": [], - "signature": [ - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "<{}, {}>[]" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.Investigation.notes", - "type": "Array", - "tags": [], - "label": "notes", - "description": [], - "signature": [ - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigationNote", - "text": "InvestigationNote" - }, - "[]" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.Investigation.parameters", - "type": "Object", - "tags": [], - "label": "parameters", - "description": [], - "signature": [ - "GlobalWidgetParameters" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigationNote", - "type": "Interface", - "tags": [], - "label": "InvestigationNote", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "investigate", - "id": "def-common.InvestigationNote.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigationNote.createdAt", - "type": "number", - "tags": [], - "label": "createdAt", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigationNote.createdBy", - "type": "string", - "tags": [], - "label": "createdBy", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "investigate", - "id": "def-common.InvestigationNote.content", - "type": "string", - "tags": [], - "label": "content", - "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - } - ], + "interfaces": [], "enums": [], - "misc": [ - { - "parentPluginId": "investigate", - "id": "def-common.InvestigateWidgetCreate", - "type": "Type", - "tags": [], - "label": "InvestigateWidgetCreate", - "description": [], - "signature": [ - "Pick<", - { - "pluginId": "investigate", - "scope": "common", - "docId": "kibInvestigatePluginApi", - "section": "def-common.InvestigateWidget", - "text": "InvestigateWidget" - }, - "<{}, {}>, \"type\" | \"title\"> & { parameters: ", - "_DeepPartialObject", - "<", - "GlobalWidgetParameters", - "> & TParameters; }" - ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - } - ], + "misc": [], "objects": [] } } \ No newline at end of file diff --git a/api_docs/investigate.mdx b/api_docs/investigate.mdx index 5f62ee48d6443..9c9bea6f8f5e0 100644 --- a/api_docs/investigate.mdx +++ b/api_docs/investigate.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/investigate title: "investigate" image: https://source.unsplash.com/400x175/?github description: API docs for the investigate plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'investigate'] --- import investigateObj from './investigate.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/ | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 92 | 0 | 92 | 5 | +| 43 | 0 | 43 | 4 | ## Client @@ -37,9 +37,6 @@ Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/ ### Interfaces -### Consts, variables and types - - ## Server ### Setup @@ -53,9 +50,3 @@ Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/ ### Functions -### Interfaces - - -### Consts, variables and types - - diff --git a/api_docs/investigate_app.devdocs.json b/api_docs/investigate_app.devdocs.json index cb7fd681facbe..e4ef66657279e 100644 --- a/api_docs/investigate_app.devdocs.json +++ b/api_docs/investigate_app.devdocs.json @@ -58,7 +58,7 @@ "StringC", "; }>; }> | undefined; handler: ({}: ", "InvestigateAppRouteHandlerResources", - " & { params: { path: { investigationId: string; }; }; }) => Promise<({ id: string; createdAt: number; createdBy: string; } & { title: string; type: \"esql\"; params: { esql: string; suggestion: any; }; })[]>; } & ", + " & { params: { path: { investigationId: string; }; }; }) => Promise<({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]>; } & ", "InvestigateAppRouteCreateOptions", "; \"DELETE /api/observability/investigations/{investigationId}/items/{itemId} 2023-10-31\": { endpoint: \"DELETE /api/observability/investigations/{investigationId}/items/{itemId} 2023-10-31\"; params?: ", "TypeC", @@ -83,54 +83,56 @@ "<{ title: ", "StringC", "; type: ", - "LiteralC", - "<\"esql\">; params: ", - "TypeC", - "<{ esql: ", "StringC", - "; suggestion: ", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", "AnyC", - "; }>; }>; }> | undefined; handler: ({}: ", + ">; }>; }> | undefined; handler: ({}: ", "InvestigateAppRouteHandlerResources", - " & { params: { path: { investigationId: string; }; body: { title: string; type: \"esql\"; params: { esql: string; suggestion: any; }; }; }; }) => Promise<{ id: string; createdAt: number; createdBy: string; } & { title: string; type: \"esql\"; params: { esql: string; suggestion: any; }; }>; } & ", + " & { params: { path: { investigationId: string; }; body: { title: string; type: string; params: { [x: string]: any; }; }; }; }) => Promise<{ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; }>; } & ", "InvestigateAppRouteCreateOptions", - "; \"DELETE /api/observability/investigations/{investigationId}/notes/{noteId} 2023-10-31\": { endpoint: \"DELETE /api/observability/investigations/{investigationId}/notes/{noteId} 2023-10-31\"; params?: ", + "; \"DELETE /api/observability/investigations/{investigationId} 2023-10-31\": { endpoint: \"DELETE /api/observability/investigations/{investigationId} 2023-10-31\"; params?: ", "TypeC", "<{ path: ", "TypeC", "<{ investigationId: ", "StringC", - "; noteId: ", - "StringC", "; }>; }> | undefined; handler: ({}: ", "InvestigateAppRouteHandlerResources", - " & { params: { path: { investigationId: string; noteId: string; }; }; }) => Promise; } & ", + " & { params: { path: { investigationId: string; }; }; }) => Promise; } & ", "InvestigateAppRouteCreateOptions", - "; \"GET /api/observability/investigations/{investigationId}/notes 2023-10-31\": { endpoint: \"GET /api/observability/investigations/{investigationId}/notes 2023-10-31\"; params?: ", + "; \"DELETE /api/observability/investigations/{investigationId}/notes/{noteId} 2023-10-31\": { endpoint: \"DELETE /api/observability/investigations/{investigationId}/notes/{noteId} 2023-10-31\"; params?: ", "TypeC", "<{ path: ", "TypeC", "<{ investigationId: ", "StringC", + "; noteId: ", + "StringC", "; }>; }> | undefined; handler: ({}: ", "InvestigateAppRouteHandlerResources", - " & { params: { path: { investigationId: string; }; }; }) => Promise<{ id: string; content: string; createdAt: number; createdBy: string; }[]>; } & ", + " & { params: { path: { investigationId: string; noteId: string; }; }; }) => Promise; } & ", "InvestigateAppRouteCreateOptions", - "; \"POST /api/observability/investigations/{investigationId}/notes 2023-10-31\": { endpoint: \"POST /api/observability/investigations/{investigationId}/notes 2023-10-31\"; params?: ", + "; \"PUT /api/observability/investigations/{investigationId}/notes/{noteId} 2023-10-31\": { endpoint: \"PUT /api/observability/investigations/{investigationId}/notes/{noteId} 2023-10-31\"; params?: ", "TypeC", "<{ path: ", "TypeC", "<{ investigationId: ", "StringC", + "; noteId: ", + "StringC", "; }>; body: ", "TypeC", "<{ content: ", "StringC", "; }>; }> | undefined; handler: ({}: ", "InvestigateAppRouteHandlerResources", - " & { params: { path: { investigationId: string; }; body: { content: string; }; }; }) => Promise<{ id: string; content: string; createdAt: number; createdBy: string; }>; } & ", + " & { params: { path: { investigationId: string; noteId: string; }; body: { content: string; }; }; }) => Promise; } & ", "InvestigateAppRouteCreateOptions", - "; \"DELETE /api/observability/investigations/{investigationId} 2023-10-31\": { endpoint: \"DELETE /api/observability/investigations/{investigationId} 2023-10-31\"; params?: ", + "; \"GET /api/observability/investigations/{investigationId}/notes 2023-10-31\": { endpoint: \"GET /api/observability/investigations/{investigationId}/notes 2023-10-31\"; params?: ", "TypeC", "<{ path: ", "TypeC", @@ -138,7 +140,21 @@ "StringC", "; }>; }> | undefined; handler: ({}: ", "InvestigateAppRouteHandlerResources", - " & { params: { path: { investigationId: string; }; }; }) => Promise; } & ", + " & { params: { path: { investigationId: string; }; }; }) => Promise<{ id: string; content: string; createdAt: number; createdBy: string; }[]>; } & ", + "InvestigateAppRouteCreateOptions", + "; \"POST /api/observability/investigations/{investigationId}/notes 2023-10-31\": { endpoint: \"POST /api/observability/investigations/{investigationId}/notes 2023-10-31\"; params?: ", + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; }>; body: ", + "TypeC", + "<{ content: ", + "StringC", + "; }>; }> | undefined; handler: ({}: ", + "InvestigateAppRouteHandlerResources", + " & { params: { path: { investigationId: string; }; body: { content: string; }; }; }) => Promise<{ id: string; content: string; createdAt: number; createdBy: string; }>; } & ", "InvestigateAppRouteCreateOptions", "; \"GET /api/observability/investigations/{investigationId} 2023-10-31\": { endpoint: \"GET /api/observability/investigations/{investigationId} 2023-10-31\"; params?: ", "TypeC", @@ -148,7 +164,7 @@ "StringC", "; }>; }> | undefined; handler: ({}: ", "InvestigateAppRouteHandlerResources", - " & { params: { path: { investigationId: string; }; }; }) => Promise<{ id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: \"esql\"; params: { esql: string; suggestion: any; }; })[]; }>; } & ", + " & { params: { path: { investigationId: string; }; }; }) => Promise<{ id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]; }>; } & ", "InvestigateAppRouteCreateOptions", "; \"GET /api/observability/investigations 2023-10-31\": { endpoint: \"GET /api/observability/investigations 2023-10-31\"; params?: ", "PartialC", @@ -162,7 +178,7 @@ "StringC", "; }>; }> | undefined; handler: ({}: ", "InvestigateAppRouteHandlerResources", - " & { params?: { query?: { alertId?: string | undefined; page?: string | undefined; perPage?: string | undefined; } | undefined; } | undefined; }) => Promise<{ page: number; perPage: number; total: number; results: { id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: \"esql\"; params: { esql: string; suggestion: any; }; })[]; }[]; }>; } & ", + " & { params?: { query?: { alertId?: string | undefined; page?: string | undefined; perPage?: string | undefined; } | undefined; } | undefined; }) => Promise<{ page: number; perPage: number; total: number; results: { id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]; }[]; }>; } & ", "InvestigateAppRouteCreateOptions", "; \"POST /api/observability/investigations 2023-10-31\": { endpoint: \"POST /api/observability/investigations 2023-10-31\"; params?: ", "TypeC", @@ -194,7 +210,7 @@ "LiteralC", "<\"blank\">; }>]>; }>; }> | undefined; handler: ({}: ", "InvestigateAppRouteHandlerResources", - " & { params: { body: { id: string; title: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; }; }; }) => Promise<{ id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: \"esql\"; params: { esql: string; suggestion: any; }; })[]; }>; } & ", + " & { params: { body: { id: string; title: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; }; }; }) => Promise<{ id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]; }>; } & ", "InvestigateAppRouteCreateOptions", "; }" ], diff --git a/api_docs/investigate_app.mdx b/api_docs/investigate_app.mdx index 1ab92fa69605d..3a093ec714dbc 100644 --- a/api_docs/investigate_app.mdx +++ b/api_docs/investigate_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/investigateApp title: "investigateApp" image: https://source.unsplash.com/400x175/?github description: API docs for the investigateApp plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'investigateApp'] --- import investigateAppObj from './investigate_app.devdocs.json'; diff --git a/api_docs/kbn_ace.mdx b/api_docs/kbn_ace.mdx index de5e39c7a3ad4..679421254c5bd 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-08-28 +date: 2024-08-30 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 1beeb6a838961..f48034d7bfcae 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-08-28 +date: 2024-08-30 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 742f36ccd0f26..936652a661daf 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-08-28 +date: 2024-08-30 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 ef0e8fea377c3..e1353425d81ce 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-08-28 +date: 2024-08-30 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 fe40906305405..57bfde18c3ea6 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-08-28 +date: 2024-08-30 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 51d3e65739266..077ee93963df0 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-08-28 +date: 2024-08-30 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 e2818b7937d79..152e7b6994e74 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-08-28 +date: 2024-08-30 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 6b70acc648945..905f25cfac2ac 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-08-28 +date: 2024-08-30 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 f354c3efa6cd5..6cac89dbd7bc8 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-08-28 +date: 2024-08-30 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 11ab9d08f9152..c0031cdba9e13 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-as-data-utils'] --- import kbnAlertsAsDataUtilsObj from './kbn_alerts_as_data_utils.devdocs.json'; diff --git a/api_docs/kbn_alerts_grouping.mdx b/api_docs/kbn_alerts_grouping.mdx index 2edda489ca650..8b33fb5bd0503 100644 --- a/api_docs/kbn_alerts_grouping.mdx +++ b/api_docs/kbn_alerts_grouping.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts-grouping title: "@kbn/alerts-grouping" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts-grouping plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-grouping'] --- import kbnAlertsGroupingObj from './kbn_alerts_grouping.devdocs.json'; diff --git a/api_docs/kbn_alerts_ui_shared.mdx b/api_docs/kbn_alerts_ui_shared.mdx index a7c54fe669152..427defb75bb8e 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-ui-shared'] --- import kbnAlertsUiSharedObj from './kbn_alerts_ui_shared.devdocs.json'; diff --git a/api_docs/kbn_analytics.mdx b/api_docs/kbn_analytics.mdx index 7215c53eed90c..b53f0e979781c 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-08-28 +date: 2024-08-30 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 2b9cfcf48a28c..cb7691170701d 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-08-28 +date: 2024-08-30 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 216d465b69d09..c4b351173059c 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-08-28 +date: 2024-08-30 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 d8e3b48cac082..cdd3140698a50 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-08-28 +date: 2024-08-30 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 99d3578a0cbfa..17e121cfa2555 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-08-28 +date: 2024-08-30 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.mdx b/api_docs/kbn_apm_synthtrace_client.mdx index 4c68b9025e77b..74bcf57cc32e0 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace-client'] --- import kbnApmSynthtraceClientObj from './kbn_apm_synthtrace_client.devdocs.json'; diff --git a/api_docs/kbn_apm_types.mdx b/api_docs/kbn_apm_types.mdx index cc910fd4d0b62..b40c7bac77480 100644 --- a/api_docs/kbn_apm_types.mdx +++ b/api_docs/kbn_apm_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-types title: "@kbn/apm-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-types plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-types'] --- import kbnApmTypesObj from './kbn_apm_types.devdocs.json'; diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index 6512c394b8aa9..e8f4cb7dd3f39 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-utils'] --- import kbnApmUtilsObj from './kbn_apm_utils.devdocs.json'; diff --git a/api_docs/kbn_avc_banner.mdx b/api_docs/kbn_avc_banner.mdx index bccc73f21eab4..a0df7fe47a5af 100644 --- a/api_docs/kbn_avc_banner.mdx +++ b/api_docs/kbn_avc_banner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-avc-banner title: "@kbn/avc-banner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/avc-banner plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/avc-banner'] --- import kbnAvcBannerObj from './kbn_avc_banner.devdocs.json'; diff --git a/api_docs/kbn_axe_config.mdx b/api_docs/kbn_axe_config.mdx index 3e765df2a5f24..6f447cb7d0f7d 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-08-28 +date: 2024-08-30 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 a56a82b88e691..776112d794cb2 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-08-28 +date: 2024-08-30 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 3cd65e1a3d508..04b35ce834b3f 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-08-28 +date: 2024-08-30 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 d13474b5cff20..34099412fa5a9 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-08-28 +date: 2024-08-30 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 d099dbb1513ab..2287a0ca7ce3f 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cases-components'] --- import kbnCasesComponentsObj from './kbn_cases_components.devdocs.json'; diff --git a/api_docs/kbn_cbor.mdx b/api_docs/kbn_cbor.mdx index ed03c93296b6d..d9c719f85cf54 100644 --- a/api_docs/kbn_cbor.mdx +++ b/api_docs/kbn_cbor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cbor title: "@kbn/cbor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cbor plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cbor'] --- import kbnCborObj from './kbn_cbor.devdocs.json'; diff --git a/api_docs/kbn_cell_actions.mdx b/api_docs/kbn_cell_actions.mdx index 48e186669c5fc..eba654144b13c 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-08-28 +date: 2024-08-30 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 7d37cdc3253e3..946e2fd941d28 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-08-28 +date: 2024-08-30 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 f9258aa18adb7..5039f1373ae97 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-08-28 +date: 2024-08-30 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 b974643792385..a7085eb31fc12 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-08-28 +date: 2024-08-30 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 0fa4c5c5408d1..22f8f2c34facd 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-08-28 +date: 2024-08-30 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 cb5c932b0fbed..2cd05a12042a4 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-08-28 +date: 2024-08-30 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 bd560513b1f95..5a2414324816b 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cli-dev-mode'] --- import kbnCliDevModeObj from './kbn_cli_dev_mode.devdocs.json'; diff --git a/api_docs/kbn_cloud_security_posture.devdocs.json b/api_docs/kbn_cloud_security_posture.devdocs.json index 9f42159f69001..56abf5d314460 100644 --- a/api_docs/kbn_cloud_security_posture.devdocs.json +++ b/api_docs/kbn_cloud_security_posture.devdocs.json @@ -2,7 +2,70 @@ "id": "@kbn/cloud-security-posture", "client": { "classes": [], - "functions": [], + "functions": [ + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.showErrorToast", + "type": "Function", + "tags": [], + "label": "showErrorToast", + "description": [], + "signature": [ + "(toasts: ", + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "public", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-public.IToasts", + "text": "IToasts" + }, + ", error: unknown) => void" + ], + "path": "x-pack/packages/kbn-cloud-security-posture/src/utils/show_error_toast.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.showErrorToast.$1", + "type": "Object", + "tags": [], + "label": "toasts", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-notifications-browser", + "scope": "public", + "docId": "kibKbnCoreNotificationsBrowserPluginApi", + "section": "def-public.IToasts", + "text": "IToasts" + } + ], + "path": "x-pack/packages/kbn-cloud-security-posture/src/utils/show_error_toast.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/cloud-security-posture", + "id": "def-public.showErrorToast.$2", + "type": "Unknown", + "tags": [], + "label": "error", + "description": [], + "signature": [ + "unknown" + ], + "path": "x-pack/packages/kbn-cloud-security-posture/src/utils/show_error_toast.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], "interfaces": [ { "parentPluginId": "@kbn/cloud-security-posture", diff --git a/api_docs/kbn_cloud_security_posture.mdx b/api_docs/kbn_cloud_security_posture.mdx index cf41b91d3ac27..8d2ca431ae2c8 100644 --- a/api_docs/kbn_cloud_security_posture.mdx +++ b/api_docs/kbn_cloud_security_posture.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cloud-security-posture title: "@kbn/cloud-security-posture" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cloud-security-posture plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cloud-security-posture'] --- import kbnCloudSecurityPostureObj from './kbn_cloud_security_posture.devdocs.json'; @@ -21,10 +21,13 @@ Contact [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 19 | 0 | 19 | 0 | +| 22 | 0 | 22 | 0 | ## Client +### Functions + + ### Interfaces diff --git a/api_docs/kbn_cloud_security_posture_common.devdocs.json b/api_docs/kbn_cloud_security_posture_common.devdocs.json index 99c75826461c2..ccac5b517f03c 100644 --- a/api_docs/kbn_cloud_security_posture_common.devdocs.json +++ b/api_docs/kbn_cloud_security_posture_common.devdocs.json @@ -18,7 +18,91 @@ }, "common": { "classes": [], - "functions": [], + "functions": [ + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.buildMutedRulesFilter", + "type": "Function", + "tags": [], + "label": "buildMutedRulesFilter", + "description": [], + "signature": [ + "(rulesStates: Record>) => ", + "QueryDslQueryContainer", + "[]" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.buildMutedRulesFilter.$1", + "type": "Object", + "tags": [], + "label": "rulesStates", + "description": [], + "signature": [ + "Record>" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.extractErrorMessage", + "type": "Function", + "tags": [], + "label": "extractErrorMessage", + "description": [], + "signature": [ + "(e: unknown, fallbackMessage?: string | undefined) => string" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.extractErrorMessage.$1", + "type": "Unknown", + "tags": [], + "label": "e", + "description": [], + "signature": [ + "unknown" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.extractErrorMessage.$2", + "type": "string", + "tags": [], + "label": "fallbackMessage", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], "interfaces": [ { "parentPluginId": "@kbn/cloud-security-posture-common", @@ -27,7 +111,7 @@ "tags": [], "label": "BaseCspSetupBothPolicy", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41,7 +125,7 @@ "signature": [ "\"indexed\" | \"unprivileged\" | \"indexing\" | \"index-timeout\" | \"not-deployed\" | \"not-installed\" | \"waiting_for_results\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -52,7 +136,7 @@ "tags": [], "label": "installedPackagePolicies", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -63,7 +147,7 @@ "tags": [], "label": "healthyAgents", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false } @@ -77,7 +161,7 @@ "tags": [], "label": "BaseCspSetupStatus", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -98,7 +182,7 @@ }, "[]" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -109,7 +193,7 @@ "tags": [], "label": "latestPackageVersion", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -129,7 +213,7 @@ "text": "BaseCspSetupBothPolicy" } ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -149,7 +233,7 @@ "text": "BaseCspSetupBothPolicy" } ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -169,7 +253,7 @@ "text": "BaseCspSetupBothPolicy" } ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -180,7 +264,7 @@ "tags": [], "label": "isPluginInitialized", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -194,7 +278,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -208,7 +292,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false } @@ -222,7 +306,7 @@ "tags": [], "label": "CspFinding", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -233,7 +317,7 @@ "tags": [], "label": "'@timestamp'", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -247,7 +331,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -261,7 +345,7 @@ "signature": [ "CspFindingOrchestrator | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -275,7 +359,7 @@ "signature": [ "CspFindingCloud | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -289,7 +373,7 @@ "signature": [ "CspFindingResult" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -303,7 +387,7 @@ "signature": [ "CspFindingResource" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -317,7 +401,7 @@ "signature": [ "{ readonly impact?: string | undefined; readonly references?: string | undefined; readonly default_value?: string | undefined; readonly id: string; readonly version: string; readonly name: string; readonly tags: string[]; readonly description: string; readonly section: string; readonly audit: string; readonly benchmark: Readonly<{ posture_type?: \"kspm\" | \"cspm\" | undefined; rule_number?: string | undefined; } & { id: string; version: string; name: string; }>; readonly profile_applicability: string; readonly rationale: string; readonly rego_rule_id: string; readonly remediation: string; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -331,7 +415,7 @@ "signature": [ "CspFindingHost" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -345,7 +429,7 @@ "signature": [ "EcsEvent" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -359,7 +443,7 @@ "signature": [ "EcsDataStream" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -373,7 +457,7 @@ "signature": [ "CspFindingAgent" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -387,7 +471,7 @@ "signature": [ "{ version: string; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts", "deprecated": false, "trackAdoption": false } @@ -401,7 +485,7 @@ "tags": [], "label": "IndexDetails", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -412,7 +496,7 @@ "tags": [], "label": "index", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -426,7 +510,7 @@ "signature": [ "\"empty\" | \"not-empty\" | \"unprivileged\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false } @@ -436,6 +520,21 @@ ], "enums": [], "misc": [ + { + "parentPluginId": "@kbn/cloud-security-posture-common", + "id": "def-common.BenchmarksCisId", + "type": "Type", + "tags": [], + "label": "BenchmarksCisId", + "description": [], + "signature": [ + "\"cis_k8s\" | \"cis_azure\" | \"cis_aws\" | \"cis_eks\" | \"cis_gcp\"" + ], + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/benchmark.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/cloud-security-posture-common", "id": "def-common.CDR_LATEST_NATIVE_MISCONFIGURATIONS_INDEX_PATTERN", @@ -508,36 +607,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "@kbn/cloud-security-posture-common", - "id": "def-common.CspBenchmarkRuleMetadata", - "type": "Type", - "tags": [], - "label": "CspBenchmarkRuleMetadata", - "description": [], - "signature": [ - "{ readonly impact?: string | undefined; readonly references?: string | undefined; readonly default_value?: string | undefined; readonly id: string; readonly version: string; readonly name: string; readonly tags: string[]; readonly description: string; readonly section: string; readonly audit: string; readonly benchmark: Readonly<{ posture_type?: \"kspm\" | \"cspm\" | undefined; rule_number?: string | undefined; } & { id: string; version: string; name: string; }>; readonly profile_applicability: string; readonly rationale: string; readonly rego_rule_id: string; readonly remediation: string; }" - ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/schema/rules.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/cloud-security-posture-common", - "id": "def-common.CspBenchmarkRulesStates", - "type": "Type", - "tags": [], - "label": "CspBenchmarkRulesStates", - "description": [], - "signature": [ - "{ [x: string]: Readonly<{} & { muted: boolean; rule_id: string; rule_number: string; benchmark_id: string; benchmark_version: string; }>; }" - ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/schema/rules.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "@kbn/cloud-security-posture-common", "id": "def-common.CSPM_POLICY_TEMPLATE", @@ -569,7 +638,7 @@ "text": "BaseCspSetupStatus" } ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -584,7 +653,7 @@ "signature": [ "\"indexed\" | \"unprivileged\" | \"indexing\" | \"index-timeout\" | \"not-deployed\" | \"not-installed\" | \"waiting_for_results\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -599,7 +668,7 @@ "signature": [ "\"empty\" | \"not-empty\" | \"unprivileged\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture-common/types.ts", + "path": "x-pack/packages/kbn-cloud-security-posture-common/types/status.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_cloud_security_posture_common.mdx b/api_docs/kbn_cloud_security_posture_common.mdx index 10c54c1447aa8..1a80a540c8448 100644 --- a/api_docs/kbn_cloud_security_posture_common.mdx +++ b/api_docs/kbn_cloud_security_posture_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cloud-security-posture-common title: "@kbn/cloud-security-posture-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cloud-security-posture-common plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cloud-security-posture-common'] --- import kbnCloudSecurityPostureCommonObj from './kbn_cloud_security_posture_common.devdocs.json'; @@ -21,10 +21,13 @@ Contact [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 45 | 0 | 45 | 0 | +| 49 | 0 | 49 | 0 | ## Common +### Functions + + ### Interfaces diff --git a/api_docs/kbn_code_editor.mdx b/api_docs/kbn_code_editor.mdx index 62ed02d3c381b..6940e0297454a 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-08-28 +date: 2024-08-30 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 0c8788a384f3e..1929892edb54f 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-08-28 +date: 2024-08-30 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 faa1944b75ae4..c2a9484f9babe 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-08-28 +date: 2024-08-30 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 eb66728a27466..8be4839edff5f 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-08-28 +date: 2024-08-30 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 23751f1965a81..8f521d6ec17bf 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-08-28 +date: 2024-08-30 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 1e4b15907da3f..54cbc8521187b 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-08-28 +date: 2024-08-30 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 901bc860d5cf7..26704279e2a83 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-08-28 +date: 2024-08-30 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 62671abae5ab8..f64f236b85e42 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-content-editor'] --- import kbnContentManagementContentEditorObj from './kbn_content_management_content_editor.devdocs.json'; diff --git a/api_docs/kbn_content_management_content_insights_public.mdx b/api_docs/kbn_content_management_content_insights_public.mdx index 15c52f3c06369..5a54cae45c652 100644 --- a/api_docs/kbn_content_management_content_insights_public.mdx +++ b/api_docs/kbn_content_management_content_insights_public.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-content-insights-public title: "@kbn/content-management-content-insights-public" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-content-insights-public plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-content-insights-public'] --- import kbnContentManagementContentInsightsPublicObj from './kbn_content_management_content_insights_public.devdocs.json'; diff --git a/api_docs/kbn_content_management_content_insights_server.mdx b/api_docs/kbn_content_management_content_insights_server.mdx index ec24a2c668e05..bbac6d01aa050 100644 --- a/api_docs/kbn_content_management_content_insights_server.mdx +++ b/api_docs/kbn_content_management_content_insights_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-content-insights-server title: "@kbn/content-management-content-insights-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-content-insights-server plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-content-insights-server'] --- import kbnContentManagementContentInsightsServerObj from './kbn_content_management_content_insights_server.devdocs.json'; diff --git a/api_docs/kbn_content_management_favorites_public.devdocs.json b/api_docs/kbn_content_management_favorites_public.devdocs.json index 9d7837ee1cfd2..29fe90dd21c3f 100644 --- a/api_docs/kbn_content_management_favorites_public.devdocs.json +++ b/api_docs/kbn_content_management_favorites_public.devdocs.json @@ -49,7 +49,7 @@ "id": "def-public.FavoritesClient.Unnamed.$1", "type": "string", "tags": [], - "label": "favoriteObjectType", + "label": "appName", "description": [], "signature": [ "string" @@ -62,6 +62,21 @@ { "parentPluginId": "@kbn/content-management-favorites-public", "id": "def-public.FavoritesClient.Unnamed.$2", + "type": "string", + "tags": [], + "label": "favoriteObjectType", + "description": [], + "signature": [ + "string" + ], + "path": "packages/content-management/favorites/favorites_public/src/favorites_client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/content-management-favorites-public", + "id": "def-public.FavoritesClient.Unnamed.$3", "type": "Object", "tags": [], "label": "deps", @@ -72,7 +87,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-favorites-public", - "id": "def-public.FavoritesClient.Unnamed.$2.http", + "id": "def-public.FavoritesClient.Unnamed.$3.http", "type": "Object", "tags": [], "label": "http", @@ -89,6 +104,27 @@ "path": "packages/content-management/favorites/favorites_public/src/favorites_client.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/content-management-favorites-public", + "id": "def-public.FavoritesClient.Unnamed.$3.usageCollection", + "type": "Object", + "tags": [], + "label": "usageCollection", + "description": [], + "signature": [ + { + "pluginId": "usageCollection", + "scope": "public", + "docId": "kibUsageCollectionPluginApi", + "section": "def-public.UsageCollectionStart", + "text": "UsageCollectionStart" + }, + " | undefined" + ], + "path": "packages/content-management/favorites/favorites_public/src/favorites_client.ts", + "deprecated": false, + "trackAdoption": false } ] } @@ -232,6 +268,38 @@ "trackAdoption": false, "children": [], "returnComment": [] + }, + { + "parentPluginId": "@kbn/content-management-favorites-public", + "id": "def-public.FavoritesClient.reportAddFavoriteClick", + "type": "Function", + "tags": [], + "label": "reportAddFavoriteClick", + "description": [], + "signature": [ + "() => void" + ], + "path": "packages/content-management/favorites/favorites_public/src/favorites_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/content-management-favorites-public", + "id": "def-public.FavoritesClient.reportRemoveFavoriteClick", + "type": "Function", + "tags": [], + "label": "reportRemoveFavoriteClick", + "description": [], + "signature": [ + "() => void" + ], + "path": "packages/content-management/favorites/favorites_public/src/favorites_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] } ], "initialIsOpen": false @@ -674,6 +742,38 @@ "trackAdoption": false, "children": [], "returnComment": [] + }, + { + "parentPluginId": "@kbn/content-management-favorites-public", + "id": "def-public.FavoritesClientPublic.reportAddFavoriteClick", + "type": "Function", + "tags": [], + "label": "reportAddFavoriteClick", + "description": [], + "signature": [ + "() => void" + ], + "path": "packages/content-management/favorites/favorites_public/src/favorites_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/content-management-favorites-public", + "id": "def-public.FavoritesClientPublic.reportRemoveFavoriteClick", + "type": "Function", + "tags": [], + "label": "reportRemoveFavoriteClick", + "description": [], + "signature": [ + "() => void" + ], + "path": "packages/content-management/favorites/favorites_public/src/favorites_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] } ], "initialIsOpen": false diff --git a/api_docs/kbn_content_management_favorites_public.mdx b/api_docs/kbn_content_management_favorites_public.mdx index f2b866913d784..59ebb207d5b97 100644 --- a/api_docs/kbn_content_management_favorites_public.mdx +++ b/api_docs/kbn_content_management_favorites_public.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-favorites-public title: "@kbn/content-management-favorites-public" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-favorites-public plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-favorites-public'] --- import kbnContentManagementFavoritesPublicObj from './kbn_content_management_favorites_public.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 | |-------------------|-----------|------------------------|-----------------| -| 39 | 0 | 38 | 0 | +| 45 | 0 | 44 | 0 | ## Client diff --git a/api_docs/kbn_content_management_favorites_server.devdocs.json b/api_docs/kbn_content_management_favorites_server.devdocs.json index 2ddd581cc7caa..333a8d280971a 100644 --- a/api_docs/kbn_content_management_favorites_server.devdocs.json +++ b/api_docs/kbn_content_management_favorites_server.devdocs.json @@ -19,7 +19,7 @@ "label": "registerFavorites", "description": [], "signature": [ - "({ logger, core }: { core: ", + "({\n logger,\n core,\n usageCollection,\n}: { core: ", { "pluginId": "@kbn/core-lifecycle-server", "scope": "server", @@ -35,7 +35,15 @@ "section": "def-common.Logger", "text": "Logger" }, - "; }) => void" + "; usageCollection?: ", + { + "pluginId": "usageCollection", + "scope": "server", + "docId": "kibUsageCollectionPluginApi", + "section": "def-server.UsageCollectionSetup", + "text": "UsageCollectionSetup" + }, + " | undefined; }) => void" ], "path": "packages/content-management/favorites/favorites_server/src/index.ts", "deprecated": false, @@ -46,7 +54,7 @@ "id": "def-server.registerFavorites.$1", "type": "Object", "tags": [], - "label": "{ logger, core }", + "label": "{\n logger,\n core,\n usageCollection,\n}", "description": [], "path": "packages/content-management/favorites/favorites_server/src/index.ts", "deprecated": false, @@ -92,6 +100,27 @@ "path": "packages/content-management/favorites/favorites_server/src/index.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/content-management-favorites-server", + "id": "def-server.registerFavorites.$1.usageCollection", + "type": "CompoundType", + "tags": [], + "label": "usageCollection", + "description": [], + "signature": [ + { + "pluginId": "usageCollection", + "scope": "server", + "docId": "kibUsageCollectionPluginApi", + "section": "def-server.UsageCollectionSetup", + "text": "UsageCollectionSetup" + }, + " | undefined" + ], + "path": "packages/content-management/favorites/favorites_server/src/index.ts", + "deprecated": false, + "trackAdoption": false } ] } diff --git a/api_docs/kbn_content_management_favorites_server.mdx b/api_docs/kbn_content_management_favorites_server.mdx index ad6b103873fa2..a24a4e8bf69d3 100644 --- a/api_docs/kbn_content_management_favorites_server.mdx +++ b/api_docs/kbn_content_management_favorites_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-favorites-server title: "@kbn/content-management-favorites-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-favorites-server plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-favorites-server'] --- import kbnContentManagementFavoritesServerObj from './kbn_content_management_favorites_server.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 | |-------------------|-----------|------------------------|-----------------| -| 6 | 0 | 6 | 0 | +| 7 | 0 | 7 | 0 | ## Server 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 5d7a5e6b667d8..8735a690b41fd 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-tabbed-table-list-view'] --- import kbnContentManagementTabbedTableListViewObj from './kbn_content_management_tabbed_table_list_view.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list_view.mdx b/api_docs/kbn_content_management_table_list_view.mdx index 9acb9721a2ea7..a861621d282c9 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-08-28 +date: 2024-08-30 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 debbdd550bdef..405e23e94c7bd 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view-common'] --- import kbnContentManagementTableListViewCommonObj from './kbn_content_management_table_list_view_common.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list_view_table.mdx b/api_docs/kbn_content_management_table_list_view_table.mdx index 64618a4838360..c60b9cf2ffe84 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view-table'] --- import kbnContentManagementTableListViewTableObj from './kbn_content_management_table_list_view_table.devdocs.json'; diff --git a/api_docs/kbn_content_management_user_profiles.mdx b/api_docs/kbn_content_management_user_profiles.mdx index f8ffe314ab93f..26afb8c6b9ccf 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-08-28 +date: 2024-08-30 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.devdocs.json b/api_docs/kbn_content_management_utils.devdocs.json index 5ad26a1d86d38..57e4a206e1291 100644 --- a/api_docs/kbn_content_management_utils.devdocs.json +++ b/api_docs/kbn_content_management_utils.devdocs.json @@ -9,18 +9,10 @@ "objects": [] }, "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { "classes": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage", + "id": "def-server.SOContentStorage", "type": "Class", "tags": [], "label": "SOContentStorage", @@ -28,9 +20,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOContentStorage", + "section": "def-server.SOContentStorage", "text": "SOContentStorage" }, " implements ", @@ -57,7 +49,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.Unnamed", + "id": "def-server.SOContentStorage.Unnamed", "type": "Function", "tags": [], "label": "Constructor", @@ -71,7 +63,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.Unnamed.$1", + "id": "def-server.SOContentStorage.Unnamed.$1", "type": "Object", "tags": [], "label": "{\n savedObjectType,\n cmServicesDefinition,\n createArgsToSoCreateOptions,\n updateArgsToSoUpdateOptions,\n searchArgsToSOFindOptions,\n enableMSearch,\n allowedSavedObjectAttributes,\n mSearchAdditionalSearchFields,\n logger,\n throwOnResultValidationError,\n }", @@ -79,9 +71,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOContentStorageConstructorParams", + "section": "def-server.SOContentStorageConstructorParams", "text": "SOContentStorageConstructorParams" }, "" @@ -96,7 +88,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.mSearch", + "id": "def-server.SOContentStorage.mSearch", "type": "Object", "tags": [], "label": "mSearch", @@ -126,7 +118,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.get", + "id": "def-server.SOContentStorage.get", "type": "Function", "tags": [], "label": "get", @@ -148,7 +140,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.get.$1", + "id": "def-server.SOContentStorage.get.$1", "type": "Object", "tags": [], "label": "ctx", @@ -169,7 +161,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.get.$2", + "id": "def-server.SOContentStorage.get.$2", "type": "string", "tags": [], "label": "id", @@ -187,7 +179,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.bulkGet", + "id": "def-server.SOContentStorage.bulkGet", "type": "Function", "tags": [], "label": "bulkGet", @@ -203,7 +195,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.create", + "id": "def-server.SOContentStorage.create", "type": "Function", "tags": [], "label": "create", @@ -225,7 +217,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.create.$1", + "id": "def-server.SOContentStorage.create.$1", "type": "Object", "tags": [], "label": "ctx", @@ -246,7 +238,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.create.$2", + "id": "def-server.SOContentStorage.create.$2", "type": "Uncategorized", "tags": [], "label": "data", @@ -261,7 +253,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.create.$3", + "id": "def-server.SOContentStorage.create.$3", "type": "Uncategorized", "tags": [], "label": "options", @@ -279,7 +271,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.update", + "id": "def-server.SOContentStorage.update", "type": "Function", "tags": [], "label": "update", @@ -301,7 +293,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.update.$1", + "id": "def-server.SOContentStorage.update.$1", "type": "Object", "tags": [], "label": "ctx", @@ -322,7 +314,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.update.$2", + "id": "def-server.SOContentStorage.update.$2", "type": "string", "tags": [], "label": "id", @@ -337,7 +329,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.update.$3", + "id": "def-server.SOContentStorage.update.$3", "type": "Uncategorized", "tags": [], "label": "data", @@ -352,7 +344,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.update.$4", + "id": "def-server.SOContentStorage.update.$4", "type": "Uncategorized", "tags": [], "label": "options", @@ -370,7 +362,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.delete", + "id": "def-server.SOContentStorage.delete", "type": "Function", "tags": [], "label": "delete", @@ -392,7 +384,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.delete.$1", + "id": "def-server.SOContentStorage.delete.$1", "type": "Object", "tags": [], "label": "ctx", @@ -413,7 +405,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.delete.$2", + "id": "def-server.SOContentStorage.delete.$2", "type": "string", "tags": [], "label": "id", @@ -428,7 +420,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.delete.$3", + "id": "def-server.SOContentStorage.delete.$3", "type": "Object", "tags": [], "label": "options", @@ -439,7 +431,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.delete.$3.force", + "id": "def-server.SOContentStorage.delete.$3.force", "type": "boolean", "tags": [], "label": "force", @@ -455,7 +447,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.search", + "id": "def-server.SOContentStorage.search", "type": "Function", "tags": [], "label": "search", @@ -485,7 +477,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.search.$1", + "id": "def-server.SOContentStorage.search.$1", "type": "Object", "tags": [], "label": "ctx", @@ -506,7 +498,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.search.$2", + "id": "def-server.SOContentStorage.search.$2", "type": "Object", "tags": [], "label": "query", @@ -527,7 +519,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorage.search.$3", + "id": "def-server.SOContentStorage.search.$3", "type": "Uncategorized", "tags": [], "label": "options", @@ -550,7 +542,7 @@ "functions": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createArgsToSoCreateOptionsDefault", + "id": "def-server.createArgsToSoCreateOptionsDefault", "type": "Function", "tags": [], "label": "createArgsToSoCreateOptionsDefault", @@ -579,7 +571,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createArgsToSoCreateOptionsDefault.$1", + "id": "def-server.createArgsToSoCreateOptionsDefault.$1", "type": "Object", "tags": [], "label": "params", @@ -604,7 +596,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createResultSchema", + "id": "def-server.createResultSchema", "type": "Function", "tags": [], "label": "createResultSchema", @@ -642,7 +634,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createResultSchema.$1", + "id": "def-server.createResultSchema.$1", "type": "Object", "tags": [], "label": "soSchema", @@ -668,7 +660,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.getMSearch", + "id": "def-server.getMSearch", "type": "Function", "tags": [], "label": "getMSearch", @@ -698,7 +690,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.getMSearch.$1", + "id": "def-server.getMSearch.$1", "type": "Object", "tags": [], "label": "{\n savedObjectType,\n cmServicesDefinition,\n allowedSavedObjectAttributes,\n}", @@ -717,7 +709,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.objectTypeToGetResultSchema", + "id": "def-server.objectTypeToGetResultSchema", "type": "Function", "tags": [], "label": "objectTypeToGetResultSchema", @@ -787,7 +779,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.objectTypeToGetResultSchema.$1", + "id": "def-server.objectTypeToGetResultSchema.$1", "type": "Object", "tags": [], "label": "soSchema", @@ -813,7 +805,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.savedObjectSchema", + "id": "def-server.savedObjectSchema", "type": "Function", "tags": [], "label": "savedObjectSchema", @@ -923,7 +915,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.savedObjectSchema.$1", + "id": "def-server.savedObjectSchema.$1", "type": "Object", "tags": [], "label": "attributesSchema", @@ -949,7 +941,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchArgsToSOFindOptionsDefault", + "id": "def-server.searchArgsToSOFindOptionsDefault", "type": "Function", "tags": [], "label": "searchArgsToSOFindOptionsDefault", @@ -966,9 +958,9 @@ ") => ", @@ -986,7 +978,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchArgsToSOFindOptionsDefault.$1", + "id": "def-server.searchArgsToSOFindOptionsDefault.$1", "type": "Object", "tags": [], "label": "params", @@ -1002,9 +994,9 @@ "" @@ -1020,7 +1012,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.tagsToFindOptions", + "id": "def-server.tagsToFindOptions", "type": "Function", "tags": [], "label": "tagsToFindOptions", @@ -1050,7 +1042,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.tagsToFindOptions.$1", + "id": "def-server.tagsToFindOptions.$1", "type": "Object", "tags": [], "label": "{\n included,\n excluded,\n}", @@ -1061,7 +1053,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.tagsToFindOptions.$1.included", + "id": "def-server.tagsToFindOptions.$1.included", "type": "Array", "tags": [], "label": "included", @@ -1075,7 +1067,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.tagsToFindOptions.$1.excluded", + "id": "def-server.tagsToFindOptions.$1.excluded", "type": "Array", "tags": [], "label": "excluded", @@ -1095,7 +1087,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateArgsToSoUpdateOptionsDefault", + "id": "def-server.updateArgsToSoUpdateOptionsDefault", "type": "Function", "tags": [], "label": "updateArgsToSoUpdateOptionsDefault", @@ -1104,9 +1096,9 @@ "(params: ", @@ -1133,7 +1125,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateArgsToSoUpdateOptionsDefault.$1", + "id": "def-server.updateArgsToSoUpdateOptionsDefault.$1", "type": "Object", "tags": [], "label": "params", @@ -1161,7 +1153,7 @@ "interfaces": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes", + "id": "def-server.CMCrudTypes", "type": "Interface", "tags": [], "label": "CMCrudTypes", @@ -1172,7 +1164,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.Attributes", + "id": "def-server.CMCrudTypes.Attributes", "type": "Uncategorized", "tags": [], "label": "Attributes", @@ -1188,7 +1180,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.Item", + "id": "def-server.CMCrudTypes.Item", "type": "Object", "tags": [], "label": "Item", @@ -1198,9 +1190,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "" @@ -1211,7 +1203,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.PartialItem", + "id": "def-server.CMCrudTypes.PartialItem", "type": "CompoundType", "tags": [], "label": "PartialItem", @@ -1222,17 +1214,17 @@ "Omit<", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, ", \"attributes\" | \"references\"> & { attributes: object; references: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[] | undefined; }" @@ -1243,7 +1235,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.GetIn", + "id": "def-server.CMCrudTypes.GetIn", "type": "Object", "tags": [], "label": "GetIn", @@ -1266,7 +1258,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.GetOut", + "id": "def-server.CMCrudTypes.GetOut", "type": "Object", "tags": [], "label": "GetOut", @@ -1277,9 +1269,9 @@ "{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "; meta: { outcome: \"exactMatch\" | \"aliasMatch\" | \"conflict\"; aliasTargetId?: string | undefined; aliasPurpose?: \"savedObjectConversion\" | \"savedObjectImport\" | undefined; }; }" @@ -1290,7 +1282,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.CreateIn", + "id": "def-server.CMCrudTypes.CreateIn", "type": "Object", "tags": [], "label": "CreateIn", @@ -1313,7 +1305,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.CreateOut", + "id": "def-server.CMCrudTypes.CreateOut", "type": "Object", "tags": [], "label": "CreateOut", @@ -1324,9 +1316,9 @@ "{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "; meta?: undefined; }" @@ -1337,7 +1329,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.CreateOptions", + "id": "def-server.CMCrudTypes.CreateOptions", "type": "Uncategorized", "tags": [], "label": "CreateOptions", @@ -1353,7 +1345,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.SearchIn", + "id": "def-server.CMCrudTypes.SearchIn", "type": "Object", "tags": [], "label": "SearchIn", @@ -1376,7 +1368,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.SearchOut", + "id": "def-server.CMCrudTypes.SearchOut", "type": "Object", "tags": [], "label": "SearchOut", @@ -1387,9 +1379,9 @@ "{ hits: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "[]; pagination: { total: number; cursor?: string | undefined; }; }" @@ -1400,7 +1392,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.SearchOptions", + "id": "def-server.CMCrudTypes.SearchOptions", "type": "Uncategorized", "tags": [], "label": "SearchOptions", @@ -1416,7 +1408,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.UpdateIn", + "id": "def-server.CMCrudTypes.UpdateIn", "type": "Object", "tags": [], "label": "UpdateIn", @@ -1439,7 +1431,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.UpdateOut", + "id": "def-server.CMCrudTypes.UpdateOut", "type": "Object", "tags": [], "label": "UpdateOut", @@ -1450,9 +1442,9 @@ "{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadataPartial", + "section": "def-server.SOWithMetadataPartial", "text": "SOWithMetadataPartial" }, "; meta?: undefined; }" @@ -1463,7 +1455,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.UpdateOptions", + "id": "def-server.CMCrudTypes.UpdateOptions", "type": "Uncategorized", "tags": [], "label": "UpdateOptions", @@ -1479,7 +1471,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.DeleteIn", + "id": "def-server.CMCrudTypes.DeleteIn", "type": "Object", "tags": [], "label": "DeleteIn", @@ -1502,7 +1494,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CMCrudTypes.DeleteOut", + "id": "def-server.CMCrudTypes.DeleteOut", "type": "Object", "tags": [], "label": "DeleteOut", @@ -1527,7 +1519,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes", + "id": "def-server.ContentManagementCrudTypes", "type": "Interface", "tags": [ "argument", @@ -1540,9 +1532,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.ContentManagementCrudTypes", + "section": "def-server.ContentManagementCrudTypes", "text": "ContentManagementCrudTypes" }, "" @@ -1553,7 +1545,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.Attributes", + "id": "def-server.ContentManagementCrudTypes.Attributes", "type": "Uncategorized", "tags": [], "label": "Attributes", @@ -1567,7 +1559,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.Item", + "id": "def-server.ContentManagementCrudTypes.Item", "type": "Object", "tags": [], "label": "Item", @@ -1577,9 +1569,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "" @@ -1590,7 +1582,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.PartialItem", + "id": "def-server.ContentManagementCrudTypes.PartialItem", "type": "CompoundType", "tags": [], "label": "PartialItem", @@ -1601,17 +1593,17 @@ "Omit<", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, ", \"attributes\" | \"references\"> & { attributes: Partial; references: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[] | undefined; }" @@ -1622,7 +1614,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.CreateOptions", + "id": "def-server.ContentManagementCrudTypes.CreateOptions", "type": "Uncategorized", "tags": [], "label": "CreateOptions", @@ -1638,7 +1630,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.UpdateOptions", + "id": "def-server.ContentManagementCrudTypes.UpdateOptions", "type": "Uncategorized", "tags": [], "label": "UpdateOptions", @@ -1654,7 +1646,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.SearchOptions", + "id": "def-server.ContentManagementCrudTypes.SearchOptions", "type": "Uncategorized", "tags": [], "label": "SearchOptions", @@ -1670,7 +1662,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.GetIn", + "id": "def-server.ContentManagementCrudTypes.GetIn", "type": "Object", "tags": [], "label": "GetIn", @@ -1693,7 +1685,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.GetOut", + "id": "def-server.ContentManagementCrudTypes.GetOut", "type": "Object", "tags": [], "label": "GetOut", @@ -1704,9 +1696,9 @@ "{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "; meta: { outcome: \"exactMatch\" | \"aliasMatch\" | \"conflict\"; aliasTargetId?: string | undefined; aliasPurpose?: \"savedObjectConversion\" | \"savedObjectImport\" | undefined; }; }" @@ -1717,7 +1709,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.CreateIn", + "id": "def-server.ContentManagementCrudTypes.CreateIn", "type": "Object", "tags": [], "label": "CreateIn", @@ -1740,7 +1732,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.CreateOut", + "id": "def-server.ContentManagementCrudTypes.CreateOut", "type": "Object", "tags": [], "label": "CreateOut", @@ -1751,9 +1743,9 @@ "{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "; meta?: undefined; }" @@ -1764,7 +1756,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.SearchIn", + "id": "def-server.ContentManagementCrudTypes.SearchIn", "type": "Object", "tags": [], "label": "SearchIn", @@ -1787,7 +1779,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.SearchOut", + "id": "def-server.ContentManagementCrudTypes.SearchOut", "type": "Object", "tags": [], "label": "SearchOut", @@ -1798,9 +1790,9 @@ "{ hits: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "[]; pagination: { total: number; cursor?: string | undefined; }; }" @@ -1811,7 +1803,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.UpdateIn", + "id": "def-server.ContentManagementCrudTypes.UpdateIn", "type": "Object", "tags": [], "label": "UpdateIn", @@ -1834,7 +1826,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.UpdateOut", + "id": "def-server.ContentManagementCrudTypes.UpdateOut", "type": "Object", "tags": [], "label": "UpdateOut", @@ -1845,9 +1837,9 @@ "{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadataPartial", + "section": "def-server.SOWithMetadataPartial", "text": "SOWithMetadataPartial" }, "; meta?: undefined; }" @@ -1858,7 +1850,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.DeleteIn", + "id": "def-server.ContentManagementCrudTypes.DeleteIn", "type": "Object", "tags": [], "label": "DeleteIn", @@ -1881,7 +1873,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ContentManagementCrudTypes.DeleteOut", + "id": "def-server.ContentManagementCrudTypes.DeleteOut", "type": "Object", "tags": [], "label": "DeleteOut", @@ -1906,7 +1898,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.GetMSearchType", + "id": "def-server.GetMSearchType", "type": "Interface", "tags": [], "label": "GetMSearchType", @@ -1914,9 +1906,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.GetMSearchType", + "section": "def-server.GetMSearchType", "text": "GetMSearchType" }, "" @@ -1927,7 +1919,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.GetMSearchType.savedObjectType", + "id": "def-server.GetMSearchType.savedObjectType", "type": "string", "tags": [], "label": "savedObjectType", @@ -1938,7 +1930,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.GetMSearchType.toItemResult", + "id": "def-server.GetMSearchType.toItemResult", "type": "Function", "tags": [], "label": "toItemResult", @@ -1968,7 +1960,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.GetMSearchType.toItemResult.$1", + "id": "def-server.GetMSearchType.toItemResult.$1", "type": "Object", "tags": [], "label": "ctx", @@ -1989,7 +1981,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.GetMSearchType.toItemResult.$2", + "id": "def-server.GetMSearchType.toItemResult.$2", "type": "Object", "tags": [], "label": "savedObject", @@ -2017,7 +2009,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.Reference", + "id": "def-server.Reference", "type": "Interface", "tags": [], "label": "Reference", @@ -2028,7 +2020,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.Reference.type", + "id": "def-server.Reference.type", "type": "string", "tags": [], "label": "type", @@ -2039,7 +2031,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.Reference.id", + "id": "def-server.Reference.id", "type": "string", "tags": [], "label": "id", @@ -2050,7 +2042,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.Reference.name", + "id": "def-server.Reference.name", "type": "string", "tags": [], "label": "name", @@ -2064,7 +2056,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectCreateOptions", + "id": "def-server.SavedObjectCreateOptions", "type": "Interface", "tags": [], "label": "SavedObjectCreateOptions", @@ -2077,7 +2069,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectCreateOptions.id", + "id": "def-server.SavedObjectCreateOptions.id", "type": "string", "tags": [], "label": "id", @@ -2093,7 +2085,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectCreateOptions.overwrite", + "id": "def-server.SavedObjectCreateOptions.overwrite", "type": "CompoundType", "tags": [], "label": "overwrite", @@ -2109,7 +2101,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectCreateOptions.version", + "id": "def-server.SavedObjectCreateOptions.version", "type": "string", "tags": [], "label": "version", @@ -2125,7 +2117,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectCreateOptions.references", + "id": "def-server.SavedObjectCreateOptions.references", "type": "Array", "tags": [], "label": "references", @@ -2135,9 +2127,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[] | undefined" @@ -2148,7 +2140,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectCreateOptions.refresh", + "id": "def-server.SavedObjectCreateOptions.refresh", "type": "CompoundType", "tags": [], "label": "refresh", @@ -2164,7 +2156,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectCreateOptions.initialNamespaces", + "id": "def-server.SavedObjectCreateOptions.initialNamespaces", "type": "Array", "tags": [], "label": "initialNamespaces", @@ -2183,7 +2175,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions", + "id": "def-server.SavedObjectSearchOptions", "type": "Interface", "tags": [], "label": "SavedObjectSearchOptions", @@ -2196,7 +2188,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.page", + "id": "def-server.SavedObjectSearchOptions.page", "type": "number", "tags": [], "label": "page", @@ -2212,7 +2204,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.perPage", + "id": "def-server.SavedObjectSearchOptions.perPage", "type": "number", "tags": [], "label": "perPage", @@ -2228,7 +2220,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.sortField", + "id": "def-server.SavedObjectSearchOptions.sortField", "type": "string", "tags": [], "label": "sortField", @@ -2244,7 +2236,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.sortOrder", + "id": "def-server.SavedObjectSearchOptions.sortOrder", "type": "CompoundType", "tags": [], "label": "sortOrder", @@ -2261,7 +2253,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.fields", + "id": "def-server.SavedObjectSearchOptions.fields", "type": "Array", "tags": [], "label": "fields", @@ -2277,7 +2269,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.search", + "id": "def-server.SavedObjectSearchOptions.search", "type": "string", "tags": [], "label": "search", @@ -2293,7 +2285,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.searchFields", + "id": "def-server.SavedObjectSearchOptions.searchFields", "type": "Array", "tags": [], "label": "searchFields", @@ -2309,7 +2301,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.searchAfter", + "id": "def-server.SavedObjectSearchOptions.searchAfter", "type": "Array", "tags": [], "label": "searchAfter", @@ -2326,7 +2318,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.rootSearchFields", + "id": "def-server.SavedObjectSearchOptions.rootSearchFields", "type": "Array", "tags": [], "label": "rootSearchFields", @@ -2342,7 +2334,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.hasReference", + "id": "def-server.SavedObjectSearchOptions.hasReference", "type": "CompoundType", "tags": [], "label": "hasReference", @@ -2373,7 +2365,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.hasReferenceOperator", + "id": "def-server.SavedObjectSearchOptions.hasReferenceOperator", "type": "CompoundType", "tags": [], "label": "hasReferenceOperator", @@ -2389,7 +2381,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.hasNoReference", + "id": "def-server.SavedObjectSearchOptions.hasNoReference", "type": "CompoundType", "tags": [], "label": "hasNoReference", @@ -2420,7 +2412,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.hasNoReferenceOperator", + "id": "def-server.SavedObjectSearchOptions.hasNoReferenceOperator", "type": "CompoundType", "tags": [], "label": "hasNoReferenceOperator", @@ -2436,7 +2428,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.defaultSearchOperator", + "id": "def-server.SavedObjectSearchOptions.defaultSearchOperator", "type": "CompoundType", "tags": [], "label": "defaultSearchOperator", @@ -2452,7 +2444,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.filter", + "id": "def-server.SavedObjectSearchOptions.filter", "type": "Any", "tags": [], "label": "filter", @@ -2468,7 +2460,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.aggs", + "id": "def-server.SavedObjectSearchOptions.aggs", "type": "Object", "tags": [ "alpha" @@ -2488,7 +2480,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.namespaces", + "id": "def-server.SavedObjectSearchOptions.namespaces", "type": "Array", "tags": [], "label": "namespaces", @@ -2504,7 +2496,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectSearchOptions.pit", + "id": "def-server.SavedObjectSearchOptions.pit", "type": "Object", "tags": [], "label": "pit", @@ -2530,7 +2522,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectUpdateOptions", + "id": "def-server.SavedObjectUpdateOptions", "type": "Interface", "tags": [], "label": "SavedObjectUpdateOptions", @@ -2540,9 +2532,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SavedObjectUpdateOptions", + "section": "def-server.SavedObjectUpdateOptions", "text": "SavedObjectUpdateOptions" }, "" @@ -2553,7 +2545,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectUpdateOptions.references", + "id": "def-server.SavedObjectUpdateOptions.references", "type": "Array", "tags": [], "label": "references", @@ -2563,9 +2555,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[] | undefined" @@ -2576,7 +2568,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectUpdateOptions.version", + "id": "def-server.SavedObjectUpdateOptions.version", "type": "string", "tags": [], "label": "version", @@ -2590,7 +2582,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectUpdateOptions.refresh", + "id": "def-server.SavedObjectUpdateOptions.refresh", "type": "CompoundType", "tags": [], "label": "refresh", @@ -2613,7 +2605,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectUpdateOptions.upsert", + "id": "def-server.SavedObjectUpdateOptions.upsert", "type": "Uncategorized", "tags": [], "label": "upsert", @@ -2629,7 +2621,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectUpdateOptions.retryOnConflict", + "id": "def-server.SavedObjectUpdateOptions.retryOnConflict", "type": "number", "tags": [], "label": "retryOnConflict", @@ -2645,7 +2637,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SavedObjectUpdateOptions.mergeAttributes", + "id": "def-server.SavedObjectUpdateOptions.mergeAttributes", "type": "CompoundType", "tags": [], "label": "mergeAttributes", @@ -2664,7 +2656,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SearchArgsToSOFindOptionsOptionsDefault", + "id": "def-server.SearchArgsToSOFindOptionsOptionsDefault", "type": "Interface", "tags": [], "label": "SearchArgsToSOFindOptionsOptionsDefault", @@ -2675,7 +2667,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SearchArgsToSOFindOptionsOptionsDefault.fields", + "id": "def-server.SearchArgsToSOFindOptionsOptionsDefault.fields", "type": "Array", "tags": [], "label": "fields", @@ -2689,7 +2681,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SearchArgsToSOFindOptionsOptionsDefault.searchFields", + "id": "def-server.SearchArgsToSOFindOptionsOptionsDefault.searchFields", "type": "Array", "tags": [], "label": "searchFields", @@ -2706,7 +2698,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ServicesDefinitionSet", + "id": "def-server.ServicesDefinitionSet", "type": "Interface", "tags": [], "label": "ServicesDefinitionSet", @@ -2717,7 +2709,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.ServicesDefinitionSet.Unnamed", + "id": "def-server.ServicesDefinitionSet.Unnamed", "type": "IndexSignature", "tags": [], "label": "[version: number]: ServicesDefinition", @@ -2726,9 +2718,9 @@ "[version: number]: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ServicesDefinition", + "section": "def-server.ServicesDefinition", "text": "ServicesDefinition" } ], @@ -2741,7 +2733,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams", + "id": "def-server.SOContentStorageConstructorParams", "type": "Interface", "tags": [], "label": "SOContentStorageConstructorParams", @@ -2749,9 +2741,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOContentStorageConstructorParams", + "section": "def-server.SOContentStorageConstructorParams", "text": "SOContentStorageConstructorParams" }, "" @@ -2762,7 +2754,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.savedObjectType", + "id": "def-server.SOContentStorageConstructorParams.savedObjectType", "type": "string", "tags": [], "label": "savedObjectType", @@ -2773,7 +2765,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.cmServicesDefinition", + "id": "def-server.SOContentStorageConstructorParams.cmServicesDefinition", "type": "Object", "tags": [], "label": "cmServicesDefinition", @@ -2781,9 +2773,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.ServicesDefinitionSet", + "section": "def-server.ServicesDefinitionSet", "text": "ServicesDefinitionSet" } ], @@ -2793,7 +2785,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.allowedSavedObjectAttributes", + "id": "def-server.SOContentStorageConstructorParams.allowedSavedObjectAttributes", "type": "Array", "tags": [], "label": "allowedSavedObjectAttributes", @@ -2807,7 +2799,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.createArgsToSoCreateOptions", + "id": "def-server.SOContentStorageConstructorParams.createArgsToSoCreateOptions", "type": "Function", "tags": [], "label": "createArgsToSoCreateOptions", @@ -2815,9 +2807,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.CreateArgsToSoCreateOptions", + "section": "def-server.CreateArgsToSoCreateOptions", "text": "CreateArgsToSoCreateOptions" }, " | undefined" @@ -2828,7 +2820,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.updateArgsToSoUpdateOptions", + "id": "def-server.SOContentStorageConstructorParams.updateArgsToSoUpdateOptions", "type": "Function", "tags": [], "label": "updateArgsToSoUpdateOptions", @@ -2836,9 +2828,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.UpdateArgsToSoUpdateOptions", + "section": "def-server.UpdateArgsToSoUpdateOptions", "text": "UpdateArgsToSoUpdateOptions" }, " | undefined" @@ -2849,7 +2841,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.searchArgsToSOFindOptions", + "id": "def-server.SOContentStorageConstructorParams.searchArgsToSOFindOptions", "type": "Function", "tags": [], "label": "searchArgsToSOFindOptions", @@ -2857,9 +2849,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SearchArgsToSOFindOptions", + "section": "def-server.SearchArgsToSOFindOptions", "text": "SearchArgsToSOFindOptions" }, " | undefined" @@ -2870,7 +2862,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.enableMSearch", + "id": "def-server.SOContentStorageConstructorParams.enableMSearch", "type": "CompoundType", "tags": [], "label": "enableMSearch", @@ -2886,7 +2878,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.mSearchAdditionalSearchFields", + "id": "def-server.SOContentStorageConstructorParams.mSearchAdditionalSearchFields", "type": "Array", "tags": [], "label": "mSearchAdditionalSearchFields", @@ -2900,7 +2892,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.logger", + "id": "def-server.SOContentStorageConstructorParams.logger", "type": "Object", "tags": [], "label": "logger", @@ -2920,7 +2912,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOContentStorageConstructorParams.throwOnResultValidationError", + "id": "def-server.SOContentStorageConstructorParams.throwOnResultValidationError", "type": "boolean", "tags": [], "label": "throwOnResultValidationError", @@ -2934,7 +2926,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata", + "id": "def-server.SOWithMetadata", "type": "Interface", "tags": [], "label": "SOWithMetadata", @@ -2944,9 +2936,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "" @@ -2957,7 +2949,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.id", + "id": "def-server.SOWithMetadata.id", "type": "string", "tags": [], "label": "id", @@ -2968,7 +2960,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.type", + "id": "def-server.SOWithMetadata.type", "type": "string", "tags": [], "label": "type", @@ -2979,7 +2971,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.version", + "id": "def-server.SOWithMetadata.version", "type": "string", "tags": [], "label": "version", @@ -2993,7 +2985,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.createdAt", + "id": "def-server.SOWithMetadata.createdAt", "type": "string", "tags": [], "label": "createdAt", @@ -3007,7 +2999,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.updatedAt", + "id": "def-server.SOWithMetadata.updatedAt", "type": "string", "tags": [], "label": "updatedAt", @@ -3021,7 +3013,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.createdBy", + "id": "def-server.SOWithMetadata.createdBy", "type": "string", "tags": [], "label": "createdBy", @@ -3035,7 +3027,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.updatedBy", + "id": "def-server.SOWithMetadata.updatedBy", "type": "string", "tags": [], "label": "updatedBy", @@ -3049,7 +3041,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.error", + "id": "def-server.SOWithMetadata.error", "type": "Object", "tags": [], "label": "error", @@ -3063,7 +3055,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.managed", + "id": "def-server.SOWithMetadata.managed", "type": "CompoundType", "tags": [], "label": "managed", @@ -3077,7 +3069,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.attributes", + "id": "def-server.SOWithMetadata.attributes", "type": "Uncategorized", "tags": [], "label": "attributes", @@ -3091,7 +3083,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.references", + "id": "def-server.SOWithMetadata.references", "type": "Array", "tags": [], "label": "references", @@ -3099,9 +3091,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[]" @@ -3112,7 +3104,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.namespaces", + "id": "def-server.SOWithMetadata.namespaces", "type": "Array", "tags": [], "label": "namespaces", @@ -3126,7 +3118,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadata.originId", + "id": "def-server.SOWithMetadata.originId", "type": "string", "tags": [], "label": "originId", @@ -3146,7 +3138,7 @@ "misc": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CreateArgsToSoCreateOptions", + "id": "def-server.CreateArgsToSoCreateOptions", "type": "Type", "tags": [], "label": "CreateArgsToSoCreateOptions", @@ -3168,7 +3160,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.CreateArgsToSoCreateOptions.$1", + "id": "def-server.CreateArgsToSoCreateOptions.$1", "type": "Uncategorized", "tags": [], "label": "params", @@ -3185,7 +3177,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.GetResultSO", + "id": "def-server.GetResultSO", "type": "Type", "tags": [], "label": "GetResultSO", @@ -3202,7 +3194,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SearchArgsToSOFindOptions", + "id": "def-server.SearchArgsToSOFindOptions", "type": "Type", "tags": [], "label": "SearchArgsToSOFindOptions", @@ -3224,7 +3216,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SearchArgsToSOFindOptions.$1", + "id": "def-server.SearchArgsToSOFindOptions.$1", "type": "Uncategorized", "tags": [], "label": "params", @@ -3241,7 +3233,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.SOWithMetadataPartial", + "id": "def-server.SOWithMetadataPartial", "type": "Type", "tags": [], "label": "SOWithMetadataPartial", @@ -3250,17 +3242,17 @@ "Omit<", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, ", \"attributes\" | \"references\"> & { attributes: Partial; references: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[] | undefined; }" @@ -3272,7 +3264,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.UpdateArgsToSoUpdateOptions", + "id": "def-server.UpdateArgsToSoUpdateOptions", "type": "Type", "tags": [], "label": "UpdateArgsToSoUpdateOptions", @@ -3295,7 +3287,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.UpdateArgsToSoUpdateOptions.$1", + "id": "def-server.UpdateArgsToSoUpdateOptions.$1", "type": "Uncategorized", "tags": [], "label": "params", @@ -3314,7 +3306,7 @@ "objects": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.apiError", + "id": "def-server.apiError", "type": "Object", "tags": [], "label": "apiError", @@ -3368,7 +3360,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createOptionsSchemas", + "id": "def-server.createOptionsSchemas", "type": "Object", "tags": [], "label": "createOptionsSchemas", @@ -3379,7 +3371,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createOptionsSchemas.id", + "id": "def-server.createOptionsSchemas.id", "type": "Object", "tags": [], "label": "id", @@ -3400,7 +3392,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createOptionsSchemas.references", + "id": "def-server.createOptionsSchemas.references", "type": "Object", "tags": [], "label": "references", @@ -3421,7 +3413,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createOptionsSchemas.overwrite", + "id": "def-server.createOptionsSchemas.overwrite", "type": "Object", "tags": [], "label": "overwrite", @@ -3442,7 +3434,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createOptionsSchemas.version", + "id": "def-server.createOptionsSchemas.version", "type": "Object", "tags": [], "label": "version", @@ -3463,7 +3455,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createOptionsSchemas.refresh", + "id": "def-server.createOptionsSchemas.refresh", "type": "Object", "tags": [], "label": "refresh", @@ -3484,7 +3476,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.createOptionsSchemas.initialNamespaces", + "id": "def-server.createOptionsSchemas.initialNamespaces", "type": "Object", "tags": [], "label": "initialNamespaces", @@ -3508,7 +3500,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.referenceSchema", + "id": "def-server.referenceSchema", "type": "Object", "tags": [], "label": "referenceSchema", @@ -3554,7 +3546,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.referencesSchema", + "id": "def-server.referencesSchema", "type": "Object", "tags": [], "label": "referencesSchema", @@ -3576,7 +3568,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.schemaAndOr", + "id": "def-server.schemaAndOr", "type": "Object", "tags": [], "label": "schemaAndOr", @@ -3598,7 +3590,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas", + "id": "def-server.searchOptionsSchemas", "type": "Object", "tags": [], "label": "searchOptionsSchemas", @@ -3609,7 +3601,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.page", + "id": "def-server.searchOptionsSchemas.page", "type": "Object", "tags": [], "label": "page", @@ -3630,7 +3622,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.perPage", + "id": "def-server.searchOptionsSchemas.perPage", "type": "Object", "tags": [], "label": "perPage", @@ -3651,7 +3643,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.sortField", + "id": "def-server.searchOptionsSchemas.sortField", "type": "Object", "tags": [], "label": "sortField", @@ -3672,7 +3664,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.sortOrder", + "id": "def-server.searchOptionsSchemas.sortOrder", "type": "Object", "tags": [], "label": "sortOrder", @@ -3693,7 +3685,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.fields", + "id": "def-server.searchOptionsSchemas.fields", "type": "Object", "tags": [], "label": "fields", @@ -3714,7 +3706,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.search", + "id": "def-server.searchOptionsSchemas.search", "type": "Object", "tags": [], "label": "search", @@ -3735,7 +3727,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.searchFields", + "id": "def-server.searchOptionsSchemas.searchFields", "type": "Object", "tags": [], "label": "searchFields", @@ -3756,7 +3748,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.rootSearchFields", + "id": "def-server.searchOptionsSchemas.rootSearchFields", "type": "Object", "tags": [], "label": "rootSearchFields", @@ -3777,7 +3769,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.hasReference", + "id": "def-server.searchOptionsSchemas.hasReference", "type": "Object", "tags": [], "label": "hasReference", @@ -3798,7 +3790,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.hasReferenceOperator", + "id": "def-server.searchOptionsSchemas.hasReferenceOperator", "type": "Object", "tags": [], "label": "hasReferenceOperator", @@ -3819,7 +3811,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.hasNoReference", + "id": "def-server.searchOptionsSchemas.hasNoReference", "type": "Object", "tags": [], "label": "hasNoReference", @@ -3840,7 +3832,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.hasNoReferenceOperator", + "id": "def-server.searchOptionsSchemas.hasNoReferenceOperator", "type": "Object", "tags": [], "label": "hasNoReferenceOperator", @@ -3861,7 +3853,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.defaultSearchOperator", + "id": "def-server.searchOptionsSchemas.defaultSearchOperator", "type": "Object", "tags": [], "label": "defaultSearchOperator", @@ -3882,7 +3874,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.namespaces", + "id": "def-server.searchOptionsSchemas.namespaces", "type": "Object", "tags": [], "label": "namespaces", @@ -3903,7 +3895,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.type", + "id": "def-server.searchOptionsSchemas.type", "type": "Object", "tags": [], "label": "type", @@ -3924,7 +3916,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.filter", + "id": "def-server.searchOptionsSchemas.filter", "type": "Object", "tags": [], "label": "filter", @@ -3945,7 +3937,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.searchOptionsSchemas.pit", + "id": "def-server.searchOptionsSchemas.pit", "type": "Object", "tags": [], "label": "pit", @@ -3969,7 +3961,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema", + "id": "def-server.updateOptionsSchema", "type": "Object", "tags": [], "label": "updateOptionsSchema", @@ -3980,7 +3972,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema.references", + "id": "def-server.updateOptionsSchema.references", "type": "Object", "tags": [], "label": "references", @@ -4001,7 +3993,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema.version", + "id": "def-server.updateOptionsSchema.version", "type": "Object", "tags": [], "label": "version", @@ -4022,7 +4014,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema.refresh", + "id": "def-server.updateOptionsSchema.refresh", "type": "Object", "tags": [], "label": "refresh", @@ -4043,7 +4035,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema.upsert", + "id": "def-server.updateOptionsSchema.upsert", "type": "Function", "tags": [], "label": "upsert", @@ -4073,7 +4065,7 @@ "children": [ { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema.upsert.$1", + "id": "def-server.updateOptionsSchema.upsert.$1", "type": "Object", "tags": [], "label": "attributesSchema", @@ -4098,7 +4090,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema.retryOnConflict", + "id": "def-server.updateOptionsSchema.retryOnConflict", "type": "Object", "tags": [], "label": "retryOnConflict", @@ -4119,7 +4111,7 @@ }, { "parentPluginId": "@kbn/content-management-utils", - "id": "def-common.updateOptionsSchema.mergeAttributes", + "id": "def-server.updateOptionsSchema.mergeAttributes", "type": "Object", "tags": [], "label": "mergeAttributes", @@ -4142,5 +4134,13 @@ "initialIsOpen": false } ] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_content_management_utils.mdx b/api_docs/kbn_content_management_utils.mdx index 2351ec22cc7e2..76c9cad927a67 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-utils'] --- import kbnContentManagementUtilsObj from './kbn_content_management_utils.devdocs.json'; @@ -23,20 +23,20 @@ Contact [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/k |-------------------|-----------|------------------------|-----------------| | 195 | 1 | 128 | 0 | -## Common +## Server ### Objects - + ### Functions - + ### Classes - + ### Interfaces - + ### Consts, variables and types - + diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index fadef02f4ccde..0968ba24b4cb8 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-08-28 +date: 2024-08-30 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 d170328b64b0a..1794bd9f28f63 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-08-28 +date: 2024-08-30 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 8ced9f563d0f0..9b76a9f4487d3 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-mocks'] --- import kbnCoreAnalyticsBrowserMocksObj from './kbn_core_analytics_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index b8b05bc6e6cc7..bcd913a82f047 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-08-28 +date: 2024-08-30 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 95cd78b2ae7de..646a98ab3d49d 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-08-28 +date: 2024-08-30 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 69bd249d910c4..4a351aedabd47 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-08-28 +date: 2024-08-30 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 18a88e2a8fd38..c24a02818f4ed 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-08-28 +date: 2024-08-30 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 d4276bf3cd40b..27276a9f01608 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-08-28 +date: 2024-08-30 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 a34d9c3af2ee2..9f046ca32775a 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-08-28 +date: 2024-08-30 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 d5cc5a16dd78d..4e721b190ba1b 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-08-28 +date: 2024-08-30 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 f6e69dba3ddd1..bc9fed7571f8f 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-08-28 +date: 2024-08-30 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 c5b2b2c6c10aa..72d71c731a673 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-08-28 +date: 2024-08-30 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 cbee46a3e00d3..54a1fa951a099 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-08-28 +date: 2024-08-30 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 a5b484780c408..deab26dbe3e6b 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-08-28 +date: 2024-08-30 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 96f70839a1a8e..8ebc31a0c66eb 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-08-28 +date: 2024-08-30 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 d6aeb02f3a9ea..38fc54662636d 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-08-28 +date: 2024-08-30 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 ecdbe0a8a97b9..18e5a3cd88bcb 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-08-28 +date: 2024-08-30 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 b858fbc32c251..0d5b57d884636 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-08-28 +date: 2024-08-30 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 c7384cdde37b0..9518f3f112092 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-08-28 +date: 2024-08-30 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 f7a56267feff8..7e264c1b6a4f2 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-08-28 +date: 2024-08-30 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 f175b99844757..b837733c7ec3f 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server-mocks'] --- import kbnCoreCapabilitiesServerMocksObj from './kbn_core_capabilities_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser.mdx b/api_docs/kbn_core_chrome_browser.mdx index c6aff68efc4bf..2624d18a17b81 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-08-28 +date: 2024-08-30 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 551f13ffe589b..76dbe22054955 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-08-28 +date: 2024-08-30 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 d0275aff929cb..2db0625bf88db 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-08-28 +date: 2024-08-30 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 25a536421f593..791e7330102bf 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-08-28 +date: 2024-08-30 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 92be11ce0d9dd..035c687013daa 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-08-28 +date: 2024-08-30 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 6b615965140c1..383965acc5f1c 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-08-28 +date: 2024-08-30 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 dd39797af0fe1..2d823e1e761d5 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-08-28 +date: 2024-08-30 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 ec55701cc8320..416ce876c7aac 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-08-28 +date: 2024-08-30 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 7a23d03de9c64..5523840542a44 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-08-28 +date: 2024-08-30 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 684cda6b45772..f63525047461c 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-08-28 +date: 2024-08-30 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 91cd495540d8d..c40c9c49167e9 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-08-28 +date: 2024-08-30 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 d16cbfb4f9cef..93cbb9e2b6c3e 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-08-28 +date: 2024-08-30 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 6112b74587ea8..850200f72ef9b 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-08-28 +date: 2024-08-30 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 65800834b7f79..c11bc63ac99c0 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-08-28 +date: 2024-08-30 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 b6957c01d34d0..8bd8d7f757c9c 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-08-28 +date: 2024-08-30 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 7d96305a8f5bf..2d186d3b20412 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-08-28 +date: 2024-08-30 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 f43997f0850d9..fab9ccaad34d6 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-08-28 +date: 2024-08-30 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 bf99f2c0d51b8..ac963b2cc8e79 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-08-28 +date: 2024-08-30 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 eafad11cc83e5..e2a4a4bde7220 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-08-28 +date: 2024-08-30 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 3357cbaf9f988..ad6ad2856a392 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-08-28 +date: 2024-08-30 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 0c66904878682..a69c880704d70 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-08-28 +date: 2024-08-30 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 14a7a3ffe8ffa..a5c1e95bbcebe 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-08-28 +date: 2024-08-30 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 34fcaff619ff4..6d4406a5f5f70 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-08-28 +date: 2024-08-30 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 27cc50177e1df..48a7259d7182e 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-08-28 +date: 2024-08-30 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 81edbcc14d5eb..4318e9386481c 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-08-28 +date: 2024-08-30 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 cfcd48173846d..825de8b64d45d 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-08-28 +date: 2024-08-30 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 b25665a358f93..2d0b7eec34b98 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-08-28 +date: 2024-08-30 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 a4c1281764377..58b6f0853bf31 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-08-28 +date: 2024-08-30 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 018111bdbeec5..88c88dc50b631 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-08-28 +date: 2024-08-30 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 dfce0734fc32c..f26058dcce5b0 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-08-28 +date: 2024-08-30 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 2e16db121bf9c..609f18f2d9ab1 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-08-28 +date: 2024-08-30 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 7159ffb2b590d..ec68c1b630202 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-08-28 +date: 2024-08-30 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 badd2648e2737..321d900080aec 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-08-28 +date: 2024-08-30 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 f0896078c197c..93c487dd90955 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-08-28 +date: 2024-08-30 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 530318b669614..ab32b1865b2d7 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-08-28 +date: 2024-08-30 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 74854dd8be46e..1759d2098ac02 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-08-28 +date: 2024-08-30 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 20833b44877f0..8e1b77480a46d 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-08-28 +date: 2024-08-30 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 aa38aafffd78b..a684cfc36da92 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-08-28 +date: 2024-08-30 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 7a5463bc654ee..37f25c49f156d 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-08-28 +date: 2024-08-30 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 e05a0d767aab1..4f8378869ec54 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-08-28 +date: 2024-08-30 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 d24999c5e06c4..67dff40579d10 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-08-28 +date: 2024-08-30 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 370f456d1ef4d..7b4b898ce5ea6 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-08-28 +date: 2024-08-30 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 be8f171967154..fff778b862f57 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-08-28 +date: 2024-08-30 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 cf2672ba84ed2..a1affd48e3418 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-08-28 +date: 2024-08-30 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 418dea7be93b6..691d27c4a405d 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-08-28 +date: 2024-08-30 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 a8558849d2124..cce6a55a2c1f1 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-08-28 +date: 2024-08-30 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 14ea14ec33ba3..1ec61a55724b6 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-08-28 +date: 2024-08-30 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 ffdbc1cb5a46a..76db0cd9337e4 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-08-28 +date: 2024-08-30 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 ee12ebb0eb77c..bee7e092d95ca 100644 --- a/api_docs/kbn_core_http_server.devdocs.json +++ b/api_docs/kbn_core_http_server.devdocs.json @@ -9276,6 +9276,10 @@ "plugin": "@kbn/test-suites-xpack", "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/resilient_simulation.ts" }, + { + "plugin": "entityManager", + "path": "x-pack/plugins/observability_solution/entity_manager/server/routes/entities/update.ts" + }, { "plugin": "@kbn/core-http-router-server-internal", "path": "packages/core/http/core-http-router-server-internal/src/router.ts" @@ -15748,6 +15752,10 @@ "plugin": "canvas", "path": "x-pack/plugins/canvas/server/routes/workpad/import.ts" }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/server/routes/functions/functions.ts" + }, { "plugin": "telemetry", "path": "src/plugins/telemetry/server/routes/telemetry_opt_in_stats.ts" diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index 1ab540db53133..c401fa62c1482 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-08-28 +date: 2024-08-30 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 836cd9c2eff11..045ecc84f81c8 100644 --- a/api_docs/kbn_core_http_server_internal.devdocs.json +++ b/api_docs/kbn_core_http_server_internal.devdocs.json @@ -235,9 +235,9 @@ " implements ", { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.IHttpConfig", + "section": "def-server.IHttpConfig", "text": "IHttpConfig" } ], @@ -475,9 +475,9 @@ "signature": [ { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.SslConfig", + "section": "def-server.SslConfig", "text": "SslConfig" } ], diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index 6e3426b9afaec..6dcd45b670e51 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-internal'] --- import kbnCoreHttpServerInternalObj from './kbn_core_http_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_mocks.mdx b/api_docs/kbn_core_http_server_mocks.mdx index bad8c03b5fa44..f3415d3fd2d23 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-08-28 +date: 2024-08-30 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 792de43642544..bafc24ba958af 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-08-28 +date: 2024-08-30 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 79270343d061c..c2fd4aafad134 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-08-28 +date: 2024-08-30 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 9e5c988cb7f50..9e6aad849a1c7 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-08-28 +date: 2024-08-30 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 4dd628e1e5b57..dafe4b7c07a99 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-08-28 +date: 2024-08-30 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 0107a156f9e6e..c798bc272a99b 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-08-28 +date: 2024-08-30 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 8287f47530d1c..8d0bf909007a3 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-08-28 +date: 2024-08-30 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 e21a74a1ddfe0..1f6ca3d9f376c 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-08-28 +date: 2024-08-30 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 b4fce5aad0e41..1660eaadf2aa4 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-08-28 +date: 2024-08-30 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 9c98f40a98cd3..2d8fd0bcb2f82 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-08-28 +date: 2024-08-30 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 95271a5c086d4..8de9ff255cbf5 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-08-28 +date: 2024-08-30 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 37f2666a44707..2ae964ba36006 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-08-28 +date: 2024-08-30 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 1931130826a60..2af3746f0d033 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-08-28 +date: 2024-08-30 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 6e8e8642252be..e6e0c41b63807 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-08-28 +date: 2024-08-30 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 406edf672dce4..9a9f733421c96 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-08-28 +date: 2024-08-30 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 f029973afd55b..402b5cf5f24e4 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-08-28 +date: 2024-08-30 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 3efcdea2d87d5..cc6dc8ac41116 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-internal'] --- import kbnCoreLoggingServerInternalObj from './kbn_core_logging_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_mocks.mdx b/api_docs/kbn_core_logging_server_mocks.mdx index 80c1e7654b05b..8c6efa9bb2da3 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-08-28 +date: 2024-08-30 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 dc5818edcd5bb..8eba53884bdff 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-08-28 +date: 2024-08-30 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 41efb9f3d3a76..3ed0c2c8e290e 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-mocks'] --- import kbnCoreMetricsCollectorsServerMocksObj from './kbn_core_metrics_collectors_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server.mdx b/api_docs/kbn_core_metrics_server.mdx index bd38cd17ab9a5..7def0f0a0e455 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-08-28 +date: 2024-08-30 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 82095bc095b67..f27128a8245c8 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-08-28 +date: 2024-08-30 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 d6dbc2971be62..6b67a37a6cffc 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-08-28 +date: 2024-08-30 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 48e0dac8b4476..59a760adfe678 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-08-28 +date: 2024-08-30 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 d614a588d382d..13a1e7c250228 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-08-28 +date: 2024-08-30 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 5bcc9d4855eea..2a7d27f61f7b3 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-08-28 +date: 2024-08-30 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 c496e437ddd65..525dc9af3cb72 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-08-28 +date: 2024-08-30 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 b3ee49e96ec2f..f1516ff27779a 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-08-28 +date: 2024-08-30 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 a3428555aa936..f5e20d0fdd77e 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-08-28 +date: 2024-08-30 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 a854d85a867c4..8047e23dacd26 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-08-28 +date: 2024-08-30 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 da9425adf1225..f4baf26a83a9c 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-08-28 +date: 2024-08-30 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 3a325e1c71072..c4a99e011f08c 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-08-28 +date: 2024-08-30 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 9fc84b65ede4f..67aad15165721 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-08-28 +date: 2024-08-30 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 f0bdb14aeb912..d412261d3607f 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-08-28 +date: 2024-08-30 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 6955802612659..f76c2c0e6e447 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-08-28 +date: 2024-08-30 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 57faa07885c9b..922f8edc6b157 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-08-28 +date: 2024-08-30 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 692bb2c15fac8..e4fa20ccc9580 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-08-28 +date: 2024-08-30 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 77dd91fbbf0ce..d0924e8c11fe3 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-08-28 +date: 2024-08-30 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 7c72b16ca068a..2879b00943075 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-08-28 +date: 2024-08-30 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 d2ded3b722ac9..0444bbf328f43 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-08-28 +date: 2024-08-30 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 af404bd221e93..4aeb0e9ec967f 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-08-28 +date: 2024-08-30 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 997a326429ff9..ec55f2912c6cd 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-08-28 +date: 2024-08-30 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 b46fba7edecde..c3b4eb838e4ef 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-08-28 +date: 2024-08-30 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 5165aaf21edab..d4b8ace2e7ac5 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-08-28 +date: 2024-08-30 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 dac44ca6f75d9..3182fa462bf2e 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-08-28 +date: 2024-08-30 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 198bfbbe24fa6..25e41a4fff3be 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-08-28 +date: 2024-08-30 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 f317acd39957d..ce931692ad0ff 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-08-28 +date: 2024-08-30 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 21a5ddd714a57..b7722b51463a5 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-08-28 +date: 2024-08-30 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 9ca4a2de768ce..78baee08cad00 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-08-28 +date: 2024-08-30 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 a0a75df94966f..f5e9ddb2c38f2 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-08-28 +date: 2024-08-30 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 cd14eaf5026e5..d651248e326f6 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-08-28 +date: 2024-08-30 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 fb5fdb17d80e8..faad08959fd4e 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-08-28 +date: 2024-08-30 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 b72be56ff0060..a60c651ddeec8 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-08-28 +date: 2024-08-30 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 b1380792df973..79e04520d5b3a 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-08-28 +date: 2024-08-30 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 aa88cbc634c2d..c041f0c5bdea9 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-08-28 +date: 2024-08-30 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 97673afabbad8..71296a7a1cf97 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-08-28 +date: 2024-08-30 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 b3b6e12ba7b14..29bd65eff9547 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-08-28 +date: 2024-08-30 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 5f579232e2d39..7aa6937ada428 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-08-28 +date: 2024-08-30 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.mdx b/api_docs/kbn_core_saved_objects_server.mdx index 7653479ad1ecb..4c22f3833963c 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server'] --- import kbnCoreSavedObjectsServerObj from './kbn_core_saved_objects_server.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server_internal.mdx b/api_docs/kbn_core_saved_objects_server_internal.mdx index e425bfa55ac34..e0068dff8f57d 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-08-28 +date: 2024-08-30 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 e2fb3ec740594..38432bac14838 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-08-28 +date: 2024-08-30 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 88b6f36cc6946..e367fc5a952b2 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-08-28 +date: 2024-08-30 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 2a3aebc435581..afbf93b5b890b 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-08-28 +date: 2024-08-30 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 cc26fd8c73631..453626daff127 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-08-28 +date: 2024-08-30 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 3297057acc7c7..feb56aac8b02b 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-08-28 +date: 2024-08-30 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 543524b63305d..2d2f2929fa20c 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-08-28 +date: 2024-08-30 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.mdx b/api_docs/kbn_core_security_server.mdx index 584f329b21ec4..7f1d5f8be11cb 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-server'] --- import kbnCoreSecurityServerObj from './kbn_core_security_server.devdocs.json'; diff --git a/api_docs/kbn_core_security_server_internal.mdx b/api_docs/kbn_core_security_server_internal.mdx index 9472c1f24457b..842d0d5fc4f31 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-08-28 +date: 2024-08-30 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.mdx b/api_docs/kbn_core_security_server_mocks.mdx index bf264bdc7e0e6..5bf8a3142385f 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-server-mocks'] --- import kbnCoreSecurityServerMocksObj from './kbn_core_security_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_status_common.mdx b/api_docs/kbn_core_status_common.mdx index d172e33dcafe2..10c8dba7be79c 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-08-28 +date: 2024-08-30 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 288a424afa3f8..d792aa5e991dd 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-08-28 +date: 2024-08-30 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 6f68ff77ea38f..a363a016440fd 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-08-28 +date: 2024-08-30 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 ce320e5f20d56..2cbbd066a9fe7 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-08-28 +date: 2024-08-30 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 c992a9c235b41..f9c5c45e2af62 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-08-28 +date: 2024-08-30 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 2da48e25be7cf..774309c8268cc 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-08-28 +date: 2024-08-30 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 c0e734d159b5f..1118bb769df86 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-08-28 +date: 2024-08-30 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 45292df02aca0..4f852d920d5b1 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-08-28 +date: 2024-08-30 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 b6c4739e27ad8..f152f1c0051ff 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-08-28 +date: 2024-08-30 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 1a4deebdb378f..41b5bcb11fe59 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-08-28 +date: 2024-08-30 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 224723cdcbb6c..e256ab3448079 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-08-28 +date: 2024-08-30 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 3cc640b4c08eb..bd4ff19126842 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-08-28 +date: 2024-08-30 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 9099b3d43e893..686e573b3d2fe 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-08-28 +date: 2024-08-30 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 a5d2a8ec33bbd..d00309f6d9119 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-08-28 +date: 2024-08-30 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 d17aebd70db2b..c914af44aea17 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-08-28 +date: 2024-08-30 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 9485653394f53..c2641ebaff02e 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-08-28 +date: 2024-08-30 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 1b969d568a59a..f76f48c952566 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-08-28 +date: 2024-08-30 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 5597c2c209f6b..8093801f31d1c 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-08-28 +date: 2024-08-30 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 20c024e2febd2..32ea9d3cf1ab1 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-08-28 +date: 2024-08-30 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 29a179c899e31..a79218695fde1 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-08-28 +date: 2024-08-30 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 662bf78ad8465..6a81699f3140a 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-08-28 +date: 2024-08-30 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 f0f322c51d730..803241fd3737c 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-08-28 +date: 2024-08-30 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 3d5f8fa2fcaf8..950dc61d68173 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-08-28 +date: 2024-08-30 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 654726bd50325..757484f750213 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-08-28 +date: 2024-08-30 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 2336420fa4dad..05b3a69cb9a86 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-08-28 +date: 2024-08-30 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 7951a3ae07da1..77c485a1e315a 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-08-28 +date: 2024-08-30 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 9193181fad1af..e065e671af4f7 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-08-28 +date: 2024-08-30 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 b0b5242c25ec9..e46c6905c6f5b 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-08-28 +date: 2024-08-30 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 6ae08b4be8463..b3d775561d2e1 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-08-28 +date: 2024-08-30 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 4b7b54ea394de..0dc074901c4dd 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-08-28 +date: 2024-08-30 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 8a3a8025000eb..4a6347b55861a 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-08-28 +date: 2024-08-30 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 764276d27b8db..2ffb3e7452285 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-08-28 +date: 2024-08-30 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 39d96d1757ba9..c027a895cfb67 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-08-28 +date: 2024-08-30 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 ed996e09acc1a..e68e2fe22a7e9 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-08-28 +date: 2024-08-30 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 9e2004b524340..32691e3e79b14 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-08-28 +date: 2024-08-30 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 416223d95dff9..911420b199c29 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-08-28 +date: 2024-08-30 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 1951970a4e600..0c7dba2d74417 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-08-28 +date: 2024-08-30 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 b2cdf90117c4d..83282d336b4bc 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-08-28 +date: 2024-08-30 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 7545675daa5d1..573baab544b60 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-08-28 +date: 2024-08-30 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 d977297f068dd..d00024ebb3a98 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-stream-adapter'] --- import kbnDataStreamAdapterObj from './kbn_data_stream_adapter.devdocs.json'; diff --git a/api_docs/kbn_data_view_utils.mdx b/api_docs/kbn_data_view_utils.mdx index 397ca58e9b5e1..9ea313ed96183 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-view-utils'] --- import kbnDataViewUtilsObj from './kbn_data_view_utils.devdocs.json'; diff --git a/api_docs/kbn_datemath.mdx b/api_docs/kbn_datemath.mdx index cd49dfc2bbbf1..34d6618024c1b 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-08-28 +date: 2024-08-30 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 7ec3a5111d5e2..315e53d568769 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-08-28 +date: 2024-08-30 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 7650db8eced29..54b40d76657c4 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-08-28 +date: 2024-08-30 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 53e10c7ad8b6a..e447f63c9ed3b 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-fleet'] --- import kbnDeeplinksFleetObj from './kbn_deeplinks_fleet.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_management.mdx b/api_docs/kbn_deeplinks_management.mdx index 04273d2e74009..75a78441b32ff 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-08-28 +date: 2024-08-30 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 e910162389382..fab2cc7e373e2 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-ml'] --- import kbnDeeplinksMlObj from './kbn_deeplinks_ml.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_observability.mdx b/api_docs/kbn_deeplinks_observability.mdx index fbcccee7c5578..1209422cd5f25 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-observability'] --- import kbnDeeplinksObservabilityObj from './kbn_deeplinks_observability.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_search.mdx b/api_docs/kbn_deeplinks_search.mdx index 2f28908786484..cf15b643db7d8 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-08-28 +date: 2024-08-30 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 781756df9673a..12cc6ffc4ed1d 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-08-28 +date: 2024-08-30 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 51a32ec8b9f9b..004fc8175082b 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-08-28 +date: 2024-08-30 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 8ccd219a8d75c..e5823e81277f9 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-08-28 +date: 2024-08-30 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 168b999260a3e..117c670264628 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-08-28 +date: 2024-08-30 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 33fbe27177d4f..a52cf68ad21f1 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-08-28 +date: 2024-08-30 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 62c60440adc52..cbb491a535221 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-08-28 +date: 2024-08-30 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 b475ba870854b..5b0653ac15de3 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-08-28 +date: 2024-08-30 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 d18a98a759d93..421441eab8cca 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-08-28 +date: 2024-08-30 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 3d6a525ce7811..827ae84686a49 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-08-28 +date: 2024-08-30 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 42ad7434be3b3..249e7c4372c82 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-08-28 +date: 2024-08-30 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 92d0ab87171df..98aff44a2947f 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/discover-utils'] --- import kbnDiscoverUtilsObj from './kbn_discover_utils.devdocs.json'; diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index e556d035ffccf..12badce084c81 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-08-28 +date: 2024-08-30 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 c7a6c2354032e..45f830fdaba83 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-08-28 +date: 2024-08-30 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.devdocs.json b/api_docs/kbn_dom_drag_drop.devdocs.json index 434b89203c86e..4112bf83a67b0 100644 --- a/api_docs/kbn_dom_drag_drop.devdocs.json +++ b/api_docs/kbn_dom_drag_drop.devdocs.json @@ -159,7 +159,13 @@ ], "signature": [ "(props: ", - "DroppableProps", + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DroppableProps", + "text": "DroppableProps" + }, ") => JSX.Element" ], "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", @@ -174,7 +180,13 @@ "label": "props", "description": [], "signature": [ - "DroppableProps" + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DroppableProps", + "text": "DroppableProps" + } ], "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", "deprecated": false, @@ -528,6 +540,322 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps", + "type": "Interface", + "tags": [], + "label": "DroppableProps", + "description": [ + "\nThe base props to the Droppable component." + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.className", + "type": "string", + "tags": [], + "label": "className", + "description": [ + "\nThe CSS class(es) for the root element." + ], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.onDrop", + "type": "Function", + "tags": [], + "label": "onDrop", + "description": [ + "\nThe event handler that fires when an item\nis dropped onto this Droppable component." + ], + "signature": [ + "DropHandler", + " | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.value", + "type": "CompoundType", + "tags": [], + "label": "value", + "description": [ + "\nThe value associated with this item." + ], + "signature": [ + "Record & { id: string; humanData: ", + "HumanData", + "; }" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.children", + "type": "Object", + "tags": [], + "label": "children", + "description": [ + "\nThe React element which will be passed the draggable handlers" + ], + "signature": [ + "React.ReactElement>" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.isDisabled", + "type": "CompoundType", + "tags": [], + "label": "isDisabled", + "description": [ + "\nDisable any drag & drop behaviour" + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.getAdditionalClassesOnEnter", + "type": "Function", + "tags": [], + "label": "getAdditionalClassesOnEnter", + "description": [ + "\nAdditional class names to apply when another element is over the drop target" + ], + "signature": [ + "((dropType?: ", + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DropType", + "text": "DropType" + }, + " | undefined) => string | undefined) | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.getAdditionalClassesOnEnter.$1", + "type": "CompoundType", + "tags": [], + "label": "dropType", + "description": [], + "signature": [ + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DropType", + "text": "DropType" + }, + " | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.getAdditionalClassesOnDroppable", + "type": "Function", + "tags": [], + "label": "getAdditionalClassesOnDroppable", + "description": [ + "\nAdditional class names to apply when another element is droppable for a currently dragged item" + ], + "signature": [ + "((dropType?: ", + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DropType", + "text": "DropType" + }, + " | undefined) => string | undefined) | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.getAdditionalClassesOnDroppable.$1", + "type": "CompoundType", + "tags": [], + "label": "dropType", + "description": [], + "signature": [ + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DropType", + "text": "DropType" + }, + " | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.dataTestSubj", + "type": "string", + "tags": [], + "label": "dataTestSubj", + "description": [ + "\nThe optional test subject associated with this DOM element." + ], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.reorderableGroup", + "type": "Array", + "tags": [], + "label": "reorderableGroup", + "description": [ + "\nitems belonging to the same group that can be reordered" + ], + "signature": [ + "{ id: string; }[] | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.dropTypes", + "type": "Array", + "tags": [], + "label": "dropTypes", + "description": [ + "\nIndicates the type of drop targets - when undefined, the currently dragged item\ncannot be dropped onto this component." + ], + "signature": [ + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DropType", + "text": "DropType" + }, + "[] | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.order", + "type": "Array", + "tags": [], + "label": "order", + "description": [ + "\nOrder for keyboard dragging. This takes an array of numbers which will be used to order hierarchically" + ], + "signature": [ + "number[]" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.getCustomDropTarget", + "type": "Function", + "tags": [], + "label": "getCustomDropTarget", + "description": [ + "\nExtra drop targets by dropType" + ], + "signature": [ + "((dropType: ", + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DropType", + "text": "DropType" + }, + ") => React.ReactElement> | null) | undefined" + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/dom-drag-drop", + "id": "def-common.DroppableProps.getCustomDropTarget.$1", + "type": "CompoundType", + "tags": [], + "label": "dropType", + "description": [], + "signature": [ + { + "pluginId": "@kbn/dom-drag-drop", + "scope": "common", + "docId": "kibKbnDomDragDropPluginApi", + "section": "def-common.DropType", + "text": "DropType" + } + ], + "path": "packages/kbn-dom-drag-drop/src/droppable.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false } ], "enums": [], diff --git a/api_docs/kbn_dom_drag_drop.mdx b/api_docs/kbn_dom_drag_drop.mdx index 9e18a8b293bd6..cffda33786f4b 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dom-drag-drop'] --- import kbnDomDragDropObj from './kbn_dom_drag_drop.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 | |-------------------|-----------|------------------------|-----------------| -| 41 | 0 | 27 | 6 | +| 57 | 0 | 30 | 6 | ## Common diff --git a/api_docs/kbn_ebt_tools.devdocs.json b/api_docs/kbn_ebt_tools.devdocs.json index 4accaa3356967..a7441d35b485e 100644 --- a/api_docs/kbn_ebt_tools.devdocs.json +++ b/api_docs/kbn_ebt_tools.devdocs.json @@ -166,6 +166,65 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/ebt-tools", + "id": "def-common.usePageReady", + "type": "Function", + "tags": [], + "label": "usePageReady", + "description": [], + "signature": [ + "(state: { customMetrics?: ", + "CustomMetrics", + " | undefined; isReady: boolean; }) => void" + ], + "path": "packages/kbn-ebt-tools/src/performance_metrics/context/use_page_ready.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/ebt-tools", + "id": "def-common.usePageReady.$1", + "type": "Object", + "tags": [], + "label": "state", + "description": [], + "path": "packages/kbn-ebt-tools/src/performance_metrics/context/use_page_ready.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/ebt-tools", + "id": "def-common.usePageReady.$1.customMetrics", + "type": "Object", + "tags": [], + "label": "customMetrics", + "description": [], + "signature": [ + "CustomMetrics", + " | undefined" + ], + "path": "packages/kbn-ebt-tools/src/performance_metrics/context/use_page_ready.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ebt-tools", + "id": "def-common.usePageReady.$1.isReady", + "type": "boolean", + "tags": [], + "label": "isReady", + "description": [], + "path": "packages/kbn-ebt-tools/src/performance_metrics/context/use_page_ready.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/ebt-tools", "id": "def-common.usePerformanceContext", diff --git a/api_docs/kbn_ebt_tools.mdx b/api_docs/kbn_ebt_tools.mdx index 0a4a2b0f68df2..5bc4daf1c0d77 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ebt-tools'] --- import kbnEbtToolsObj from './kbn_ebt_tools.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 | |-------------------|-----------|------------------------|-----------------| -| 33 | 0 | 24 | 1 | +| 37 | 0 | 28 | 2 | ## Common diff --git a/api_docs/kbn_ecs_data_quality_dashboard.devdocs.json b/api_docs/kbn_ecs_data_quality_dashboard.devdocs.json index 031d3c58d56f4..a74c5506b1f6a 100644 --- a/api_docs/kbn_ecs_data_quality_dashboard.devdocs.json +++ b/api_docs/kbn_ecs_data_quality_dashboard.devdocs.json @@ -159,6 +159,21 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/ecs-data-quality-dashboard", + "id": "def-public.ECS_FIELD_REFERENCE_URL", + "type": "string", + "tags": [], + "label": "ECS_FIELD_REFERENCE_URL", + "description": [], + "signature": [ + "\"https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html\"" + ], + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/ecs-data-quality-dashboard", "id": "def-public.ECS_REFERENCE_URL", @@ -171,7 +186,7 @@ "signature": [ "\"https://www.elastic.co/guide/en/ecs/current/ecs-reference.html\"" ], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_properties/markdown/helpers.ts", + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -204,6 +219,21 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/ecs-data-quality-dashboard", + "id": "def-public.MAPPING_URL", + "type": "string", + "tags": [], + "label": "MAPPING_URL", + "description": [], + "signature": [ + "\"https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html\"" + ], + "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/ecs-data-quality-dashboard", "id": "def-public.SELECT_ONE_OR_MORE_ILM_PHASES", diff --git a/api_docs/kbn_ecs_data_quality_dashboard.mdx b/api_docs/kbn_ecs_data_quality_dashboard.mdx index 0ee7b804eccd6..ed9609f9ca4da 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ecs-data-quality-dashboard'] --- import kbnEcsDataQualityDashboardObj from './kbn_ecs_data_quality_dashboard.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/security-threat-hunting-explore](https://github.com/orgs/elast | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 14 | 0 | 6 | 0 | +| 16 | 0 | 8 | 0 | ## Client diff --git a/api_docs/kbn_elastic_agent_utils.mdx b/api_docs/kbn_elastic_agent_utils.mdx index e562d4ef205bd..8715e808234c3 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-08-28 +date: 2024-08-30 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 20c093d04b03f..6e8752766e365 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-assistant'] --- import kbnElasticAssistantObj from './kbn_elastic_assistant.devdocs.json'; diff --git a/api_docs/kbn_elastic_assistant_common.devdocs.json b/api_docs/kbn_elastic_assistant_common.devdocs.json index 22e41b3b3c6c7..b30a7523fd7fd 100644 --- a/api_docs/kbn_elastic_assistant_common.devdocs.json +++ b/api_docs/kbn_elastic_assistant_common.devdocs.json @@ -1169,7 +1169,7 @@ "label": "ChatCompleteProps", "description": [], "signature": [ - "{ connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; responseLanguage?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; }" + "{ connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; responseLanguage?: string | undefined; }" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts", "deprecated": false, @@ -1184,7 +1184,7 @@ "label": "ChatCompleteRequestBody", "description": [], "signature": [ - "{ connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; responseLanguage?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; }" + "{ connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; responseLanguage?: string | undefined; }" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts", "deprecated": false, @@ -1199,7 +1199,7 @@ "label": "ChatCompleteRequestBodyInput", "description": [], "signature": [ - "{ connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; responseLanguage?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; }" + "{ connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; responseLanguage?: string | undefined; }" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts", "deprecated": false, @@ -3738,7 +3738,7 @@ "label": "ChatCompleteProps", "description": [], "signature": [ - "Zod.ZodObject<{ conversationId: Zod.ZodOptional; promptId: Zod.ZodOptional; isStream: Zod.ZodOptional; responseLanguage: Zod.ZodOptional; langSmithProject: Zod.ZodOptional; langSmithApiKey: Zod.ZodOptional; connectorId: Zod.ZodString; model: Zod.ZodOptional; persist: Zod.ZodBoolean; messages: Zod.ZodArray; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; data: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; fields_to_anonymize: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; responseLanguage?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; }, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; responseLanguage?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; }>" + "Zod.ZodObject<{ conversationId: Zod.ZodOptional; promptId: Zod.ZodOptional; isStream: Zod.ZodOptional; responseLanguage: Zod.ZodOptional; langSmithProject: Zod.ZodOptional; langSmithApiKey: Zod.ZodOptional; connectorId: Zod.ZodString; model: Zod.ZodOptional; persist: Zod.ZodBoolean; messages: Zod.ZodArray; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; data: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; fields_to_anonymize: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; responseLanguage?: string | undefined; }, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; responseLanguage?: string | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts", "deprecated": false, @@ -3753,7 +3753,7 @@ "label": "ChatCompleteRequestBody", "description": [], "signature": [ - "Zod.ZodObject<{ conversationId: Zod.ZodOptional; promptId: Zod.ZodOptional; isStream: Zod.ZodOptional; responseLanguage: Zod.ZodOptional; langSmithProject: Zod.ZodOptional; langSmithApiKey: Zod.ZodOptional; connectorId: Zod.ZodString; model: Zod.ZodOptional; persist: Zod.ZodBoolean; messages: Zod.ZodArray; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; data: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; fields_to_anonymize: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; responseLanguage?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; }, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; responseLanguage?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; }>" + "Zod.ZodObject<{ conversationId: Zod.ZodOptional; promptId: Zod.ZodOptional; isStream: Zod.ZodOptional; responseLanguage: Zod.ZodOptional; langSmithProject: Zod.ZodOptional; langSmithApiKey: Zod.ZodOptional; connectorId: Zod.ZodString; model: Zod.ZodOptional; persist: Zod.ZodBoolean; messages: Zod.ZodArray; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; data: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; fields_to_anonymize: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }, { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; responseLanguage?: string | undefined; }, { connectorId: string; persist: boolean; messages: { role: \"user\" | \"system\" | \"assistant\"; data?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; content?: string | undefined; fields_to_anonymize?: string[] | undefined; }[]; conversationId?: string | undefined; model?: string | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; promptId?: string | undefined; isStream?: boolean | undefined; responseLanguage?: string | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/chat/post_chat_complete_route.gen.ts", "deprecated": false, diff --git a/api_docs/kbn_elastic_assistant_common.mdx b/api_docs/kbn_elastic_assistant_common.mdx index 8e3c9ddee6d9a..1719fbb46250d 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-08-28 +date: 2024-08-30 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 f27af1ce315d9..dfec5906e2eab 100644 --- a/api_docs/kbn_entities_schema.devdocs.json +++ b/api_docs/kbn_entities_schema.devdocs.json @@ -194,7 +194,7 @@ "label": "DeleteEntityDefinitionQuery", "description": [], "signature": [ - "{ deleteData?: boolean | undefined; }" + "{ deleteData: boolean; }" ], "path": "x-pack/packages/kbn-entities-schema/src/rest_spec/delete.ts", "deprecated": false, @@ -284,6 +284,29 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/entities-schema", + "id": "def-common.EntityDefinitionUpdate", + "type": "Type", + "tags": [], + "label": "EntityDefinitionUpdate", + "description": [], + "signature": [ + "{ version: string; type?: string | undefined; filter?: string | undefined; name?: string | undefined; description?: string | undefined; history?: { interval?: string | undefined; settings?: { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; } | undefined; timestampField?: string | undefined; } | undefined; metrics?: { name: string; metrics: ({ name: string; field: string; aggregation: ", + { + "pluginId": "@kbn/entities-schema", + "scope": "common", + "docId": "kibKbnEntitiesSchemaPluginApi", + "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; indexPatterns?: string[] | undefined; metadata?: ({ destination: string; limit: number; source: string; } | { source: string; destination: string; limit: number; })[] | undefined; latest?: { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; } | undefined; identityFields?: ({ field: string; optional: boolean; } | { field: string; optional: boolean; })[] | undefined; displayNameTemplate?: string | undefined; staticFields?: Record | undefined; }" + ], + "path": "x-pack/packages/kbn-entities-schema/src/schema/entity_definition.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/entities-schema", "id": "def-common.KeyMetric", @@ -417,7 +440,7 @@ "label": "createEntityDefinitionQuerySchema", "description": [], "signature": [ - "Zod.ZodObject<{ installOnly: Zod.ZodDefault>; }, \"strip\", Zod.ZodTypeAny, { installOnly: boolean; }, { installOnly?: boolean | undefined; }>" + "Zod.ZodObject<{ installOnly: Zod.ZodDefault, Zod.ZodBoolean]>, boolean, boolean | \"true\" | \"false\">>>; }, \"strip\", Zod.ZodTypeAny, { installOnly: boolean; }, { installOnly?: boolean | \"true\" | \"false\" | undefined; }>" ], "path": "x-pack/packages/kbn-entities-schema/src/rest_spec/create.ts", "deprecated": false, @@ -447,7 +470,7 @@ "label": "deleteEntityDefinitionQuerySchema", "description": [], "signature": [ - "Zod.ZodObject<{ deleteData: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { deleteData?: boolean | undefined; }, { deleteData?: boolean | undefined; }>" + "Zod.ZodObject<{ deleteData: Zod.ZodDefault, Zod.ZodBoolean]>, boolean, boolean | \"true\" | \"false\">>>; }, \"strip\", Zod.ZodTypeAny, { deleteData: boolean; }, { deleteData?: boolean | \"true\" | \"false\" | undefined; }>" ], "path": "x-pack/packages/kbn-entities-schema/src/rest_spec/delete.ts", "deprecated": false, @@ -570,6 +593,77 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/entities-schema", + "id": "def-common.entityDefinitionUpdateSchema", + "type": "Object", + "tags": [], + "label": "entityDefinitionUpdateSchema", + "description": [], + "signature": [ + "Zod.ZodObject; filter: Zod.ZodOptional>; version: Zod.ZodOptional>; name: Zod.ZodOptional; description: Zod.ZodOptional>; history: Zod.ZodOptional; settings: Zod.ZodEffects; syncDelay: Zod.ZodOptional; lookbackPeriod: Zod.ZodDefault>; frequency: Zod.ZodOptional; backfillSyncDelay: Zod.ZodOptional; backfillLookbackPeriod: Zod.ZodOptional; backfillFrequency: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }, { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }>>, { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }, { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; } | undefined>; }, \"strip\", Zod.ZodTypeAny, { interval: string; settings: { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }; timestampField: string; }, { interval: string; timestampField: string; settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; } | undefined; }>>; metrics: Zod.ZodOptional; field: Zod.ZodString; filter: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { name: string; field: string; aggregation: ", + { + "pluginId": "@kbn/entities-schema", + "scope": "common", + "docId": "kibKbnEntitiesSchemaPluginApi", + "section": "def-common.BasicAggregations", + "text": "BasicAggregations" + }, + "; filter?: string | undefined; }, { name: string; field: string; aggregation: ", + { + "pluginId": "@kbn/entities-schema", + "scope": "common", + "docId": "kibKbnEntitiesSchemaPluginApi", + "section": "def-common.BasicAggregations", + "text": "BasicAggregations" + }, + "; filter?: string | undefined; }>, Zod.ZodObject<{ name: Zod.ZodString; aggregation: Zod.ZodLiteral<\"doc_count\">; filter: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { name: string; aggregation: \"doc_count\"; filter?: string | undefined; }, { name: string; aggregation: \"doc_count\"; filter?: string | undefined; }>, Zod.ZodObject<{ name: Zod.ZodString; aggregation: Zod.ZodLiteral<\"percentile\">; field: Zod.ZodString; percentile: Zod.ZodNumber; filter: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { name: string; field: string; percentile: number; aggregation: \"percentile\"; filter?: string | undefined; }, { name: string; field: string; percentile: number; aggregation: \"percentile\"; filter?: string | undefined; }>]>, \"many\">; equation: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { name: string; metrics: ({ name: string; field: string; aggregation: ", + { + "pluginId": "@kbn/entities-schema", + "scope": "common", + "docId": "kibKbnEntitiesSchemaPluginApi", + "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; }, { name: string; metrics: ({ name: string; field: string; aggregation: ", + { + "pluginId": "@kbn/entities-schema", + "scope": "common", + "docId": "kibKbnEntitiesSchemaPluginApi", + "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; }>, \"many\">>>; indexPatterns: Zod.ZodOptional>; metadata: Zod.ZodOptional; limit: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { source: string; limit?: number | undefined; destination?: string | undefined; }, { source: string; limit?: number | undefined; destination?: string | undefined; }>, { destination: string; limit: number; source: string; }, { source: string; limit?: number | undefined; destination?: string | undefined; }>, Zod.ZodEffects]>, { destination: string; limit: number; source: string; } | { source: string; destination: string; limit: number; }, string | { source: string; limit?: number | undefined; destination?: string | undefined; }>, \"many\">>>; latest: Zod.ZodOptional; syncDelay: Zod.ZodOptional; frequency: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; }, { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; }, { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; }>>>; identityFields: Zod.ZodOptional, Zod.ZodEffects]>, \"many\">>; displayNameTemplate: Zod.ZodOptional; staticFields: Zod.ZodOptional>>; }, { history: Zod.ZodOptional; interval: Zod.ZodOptional>; settings: Zod.ZodOptional; syncDelay: Zod.ZodOptional; lookbackPeriod: Zod.ZodDefault>; frequency: Zod.ZodOptional; backfillSyncDelay: Zod.ZodOptional; backfillLookbackPeriod: Zod.ZodOptional; backfillFrequency: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }, { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }>>, { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; }, { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; } | undefined>>; }, \"strip\", Zod.ZodTypeAny, { interval?: string | undefined; settings?: { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; } | undefined; timestampField?: string | undefined; }, { interval?: string | undefined; settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; } | undefined; timestampField?: string | undefined; }>>; version: Zod.ZodEffects; }>, \"strip\", Zod.ZodTypeAny, { version: string; type?: string | undefined; filter?: string | undefined; name?: string | undefined; description?: string | undefined; history?: { interval?: string | undefined; settings?: { lookbackPeriod: string; frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; } | undefined; timestampField?: string | undefined; } | undefined; metrics?: { name: string; metrics: ({ name: string; field: string; aggregation: ", + { + "pluginId": "@kbn/entities-schema", + "scope": "common", + "docId": "kibKbnEntitiesSchemaPluginApi", + "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; indexPatterns?: string[] | undefined; metadata?: ({ destination: string; limit: number; source: string; } | { source: string; destination: string; limit: number; })[] | undefined; latest?: { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; } | undefined; identityFields?: ({ field: string; optional: boolean; } | { field: string; optional: boolean; })[] | undefined; displayNameTemplate?: string | undefined; staticFields?: Record | undefined; }, { version: string; type?: string | undefined; filter?: string | undefined; name?: string | undefined; description?: string | undefined; history?: { interval?: string | undefined; settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; lookbackPeriod?: string | undefined; backfillSyncDelay?: string | undefined; backfillLookbackPeriod?: string | undefined; backfillFrequency?: string | undefined; } | undefined; timestampField?: string | undefined; } | undefined; metrics?: { name: string; metrics: ({ name: string; field: string; aggregation: ", + { + "pluginId": "@kbn/entities-schema", + "scope": "common", + "docId": "kibKbnEntitiesSchemaPluginApi", + "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; indexPatterns?: string[] | undefined; metadata?: (string | { source: string; limit?: number | undefined; destination?: string | undefined; })[] | undefined; latest?: { settings?: { frequency?: string | undefined; syncDelay?: string | undefined; syncField?: string | undefined; } | undefined; } | undefined; identityFields?: (string | { field: string; optional: boolean; })[] | undefined; displayNameTemplate?: string | undefined; staticFields?: Record | undefined; }>" + ], + "path": "x-pack/packages/kbn-entities-schema/src/schema/entity_definition.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/entities-schema", "id": "def-common.entityHistorySchema", diff --git a/api_docs/kbn_entities_schema.mdx b/api_docs/kbn_entities_schema.mdx index b89d5148b988b..7f8acdb3f506c 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/entities-schema'] --- import kbnEntitiesSchemaObj from './kbn_entities_schema.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-entities](https://github.com/orgs/elastic/teams/obs-entiti | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 41 | 0 | 41 | 0 | +| 43 | 0 | 43 | 0 | ## Common diff --git a/api_docs/kbn_es.mdx b/api_docs/kbn_es.mdx index 245ea9bf73a0e..7c63db2093b26 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-08-28 +date: 2024-08-30 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 86e8b70002c49..70284e5d9d5a4 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-08-28 +date: 2024-08-30 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 e1d296b7125c3..ce11a49089aab 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-08-28 +date: 2024-08-30 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 30af1ba231576..3418fe84ef2da 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-08-28 +date: 2024-08-30 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 4c30b942444ec..19a63c3330cd0 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-08-28 +date: 2024-08-30 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 22c59b964d8a6..16dc4e977eae3 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/eslint-plugin-imports'] --- import kbnEslintPluginImportsObj from './kbn_eslint_plugin_imports.devdocs.json'; diff --git a/api_docs/kbn_esql_ast.mdx b/api_docs/kbn_esql_ast.mdx index 36beadace825e..0975beb293a32 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-ast'] --- import kbnEsqlAstObj from './kbn_esql_ast.devdocs.json'; diff --git a/api_docs/kbn_esql_utils.mdx b/api_docs/kbn_esql_utils.mdx index 7fa5810114eb6..d1c26bbd79078 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-utils'] --- import kbnEsqlUtilsObj from './kbn_esql_utils.devdocs.json'; diff --git a/api_docs/kbn_esql_validation_autocomplete.mdx b/api_docs/kbn_esql_validation_autocomplete.mdx index 4971ec6172e76..988d810818c42 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-08-28 +date: 2024-08-30 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 7bfe45b1a9535..c2d16553ab129 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-08-28 +date: 2024-08-30 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.devdocs.json b/api_docs/kbn_event_annotation_components.devdocs.json index b17e02bb66ce2..840ff9690d6ef 100644 --- a/api_docs/kbn_event_annotation_components.devdocs.json +++ b/api_docs/kbn_event_annotation_components.devdocs.json @@ -924,9 +924,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "<", diff --git a/api_docs/kbn_event_annotation_components.mdx b/api_docs/kbn_event_annotation_components.mdx index 854949d74dfa2..673079bae1a0a 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-08-28 +date: 2024-08-30 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 9b62929ad6548..2d5423ea25a8b 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-08-28 +date: 2024-08-30 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 5c1883bbac54e..99b4fe85a1d55 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-08-28 +date: 2024-08-30 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 94f9fc46a637b..a62a7793f6cc4 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-08-28 +date: 2024-08-30 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 b2ce9bbaec8c2..5f567025a04bb 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-08-28 +date: 2024-08-30 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 42a98d9c2eb22..eb680b7207bc2 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-08-28 +date: 2024-08-30 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 4272125d080fb..2ce3315d57466 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-08-28 +date: 2024-08-30 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 dfd28c9c395ad..19aed9a9cf12d 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-08-28 +date: 2024-08-30 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 59c49ff53845e..e0bd2be7ccf57 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-08-28 +date: 2024-08-30 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 afafdb650f309..93a41e563da55 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-08-28 +date: 2024-08-30 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 ed72548c5bf7b..8d75dc7cb41f2 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate-csv'] --- import kbnGenerateCsvObj from './kbn_generate_csv.devdocs.json'; diff --git a/api_docs/kbn_grid_layout.mdx b/api_docs/kbn_grid_layout.mdx index e2f8c291f1d1b..ec3bbf4426a04 100644 --- a/api_docs/kbn_grid_layout.mdx +++ b/api_docs/kbn_grid_layout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-grid-layout title: "@kbn/grid-layout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/grid-layout plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/grid-layout'] --- import kbnGridLayoutObj from './kbn_grid_layout.devdocs.json'; diff --git a/api_docs/kbn_grouping.devdocs.json b/api_docs/kbn_grouping.devdocs.json index be6c1495f9a0b..545bf1de1263c 100644 --- a/api_docs/kbn_grouping.devdocs.json +++ b/api_docs/kbn_grouping.devdocs.json @@ -108,7 +108,9 @@ "\nHook to configure grouping component" ], "signature": [ - "({ componentProps, defaultGroupingOptions, fields, groupingId, maxGroupingLevels, onGroupChange, onOptionsChange, tracker, title, }: GroupingArgs) => ", + "({ componentProps, defaultGroupingOptions, fields, groupingId, maxGroupingLevels, onGroupChange, onOptionsChange, tracker, title, }: ", + "GroupingArgs", + ") => ", "UseGrouping", "" ], @@ -124,7 +126,8 @@ "label": "{\n componentProps,\n defaultGroupingOptions,\n fields,\n groupingId,\n maxGroupingLevels,\n onGroupChange,\n onOptionsChange,\n tracker,\n title,\n}", "description": [], "signature": [ - "GroupingArgs" + "GroupingArgs", + "" ], "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 c2c45ba88a575..f37616221f432 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-08-28 +date: 2024-08-30 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 | 10 | +| 17 | 0 | 12 | 11 | ## Common diff --git a/api_docs/kbn_guided_onboarding.mdx b/api_docs/kbn_guided_onboarding.mdx index 58df0ed970eb1..636fb3c401918 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-08-28 +date: 2024-08-30 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 0a1b39f4a0c60..ce4b06d82556b 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-08-28 +date: 2024-08-30 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 65c871a13d134..2a1938bccda85 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-08-28 +date: 2024-08-30 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 efd824d1811f8..b666965b0b417 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-08-28 +date: 2024-08-30 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 3d3305b11f6af..04577374470c1 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-08-28 +date: 2024-08-30 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 83a2889828c12..4b5f5c99a9217 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-08-28 +date: 2024-08-30 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 c7ca6f32453b2..ccc972ed75049 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-08-28 +date: 2024-08-30 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 5f0b7eb29c69f..e3e7d436c91d1 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-08-28 +date: 2024-08-30 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 bb7124a658f55..8842654d41e0c 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-08-28 +date: 2024-08-30 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 c87426cbfa4d4..f9b30387c2f02 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-08-28 +date: 2024-08-30 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 32e76aaf49895..77573c49cbffe 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-08-28 +date: 2024-08-30 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 d2ec413ca47f7..0dc8d9e0e8e6a 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-08-28 +date: 2024-08-30 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 7eb1d0ce6bc67..006e34c764a3c 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/interpreter'] --- import kbnInterpreterObj from './kbn_interpreter.devdocs.json'; diff --git a/api_docs/kbn_investigation_shared.devdocs.json b/api_docs/kbn_investigation_shared.devdocs.json index cf946715b36b0..e785c44f633f7 100644 --- a/api_docs/kbn_investigation_shared.devdocs.json +++ b/api_docs/kbn_investigation_shared.devdocs.json @@ -30,7 +30,7 @@ "label": "CreateInvestigationItemParams", "description": [], "signature": [ - "{ title: string; type: \"esql\"; params: { esql: string; suggestion: any; }; }" + "{ title: string; type: string; params: { [x: string]: any; }; }" ], "path": "packages/kbn-investigation-shared/src/rest_specs/create_item.ts", "deprecated": false, @@ -45,7 +45,7 @@ "label": "CreateInvestigationItemResponse", "description": [], "signature": [ - "{ id: string; createdAt: number; createdBy: string; } & { title: string; type: \"esql\"; params: { esql: string; suggestion: any; }; }" + "{ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; }" ], "path": "packages/kbn-investigation-shared/src/rest_specs/create_item.ts", "deprecated": false, @@ -105,7 +105,7 @@ "label": "CreateInvestigationResponse", "description": [], "signature": [ - "{ id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: \"esql\"; params: { esql: string; suggestion: any; }; })[]; }" + "{ id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]; }" ], "path": "packages/kbn-investigation-shared/src/rest_specs/create.ts", "deprecated": false, @@ -180,7 +180,7 @@ "label": "FindInvestigationsResponse", "description": [], "signature": [ - "{ page: number; perPage: number; total: number; results: { id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: \"esql\"; params: { esql: string; suggestion: any; }; })[]; }[]; }" + "{ page: number; perPage: number; total: number; results: { id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]; }[]; }" ], "path": "packages/kbn-investigation-shared/src/rest_specs/find.ts", "deprecated": false, @@ -195,7 +195,7 @@ "label": "GetInvestigationItemsResponse", "description": [], "signature": [ - "({ id: string; createdAt: number; createdBy: string; } & { title: string; type: \"esql\"; params: { esql: string; suggestion: any; }; })[]" + "({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]" ], "path": "packages/kbn-investigation-shared/src/rest_specs/get_items.ts", "deprecated": false, @@ -240,13 +240,43 @@ "label": "GetInvestigationResponse", "description": [], "signature": [ - "{ id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: \"esql\"; params: { esql: string; suggestion: any; }; })[]; }" + "{ id: string; title: string; createdAt: number; createdBy: string; params: { timeRange: { from: number; to: number; }; }; origin: { type: \"alert\"; id: string; } | { type: \"blank\"; }; status: \"closed\" | \"ongoing\"; notes: { id: string; content: string; createdAt: number; createdBy: string; }[]; items: ({ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; })[]; }" ], "path": "packages/kbn-investigation-shared/src/rest_specs/get.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.InvestigationItem", + "type": "Type", + "tags": [], + "label": "InvestigationItem", + "description": [], + "signature": [ + "{ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; }" + ], + "path": "packages/kbn-investigation-shared/src/schema/investigation_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.InvestigationItemResponse", + "type": "Type", + "tags": [], + "label": "InvestigationItemResponse", + "description": [], + "signature": [ + "{ id: string; createdAt: number; createdBy: string; } & { title: string; type: string; params: { [x: string]: any; }; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/investigation_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/investigation-shared", "id": "def-common.InvestigationNoteResponse", @@ -261,6 +291,51 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.Item", + "type": "Type", + "tags": [], + "label": "Item", + "description": [], + "signature": [ + "{ title: string; type: string; params: { [x: string]: any; }; }" + ], + "path": "packages/kbn-investigation-shared/src/schema/investigation_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.UpdateInvestigationNoteParams", + "type": "Type", + "tags": [], + "label": "UpdateInvestigationNoteParams", + "description": [], + "signature": [ + "{ content: string; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/update_note.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.UpdateInvestigationNoteResponse", + "type": "Type", + "tags": [], + "label": "UpdateInvestigationNoteResponse", + "description": [], + "signature": [ + "{ id: string; content: string; createdAt: number; createdBy: string; }" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/update_note.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ], "objects": [ @@ -320,14 +395,14 @@ "<{ title: ", "StringC", "; type: ", - "LiteralC", - "<\"esql\">; params: ", - "TypeC", - "<{ esql: ", "StringC", - "; suggestion: ", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", "AnyC", - "; }>; }>; }>" + ">; }>; }>" ], "path": "packages/kbn-investigation-shared/src/rest_specs/create_item.ts", "deprecated": false, @@ -356,14 +431,14 @@ "<{ title: ", "StringC", "; type: ", - "LiteralC", - "<\"esql\">; params: ", - "TypeC", - "<{ esql: ", "StringC", - "; suggestion: ", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", "AnyC", - "; }>; }>]>" + ">; }>]>" ], "path": "packages/kbn-investigation-shared/src/rest_specs/create_item.ts", "deprecated": false, @@ -532,14 +607,14 @@ "<{ title: ", "StringC", "; type: ", - "LiteralC", - "<\"esql\">; params: ", - "TypeC", - "<{ esql: ", "StringC", - "; suggestion: ", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", "AnyC", - "; }>; }>]>>; }>" + ">; }>]>>; }>" ], "path": "packages/kbn-investigation-shared/src/rest_specs/create.ts", "deprecated": false, @@ -610,32 +685,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "@kbn/investigation-shared", - "id": "def-common.esqlItemSchema", - "type": "Object", - "tags": [], - "label": "esqlItemSchema", - "description": [], - "signature": [ - "TypeC", - "<{ title: ", - "StringC", - "; type: ", - "LiteralC", - "<\"esql\">; params: ", - "TypeC", - "<{ esql: ", - "StringC", - "; suggestion: ", - "AnyC", - "; }>; }>" - ], - "path": "packages/kbn-investigation-shared/src/schema/investigation_item.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "@kbn/investigation-shared", "id": "def-common.findInvestigationsParamsSchema", @@ -742,14 +791,14 @@ "<{ title: ", "StringC", "; type: ", - "LiteralC", - "<\"esql\">; params: ", - "TypeC", - "<{ esql: ", "StringC", - "; suggestion: ", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", "AnyC", - "; }>; }>]>>; }>>; }>" + ">; }>]>>; }>>; }>" ], "path": "packages/kbn-investigation-shared/src/rest_specs/find.ts", "deprecated": false, @@ -800,14 +849,14 @@ "<{ title: ", "StringC", "; type: ", - "LiteralC", - "<\"esql\">; params: ", - "TypeC", - "<{ esql: ", "StringC", - "; suggestion: ", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", "AnyC", - "; }>; }>]>>" + ">; }>]>>" ], "path": "packages/kbn-investigation-shared/src/rest_specs/get_items.ts", "deprecated": false, @@ -952,14 +1001,14 @@ "<{ title: ", "StringC", "; type: ", - "LiteralC", - "<\"esql\">; params: ", - "TypeC", - "<{ esql: ", "StringC", - "; suggestion: ", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", "AnyC", - "; }>; }>]>>; }>" + ">; }>]>>; }>" ], "path": "packages/kbn-investigation-shared/src/rest_specs/get.ts", "deprecated": false, @@ -968,10 +1017,10 @@ }, { "parentPluginId": "@kbn/investigation-shared", - "id": "def-common.investigationItemSchema", + "id": "def-common.investigationItemResponseSchema", "type": "Object", "tags": [], - "label": "investigationItemSchema", + "label": "investigationItemResponseSchema", "description": [], "signature": [ "IntersectionC", @@ -988,40 +1037,50 @@ "<{ title: ", "StringC", "; type: ", - "LiteralC", - "<\"esql\">; params: ", - "TypeC", - "<{ esql: ", "StringC", - "; suggestion: ", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", "AnyC", - "; }>; }>]>" + ">; }>]>" ], - "path": "packages/kbn-investigation-shared/src/schema/investigation_item.ts", + "path": "packages/kbn-investigation-shared/src/rest_specs/investigation_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { "parentPluginId": "@kbn/investigation-shared", - "id": "def-common.investigationItemsSchema", + "id": "def-common.investigationItemSchema", "type": "Object", "tags": [], - "label": "investigationItemsSchema", + "label": "investigationItemSchema", "description": [], "signature": [ + "IntersectionC", + "<[", + "TypeC", + "<{ id: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>, ", "TypeC", "<{ title: ", "StringC", "; type: ", - "LiteralC", - "<\"esql\">; params: ", - "TypeC", - "<{ esql: ", "StringC", - "; suggestion: ", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", "AnyC", - "; }>; }>" + ">; }>]>" ], "path": "packages/kbn-investigation-shared/src/schema/investigation_item.ts", "deprecated": false, @@ -1148,19 +1207,95 @@ "<{ title: ", "StringC", "; type: ", - "LiteralC", - "<\"esql\">; params: ", - "TypeC", - "<{ esql: ", "StringC", - "; suggestion: ", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", "AnyC", - "; }>; }>]>>; }>" + ">; }>]>>; }>" ], "path": "packages/kbn-investigation-shared/src/schema/investigation.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.itemSchema", + "type": "Object", + "tags": [], + "label": "itemSchema", + "description": [], + "signature": [ + "TypeC", + "<{ title: ", + "StringC", + "; type: ", + "StringC", + "; params: ", + "RecordC", + "<", + "StringC", + ", ", + "AnyC", + ">; }>" + ], + "path": "packages/kbn-investigation-shared/src/schema/investigation_item.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.updateInvestigationNoteParamsSchema", + "type": "Object", + "tags": [], + "label": "updateInvestigationNoteParamsSchema", + "description": [], + "signature": [ + "TypeC", + "<{ path: ", + "TypeC", + "<{ investigationId: ", + "StringC", + "; noteId: ", + "StringC", + "; }>; body: ", + "TypeC", + "<{ content: ", + "StringC", + "; }>; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/update_note.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.updateInvestigationNoteResponseSchema", + "type": "Object", + "tags": [], + "label": "updateInvestigationNoteResponseSchema", + "description": [], + "signature": [ + "TypeC", + "<{ id: ", + "StringC", + "; content: ", + "StringC", + "; createdAt: ", + "NumberC", + "; createdBy: ", + "StringC", + "; }>" + ], + "path": "packages/kbn-investigation-shared/src/rest_specs/update_note.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ] } diff --git a/api_docs/kbn_investigation_shared.mdx b/api_docs/kbn_investigation_shared.mdx index bc725fc8ba945..da3c1e4fe9c30 100644 --- a/api_docs/kbn_investigation_shared.mdx +++ b/api_docs/kbn_investigation_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-investigation-shared title: "@kbn/investigation-shared" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/investigation-shared plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/investigation-shared'] --- import kbnInvestigationSharedObj from './kbn_investigation_shared.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/ | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 41 | 0 | 41 | 0 | +| 48 | 0 | 48 | 0 | ## Common diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index b6b728142c185..d3a09d65ba486 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-08-28 +date: 2024-08-30 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 3644c047e8d7a..aa4312deed2ae 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-08-28 +date: 2024-08-30 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 0c9f7549fb4f4..b80b3deda0ad8 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-08-28 +date: 2024-08-30 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 bc842d5b5931e..5b30fde0e1fbc 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-08-28 +date: 2024-08-30 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 49282c5befd30..cf5cd1a1b97ad 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-08-28 +date: 2024-08-30 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 9d437d6b3d236..f8f67c945fa58 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-08-28 +date: 2024-08-30 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 dff948d56b4b8..ef0cb197282a3 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-08-28 +date: 2024-08-30 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 7ad27185d0640..26c1a421fab30 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-08-28 +date: 2024-08-30 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 2437576a6d4e3..47cc0239c8149 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-08-28 +date: 2024-08-30 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 ac963e9749806..843eaa5500575 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/lens-formula-docs'] --- import kbnLensFormulaDocsObj from './kbn_lens_formula_docs.devdocs.json'; diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index d4c2ad797da0d..0e9cf949cc744 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging'] --- import kbnLoggingObj from './kbn_logging.devdocs.json'; diff --git a/api_docs/kbn_logging_mocks.mdx b/api_docs/kbn_logging_mocks.mdx index dafd29a97ea2b..bbf77611a94e7 100644 --- a/api_docs/kbn_logging_mocks.mdx +++ b/api_docs/kbn_logging_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging-mocks title: "@kbn/logging-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging-mocks plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging-mocks'] --- import kbnLoggingMocksObj from './kbn_logging_mocks.devdocs.json'; diff --git a/api_docs/kbn_managed_content_badge.mdx b/api_docs/kbn_managed_content_badge.mdx index e8672860dce40..b8946656e2695 100644 --- a/api_docs/kbn_managed_content_badge.mdx +++ b/api_docs/kbn_managed_content_badge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-managed-content-badge title: "@kbn/managed-content-badge" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/managed-content-badge plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/managed-content-badge'] --- import kbnManagedContentBadgeObj from './kbn_managed_content_badge.devdocs.json'; diff --git a/api_docs/kbn_managed_vscode_config.mdx b/api_docs/kbn_managed_vscode_config.mdx index 25857ead0fad2..cd787e96755eb 100644 --- a/api_docs/kbn_managed_vscode_config.mdx +++ b/api_docs/kbn_managed_vscode_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-managed-vscode-config title: "@kbn/managed-vscode-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/managed-vscode-config plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/managed-vscode-config'] --- import kbnManagedVscodeConfigObj from './kbn_managed_vscode_config.devdocs.json'; diff --git a/api_docs/kbn_management_cards_navigation.mdx b/api_docs/kbn_management_cards_navigation.mdx index 4474c7101f61d..7c6aeb0bf8912 100644 --- a/api_docs/kbn_management_cards_navigation.mdx +++ b/api_docs/kbn_management_cards_navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-cards-navigation title: "@kbn/management-cards-navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-cards-navigation plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-cards-navigation'] --- import kbnManagementCardsNavigationObj from './kbn_management_cards_navigation.devdocs.json'; diff --git a/api_docs/kbn_management_settings_application.mdx b/api_docs/kbn_management_settings_application.mdx index 42e4b918c52b8..8f95ad8e48854 100644 --- a/api_docs/kbn_management_settings_application.mdx +++ b/api_docs/kbn_management_settings_application.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-application title: "@kbn/management-settings-application" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-application plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-application'] --- import kbnManagementSettingsApplicationObj from './kbn_management_settings_application.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_field_category.mdx b/api_docs/kbn_management_settings_components_field_category.mdx index f2e8353db741a..6e540d8fca540 100644 --- a/api_docs/kbn_management_settings_components_field_category.mdx +++ b/api_docs/kbn_management_settings_components_field_category.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-field-category title: "@kbn/management-settings-components-field-category" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-field-category plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-field-category'] --- import kbnManagementSettingsComponentsFieldCategoryObj from './kbn_management_settings_components_field_category.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_field_input.mdx b/api_docs/kbn_management_settings_components_field_input.mdx index 39ea4c5a1e312..660e1cb43b9c8 100644 --- a/api_docs/kbn_management_settings_components_field_input.mdx +++ b/api_docs/kbn_management_settings_components_field_input.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-field-input title: "@kbn/management-settings-components-field-input" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-field-input plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-field-input'] --- import kbnManagementSettingsComponentsFieldInputObj from './kbn_management_settings_components_field_input.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_field_row.mdx b/api_docs/kbn_management_settings_components_field_row.mdx index 07bd3d35ce99e..804ae6994d154 100644 --- a/api_docs/kbn_management_settings_components_field_row.mdx +++ b/api_docs/kbn_management_settings_components_field_row.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-field-row title: "@kbn/management-settings-components-field-row" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-field-row plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-field-row'] --- import kbnManagementSettingsComponentsFieldRowObj from './kbn_management_settings_components_field_row.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_form.mdx b/api_docs/kbn_management_settings_components_form.mdx index ee8e2262ca80d..cdce414c687e3 100644 --- a/api_docs/kbn_management_settings_components_form.mdx +++ b/api_docs/kbn_management_settings_components_form.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-form title: "@kbn/management-settings-components-form" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-form plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-form'] --- import kbnManagementSettingsComponentsFormObj from './kbn_management_settings_components_form.devdocs.json'; diff --git a/api_docs/kbn_management_settings_field_definition.mdx b/api_docs/kbn_management_settings_field_definition.mdx index 096ea02ad9ebb..33f161fd95e10 100644 --- a/api_docs/kbn_management_settings_field_definition.mdx +++ b/api_docs/kbn_management_settings_field_definition.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-field-definition title: "@kbn/management-settings-field-definition" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-field-definition plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-field-definition'] --- import kbnManagementSettingsFieldDefinitionObj from './kbn_management_settings_field_definition.devdocs.json'; diff --git a/api_docs/kbn_management_settings_ids.devdocs.json b/api_docs/kbn_management_settings_ids.devdocs.json index f5662d441bdc0..02da2b2d9b18f 100644 --- a/api_docs/kbn_management_settings_ids.devdocs.json +++ b/api_docs/kbn_management_settings_ids.devdocs.json @@ -1087,21 +1087,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "@kbn/management-settings-ids", - "id": "def-common.OBSERVABILITY_AI_ASSISTANT_RESPONSE_LANGUAGE", - "type": "string", - "tags": [], - "label": "OBSERVABILITY_AI_ASSISTANT_RESPONSE_LANGUAGE", - "description": [], - "signature": [ - "\"observability:aiAssistantResponseLanguage\"" - ], - "path": "packages/kbn-management/settings/setting_ids/index.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "@kbn/management-settings-ids", "id": "def-common.OBSERVABILITY_AI_ASSISTANT_SEARCH_CONNECTOR_INDEX_PATTERN", diff --git a/api_docs/kbn_management_settings_ids.mdx b/api_docs/kbn_management_settings_ids.mdx index 7a7c86fcb6fdd..ae7b245d7f879 100644 --- a/api_docs/kbn_management_settings_ids.mdx +++ b/api_docs/kbn_management_settings_ids.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-ids title: "@kbn/management-settings-ids" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-ids plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-ids'] --- import kbnManagementSettingsIdsObj from './kbn_management_settings_ids.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/appex-sharedux @elastic/kibana-management](https://github.com/ | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 143 | 0 | 141 | 0 | +| 142 | 0 | 140 | 0 | ## Common diff --git a/api_docs/kbn_management_settings_section_registry.mdx b/api_docs/kbn_management_settings_section_registry.mdx index e6c29dacc4fcf..61f85ac35e770 100644 --- a/api_docs/kbn_management_settings_section_registry.mdx +++ b/api_docs/kbn_management_settings_section_registry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-section-registry title: "@kbn/management-settings-section-registry" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-section-registry plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-section-registry'] --- import kbnManagementSettingsSectionRegistryObj from './kbn_management_settings_section_registry.devdocs.json'; diff --git a/api_docs/kbn_management_settings_types.mdx b/api_docs/kbn_management_settings_types.mdx index f56ca9d3c561c..cc74232071cdd 100644 --- a/api_docs/kbn_management_settings_types.mdx +++ b/api_docs/kbn_management_settings_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-types title: "@kbn/management-settings-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-types plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-types'] --- import kbnManagementSettingsTypesObj from './kbn_management_settings_types.devdocs.json'; diff --git a/api_docs/kbn_management_settings_utilities.mdx b/api_docs/kbn_management_settings_utilities.mdx index 54264135d310c..62759e8eb7800 100644 --- a/api_docs/kbn_management_settings_utilities.mdx +++ b/api_docs/kbn_management_settings_utilities.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-utilities title: "@kbn/management-settings-utilities" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-utilities plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-utilities'] --- import kbnManagementSettingsUtilitiesObj from './kbn_management_settings_utilities.devdocs.json'; diff --git a/api_docs/kbn_management_storybook_config.mdx b/api_docs/kbn_management_storybook_config.mdx index d81421aba1281..0eaf38f4368ae 100644 --- a/api_docs/kbn_management_storybook_config.mdx +++ b/api_docs/kbn_management_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-storybook-config title: "@kbn/management-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-storybook-config plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-storybook-config'] --- import kbnManagementStorybookConfigObj from './kbn_management_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index 564e59112f0ee..f7d7e397e6676 100644 --- a/api_docs/kbn_mapbox_gl.mdx +++ b/api_docs/kbn_mapbox_gl.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-mapbox-gl title: "@kbn/mapbox-gl" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/mapbox-gl plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mapbox-gl'] --- import kbnMapboxGlObj from './kbn_mapbox_gl.devdocs.json'; diff --git a/api_docs/kbn_maps_vector_tile_utils.mdx b/api_docs/kbn_maps_vector_tile_utils.mdx index a091fdb7e41e0..37ee9ee7e3924 100644 --- a/api_docs/kbn_maps_vector_tile_utils.mdx +++ b/api_docs/kbn_maps_vector_tile_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-maps-vector-tile-utils title: "@kbn/maps-vector-tile-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/maps-vector-tile-utils plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/maps-vector-tile-utils'] --- import kbnMapsVectorTileUtilsObj from './kbn_maps_vector_tile_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index cbe1e1c0af1ab..29872e24d4c67 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-agg-utils'] --- import kbnMlAggUtilsObj from './kbn_ml_agg_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_anomaly_utils.mdx b/api_docs/kbn_ml_anomaly_utils.mdx index 5d3a83e5563e6..06754c8c8f6a5 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-08-28 +date: 2024-08-30 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 df71ebb892bd6..04eded1f815b0 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-08-28 +date: 2024-08-30 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 32536b3792a71..cb04cd4678f4a 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-08-28 +date: 2024-08-30 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 6c98a8c60d713..1297e35282059 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-08-28 +date: 2024-08-30 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 a3fec03d57387..fa7df6e3d66d0 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-08-28 +date: 2024-08-30 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 04a12e7eb6f3a..bdc8194dd576f 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-08-28 +date: 2024-08-30 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 fd0fbcd3359f5..e7932703d1d28 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-08-28 +date: 2024-08-30 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 7f1420777a610..326cdbbd356ae 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-08-28 +date: 2024-08-30 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 0b7322aa6957a..e6dcd74bd825f 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-08-28 +date: 2024-08-30 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 be2652de764d4..4f57c1c145f2a 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-08-28 +date: 2024-08-30 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 728e505bf033f..b6b19c941d6f9 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-08-28 +date: 2024-08-30 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 3248f4218d496..cfa9a4eee5dc7 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-08-28 +date: 2024-08-30 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 bbe6ab71bb25f..a433cdcd3a203 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-08-28 +date: 2024-08-30 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 5a9b9911c0a97..9408e4b5c1848 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-08-28 +date: 2024-08-30 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 9a7e9107eccd1..0f09ba50a7449 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-08-28 +date: 2024-08-30 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 58e2c8ccfeb4f..ffd05c749b5bf 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-08-28 +date: 2024-08-30 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 726077f8bf453..a8d6295541f81 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-08-28 +date: 2024-08-30 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 ddd9855680645..96ce7d2b6dba1 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-08-28 +date: 2024-08-30 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 92fce1f01b0bc..816bf3bde18b4 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-08-28 +date: 2024-08-30 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 dec7fa04f8c2b..062685ed3000d 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-08-28 +date: 2024-08-30 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 fc061e53cebff..0ad84c77ead04 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-08-28 +date: 2024-08-30 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 1e46208acf9b0..29bfd3d7195ec 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-time-buckets'] --- import kbnMlTimeBucketsObj from './kbn_ml_time_buckets.devdocs.json'; diff --git a/api_docs/kbn_ml_trained_models_utils.devdocs.json b/api_docs/kbn_ml_trained_models_utils.devdocs.json index da7f83967f765..ca2a5a326e1df 100644 --- a/api_docs/kbn_ml_trained_models_utils.devdocs.json +++ b/api_docs/kbn_ml_trained_models_utils.devdocs.json @@ -18,7 +18,43 @@ }, "common": { "classes": [], - "functions": [], + "functions": [ + { + "parentPluginId": "@kbn/ml-trained-models-utils", + "id": "def-common.isLocalModel", + "type": "Function", + "tags": [], + "label": "isLocalModel", + "description": [], + "signature": [ + "(model: ", + "InferenceServiceSettings", + ") => boolean" + ], + "path": "x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/ml-trained-models-utils", + "id": "def-common.isLocalModel.$1", + "type": "CompoundType", + "tags": [], + "label": "model", + "description": [], + "signature": [ + "InferenceServiceSettings" + ], + "path": "x-pack/packages/ml/trained_models_utils/src/constants/trained_models.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], "interfaces": [ { "parentPluginId": "@kbn/ml-trained-models-utils", diff --git a/api_docs/kbn_ml_trained_models_utils.mdx b/api_docs/kbn_ml_trained_models_utils.mdx index f174c04706f87..0a4e8074ae640 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-trained-models-utils'] --- import kbnMlTrainedModelsUtilsObj from './kbn_ml_trained_models_utils.devdocs.json'; @@ -21,13 +21,16 @@ Contact [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) for questi | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 44 | 0 | 38 | 1 | +| 46 | 0 | 40 | 1 | ## Common ### Objects +### Functions + + ### Interfaces diff --git a/api_docs/kbn_ml_ui_actions.mdx b/api_docs/kbn_ml_ui_actions.mdx index a511bfb4b9557..628c9db89c4f4 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-08-28 +date: 2024-08-30 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 0e1acddb2d491..e9e699f75503a 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-08-28 +date: 2024-08-30 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 2d0c5758996ed..4f73378a31ce9 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-08-28 +date: 2024-08-30 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 467256380277a..e40a8a1e88459 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] --- import kbnMonacoObj from './kbn_monaco.devdocs.json'; diff --git a/api_docs/kbn_object_versioning.devdocs.json b/api_docs/kbn_object_versioning.devdocs.json index 551e1feda1d0b..77d87a2342389 100644 --- a/api_docs/kbn_object_versioning.devdocs.json +++ b/api_docs/kbn_object_versioning.devdocs.json @@ -9,19 +9,11 @@ "objects": [] }, "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { "classes": [], "functions": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.compile", + "id": "def-server.compile", "type": "Function", "tags": [], "label": "compile", @@ -32,17 +24,17 @@ "(definitions: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ServiceDefinitionVersioned", + "section": "def-server.ServiceDefinitionVersioned", "text": "ServiceDefinitionVersioned" }, ") => { [path: string]: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectMigrationDefinition", + "section": "def-server.ObjectMigrationDefinition", "text": "ObjectMigrationDefinition" }, "; }" @@ -53,7 +45,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.compile.$1", + "id": "def-server.compile.$1", "type": "Object", "tags": [], "label": "definitions", @@ -61,9 +53,9 @@ "signature": [ { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ServiceDefinitionVersioned", + "section": "def-server.ServiceDefinitionVersioned", "text": "ServiceDefinitionVersioned" } ], @@ -78,7 +70,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.getTransforms", + "id": "def-server.getTransforms", "type": "Function", "tags": [], "label": "getTransforms", @@ -87,25 +79,25 @@ "(definitions: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ServiceDefinitionVersioned", + "section": "def-server.ServiceDefinitionVersioned", "text": "ServiceDefinitionVersioned" }, ", requestVersion: number, _compiled?: { [path: string]: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectMigrationDefinition", + "section": "def-server.ObjectMigrationDefinition", "text": "ObjectMigrationDefinition" }, "; } | undefined) => ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ServiceTransforms", + "section": "def-server.ServiceTransforms", "text": "ServiceTransforms" } ], @@ -115,7 +107,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.getTransforms.$1", + "id": "def-server.getTransforms.$1", "type": "Object", "tags": [], "label": "definitions", @@ -123,9 +115,9 @@ "signature": [ { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ServiceDefinitionVersioned", + "section": "def-server.ServiceDefinitionVersioned", "text": "ServiceDefinitionVersioned" } ], @@ -136,7 +128,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.getTransforms.$2", + "id": "def-server.getTransforms.$2", "type": "number", "tags": [], "label": "requestVersion", @@ -151,7 +143,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.getTransforms.$3", + "id": "def-server.getTransforms.$3", "type": "Object", "tags": [], "label": "_compiled", @@ -162,7 +154,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.getTransforms.$3.Unnamed", + "id": "def-server.getTransforms.$3.Unnamed", "type": "IndexSignature", "tags": [], "label": "[path: string]: ObjectMigrationDefinition", @@ -171,9 +163,9 @@ "[path: string]: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectMigrationDefinition", + "section": "def-server.ObjectMigrationDefinition", "text": "ObjectMigrationDefinition" } ], @@ -189,7 +181,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.initTransform", + "id": "def-server.initTransform", "type": "Function", "tags": [], "label": "initTransform", @@ -200,9 +192,9 @@ "(requestVersion: number) => (migrationDefinition: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectMigrationDefinition", + "section": "def-server.ObjectMigrationDefinition", "text": "ObjectMigrationDefinition" }, ") => { up: (obj: I, to?: number | \"latest\", { validate }?: { validate?: boolean | undefined; }) => { error: Error; value: null; } | { value: O; error: null; }; down: (obj: I, from?: number | \"latest\", { validate }?: { validate?: boolean | undefined; }) => { error: Error; value: null; } | { value: any; error: null; }; validate: (value: unknown, version?: number) => ", @@ -221,7 +213,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.initTransform.$1", + "id": "def-server.initTransform.$1", "type": "number", "tags": [], "label": "requestVersion", @@ -246,7 +238,7 @@ "interfaces": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectMigrationDefinition", + "id": "def-server.ObjectMigrationDefinition", "type": "Interface", "tags": [], "label": "ObjectMigrationDefinition", @@ -257,7 +249,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectMigrationDefinition.Unnamed", + "id": "def-server.ObjectMigrationDefinition.Unnamed", "type": "IndexSignature", "tags": [], "label": "[version: number]: VersionableObject", @@ -266,9 +258,9 @@ "[version: number]: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, "" @@ -282,7 +274,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransforms", + "id": "def-server.ObjectTransforms", "type": "Interface", "tags": [], "label": "ObjectTransforms", @@ -290,9 +282,9 @@ "signature": [ { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "" @@ -303,7 +295,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransforms.up", + "id": "def-server.ObjectTransforms.up", "type": "Function", "tags": [], "label": "up", @@ -312,9 +304,9 @@ "(obj: I, version?: number | \"latest\" | undefined, options?: { validate?: boolean | undefined; } | undefined) => ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.TransformReturn", + "section": "def-server.TransformReturn", "text": "TransformReturn" }, "" @@ -325,7 +317,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransforms.up.$1", + "id": "def-server.ObjectTransforms.up.$1", "type": "Uncategorized", "tags": [], "label": "obj", @@ -340,7 +332,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransforms.up.$2", + "id": "def-server.ObjectTransforms.up.$2", "type": "CompoundType", "tags": [], "label": "version", @@ -355,7 +347,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransforms.up.$3", + "id": "def-server.ObjectTransforms.up.$3", "type": "Object", "tags": [], "label": "options", @@ -366,7 +358,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransforms.up.$3.validate", + "id": "def-server.ObjectTransforms.up.$3.validate", "type": "CompoundType", "tags": [], "label": "validate", @@ -387,7 +379,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransforms.down", + "id": "def-server.ObjectTransforms.down", "type": "Function", "tags": [], "label": "down", @@ -396,9 +388,9 @@ "(obj: DownIn, version?: number | \"latest\" | undefined, options?: { validate?: boolean | undefined; } | undefined) => ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.TransformReturn", + "section": "def-server.TransformReturn", "text": "TransformReturn" }, "" @@ -409,7 +401,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransforms.down.$1", + "id": "def-server.ObjectTransforms.down.$1", "type": "Uncategorized", "tags": [], "label": "obj", @@ -424,7 +416,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransforms.down.$2", + "id": "def-server.ObjectTransforms.down.$2", "type": "CompoundType", "tags": [], "label": "version", @@ -439,7 +431,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransforms.down.$3", + "id": "def-server.ObjectTransforms.down.$3", "type": "Object", "tags": [], "label": "options", @@ -450,7 +442,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransforms.down.$3.validate", + "id": "def-server.ObjectTransforms.down.$3.validate", "type": "CompoundType", "tags": [], "label": "validate", @@ -471,7 +463,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransforms.validate", + "id": "def-server.ObjectTransforms.validate", "type": "Function", "tags": [], "label": "validate", @@ -493,7 +485,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransforms.validate.$1", + "id": "def-server.ObjectTransforms.validate.$1", "type": "Any", "tags": [], "label": "obj", @@ -508,7 +500,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransforms.validate.$2", + "id": "def-server.ObjectTransforms.validate.$2", "type": "number", "tags": [], "label": "version", @@ -529,7 +521,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServiceDefinitionVersioned", + "id": "def-server.ServiceDefinitionVersioned", "type": "Interface", "tags": [], "label": "ServiceDefinitionVersioned", @@ -540,7 +532,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServiceDefinitionVersioned.Unnamed", + "id": "def-server.ServiceDefinitionVersioned.Unnamed", "type": "IndexSignature", "tags": [], "label": "[version: number]: ServicesDefinition", @@ -549,9 +541,9 @@ "[version: number]: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ServicesDefinition", + "section": "def-server.ServicesDefinition", "text": "ServicesDefinition" } ], @@ -564,7 +556,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServicesDefinition", + "id": "def-server.ServicesDefinition", "type": "Interface", "tags": [], "label": "ServicesDefinition", @@ -575,7 +567,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServicesDefinition.get", + "id": "def-server.ServicesDefinition.get", "type": "Object", "tags": [], "label": "get", @@ -584,17 +576,17 @@ "{ in?: { options?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; } | undefined; out?: { result?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; } | undefined; } | undefined" @@ -605,7 +597,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServicesDefinition.bulkGet", + "id": "def-server.ServicesDefinition.bulkGet", "type": "Object", "tags": [], "label": "bulkGet", @@ -614,17 +606,17 @@ "{ in?: { options?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; } | undefined; out?: { result?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; } | undefined; } | undefined" @@ -635,7 +627,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServicesDefinition.create", + "id": "def-server.ServicesDefinition.create", "type": "Object", "tags": [], "label": "create", @@ -644,25 +636,25 @@ "{ in?: { data?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; options?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; } | undefined; out?: { result?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; } | undefined; } | undefined" @@ -673,7 +665,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServicesDefinition.update", + "id": "def-server.ServicesDefinition.update", "type": "Object", "tags": [], "label": "update", @@ -682,25 +674,25 @@ "{ in?: { data?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; options?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; } | undefined; out?: { result?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; } | undefined; } | undefined" @@ -711,7 +703,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServicesDefinition.delete", + "id": "def-server.ServicesDefinition.delete", "type": "Object", "tags": [], "label": "delete", @@ -720,17 +712,17 @@ "{ in?: { options?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; } | undefined; out?: { result?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; } | undefined; } | undefined" @@ -741,7 +733,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServicesDefinition.search", + "id": "def-server.ServicesDefinition.search", "type": "Object", "tags": [], "label": "search", @@ -750,17 +742,17 @@ "{ in?: { options?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; } | undefined; out?: { result?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; } | undefined; } | undefined" @@ -771,7 +763,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServicesDefinition.mSearch", + "id": "def-server.ServicesDefinition.mSearch", "type": "Object", "tags": [], "label": "mSearch", @@ -780,9 +772,9 @@ "{ out?: { result?: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, " | undefined; } | undefined; } | undefined" @@ -796,7 +788,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServiceTransforms", + "id": "def-server.ServiceTransforms", "type": "Interface", "tags": [], "label": "ServiceTransforms", @@ -807,7 +799,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServiceTransforms.get", + "id": "def-server.ServiceTransforms.get", "type": "Object", "tags": [], "label": "get", @@ -816,17 +808,17 @@ "{ in: { options: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; }; out: { result: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; }; }" @@ -837,7 +829,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServiceTransforms.bulkGet", + "id": "def-server.ServiceTransforms.bulkGet", "type": "Object", "tags": [], "label": "bulkGet", @@ -846,17 +838,17 @@ "{ in: { options: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; }; out: { result: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; }; }" @@ -867,7 +859,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServiceTransforms.create", + "id": "def-server.ServiceTransforms.create", "type": "Object", "tags": [], "label": "create", @@ -876,25 +868,25 @@ "{ in: { data: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; options: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; }; out: { result: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; }; }" @@ -905,7 +897,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServiceTransforms.update", + "id": "def-server.ServiceTransforms.update", "type": "Object", "tags": [], "label": "update", @@ -914,25 +906,25 @@ "{ in: { data: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; options: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; }; out: { result: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; }; }" @@ -943,7 +935,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServiceTransforms.delete", + "id": "def-server.ServiceTransforms.delete", "type": "Object", "tags": [], "label": "delete", @@ -952,17 +944,17 @@ "{ in: { options: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; }; out: { result: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; }; }" @@ -973,7 +965,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServiceTransforms.search", + "id": "def-server.ServiceTransforms.search", "type": "Object", "tags": [], "label": "search", @@ -982,17 +974,17 @@ "{ in: { options: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; }; out: { result: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; }; }" @@ -1003,7 +995,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ServiceTransforms.mSearch", + "id": "def-server.ServiceTransforms.mSearch", "type": "Object", "tags": [], "label": "mSearch", @@ -1012,9 +1004,9 @@ "{ out: { result: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransforms", + "section": "def-server.ObjectTransforms", "text": "ObjectTransforms" }, "; }; }" @@ -1028,7 +1020,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.VersionableObject", + "id": "def-server.VersionableObject", "type": "Interface", "tags": [], "label": "VersionableObject", @@ -1036,9 +1028,9 @@ "signature": [ { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.VersionableObject", + "section": "def-server.VersionableObject", "text": "VersionableObject" }, "" @@ -1049,7 +1041,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.VersionableObject.schema", + "id": "def-server.VersionableObject.schema", "type": "Object", "tags": [], "label": "schema", @@ -1070,7 +1062,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.VersionableObject.down", + "id": "def-server.VersionableObject.down", "type": "Function", "tags": [], "label": "down", @@ -1078,9 +1070,9 @@ "signature": [ { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransform", + "section": "def-server.ObjectTransform", "text": "ObjectTransform" }, " | undefined" @@ -1091,7 +1083,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.VersionableObject.up", + "id": "def-server.VersionableObject.up", "type": "Function", "tags": [], "label": "up", @@ -1099,9 +1091,9 @@ "signature": [ { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectTransform", + "section": "def-server.ObjectTransform", "text": "ObjectTransform" }, " | undefined" @@ -1118,7 +1110,7 @@ "misc": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.GetTransformsFn", + "id": "def-server.GetTransformsFn", "type": "Type", "tags": [], "label": "GetTransformsFn", @@ -1127,25 +1119,25 @@ "(definitions: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ServiceDefinitionVersioned", + "section": "def-server.ServiceDefinitionVersioned", "text": "ServiceDefinitionVersioned" }, ", requestVersion: number, _compiled?: { [path: string]: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectMigrationDefinition", + "section": "def-server.ObjectMigrationDefinition", "text": "ObjectMigrationDefinition" }, "; } | undefined) => ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ServiceTransforms", + "section": "def-server.ServiceTransforms", "text": "ServiceTransforms" } ], @@ -1156,7 +1148,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.GetTransformsFn.$1", + "id": "def-server.GetTransformsFn.$1", "type": "Object", "tags": [], "label": "definitions", @@ -1164,9 +1156,9 @@ "signature": [ { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ServiceDefinitionVersioned", + "section": "def-server.ServiceDefinitionVersioned", "text": "ServiceDefinitionVersioned" } ], @@ -1176,7 +1168,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.GetTransformsFn.$2", + "id": "def-server.GetTransformsFn.$2", "type": "number", "tags": [], "label": "requestVersion", @@ -1187,7 +1179,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.GetTransformsFn.$3", + "id": "def-server.GetTransformsFn.$3", "type": "Object", "tags": [], "label": "_compiled", @@ -1196,9 +1188,9 @@ "{ [path: string]: ", { "pluginId": "@kbn/object-versioning", - "scope": "common", + "scope": "server", "docId": "kibKbnObjectVersioningPluginApi", - "section": "def-common.ObjectMigrationDefinition", + "section": "def-server.ObjectMigrationDefinition", "text": "ObjectMigrationDefinition" }, "; } | undefined" @@ -1212,7 +1204,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransform", + "id": "def-server.ObjectTransform", "type": "Type", "tags": [], "label": "ObjectTransform", @@ -1227,7 +1219,7 @@ "children": [ { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.ObjectTransform.$1", + "id": "def-server.ObjectTransform.$1", "type": "Uncategorized", "tags": [], "label": "input", @@ -1244,7 +1236,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.TransformReturn", + "id": "def-server.TransformReturn", "type": "Type", "tags": [], "label": "TransformReturn", @@ -1267,7 +1259,7 @@ }, { "parentPluginId": "@kbn/object-versioning", - "id": "def-common.Version", + "id": "def-server.Version", "type": "Type", "tags": [], "label": "Version", @@ -1282,5 +1274,13 @@ } ], "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_object_versioning.mdx b/api_docs/kbn_object_versioning.mdx index e53829eda2611..f8671eeee949c 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/object-versioning'] --- import kbnObjectVersioningObj from './kbn_object_versioning.devdocs.json'; @@ -23,14 +23,14 @@ Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sh |-------------------|-----------|------------------------|-----------------| | 55 | 1 | 50 | 0 | -## Common +## Server ### Functions - + ### Interfaces - + ### Consts, variables and types - + diff --git a/api_docs/kbn_object_versioning_utils.devdocs.json b/api_docs/kbn_object_versioning_utils.devdocs.json new file mode 100644 index 0000000000000..1a7dbcf2e88f5 --- /dev/null +++ b/api_docs/kbn_object_versioning_utils.devdocs.json @@ -0,0 +1,61 @@ +{ + "id": "@kbn/object-versioning-utils", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/object-versioning-utils", + "id": "def-common.validateVersion", + "type": "Function", + "tags": [], + "label": "validateVersion", + "description": [], + "signature": [ + "(version: unknown) => { result: true; value: number; } | { result: false; value: null; }" + ], + "path": "packages/kbn-object-versioning-utils/lib/validate_version.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/object-versioning-utils", + "id": "def-common.validateVersion.$1", + "type": "Unknown", + "tags": [], + "label": "version", + "description": [], + "signature": [ + "unknown" + ], + "path": "packages/kbn-object-versioning-utils/lib/validate_version.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_object_versioning_utils.mdx b/api_docs/kbn_object_versioning_utils.mdx new file mode 100644 index 0000000000000..55634bc66f4dc --- /dev/null +++ b/api_docs/kbn_object_versioning_utils.mdx @@ -0,0 +1,30 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnObjectVersioningUtilsPluginApi +slug: /kibana-dev-docs/api/kbn-object-versioning-utils +title: "@kbn/object-versioning-utils" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/object-versioning-utils plugin +date: 2024-08-30 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/object-versioning-utils'] +--- +import kbnObjectVersioningUtilsObj from './kbn_object_versioning_utils.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 | +|-------------------|-----------|------------------------|-----------------| +| 2 | 0 | 2 | 0 | + +## Common + +### Functions + + diff --git a/api_docs/kbn_observability_alert_details.mdx b/api_docs/kbn_observability_alert_details.mdx index 8245c9b225fb0..3d632f6e6dea6 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-alert-details'] --- import kbnObservabilityAlertDetailsObj from './kbn_observability_alert_details.devdocs.json'; diff --git a/api_docs/kbn_observability_alerting_rule_utils.mdx b/api_docs/kbn_observability_alerting_rule_utils.mdx index 46d1df2d60a85..63370faa5744f 100644 --- a/api_docs/kbn_observability_alerting_rule_utils.mdx +++ b/api_docs/kbn_observability_alerting_rule_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-alerting-rule-utils title: "@kbn/observability-alerting-rule-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-alerting-rule-utils plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-alerting-rule-utils'] --- import kbnObservabilityAlertingRuleUtilsObj from './kbn_observability_alerting_rule_utils.devdocs.json'; diff --git a/api_docs/kbn_observability_alerting_test_data.mdx b/api_docs/kbn_observability_alerting_test_data.mdx index 86127b23e01a1..9766f05ce62d2 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-08-28 +date: 2024-08-30 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 1cd9c498f10b0..ec5b6fd2ba575 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-08-28 +date: 2024-08-30 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 9d00620e54806..6beba53457766 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-08-28 +date: 2024-08-30 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 daa593a6bc8f0..acbbc4bc88922 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-08-28 +date: 2024-08-30 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 d9a8a1ed81360..38068da5d61c4 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-08-28 +date: 2024-08-30 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 c5dd4ebf331d7..4a13af822e083 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-08-28 +date: 2024-08-30 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 49655964b09e0..ca80fdfddb9a0 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-08-28 +date: 2024-08-30 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 fefad63e9500e..1cdc53a6b52ef 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-08-28 +date: 2024-08-30 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 22eb106ebce83..bcd39e9e352dc 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-08-28 +date: 2024-08-30 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 9677d7c4e0b6a..8b6740621b7d2 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-08-28 +date: 2024-08-30 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 c03e59f82e7e3..5f8acadc63920 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-08-28 +date: 2024-08-30 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 de188dc6f5e75..15d81f651f7ce 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] --- import kbnPluginHelpersObj from './kbn_plugin_helpers.devdocs.json'; diff --git a/api_docs/kbn_presentation_containers.devdocs.json b/api_docs/kbn_presentation_containers.devdocs.json index d3adf3e03080d..3216e399f98ba 100644 --- a/api_docs/kbn_presentation_containers.devdocs.json +++ b/api_docs/kbn_presentation_containers.devdocs.json @@ -1751,9 +1751,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[] | undefined" diff --git a/api_docs/kbn_presentation_containers.mdx b/api_docs/kbn_presentation_containers.mdx index 5e4d0a1550ed6..34bcbc0986bda 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/presentation-containers'] --- import kbnPresentationContainersObj from './kbn_presentation_containers.devdocs.json'; diff --git a/api_docs/kbn_presentation_publishing.mdx b/api_docs/kbn_presentation_publishing.mdx index a646cbae1bc14..1eedc9aafdf52 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/presentation-publishing'] --- import kbnPresentationPublishingObj from './kbn_presentation_publishing.devdocs.json'; diff --git a/api_docs/kbn_profiling_utils.mdx b/api_docs/kbn_profiling_utils.mdx index 14c46d779abbd..e7559500b3d02 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-08-28 +date: 2024-08-30 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 7d4ea6b3dc3d3..1d0e23ec78833 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-08-28 +date: 2024-08-30 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 696c51f91898e..de37d2a03c4ee 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-08-28 +date: 2024-08-30 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 1a75de8247a40..036860e8a32db 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-08-28 +date: 2024-08-30 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 ddb1ee3b0da95..dec45d5b4b9c1 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-08-28 +date: 2024-08-30 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 425a712fa40eb..9deb404fc30b2 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-08-28 +date: 2024-08-30 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 116f7ed6726be..da9a8683bb55c 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-08-28 +date: 2024-08-30 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 db0b8503c182e..8410dd52d4573 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-08-28 +date: 2024-08-30 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 15cc1d688931e..f589550dbf735 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-08-28 +date: 2024-08-30 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.devdocs.json b/api_docs/kbn_react_kibana_mount.devdocs.json index b26c6e53f7459..9340067e42c1e 100644 --- a/api_docs/kbn_react_kibana_mount.devdocs.json +++ b/api_docs/kbn_react_kibana_mount.devdocs.json @@ -152,7 +152,7 @@ "label": "useIfMounted", "description": [], "signature": [ - "() => (func: any) => void" + "() => (func?: (() => void) | undefined) => void" ], "path": "packages/react/kibana_mount/utils.ts", "deprecated": false, diff --git a/api_docs/kbn_react_kibana_mount.mdx b/api_docs/kbn_react_kibana_mount.mdx index 49c4f5567a09b..b78e21560cc66 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-08-28 +date: 2024-08-30 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.mdx b/api_docs/kbn_recently_accessed.mdx index fb1c13fd4fd5f..76b4c26b7f971 100644 --- a/api_docs/kbn_recently_accessed.mdx +++ b/api_docs/kbn_recently_accessed.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-recently-accessed title: "@kbn/recently-accessed" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/recently-accessed plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/recently-accessed'] --- import kbnRecentlyAccessedObj from './kbn_recently_accessed.devdocs.json'; diff --git a/api_docs/kbn_repo_file_maps.mdx b/api_docs/kbn_repo_file_maps.mdx index 19fe57c20e901..11bb8be74c288 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-08-28 +date: 2024-08-30 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 bf7572451ec18..c4d1bef379605 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-08-28 +date: 2024-08-30 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 4841acebe063b..df90fe096aad4 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-08-28 +date: 2024-08-30 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 f7e6d41c4c335..783fed8b87890 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-08-28 +date: 2024-08-30 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 efa822fe2219f..31c6b89f60b93 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-08-28 +date: 2024-08-30 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 76b2ecfcd4511..e836e968a74e1 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-08-28 +date: 2024-08-30 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 e75f689adbce9..93ead94a47f91 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-08-28 +date: 2024-08-30 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 00b23ddc218d5..5c617a26ba934 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-08-28 +date: 2024-08-30 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 2a38a2be017d2..e4ed7c6893684 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-08-28 +date: 2024-08-30 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 336b6850b9a6e..6860e6be3e0cd 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-08-28 +date: 2024-08-30 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 069b3011f9c28..d3c417ae7d757 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-08-28 +date: 2024-08-30 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 446047b2edd80..a37c242ba800b 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-08-28 +date: 2024-08-30 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 4bcb450459413..aec34a0ff46ea 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-08-28 +date: 2024-08-30 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 d2de17e88adaf..1801ddb7c5acb 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-08-28 +date: 2024-08-30 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 749622b7c9813..febb9d83d4785 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-08-28 +date: 2024-08-30 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 01f636db753af..937e7037193dd 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-08-28 +date: 2024-08-30 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 879eba9c1caf0..001d9c873f32d 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-08-28 +date: 2024-08-30 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 9f4fc1d369293..ff8123a05a221 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-08-28 +date: 2024-08-30 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 a5bb28db8146f..7a7d7d208c270 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-08-28 +date: 2024-08-30 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 8de6dc083b628..b7a63738afaee 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-08-28 +date: 2024-08-30 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 c94c86a32115c..645a6a76f91a0 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-08-28 +date: 2024-08-30 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 35646980aa812..b7a5720c6e512 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-08-28 +date: 2024-08-30 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 0256d43f04337..73a4bdde74d7e 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-08-28 +date: 2024-08-30 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 3463fa6f1f56c..60af399c21214 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/saved-objects-settings'] --- import kbnSavedObjectsSettingsObj from './kbn_saved_objects_settings.devdocs.json'; diff --git a/api_docs/kbn_screenshotting_server.mdx b/api_docs/kbn_screenshotting_server.mdx index a7d58f69236c9..bb4add9ec52ba 100644 --- a/api_docs/kbn_screenshotting_server.mdx +++ b/api_docs/kbn_screenshotting_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-screenshotting-server title: "@kbn/screenshotting-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/screenshotting-server plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/screenshotting-server'] --- import kbnScreenshottingServerObj from './kbn_screenshotting_server.devdocs.json'; diff --git a/api_docs/kbn_search_api_panels.mdx b/api_docs/kbn_search_api_panels.mdx index 51d4960797a15..f3fcb3be74bb7 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-api-panels'] --- import kbnSearchApiPanelsObj from './kbn_search_api_panels.devdocs.json'; diff --git a/api_docs/kbn_search_connectors.mdx b/api_docs/kbn_search_connectors.mdx index cadd97e362ac5..b3e4b43cfbc0c 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-08-28 +date: 2024-08-30 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 1a8fd3247af3f..19d2fa23b9f2e 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-08-28 +date: 2024-08-30 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 7247729be7e97..8c5d6731f51f1 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-08-28 +date: 2024-08-30 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 a41342bccd72a..2293dfe551c2e 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-08-28 +date: 2024-08-30 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 d86973669c29f..1909c149abee0 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-types'] --- import kbnSearchTypesObj from './kbn_search_types.devdocs.json'; diff --git a/api_docs/kbn_security_api_key_management.mdx b/api_docs/kbn_security_api_key_management.mdx index a0b6107bce761..19465b0c5d942 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-api-key-management'] --- import kbnSecurityApiKeyManagementObj from './kbn_security_api_key_management.devdocs.json'; diff --git a/api_docs/kbn_security_authorization_core.mdx b/api_docs/kbn_security_authorization_core.mdx index 2543ce0b567d7..7f6f9c5412bdf 100644 --- a/api_docs/kbn_security_authorization_core.mdx +++ b/api_docs/kbn_security_authorization_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-authorization-core title: "@kbn/security-authorization-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-authorization-core plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-authorization-core'] --- import kbnSecurityAuthorizationCoreObj from './kbn_security_authorization_core.devdocs.json'; diff --git a/api_docs/kbn_security_form_components.mdx b/api_docs/kbn_security_form_components.mdx index 696dc86bd2146..a7e746527bd6b 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-08-28 +date: 2024-08-30 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 9fe7388164be0..8f8c1f4c6ed5a 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-08-28 +date: 2024-08-30 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 ba3ac531fdbec..1ffff2f9df8ac 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-08-28 +date: 2024-08-30 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 6a241f764216f..e082d2a60dc56 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-08-28 +date: 2024-08-30 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.mdx b/api_docs/kbn_security_plugin_types_server.mdx index 29a3d250e1be8..be2680eba9887 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-server'] --- import kbnSecurityPluginTypesServerObj from './kbn_security_plugin_types_server.devdocs.json'; diff --git a/api_docs/kbn_security_role_management_model.mdx b/api_docs/kbn_security_role_management_model.mdx index e89f82becfc8f..7d0ec32ad6719 100644 --- a/api_docs/kbn_security_role_management_model.mdx +++ b/api_docs/kbn_security_role_management_model.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-role-management-model title: "@kbn/security-role-management-model" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-role-management-model plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-role-management-model'] --- import kbnSecurityRoleManagementModelObj from './kbn_security_role_management_model.devdocs.json'; diff --git a/api_docs/kbn_security_solution_common.mdx b/api_docs/kbn_security_solution_common.mdx index 4e2e8d5f4a8e9..a5c78e8c939c2 100644 --- a/api_docs/kbn_security_solution_common.mdx +++ b/api_docs/kbn_security_solution_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-common title: "@kbn/security-solution-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-common plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-common'] --- import kbnSecuritySolutionCommonObj from './kbn_security_solution_common.devdocs.json'; diff --git a/api_docs/kbn_security_solution_distribution_bar.mdx b/api_docs/kbn_security_solution_distribution_bar.mdx index 80cfbae5f048b..6fd0a59eb6ebc 100644 --- a/api_docs/kbn_security_solution_distribution_bar.mdx +++ b/api_docs/kbn_security_solution_distribution_bar.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-distribution-bar title: "@kbn/security-solution-distribution-bar" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-distribution-bar plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-distribution-bar'] --- import kbnSecuritySolutionDistributionBarObj from './kbn_security_solution_distribution_bar.devdocs.json'; diff --git a/api_docs/kbn_security_solution_features.mdx b/api_docs/kbn_security_solution_features.mdx index f7f19a91a2745..6667f6308a09a 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-08-28 +date: 2024-08-30 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 335066f088fb6..81f945be43864 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-08-28 +date: 2024-08-30 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 07ad76da0c47f..437a5a813eefd 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-08-28 +date: 2024-08-30 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 994132ec7b060..7b5dd8fa01cee 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-storybook-config'] --- import kbnSecuritySolutionStorybookConfigObj from './kbn_security_solution_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_security_ui_components.mdx b/api_docs/kbn_security_ui_components.mdx index de423841172ae..151a387dfde35 100644 --- a/api_docs/kbn_security_ui_components.mdx +++ b/api_docs/kbn_security_ui_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-ui-components title: "@kbn/security-ui-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-ui-components plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-ui-components'] --- import kbnSecurityUiComponentsObj from './kbn_security_ui_components.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index 392439ab86f74..30f6aadbe9e24 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-08-28 +date: 2024-08-30 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 38a9306ad8fba..b4f4ce5e62646 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-08-28 +date: 2024-08-30 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 3188323210d8a..09848eb19cdf6 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-08-28 +date: 2024-08-30 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 618d715969b7b..bd41a0e1b3b2d 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-08-28 +date: 2024-08-30 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.mdx b/api_docs/kbn_securitysolution_exception_list_components.mdx index ebab6af4c6553..f7a81f20de341 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-08-28 +date: 2024-08-30 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 bb7b633082e79..c421d0f4ca25e 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-08-28 +date: 2024-08-30 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 e438d16a8743d..e4bfed8040142 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-08-28 +date: 2024-08-30 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 582ab143f575c..ae822f48bdf8e 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-08-28 +date: 2024-08-30 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 01821273c545f..188e756fbb8eb 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-08-28 +date: 2024-08-30 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 044279b527da7..78ecd4ff54642 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-08-28 +date: 2024-08-30 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 7c576fd694c8a..0c42aac46a84a 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-08-28 +date: 2024-08-30 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 0cf28234cc2ca..394bb26cec24b 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-08-28 +date: 2024-08-30 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 a215e3ffca228..790b061523d31 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-08-28 +date: 2024-08-30 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 1a57e4d3b2dc0..909b6ac2c8646 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-08-28 +date: 2024-08-30 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 d314868c3cf14..de89ee44fb8d1 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-08-28 +date: 2024-08-30 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 901ae7160665a..7f654d34f2b73 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-08-28 +date: 2024-08-30 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 b478c534900d9..b0a325bf5f392 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-08-28 +date: 2024-08-30 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.devdocs.json b/api_docs/kbn_server_http_tools.devdocs.json index 241ce4eaf16b7..8a9b443038e43 100644 --- a/api_docs/kbn_server_http_tools.devdocs.json +++ b/api_docs/kbn_server_http_tools.devdocs.json @@ -9,18 +9,10 @@ "objects": [] }, "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { "classes": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.SslConfig", + "id": "def-server.SslConfig", "type": "Class", "tags": [], "label": "SslConfig", @@ -31,7 +23,7 @@ "children": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.SslConfig.enabled", + "id": "def-server.SslConfig.enabled", "type": "boolean", "tags": [], "label": "enabled", @@ -42,7 +34,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.SslConfig.redirectHttpFromPort", + "id": "def-server.SslConfig.redirectHttpFromPort", "type": "number", "tags": [], "label": "redirectHttpFromPort", @@ -56,7 +48,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.SslConfig.key", + "id": "def-server.SslConfig.key", "type": "string", "tags": [], "label": "key", @@ -70,7 +62,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.SslConfig.certificate", + "id": "def-server.SslConfig.certificate", "type": "string", "tags": [], "label": "certificate", @@ -84,7 +76,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.SslConfig.certificateAuthorities", + "id": "def-server.SslConfig.certificateAuthorities", "type": "Array", "tags": [], "label": "certificateAuthorities", @@ -98,7 +90,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.SslConfig.keyPassphrase", + "id": "def-server.SslConfig.keyPassphrase", "type": "string", "tags": [], "label": "keyPassphrase", @@ -112,7 +104,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.SslConfig.requestCert", + "id": "def-server.SslConfig.requestCert", "type": "boolean", "tags": [], "label": "requestCert", @@ -123,7 +115,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.SslConfig.rejectUnauthorized", + "id": "def-server.SslConfig.rejectUnauthorized", "type": "boolean", "tags": [], "label": "rejectUnauthorized", @@ -134,7 +126,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.SslConfig.cipherSuites", + "id": "def-server.SslConfig.cipherSuites", "type": "Array", "tags": [], "label": "cipherSuites", @@ -148,7 +140,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.SslConfig.supportedProtocols", + "id": "def-server.SslConfig.supportedProtocols", "type": "Array", "tags": [], "label": "supportedProtocols", @@ -162,7 +154,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.SslConfig.getSecureOptions", + "id": "def-server.SslConfig.getSecureOptions", "type": "Function", "tags": [], "label": "getSecureOptions", @@ -180,7 +172,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.SslConfig.isEqualTo", + "id": "def-server.SslConfig.isEqualTo", "type": "Function", "tags": [], "label": "isEqualTo", @@ -189,9 +181,9 @@ "(otherConfig: ", { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.SslConfig", + "section": "def-server.SslConfig", "text": "SslConfig" }, ") => boolean" @@ -202,7 +194,7 @@ "children": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.SslConfig.isEqualTo.$1", + "id": "def-server.SslConfig.isEqualTo.$1", "type": "Object", "tags": [], "label": "otherConfig", @@ -210,9 +202,9 @@ "signature": [ { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.SslConfig", + "section": "def-server.SslConfig", "text": "SslConfig" } ], @@ -231,7 +223,7 @@ "functions": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.createServer", + "id": "def-server.createServer", "type": "Function", "tags": [], "label": "createServer", @@ -248,7 +240,7 @@ "children": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.createServer.$1", + "id": "def-server.createServer.$1", "type": "Object", "tags": [], "label": "serverOptions", @@ -267,7 +259,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.defaultValidationErrorHandler", + "id": "def-server.defaultValidationErrorHandler", "type": "Function", "tags": [], "label": "defaultValidationErrorHandler", @@ -289,7 +281,7 @@ "children": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.defaultValidationErrorHandler.$1", + "id": "def-server.defaultValidationErrorHandler.$1", "type": "Object", "tags": [], "label": "request", @@ -304,7 +296,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.defaultValidationErrorHandler.$2", + "id": "def-server.defaultValidationErrorHandler.$2", "type": "Object", "tags": [], "label": "h", @@ -319,7 +311,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.defaultValidationErrorHandler.$3", + "id": "def-server.defaultValidationErrorHandler.$3", "type": "Object", "tags": [], "label": "err", @@ -338,7 +330,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.getRequestId", + "id": "def-server.getRequestId", "type": "Function", "tags": [], "label": "getRequestId", @@ -354,7 +346,7 @@ "children": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.getRequestId.$1", + "id": "def-server.getRequestId.$1", "type": "Object", "tags": [], "label": "request", @@ -369,7 +361,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.getRequestId.$2", + "id": "def-server.getRequestId.$2", "type": "Object", "tags": [], "label": "{ allowFromAnyIp, ipAllowlist }", @@ -380,7 +372,7 @@ "children": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.getRequestId.$2.allowFromAnyIp", + "id": "def-server.getRequestId.$2.allowFromAnyIp", "type": "boolean", "tags": [], "label": "allowFromAnyIp", @@ -391,7 +383,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.getRequestId.$2.ipAllowlist", + "id": "def-server.getRequestId.$2.ipAllowlist", "type": "Array", "tags": [], "label": "ipAllowlist", @@ -411,7 +403,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.getServerListener", + "id": "def-server.getServerListener", "type": "Function", "tags": [], "label": "getServerListener", @@ -420,17 +412,17 @@ "(config: ", { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.IHttpConfig", + "section": "def-server.IHttpConfig", "text": "IHttpConfig" }, ", options: GetServerListenerOptions) => ", { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.ServerListener", + "section": "def-server.ServerListener", "text": "ServerListener" } ], @@ -440,7 +432,7 @@ "children": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.getServerListener.$1", + "id": "def-server.getServerListener.$1", "type": "Object", "tags": [], "label": "config", @@ -448,9 +440,9 @@ "signature": [ { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.IHttpConfig", + "section": "def-server.IHttpConfig", "text": "IHttpConfig" } ], @@ -461,7 +453,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.getServerListener.$2", + "id": "def-server.getServerListener.$2", "type": "Object", "tags": [], "label": "options", @@ -480,7 +472,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.getServerOptions", + "id": "def-server.getServerOptions", "type": "Function", "tags": [], "label": "getServerOptions", @@ -491,9 +483,9 @@ "(config: ", { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.IHttpConfig", + "section": "def-server.IHttpConfig", "text": "IHttpConfig" }, ", { configureTLS = true }: { configureTLS?: boolean | undefined; }) => ", @@ -505,7 +497,7 @@ "children": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.getServerOptions.$1", + "id": "def-server.getServerOptions.$1", "type": "Object", "tags": [], "label": "config", @@ -513,9 +505,9 @@ "signature": [ { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.IHttpConfig", + "section": "def-server.IHttpConfig", "text": "IHttpConfig" } ], @@ -526,7 +518,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.getServerOptions.$2", + "id": "def-server.getServerOptions.$2", "type": "Object", "tags": [], "label": "{ configureTLS = true }", @@ -545,7 +537,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.getServerTLSOptions", + "id": "def-server.getServerTLSOptions", "type": "Function", "tags": [], "label": "getServerTLSOptions", @@ -556,9 +548,9 @@ "(ssl: ", { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.ISslConfig", + "section": "def-server.ISslConfig", "text": "ISslConfig" }, ") => ", @@ -575,7 +567,7 @@ "children": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.getServerTLSOptions.$1", + "id": "def-server.getServerTLSOptions.$1", "type": "Object", "tags": [], "label": "ssl", @@ -583,9 +575,9 @@ "signature": [ { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.ISslConfig", + "section": "def-server.ISslConfig", "text": "ISslConfig" } ], @@ -600,7 +592,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.setTlsConfig", + "id": "def-server.setTlsConfig", "type": "Function", "tags": [], "label": "setTlsConfig", @@ -611,9 +603,9 @@ ", sslConfig: ", { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.ISslConfig", + "section": "def-server.ISslConfig", "text": "ISslConfig" }, ") => void" @@ -624,7 +616,7 @@ "children": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.setTlsConfig.$1", + "id": "def-server.setTlsConfig.$1", "type": "Object", "tags": [], "label": "hapiServer", @@ -639,7 +631,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.setTlsConfig.$2", + "id": "def-server.setTlsConfig.$2", "type": "Object", "tags": [], "label": "sslConfig", @@ -647,9 +639,9 @@ "signature": [ { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.ISslConfig", + "section": "def-server.ISslConfig", "text": "ISslConfig" } ], @@ -666,7 +658,7 @@ "interfaces": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ICorsConfig", + "id": "def-server.ICorsConfig", "type": "Interface", "tags": [], "label": "ICorsConfig", @@ -677,7 +669,7 @@ "children": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ICorsConfig.enabled", + "id": "def-server.ICorsConfig.enabled", "type": "boolean", "tags": [], "label": "enabled", @@ -688,7 +680,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ICorsConfig.allowCredentials", + "id": "def-server.ICorsConfig.allowCredentials", "type": "boolean", "tags": [], "label": "allowCredentials", @@ -699,7 +691,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ICorsConfig.allowOrigin", + "id": "def-server.ICorsConfig.allowOrigin", "type": "Array", "tags": [], "label": "allowOrigin", @@ -716,7 +708,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.IHttpConfig", + "id": "def-server.IHttpConfig", "type": "Interface", "tags": [], "label": "IHttpConfig", @@ -727,7 +719,7 @@ "children": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.IHttpConfig.protocol", + "id": "def-server.IHttpConfig.protocol", "type": "CompoundType", "tags": [], "label": "protocol", @@ -741,7 +733,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.IHttpConfig.host", + "id": "def-server.IHttpConfig.host", "type": "string", "tags": [], "label": "host", @@ -752,7 +744,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.IHttpConfig.port", + "id": "def-server.IHttpConfig.port", "type": "number", "tags": [], "label": "port", @@ -763,7 +755,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.IHttpConfig.maxPayload", + "id": "def-server.IHttpConfig.maxPayload", "type": "Object", "tags": [], "label": "maxPayload", @@ -783,7 +775,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.IHttpConfig.keepaliveTimeout", + "id": "def-server.IHttpConfig.keepaliveTimeout", "type": "number", "tags": [], "label": "keepaliveTimeout", @@ -794,7 +786,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.IHttpConfig.socketTimeout", + "id": "def-server.IHttpConfig.socketTimeout", "type": "number", "tags": [], "label": "socketTimeout", @@ -805,7 +797,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.IHttpConfig.payloadTimeout", + "id": "def-server.IHttpConfig.payloadTimeout", "type": "number", "tags": [], "label": "payloadTimeout", @@ -816,7 +808,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.IHttpConfig.cors", + "id": "def-server.IHttpConfig.cors", "type": "Object", "tags": [], "label": "cors", @@ -824,9 +816,9 @@ "signature": [ { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.ICorsConfig", + "section": "def-server.ICorsConfig", "text": "ICorsConfig" } ], @@ -836,7 +828,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.IHttpConfig.ssl", + "id": "def-server.IHttpConfig.ssl", "type": "Object", "tags": [], "label": "ssl", @@ -844,9 +836,9 @@ "signature": [ { "pluginId": "@kbn/server-http-tools", - "scope": "common", + "scope": "server", "docId": "kibKbnServerHttpToolsPluginApi", - "section": "def-common.ISslConfig", + "section": "def-server.ISslConfig", "text": "ISslConfig" } ], @@ -856,7 +848,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.IHttpConfig.shutdownTimeout", + "id": "def-server.IHttpConfig.shutdownTimeout", "type": "Object", "tags": [], "label": "shutdownTimeout", @@ -870,7 +862,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.IHttpConfig.restrictInternalApis", + "id": "def-server.IHttpConfig.restrictInternalApis", "type": "boolean", "tags": [], "label": "restrictInternalApis", @@ -884,7 +876,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ISslConfig", + "id": "def-server.ISslConfig", "type": "Interface", "tags": [], "label": "ISslConfig", @@ -895,7 +887,7 @@ "children": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ISslConfig.enabled", + "id": "def-server.ISslConfig.enabled", "type": "boolean", "tags": [], "label": "enabled", @@ -906,7 +898,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ISslConfig.key", + "id": "def-server.ISslConfig.key", "type": "string", "tags": [], "label": "key", @@ -920,7 +912,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ISslConfig.certificate", + "id": "def-server.ISslConfig.certificate", "type": "string", "tags": [], "label": "certificate", @@ -934,7 +926,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ISslConfig.certificateAuthorities", + "id": "def-server.ISslConfig.certificateAuthorities", "type": "Array", "tags": [], "label": "certificateAuthorities", @@ -948,7 +940,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ISslConfig.cipherSuites", + "id": "def-server.ISslConfig.cipherSuites", "type": "Array", "tags": [], "label": "cipherSuites", @@ -962,7 +954,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ISslConfig.keyPassphrase", + "id": "def-server.ISslConfig.keyPassphrase", "type": "string", "tags": [], "label": "keyPassphrase", @@ -976,7 +968,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ISslConfig.requestCert", + "id": "def-server.ISslConfig.requestCert", "type": "CompoundType", "tags": [], "label": "requestCert", @@ -990,7 +982,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ISslConfig.rejectUnauthorized", + "id": "def-server.ISslConfig.rejectUnauthorized", "type": "CompoundType", "tags": [], "label": "rejectUnauthorized", @@ -1004,7 +996,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ISslConfig.getSecureOptions", + "id": "def-server.ISslConfig.getSecureOptions", "type": "Function", "tags": [], "label": "getSecureOptions", @@ -1026,7 +1018,7 @@ "misc": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ServerListener", + "id": "def-server.ServerListener", "type": "Type", "tags": [], "label": "ServerListener", @@ -1058,7 +1050,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.ServerProtocol", + "id": "def-server.ServerProtocol", "type": "Type", "tags": [], "label": "ServerProtocol", @@ -1073,7 +1065,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.TLS_V1", + "id": "def-server.TLS_V1", "type": "string", "tags": [], "label": "TLS_V1", @@ -1088,7 +1080,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.TLS_V1_1", + "id": "def-server.TLS_V1_1", "type": "string", "tags": [], "label": "TLS_V1_1", @@ -1103,7 +1095,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.TLS_V1_2", + "id": "def-server.TLS_V1_2", "type": "string", "tags": [], "label": "TLS_V1_2", @@ -1118,7 +1110,7 @@ }, { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.TLS_V1_3", + "id": "def-server.TLS_V1_3", "type": "string", "tags": [], "label": "TLS_V1_3", @@ -1135,7 +1127,7 @@ "objects": [ { "parentPluginId": "@kbn/server-http-tools", - "id": "def-common.sslSchema", + "id": "def-server.sslSchema", "type": "Object", "tags": [], "label": "sslSchema", @@ -1276,5 +1268,13 @@ "initialIsOpen": false } ] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index 51a32a2ca88e5..9bd57280ccc32 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] --- import kbnServerHttpToolsObj from './kbn_server_http_tools.devdocs.json'; @@ -23,20 +23,20 @@ Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core |-------------------|-----------|------------------------|-----------------| | 69 | 0 | 64 | 0 | -## Common +## Server ### Objects - + ### Functions - + ### Classes - + ### Interfaces - + ### Consts, variables and types - + diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index bb5122f7abdf2..363978674c032 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] --- import kbnServerRouteRepositoryObj from './kbn_server_route_repository.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository_client.devdocs.json b/api_docs/kbn_server_route_repository_client.devdocs.json index c4368889eea9e..e1f9ca04f2414 100644 --- a/api_docs/kbn_server_route_repository_client.devdocs.json +++ b/api_docs/kbn_server_route_repository_client.devdocs.json @@ -74,11 +74,83 @@ ], "returnComment": [], "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/server-route-repository-client", + "id": "def-public.isHttpFetchError", + "type": "Function", + "tags": [], + "label": "isHttpFetchError", + "description": [], + "signature": [ + "(error: unknown) => boolean" + ], + "path": "packages/kbn-server-route-repository-client/src/is_http_fetch_error.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/server-route-repository-client", + "id": "def-public.isHttpFetchError.$1", + "type": "Unknown", + "tags": [], + "label": "error", + "description": [], + "signature": [ + "unknown" + ], + "path": "packages/kbn-server-route-repository-client/src/is_http_fetch_error.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false } ], "interfaces": [], "enums": [], "misc": [ + { + "parentPluginId": "@kbn/server-route-repository-client", + "id": "def-public.ClientRequestParamsOf", + "type": "Type", + "tags": [], + "label": "ClientRequestParamsOf", + "description": [], + "signature": [ + "TServerRouteRepository[TEndpoint] extends { endpoint: any; params?: infer TRouteParamsRT extends ", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.RouteParamsRT", + "text": "RouteParamsRT" + }, + " | undefined | undefined; handler: ({}: any) => Promise; } & ", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ServerRouteCreateOptions", + "text": "ServerRouteCreateOptions" + }, + " ? TRouteParamsRT extends ", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.RouteParamsRT", + "text": "RouteParamsRT" + }, + " ? ClientRequestParamsOfType : {} : never" + ], + "path": "packages/kbn-server-route-repository-utils/src/typings.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/server-route-repository-client", "id": "def-public.DefaultClientOptions", @@ -99,6 +171,93 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/server-route-repository-client", + "id": "def-public.RouteRepositoryClient", + "type": "Type", + "tags": [], + "label": "RouteRepositoryClient", + "description": [], + "signature": [ + ">(endpoint: TEndpoint, ...args: MaybeOptionalArgs<", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ClientRequestParamsOf", + "text": "ClientRequestParamsOf" + }, + " & TAdditionalClientOptions>) => Promise<", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ReturnOf", + "text": "ReturnOf" + }, + ">" + ], + "path": "packages/kbn-server-route-repository-utils/src/typings.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/server-route-repository-client", + "id": "def-public.RouteRepositoryClient.$1", + "type": "Uncategorized", + "tags": [], + "label": "endpoint", + "description": [], + "signature": [ + "TEndpoint" + ], + "path": "packages/kbn-server-route-repository-utils/src/typings.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/server-route-repository-client", + "id": "def-public.RouteRepositoryClient.$2", + "type": "Uncategorized", + "tags": [], + "label": "args", + "description": [], + "signature": [ + "RequiredKeys", + "<", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ClientRequestParamsOf", + "text": "ClientRequestParamsOf" + }, + " & TAdditionalClientOptions> extends never ? [] | [", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ClientRequestParamsOf", + "text": "ClientRequestParamsOf" + }, + " & TAdditionalClientOptions] : [", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ClientRequestParamsOf", + "text": "ClientRequestParamsOf" + }, + " & TAdditionalClientOptions]" + ], + "path": "packages/kbn-server-route-repository-utils/src/typings.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false } ], "objects": [] diff --git a/api_docs/kbn_server_route_repository_client.mdx b/api_docs/kbn_server_route_repository_client.mdx index 9ffd326e5cfac..1d2860d262551 100644 --- a/api_docs/kbn_server_route_repository_client.mdx +++ b/api_docs/kbn_server_route_repository_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository-client title: "@kbn/server-route-repository-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository-client plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository-client'] --- import kbnServerRouteRepositoryClientObj from './kbn_server_route_repository_client.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 | |-------------------|-----------|------------------------|-----------------| -| 3 | 0 | 3 | 0 | +| 9 | 0 | 9 | 0 | ## Client diff --git a/api_docs/kbn_server_route_repository_utils.mdx b/api_docs/kbn_server_route_repository_utils.mdx index 9d11f7a675c2c..2c3dfa60fd58d 100644 --- a/api_docs/kbn_server_route_repository_utils.mdx +++ b/api_docs/kbn_server_route_repository_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository-utils title: "@kbn/server-route-repository-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository-utils plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository-utils'] --- import kbnServerRouteRepositoryUtilsObj from './kbn_server_route_repository_utils.devdocs.json'; diff --git a/api_docs/kbn_serverless_common_settings.mdx b/api_docs/kbn_serverless_common_settings.mdx index 6afe8a6caa672..0634b4bad3a4c 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-08-28 +date: 2024-08-30 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 b80830d0a7746..068f61068d2f3 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-08-28 +date: 2024-08-30 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 b39ec89439e4d..2394c3ea519a8 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-08-28 +date: 2024-08-30 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 4102878c1dafb..f9b0dd4af03a2 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-08-28 +date: 2024-08-30 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 b5c75b3edf236..bdce45037ef14 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-08-28 +date: 2024-08-30 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 8738d9092302d..9a208a0c5b1a8 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-storybook-config'] --- import kbnServerlessStorybookConfigObj from './kbn_serverless_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_shared_svg.mdx b/api_docs/kbn_shared_svg.mdx index 461ffad53cd7f..aed194e9bed8d 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-svg'] --- import kbnSharedSvgObj from './kbn_shared_svg.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_avatar_solution.mdx b/api_docs/kbn_shared_ux_avatar_solution.mdx index 189b5f10dbdfb..1c8644b55a29d 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-08-28 +date: 2024-08-30 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 e88646f12a685..2bfbbf1475ff6 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-08-28 +date: 2024-08-30 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 e981ec63d809a..abc2b2c146890 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-08-28 +date: 2024-08-30 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 9b926dd6f6d66..a0d9877c9529c 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-08-28 +date: 2024-08-30 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 dc9444b3fc6ed..e6dc15db0d9f1 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-08-28 +date: 2024-08-30 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 401cca5de77b4..2d8250e8e5083 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-08-28 +date: 2024-08-30 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 3150368de084a..7ca2bb5449430 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-08-28 +date: 2024-08-30 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 395befc767e90..1547397804ded 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-08-28 +date: 2024-08-30 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 78e45743f559f..55f08e929dd22 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-08-28 +date: 2024-08-30 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 8fd1f660b25df..c874f3702d25e 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-08-28 +date: 2024-08-30 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 2d5d3155e6597..c323168cf4c20 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-08-28 +date: 2024-08-30 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 6d1fd8cff6ea0..545fb1039b9f8 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-08-28 +date: 2024-08-30 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 aad5143245e45..abca907165dbc 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-08-28 +date: 2024-08-30 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 f516ddc516879..ed7d18945b17b 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-08-28 +date: 2024-08-30 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 83df896d4bfe9..5f6f3129df61f 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-08-28 +date: 2024-08-30 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 92500688ecbe4..cb41176199935 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-08-28 +date: 2024-08-30 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 a2d33c5befd32..03f0436b29265 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-08-28 +date: 2024-08-30 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 e8973df69791e..896e1c71ced38 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-08-28 +date: 2024-08-30 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 3dc055ee56c21..c5f51ef3c75a0 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-08-28 +date: 2024-08-30 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 9b07bfb9015f5..3b390a60685d4 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-08-28 +date: 2024-08-30 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 2476235127e5c..b8a53ebcbfe97 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-08-28 +date: 2024-08-30 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 6d8093b953ab1..29b74126783d3 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-08-28 +date: 2024-08-30 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 31fa48ba6773c..38e72fd5f60dc 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-08-28 +date: 2024-08-30 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 c62098c797c77..d790542db7236 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-08-28 +date: 2024-08-30 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 b630a1d2ad453..9f562498ab5b8 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-08-28 +date: 2024-08-30 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 75aa7e44715ac..07b769e637e0b 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-08-28 +date: 2024-08-30 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 b6473375de073..33cd43e14e858 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-08-28 +date: 2024-08-30 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 eb80e8070785d..d4c8b38ed497d 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-08-28 +date: 2024-08-30 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 0b9dde4788335..09dd72e96b63d 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-08-28 +date: 2024-08-30 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 c326ab825e1d7..518c359281a92 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-solution-nav'] --- import kbnSharedUxPageSolutionNavObj from './kbn_shared_ux_page_solution_nav.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx index 8c224d1031519..7fd05afbd46db 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-08-28 +date: 2024-08-30 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 b87be238fc5f9..caba7eb4bf2f6 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-08-28 +date: 2024-08-30 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 8732bb53f8147..daba485748705 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-08-28 +date: 2024-08-30 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 cd9ea02f81c80..2a8630f39452e 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-08-28 +date: 2024-08-30 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 fccd6157b7d03..cd0697634a9e7 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-08-28 +date: 2024-08-30 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 38143aabb9b44..995c9dc8dfc1f 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-08-28 +date: 2024-08-30 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 08c681285d4a4..77e4bbaa765d2 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-08-28 +date: 2024-08-30 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 c9edcb8fd2c5e..15bef6fa7d3f1 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-tabbed-modal'] --- import kbnSharedUxTabbedModalObj from './kbn_shared_ux_tabbed_modal.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_table_persist.mdx b/api_docs/kbn_shared_ux_table_persist.mdx index d60c8fd98efc4..63f0fd2ece639 100644 --- a/api_docs/kbn_shared_ux_table_persist.mdx +++ b/api_docs/kbn_shared_ux_table_persist.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-table-persist title: "@kbn/shared-ux-table-persist" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-table-persist plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-table-persist'] --- import kbnSharedUxTablePersistObj from './kbn_shared_ux_table_persist.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index 46721989cd733..96099a026fdc4 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-08-28 +date: 2024-08-30 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 b5a9ae92cbb8e..75ca11ce95e98 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-08-28 +date: 2024-08-30 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 0f84969365045..59dc3f3dcd4b4 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-08-28 +date: 2024-08-30 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 70198997a27dd..21572135afc47 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-08-28 +date: 2024-08-30 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 b1e085fd2c419..c0ccf9bd5a70a 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-08-28 +date: 2024-08-30 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 fdbeaf1fcd583..c3149243b86d5 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-08-28 +date: 2024-08-30 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 ae371d34082d8..9cee6db4fb5aa 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] --- import kbnStorybookObj from './kbn_storybook.devdocs.json'; diff --git a/api_docs/kbn_synthetics_e2e.mdx b/api_docs/kbn_synthetics_e2e.mdx index e3ee59596a8c3..5eb658c854e4c 100644 --- a/api_docs/kbn_synthetics_e2e.mdx +++ b/api_docs/kbn_synthetics_e2e.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-synthetics-e2e title: "@kbn/synthetics-e2e" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/synthetics-e2e plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/synthetics-e2e'] --- import kbnSyntheticsE2eObj from './kbn_synthetics_e2e.devdocs.json'; diff --git a/api_docs/kbn_synthetics_private_location.mdx b/api_docs/kbn_synthetics_private_location.mdx index caaa1271bec03..6618e7aadddba 100644 --- a/api_docs/kbn_synthetics_private_location.mdx +++ b/api_docs/kbn_synthetics_private_location.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-synthetics-private-location title: "@kbn/synthetics-private-location" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/synthetics-private-location plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/synthetics-private-location'] --- import kbnSyntheticsPrivateLocationObj from './kbn_synthetics_private_location.devdocs.json'; diff --git a/api_docs/kbn_telemetry_tools.devdocs.json b/api_docs/kbn_telemetry_tools.devdocs.json index ee5fcebe01d5a..40d5554ca0d6b 100644 --- a/api_docs/kbn_telemetry_tools.devdocs.json +++ b/api_docs/kbn_telemetry_tools.devdocs.json @@ -9,19 +9,11 @@ "objects": [] }, "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { "classes": [], "functions": [ { "parentPluginId": "@kbn/telemetry-tools", - "id": "def-common.assertTelemetryPayload", + "id": "def-server.assertTelemetryPayload", "type": "Function", "tags": [], "label": "assertTelemetryPayload", @@ -41,7 +33,7 @@ "children": [ { "parentPluginId": "@kbn/telemetry-tools", - "id": "def-common.assertTelemetryPayload.$1", + "id": "def-server.assertTelemetryPayload.$1", "type": "Object", "tags": [], "label": "telemetrySchema", @@ -52,7 +44,7 @@ "children": [ { "parentPluginId": "@kbn/telemetry-tools", - "id": "def-common.assertTelemetryPayload.$1.root", + "id": "def-server.assertTelemetryPayload.$1.root", "type": "Object", "tags": [], "label": "root", @@ -66,7 +58,7 @@ }, { "parentPluginId": "@kbn/telemetry-tools", - "id": "def-common.assertTelemetryPayload.$1.plugins", + "id": "def-server.assertTelemetryPayload.$1.plugins", "type": "Object", "tags": [], "label": "plugins", @@ -82,7 +74,7 @@ }, { "parentPluginId": "@kbn/telemetry-tools", - "id": "def-common.assertTelemetryPayload.$2", + "id": "def-server.assertTelemetryPayload.$2", "type": "Unknown", "tags": [], "label": "stats", @@ -103,7 +95,7 @@ }, { "parentPluginId": "@kbn/telemetry-tools", - "id": "def-common.runTelemetryCheck", + "id": "def-server.runTelemetryCheck", "type": "Function", "tags": [], "label": "runTelemetryCheck", @@ -120,7 +112,7 @@ }, { "parentPluginId": "@kbn/telemetry-tools", - "id": "def-common.runTelemetryExtract", + "id": "def-server.runTelemetryExtract", "type": "Function", "tags": [], "label": "runTelemetryExtract", @@ -140,5 +132,13 @@ "enums": [], "misc": [], "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_telemetry_tools.mdx b/api_docs/kbn_telemetry_tools.mdx index 116f954cc7937..83afb885ed95a 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/telemetry-tools'] --- import kbnTelemetryToolsObj from './kbn_telemetry_tools.devdocs.json'; @@ -23,8 +23,8 @@ Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core |-------------------|-----------|------------------------|-----------------| | 7 | 0 | 5 | 1 | -## Common +## Server ### Functions - + diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index 514df724c6a9b..b34c86946c2af 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] --- import kbnTestObj from './kbn_test.devdocs.json'; diff --git a/api_docs/kbn_test_eui_helpers.mdx b/api_docs/kbn_test_eui_helpers.mdx index c644b6ec1d3cd..16ce4577652ac 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-eui-helpers'] --- import kbnTestEuiHelpersObj from './kbn_test_eui_helpers.devdocs.json'; diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index f7626947f5939..02c8fd9c3b955 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-08-28 +date: 2024-08-30 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 7cce6277312d2..e0961e6d6ed8d 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-08-28 +date: 2024-08-30 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 91b540ffb4a54..cf2f0d71e51a0 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-08-28 +date: 2024-08-30 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 eabe1744d761d..367ae7d62c482 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-08-28 +date: 2024-08-30 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 0c7a93f771338..cfcbb8aba0e45 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-08-28 +date: 2024-08-30 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 bc50abb4dcade..d0bbdf1bcfb5d 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-08-28 +date: 2024-08-30 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 6c0a7f3604f88..8c229f7447dc3 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-08-28 +date: 2024-08-30 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 4151d6f35af9a..1154ceb477cb5 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-08-28 +date: 2024-08-30 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 b2d099f1515c6..4683a40194f67 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-08-28 +date: 2024-08-30 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 51b85042d9172..df5a91ed26132 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-08-28 +date: 2024-08-30 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 d80ea1cd158c8..b26b76a4286fa 100644 --- a/api_docs/kbn_ui_shared_deps_src.devdocs.json +++ b/api_docs/kbn_ui_shared_deps_src.devdocs.json @@ -677,6 +677,17 @@ "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ui-shared-deps-src", + "id": "def-common.externals.elasticapmrumcore", + "type": "string", + "tags": [], + "label": "'@elastic/apm-rum-core'", + "description": [], + "path": "packages/kbn-ui-shared-deps-src/src/definitions.js", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/kbn_ui_shared_deps_src.mdx b/api_docs/kbn_ui_shared_deps_src.mdx index 83fee146195a6..c1bb0f0afb9ba 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-08-28 +date: 2024-08-30 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 | |-------------------|-----------|------------------------|-----------------| -| 57 | 0 | 48 | 0 | +| 58 | 0 | 49 | 0 | ## Common diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index 9f0a70a4d90e4..810665271c00b 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-08-28 +date: 2024-08-30 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 e948a7643e194..5862bfb050fc5 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-08-28 +date: 2024-08-30 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 98881bbf5ed56..d07a26506fc5d 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-doc-viewer'] --- import kbnUnifiedDocViewerObj from './kbn_unified_doc_viewer.devdocs.json'; diff --git a/api_docs/kbn_unified_field_list.mdx b/api_docs/kbn_unified_field_list.mdx index 7e82f80f410b0..7b9a6443bc8b9 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-08-28 +date: 2024-08-30 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 5e196681c3126..14643f970abd8 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-08-28 +date: 2024-08-30 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 56ecb24e81450..3ae658fc07799 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-08-28 +date: 2024-08-30 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 d958fd2a39eac..c729f1311958f 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-08-28 +date: 2024-08-30 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 f3d3e63678737..07f75fd88cf80 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-08-28 +date: 2024-08-30 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 e862edc4ef89d..b5beb11b72b85 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-08-28 +date: 2024-08-30 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 f988df9018b4d..9b68ee632474f 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-08-28 +date: 2024-08-30 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.devdocs.json b/api_docs/kbn_utils.devdocs.json index f7fff669338a0..9ce76bbc13e33 100644 --- a/api_docs/kbn_utils.devdocs.json +++ b/api_docs/kbn_utils.devdocs.json @@ -9,19 +9,11 @@ "objects": [] }, "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { "classes": [], "functions": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.concatStreamProviders", + "id": "def-server.concatStreamProviders", "type": "Function", "tags": [ "return" @@ -44,7 +36,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.concatStreamProviders.$1", + "id": "def-server.concatStreamProviders.$1", "type": "Array", "tags": [], "label": "sourceProviders", @@ -61,7 +53,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.concatStreamProviders.$2", + "id": "def-server.concatStreamProviders.$2", "type": "Object", "tags": [], "label": "options", @@ -85,7 +77,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createConcatStream", + "id": "def-server.createConcatStream", "type": "Function", "tags": [ "return" @@ -104,7 +96,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createConcatStream.$1", + "id": "def-server.createConcatStream.$1", "type": "Uncategorized", "tags": [], "label": "initial", @@ -125,7 +117,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createFilterStream", + "id": "def-server.createFilterStream", "type": "Function", "tags": [], "label": "createFilterStream", @@ -140,7 +132,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createFilterStream.$1", + "id": "def-server.createFilterStream.$1", "type": "Function", "tags": [], "label": "fn", @@ -159,7 +151,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createIntersperseStream", + "id": "def-server.createIntersperseStream", "type": "Function", "tags": [ "return" @@ -178,7 +170,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createIntersperseStream.$1", + "id": "def-server.createIntersperseStream.$1", "type": "CompoundType", "tags": [], "label": "intersperseChunk", @@ -197,7 +189,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createListStream", + "id": "def-server.createListStream", "type": "Function", "tags": [ "return" @@ -216,7 +208,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createListStream.$1", + "id": "def-server.createListStream.$1", "type": "CompoundType", "tags": [], "label": "items", @@ -237,7 +229,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createMapStream", + "id": "def-server.createMapStream", "type": "Function", "tags": [], "label": "createMapStream", @@ -252,7 +244,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createMapStream.$1", + "id": "def-server.createMapStream.$1", "type": "Function", "tags": [], "label": "fn", @@ -271,7 +263,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createPromiseFromStreams", + "id": "def-server.createPromiseFromStreams", "type": "Function", "tags": [], "label": "createPromiseFromStreams", @@ -289,7 +281,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createPromiseFromStreams.$1", + "id": "def-server.createPromiseFromStreams.$1", "type": "Object", "tags": [], "label": "streams", @@ -312,7 +304,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createReduceStream", + "id": "def-server.createReduceStream", "type": "Function", "tags": [ "return" @@ -331,7 +323,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createReduceStream.$1", + "id": "def-server.createReduceStream.$1", "type": "Function", "tags": [], "label": "reducer", @@ -346,7 +338,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createReduceStream.$2", + "id": "def-server.createReduceStream.$2", "type": "Uncategorized", "tags": [], "label": "initial", @@ -367,7 +359,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createReplaceStream", + "id": "def-server.createReplaceStream", "type": "Function", "tags": [], "label": "createReplaceStream", @@ -382,7 +374,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createReplaceStream.$1", + "id": "def-server.createReplaceStream.$1", "type": "string", "tags": [], "label": "toReplace", @@ -397,7 +389,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createReplaceStream.$2", + "id": "def-server.createReplaceStream.$2", "type": "CompoundType", "tags": [], "label": "replacement", @@ -416,7 +408,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.createSplitStream", + "id": "def-server.createSplitStream", "type": "Function", "tags": [ "return" @@ -435,7 +427,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.createSplitStream.$1", + "id": "def-server.createSplitStream.$1", "type": "CompoundType", "tags": [], "label": "splitChunk", @@ -454,7 +446,7 @@ }, { "parentPluginId": "@kbn/utils", - "id": "def-common.prettyPrintAndSortKeys", + "id": "def-server.prettyPrintAndSortKeys", "type": "Function", "tags": [], "label": "prettyPrintAndSortKeys", @@ -470,7 +462,7 @@ "children": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.prettyPrintAndSortKeys.$1", + "id": "def-server.prettyPrintAndSortKeys.$1", "type": "Uncategorized", "tags": [], "label": "object", @@ -493,7 +485,7 @@ "misc": [ { "parentPluginId": "@kbn/utils", - "id": "def-common.PathConfigType", + "id": "def-server.PathConfigType", "type": "Type", "tags": [], "label": "PathConfigType", @@ -508,5 +500,13 @@ } ], "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_utils.mdx b/api_docs/kbn_utils.mdx index 48607ddc047b5..15eebe16d2ef7 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] --- import kbnUtilsObj from './kbn_utils.devdocs.json'; @@ -23,11 +23,11 @@ Contact [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kiban |-------------------|-----------|------------------------|-----------------| | 26 | 0 | 15 | 0 | -## Common +## Server ### Functions - + ### Consts, variables and types - + diff --git a/api_docs/kbn_visualization_ui_components.devdocs.json b/api_docs/kbn_visualization_ui_components.devdocs.json index 0ef41a076c1a0..4a74375de3e56 100644 --- a/api_docs/kbn_visualization_ui_components.devdocs.json +++ b/api_docs/kbn_visualization_ui_components.devdocs.json @@ -47,7 +47,15 @@ "label": "ColorPicker", "description": [], "signature": [ - "({ overwriteColor, defaultColor, isClearable, setConfig, label, disableHelpTooltip, disabledMessage, showAlpha, }: { overwriteColor?: string | null | undefined; defaultColor?: string | null | undefined; isClearable?: boolean | undefined; setConfig: (config: { color?: string | undefined; }) => void; label?: string | undefined; disableHelpTooltip?: boolean | undefined; disabledMessage?: string | undefined; showAlpha?: boolean | undefined; }) => JSX.Element" + "({ overwriteColor, defaultColor, isClearable, setConfig, label, disableHelpTooltip, disabledMessage, showAlpha, }: ", + { + "pluginId": "@kbn/visualization-ui-components", + "scope": "public", + "docId": "kibKbnVisualizationUiComponentsPluginApi", + "section": "def-public.ColorPickerProps", + "text": "ColorPickerProps" + }, + ") => JSX.Element" ], "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", "deprecated": false, @@ -60,153 +68,19 @@ "tags": [], "label": "{\n overwriteColor,\n defaultColor,\n isClearable,\n setConfig,\n label,\n disableHelpTooltip,\n disabledMessage,\n showAlpha,\n}", "description": [], + "signature": [ + { + "pluginId": "@kbn/visualization-ui-components", + "scope": "public", + "docId": "kibKbnVisualizationUiComponentsPluginApi", + "section": "def-public.ColorPickerProps", + "text": "ColorPickerProps" + } + ], "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", "deprecated": false, "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.overwriteColor", - "type": "CompoundType", - "tags": [], - "label": "overwriteColor", - "description": [], - "signature": [ - "string | null | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.defaultColor", - "type": "CompoundType", - "tags": [], - "label": "defaultColor", - "description": [], - "signature": [ - "string | null | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.isClearable", - "type": "CompoundType", - "tags": [], - "label": "isClearable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.setConfig", - "type": "Function", - "tags": [], - "label": "setConfig", - "description": [], - "signature": [ - "(config: { color?: string | undefined; }) => void" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.setConfig.$1", - "type": "Object", - "tags": [], - "label": "config", - "description": [], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.setConfig.$1.color", - "type": "string", - "tags": [], - "label": "color", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - } - ] - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.label", - "type": "string", - "tags": [], - "label": "label", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.disableHelpTooltip", - "type": "CompoundType", - "tags": [], - "label": "disableHelpTooltip", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.disabledMessage", - "type": "string", - "tags": [], - "label": "disabledMessage", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.ColorPicker.$1.showAlpha", - "type": "CompoundType", - "tags": [], - "label": "showAlpha", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", - "deprecated": false, - "trackAdoption": false - } - ] + "isRequired": true } ], "returnComment": [], @@ -812,242 +686,75 @@ "trackAdoption": false, "isRequired": true } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput", - "type": "Function", - "tags": [], - "label": "FilterQueryInput", - "description": [], - "signature": [ - "({\n inputFilter,\n onChange,\n dataView,\n helpMessage,\n label = filterByLabel,\n initiallyOpen,\n ['data-test-subj']: dataTestSubj,\n queryInputServices,\n appName,\n}: { inputFilter: ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Query", - "text": "Query" - }, - " | undefined; onChange: (query: ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Query", - "text": "Query" - }, - ") => void; dataView: ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.DataViewBase", - "text": "DataViewBase" - }, - "; helpMessage?: string | null | undefined; label?: string | undefined; initiallyOpen?: boolean | undefined; \"data-test-subj\"?: string | undefined; queryInputServices: ", - { - "pluginId": "@kbn/visualization-ui-components", - "scope": "public", - "docId": "kibKbnVisualizationUiComponentsPluginApi", - "section": "def-public.QueryInputServices", - "text": "QueryInputServices" - }, - "; appName: string; }) => JSX.Element" - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1", - "type": "Object", - "tags": [], - "label": "{\n inputFilter,\n onChange,\n dataView,\n helpMessage,\n label = filterByLabel,\n initiallyOpen,\n ['data-test-subj']: dataTestSubj,\n queryInputServices,\n appName,\n}", - "description": [], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.inputFilter", - "type": "Object", - "tags": [], - "label": "inputFilter", - "description": [], - "signature": [ - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Query", - "text": "Query" - }, - " | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.onChange", - "type": "Function", - "tags": [], - "label": "onChange", - "description": [], - "signature": [ - "(query: ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Query", - "text": "Query" - }, - ") => void" - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.onChange.$1", - "type": "Object", - "tags": [], - "label": "query", - "description": [], - "signature": [ - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Query", - "text": "Query" - } - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.dataView", - "type": "Object", - "tags": [], - "label": "dataView", - "description": [], - "signature": [ - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.DataViewBase", - "text": "DataViewBase" - } - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.helpMessage", - "type": "CompoundType", - "tags": [], - "label": "helpMessage", - "description": [], - "signature": [ - "string | null | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.label", - "type": "string", - "tags": [], - "label": "label", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.initiallyOpen", - "type": "CompoundType", - "tags": [], - "label": "initiallyOpen", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.datatestsubj", - "type": "string", - "tags": [], - "label": "['data-test-subj']", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.queryInputServices", - "type": "Object", - "tags": [], - "label": "queryInputServices", - "description": [], - "signature": [ - { - "pluginId": "@kbn/visualization-ui-components", - "scope": "public", - "docId": "kibKbnVisualizationUiComponentsPluginApi", - "section": "def-public.QueryInputServices", - "text": "QueryInputServices" - } - ], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/visualization-ui-components", - "id": "def-public.FilterQueryInput.$1.appName", - "type": "string", - "tags": [], - "label": "appName", - "description": [], - "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", - "deprecated": false, - "trackAdoption": false - } - ] + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.FilterQueryInput", + "type": "Function", + "tags": [], + "label": "FilterQueryInput", + "description": [], + "signature": [ + "({\n inputFilter,\n onChange,\n dataView,\n helpMessage,\n label = filterByLabel,\n initiallyOpen,\n ['data-test-subj']: dataTestSubj,\n queryInputServices,\n appName,\n}: ", + "FilterQueryInputProps", + ") => JSX.Element" + ], + "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.FilterQueryInput.$1", + "type": "Object", + "tags": [], + "label": "{\n inputFilter,\n onChange,\n dataView,\n helpMessage,\n label = filterByLabel,\n initiallyOpen,\n ['data-test-subj']: dataTestSubj,\n queryInputServices,\n appName,\n}", + "description": [], + "signature": [ + "FilterQueryInputProps" + ], + "path": "packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.hasIcon", + "type": "Function", + "tags": [], + "label": "hasIcon", + "description": [ + "\nIcon checking logic. It makes sure an icon has actual content." + ], + "signature": [ + "(icon: string | undefined) => boolean" + ], + "path": "packages/kbn-visualization-ui-components/util.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.hasIcon.$1", + "type": "string", + "tags": [], + "label": "icon", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-visualization-ui-components/util.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false } ], "returnComment": [], @@ -1283,6 +990,64 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.iconSortCriteria", + "type": "Function", + "tags": [], + "label": "iconSortCriteria", + "description": [ + "\nSorting criteria for icons sets. It makes sure empty icon is always on top." + ], + "signature": [ + "(a: { value: T; label: string; icon?: ", + "IconType", + " | T | undefined; shouldRotate?: boolean | undefined; }, b: { value: T; label: string; icon?: ", + "IconType", + " | T | undefined; shouldRotate?: boolean | undefined; }) => number" + ], + "path": "packages/kbn-visualization-ui-components/util.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.iconSortCriteria.$1", + "type": "Object", + "tags": [], + "label": "a", + "description": [], + "signature": [ + "{ value: T; label: string; icon?: ", + "IconType", + " | T | undefined; shouldRotate?: boolean | undefined; }" + ], + "path": "packages/kbn-visualization-ui-components/util.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.iconSortCriteria.$2", + "type": "Object", + "tags": [], + "label": "b", + "description": [], + "signature": [ + "{ value: T; label: string; icon?: ", + "IconType", + " | T | undefined; shouldRotate?: boolean | undefined; }" + ], + "path": "packages/kbn-visualization-ui-components/util.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/visualization-ui-components", "id": "def-public.isFieldLensCompatible", @@ -2141,6 +1906,162 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps", + "type": "Interface", + "tags": [], + "label": "ColorPickerProps", + "description": [], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.overwriteColor", + "type": "CompoundType", + "tags": [], + "label": "overwriteColor", + "description": [], + "signature": [ + "string | null | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.defaultColor", + "type": "CompoundType", + "tags": [], + "label": "defaultColor", + "description": [], + "signature": [ + "string | null | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.isClearable", + "type": "CompoundType", + "tags": [], + "label": "isClearable", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.setConfig", + "type": "Function", + "tags": [], + "label": "setConfig", + "description": [], + "signature": [ + "(config: { color?: string | undefined; }) => void" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.setConfig.$1", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.setConfig.$1.color", + "type": "string", + "tags": [], + "label": "color", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.label", + "type": "string", + "tags": [], + "label": "label", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.disableHelpTooltip", + "type": "CompoundType", + "tags": [], + "label": "disableHelpTooltip", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.disabledMessage", + "type": "string", + "tags": [], + "label": "disabledMessage", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.showAlpha", + "type": "CompoundType", + "tags": [], + "label": "showAlpha", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/visualization-ui-components", "id": "def-public.FieldOptionValue", @@ -2524,6 +2445,46 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.sharedSetOfIcons", + "type": "Array", + "tags": [], + "label": "sharedSetOfIcons", + "description": [ + "\nThis is the minimal icons set.\nSo far it is computed from Reference line and Metric chart icons.\nNeeds to consider annotation icons set too in the future." + ], + "signature": [ + "{ value: ", + { + "pluginId": "@kbn/visualization-ui-components", + "scope": "public", + "docId": "kibKbnVisualizationUiComponentsPluginApi", + "section": "def-public.SharedSetOfIcons", + "text": "SharedSetOfIcons" + }, + "; label: string; icon?: string | React.ComponentClass<{}, any> | React.FunctionComponent<{}> | undefined; shouldRotate?: boolean | undefined; }[]" + ], + "path": "packages/kbn-visualization-ui-components/util.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.SharedSetOfIcons", + "type": "Type", + "tags": [], + "label": "SharedSetOfIcons", + "description": [], + "signature": [ + "\"alert\" | \"tag\" | \"asterisk\" | \"bell\" | \"bolt\" | \"bug\" | \"editorComment\" | \"empty\" | \"flag\" | \"heart\" | \"mapMarker\" | \"starEmpty\"" + ], + "path": "packages/kbn-visualization-ui-components/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false } ], "objects": [] diff --git a/api_docs/kbn_visualization_ui_components.mdx b/api_docs/kbn_visualization_ui_components.mdx index 62937260ebc20..26bcb34d992bf 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-08-28 +date: 2024-08-30 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 | |-------------------|-----------|------------------------|-----------------| -| 146 | 0 | 143 | 3 | +| 144 | 0 | 138 | 4 | ## Client diff --git a/api_docs/kbn_visualization_utils.mdx b/api_docs/kbn_visualization_utils.mdx index d2bf83d048f9a..f8ea779414389 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/visualization-utils'] --- import kbnVisualizationUtilsObj from './kbn_visualization_utils.devdocs.json'; diff --git a/api_docs/kbn_xstate_utils.mdx b/api_docs/kbn_xstate_utils.mdx index c4f5ba2a2089a..902e2e41ef148 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-08-28 +date: 2024-08-30 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 638e43b6b07e7..9beba78f7e662 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/yarn-lock-validator'] --- import kbnYarnLockValidatorObj from './kbn_yarn_lock_validator.devdocs.json'; diff --git a/api_docs/kbn_zod.mdx b/api_docs/kbn_zod.mdx index 55704223fde70..bf14aeda2eea6 100644 --- a/api_docs/kbn_zod.mdx +++ b/api_docs/kbn_zod.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-zod title: "@kbn/zod" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/zod plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/zod'] --- import kbnZodObj from './kbn_zod.devdocs.json'; diff --git a/api_docs/kbn_zod_helpers.mdx b/api_docs/kbn_zod_helpers.mdx index 39bc770f0acf0..c283a15fe7406 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-08-28 +date: 2024-08-30 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 4bb33e1657aeb..fd01289e41418 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-08-28 +date: 2024-08-30 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 ecf089c261f12..3d889c673c5f1 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-08-28 +date: 2024-08-30 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 43523892ee230..afbef6b36a752 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-08-28 +date: 2024-08-30 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 fa1ce78f6d3dc..1154ebc1a339d 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-08-28 +date: 2024-08-30 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 5606127fce12c..f0eb9d0f9b29a 100644 --- a/api_docs/lens.devdocs.json +++ b/api_docs/lens.devdocs.json @@ -2510,7 +2510,7 @@ "section": "def-public.IncompleteColumn", "text": "IncompleteColumn" }, - "> | undefined" + " | undefined> | undefined" ], "path": "x-pack/plugins/lens/public/datasources/form_based/types.ts", "deprecated": false, @@ -11776,7 +11776,7 @@ "section": "def-public.IncompleteColumn", "text": "IncompleteColumn" }, - "> | undefined; sampling?: number | undefined; }" + " | undefined> | undefined; sampling?: number | undefined; }" ], "path": "x-pack/plugins/lens/public/datasources/form_based/types.ts", "deprecated": false, diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index 0c704b62488b5..16d09b573e71f 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] --- import lensObj from './lens.devdocs.json'; diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index 6593d92ac0cf2..26868ba930a77 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-08-28 +date: 2024-08-30 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 c897708732ac2..e007bb9da948c 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-08-28 +date: 2024-08-30 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 9def421b2bd58..14f178d2e1571 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] --- import licensingObj from './licensing.devdocs.json'; diff --git a/api_docs/links.mdx b/api_docs/links.mdx index c2c599f2ef56f..51088bda8b8df 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'links'] --- import linksObj from './links.devdocs.json'; diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index 8f8f41940eef0..47f7313ab808d 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] --- import listsObj from './lists.devdocs.json'; diff --git a/api_docs/logs_data_access.mdx b/api_docs/logs_data_access.mdx index f20babe54895f..814ed55db9250 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsDataAccess'] --- import logsDataAccessObj from './logs_data_access.devdocs.json'; diff --git a/api_docs/logs_explorer.mdx b/api_docs/logs_explorer.mdx index b34e18e99fb6a..171b3e61d5f17 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-08-28 +date: 2024-08-30 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 32758ecf4558d..e3cf1d13960f4 100644 --- a/api_docs/logs_shared.devdocs.json +++ b/api_docs/logs_shared.devdocs.json @@ -3173,6 +3173,137 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "logsShared", + "id": "def-public.UpdatedDateRange", + "type": "Interface", + "tags": [], + "label": "UpdatedDateRange", + "description": [], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "logsShared", + "id": "def-public.UpdatedDateRange.startDateExpression", + "type": "string", + "tags": [], + "label": "startDateExpression", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "logsShared", + "id": "def-public.UpdatedDateRange.endDateExpression", + "type": "string", + "tags": [], + "label": "endDateExpression", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "logsShared", + "id": "def-public.VisibleInterval", + "type": "Interface", + "tags": [], + "label": "VisibleInterval", + "description": [], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "logsShared", + "id": "def-public.VisibleInterval.pagesBeforeStart", + "type": "number", + "tags": [], + "label": "pagesBeforeStart", + "description": [], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "logsShared", + "id": "def-public.VisibleInterval.pagesAfterEnd", + "type": "number", + "tags": [], + "label": "pagesAfterEnd", + "description": [], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "logsShared", + "id": "def-public.VisibleInterval.startKey", + "type": "CompoundType", + "tags": [], + "label": "startKey", + "description": [], + "signature": [ + "({ time: string; tiebreaker: number; } & { gid?: string | undefined; fromAutoReload?: boolean | undefined; }) | null" + ], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "logsShared", + "id": "def-public.VisibleInterval.middleKey", + "type": "CompoundType", + "tags": [], + "label": "middleKey", + "description": [], + "signature": [ + "({ time: string; tiebreaker: number; } & { gid?: string | undefined; fromAutoReload?: boolean | undefined; }) | null" + ], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "logsShared", + "id": "def-public.VisibleInterval.endKey", + "type": "CompoundType", + "tags": [], + "label": "endKey", + "description": [], + "signature": [ + "({ time: string; tiebreaker: number; } & { gid?: string | undefined; fromAutoReload?: boolean | undefined; }) | null" + ], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "logsShared", + "id": "def-public.VisibleInterval.fromScroll", + "type": "boolean", + "tags": [], + "label": "fromScroll", + "description": [], + "path": "x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "logsShared", "id": "def-public.WithSummaryProps", diff --git a/api_docs/logs_shared.mdx b/api_docs/logs_shared.mdx index 6667c5cb456c2..eadcd99229eda 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-08-28 +date: 2024-08-30 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 | |-------------------|-----------|------------------------|-----------------| -| 300 | 0 | 272 | 32 | +| 310 | 0 | 282 | 32 | ## Client diff --git a/api_docs/management.mdx b/api_docs/management.mdx index 4398bccb7e260..d44eb972def1d 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-08-28 +date: 2024-08-30 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 cba8b57ab112e..0ad5f0f12efbb 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] --- import mapsObj from './maps.devdocs.json'; diff --git a/api_docs/maps_ems.devdocs.json b/api_docs/maps_ems.devdocs.json index 2c555e52a83bc..533a678e1eeb8 100644 --- a/api_docs/maps_ems.devdocs.json +++ b/api_docs/maps_ems.devdocs.json @@ -97,7 +97,7 @@ "signature": [ "{ readonly tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; readonly includeElasticMapsService: boolean; readonly emsUrl: string; readonly emsFileApiUrl: string; readonly emsTileApiUrl: string; readonly emsLandingPageUrl: string; readonly emsFontLibraryUrl: string; readonly emsTileLayerId: Readonly<{} & { dark: string; bright: string; desaturated: string; }>; }" ], - "path": "src/plugins/maps_ems/config.ts", + "path": "src/plugins/maps_ems/server/config.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -112,7 +112,7 @@ "signature": [ "{ readonly url?: string | undefined; readonly options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }" ], - "path": "src/plugins/maps_ems/config.ts", + "path": "src/plugins/maps_ems/server/config.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index e37260e03bb95..a1d46dd38e8c9 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] --- import mapsEmsObj from './maps_ems.devdocs.json'; diff --git a/api_docs/metrics_data_access.mdx b/api_docs/metrics_data_access.mdx index 1358223a09b61..bf452756451be 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-08-28 +date: 2024-08-30 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 97bdd17abc551..8c531d9ab6dfa 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-08-28 +date: 2024-08-30 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 2bc70fc829358..33bd59e285f44 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-08-28 +date: 2024-08-30 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 b38e1bf50ed8a..b51223c7080a2 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-08-28 +date: 2024-08-30 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 07722a96d5724..32eb42ac3bd6d 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-08-28 +date: 2024-08-30 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 9b36411f3a1ac..0d8f54f6b08c9 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-08-28 +date: 2024-08-30 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 765b5b88bb15f..6bccad9026ecf 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-08-28 +date: 2024-08-30 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 ec7d7f8cfcc90..ebcf0c3d76d99 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-08-28 +date: 2024-08-30 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 ac4feed3fbfe6..f02c6398403d8 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-08-28 +date: 2024-08-30 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 eaa4e3814d3d8..9be924035f454 100644 --- a/api_docs/observability.devdocs.json +++ b/api_docs/observability.devdocs.json @@ -8913,7 +8913,11 @@ "StringC", "; }>, ", "PartialC", - "<{ 'service.name': ", + "<{ alert_rule_parameter_time_size: ", + "StringC", + "; alert_rule_parameter_time_unit: ", + "StringC", + "; 'service.name': ", "StringC", "; 'service.environment': ", "StringC", @@ -8935,7 +8939,7 @@ "section": "def-server.ObservabilityRouteHandlerResources", "text": "ObservabilityRouteHandlerResources" }, - " & { params: { query: { alert_started_at: string; } & { 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.name'?: string | undefined; 'host.name'?: string | undefined; 'container.id'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; }; }; }) => Promise<{ alertContext: ", + " & { params: { query: { alert_started_at: string; } & { alert_rule_parameter_time_size?: string | undefined; alert_rule_parameter_time_unit?: string | undefined; 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.name'?: string | undefined; 'host.name'?: string | undefined; 'container.id'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; }; }; }) => Promise<{ alertContext: ", "AlertDetailsContextualInsight", "[]; }>; } & ", { @@ -9037,7 +9041,11 @@ "StringC", "; }>, ", "PartialC", - "<{ 'service.name': ", + "<{ alert_rule_parameter_time_size: ", + "StringC", + "; alert_rule_parameter_time_unit: ", + "StringC", + "; 'service.name': ", "StringC", "; 'service.environment': ", "StringC", @@ -9059,7 +9067,7 @@ "section": "def-server.ObservabilityRouteHandlerResources", "text": "ObservabilityRouteHandlerResources" }, - " & { params: { query: { alert_started_at: string; } & { 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.name'?: string | undefined; 'host.name'?: string | undefined; 'container.id'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; }; }; }) => Promise<{ alertContext: ", + " & { params: { query: { alert_started_at: string; } & { alert_rule_parameter_time_size?: string | undefined; alert_rule_parameter_time_unit?: string | undefined; 'service.name'?: string | undefined; 'service.environment'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.name'?: string | undefined; 'host.name'?: string | undefined; 'container.id'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; }; }; }) => Promise<{ alertContext: ", "AlertDetailsContextualInsight", "[]; }>; } & ", { diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index 557f7183d05e9..8c69d86bee49b 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] --- import observabilityObj from './observability.devdocs.json'; diff --git a/api_docs/observability_a_i_assistant.devdocs.json b/api_docs/observability_a_i_assistant.devdocs.json index a1383e4f2ba6f..2315816499755 100644 --- a/api_docs/observability_a_i_assistant.devdocs.json +++ b/api_docs/observability_a_i_assistant.devdocs.json @@ -1606,7 +1606,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; persist: boolean; disableFunctions: boolean | { except: string[]; }; signal: AbortSignal; responseLanguage?: string | undefined; instructions?: ", + "[]; persist: boolean; disableFunctions: boolean | { except: string[]; }; signal: AbortSignal; instructions?: ", "AdHocInstruction", "[] | undefined; }) => ", "Observable", @@ -1738,20 +1738,6 @@ "deprecated": false, "trackAdoption": false }, - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-public.ObservabilityAIAssistantChatService.complete.$1.responseLanguage", - "type": "string", - "tags": [], - "label": "responseLanguage", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", - "deprecated": false, - "trackAdoption": false - }, { "parentPluginId": "observabilityAIAssistant", "id": "def-public.ObservabilityAIAssistantChatService.complete.$1.instructions", @@ -2526,8 +2512,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -2592,7 +2576,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", "Readable", ">; } & ", "ObservabilityAIAssistantRouteCreateOptions", @@ -2634,8 +2618,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -2686,7 +2668,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", "ObservabilityAIAssistantScreenContextRequest", "[]; }; }; }) => Promise<", "Readable", @@ -3232,8 +3214,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -3298,7 +3278,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", "Readable", ">; } & ", "ObservabilityAIAssistantRouteCreateOptions", @@ -3340,8 +3320,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -3392,7 +3370,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", "ObservabilityAIAssistantScreenContextRequest", "[]; }; }; }) => Promise<", "Readable", @@ -4060,13 +4038,13 @@ }, { "parentPluginId": "observabilityAIAssistant", - "id": "def-public.aiAssistantResponseLanguage", + "id": "def-public.aiAssistantPreferredAIAssistantType", "type": "string", "tags": [], - "label": "aiAssistantResponseLanguage", + "label": "aiAssistantPreferredAIAssistantType", "description": [], "signature": [ - "\"observability:aiAssistantResponseLanguage\"" + "\"aiAssistant:preferredAIAssistantType\"" ], "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", "deprecated": false, @@ -4565,8 +4543,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -4631,7 +4607,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", "Readable", ">; } & ", "ObservabilityAIAssistantRouteCreateOptions", @@ -4673,8 +4649,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -4725,7 +4699,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", "ObservabilityAIAssistantScreenContextRequest", "[]; }; }; }) => Promise<", "Readable", @@ -5032,21 +5006,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-public.LANGUAGE_OPTIONS", - "type": "Array", - "tags": [], - "label": "LANGUAGE_OPTIONS", - "description": [], - "signature": [ - "{ value: string; label: string; }[]" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/language_options.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "observabilityAIAssistant", "id": "def-public.ObservabilityAIAssistantAPIClientRequestParamsOf", @@ -5509,8 +5468,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -5575,7 +5532,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", "Readable", ">; } & ", "ObservabilityAIAssistantRouteCreateOptions", @@ -5617,8 +5574,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -5669,7 +5624,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", "ObservabilityAIAssistantScreenContextRequest", "[]; }; }; }) => Promise<", "Readable", @@ -6030,21 +5985,6 @@ } ], "initialIsOpen": false - }, - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-public.DEFAULT_LANGUAGE_OPTION", - "type": "Object", - "tags": [], - "label": "DEFAULT_LANGUAGE_OPTION", - "description": [], - "signature": [ - "{ value: string; label: string; }" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/language_options.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false } ], "setup": { @@ -6274,22 +6214,6 @@ } ] }, - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-public.ObservabilityAIAssistantPublicStart.useUserPreferredLanguage", - "type": "Function", - "tags": [], - "label": "useUserPreferredLanguage", - "description": [], - "signature": [ - "() => { selectedLanguage: string; getPreferredLanguage: () => string; }" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, { "parentPluginId": "observabilityAIAssistant", "id": "def-public.ObservabilityAIAssistantPublicStart.getContextualInsightMessages", @@ -6498,21 +6422,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-server.aiAssistantResponseLanguage", - "type": "string", - "tags": [], - "label": "aiAssistantResponseLanguage", - "description": [], - "signature": [ - "\"observability:aiAssistantResponseLanguage\"" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "observabilityAIAssistant", "id": "def-server.aiAssistantSearchConnectorIndexPattern", @@ -7005,8 +6914,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -7071,7 +6978,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body?: { actions?: ({ name: string; description: string; } & { parameters?: any; })[] | undefined; } | undefined; query?: { format?: \"default\" | \"openai\" | undefined; } | undefined; }; }) => Promise<", "Readable", ">; } & ", "ObservabilityAIAssistantRouteCreateOptions", @@ -7113,8 +7020,6 @@ "StringC", "; title: ", "StringC", - "; responseLanguage: ", - "StringC", "; disableFunctions: ", "UnionC", "<[", @@ -7165,7 +7070,7 @@ "section": "def-common.Message", "text": "Message" }, - "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; responseLanguage?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", + "[]; connectorId: string; persist: boolean; } & { conversationId?: string | undefined; title?: string | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; instructions?: ({ doc_id?: string | undefined; } & { text: string; instruction_type: \"user_instruction\" | \"application_instruction\"; })[] | undefined; }; } & { body: { screenContexts: ", "ObservabilityAIAssistantScreenContextRequest", "[]; }; }; }) => Promise<", "Readable", @@ -8427,21 +8332,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-common.aiAssistantResponseLanguage", - "type": "string", - "tags": [], - "label": "aiAssistantResponseLanguage", - "description": [], - "signature": [ - "\"observability:aiAssistantResponseLanguage\"" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "observabilityAIAssistant", "id": "def-common.aiAssistantSearchConnectorIndexPattern", @@ -8713,21 +8603,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-common.LANGUAGE_OPTIONS", - "type": "Array", - "tags": [], - "label": "LANGUAGE_OPTIONS", - "description": [], - "signature": [ - "{ value: string; label: string; }[]" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/language_options.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "observabilityAIAssistant", "id": "def-common.MessageAddEvent", @@ -8884,22 +8759,6 @@ "initialIsOpen": false } ], - "objects": [ - { - "parentPluginId": "observabilityAIAssistant", - "id": "def-common.DEFAULT_LANGUAGE_OPTION", - "type": "Object", - "tags": [], - "label": "DEFAULT_LANGUAGE_OPTION", - "description": [], - "signature": [ - "{ value: string; label: string; }" - ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/language_options.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - } - ] + "objects": [] } } \ No newline at end of file diff --git a/api_docs/observability_a_i_assistant.mdx b/api_docs/observability_a_i_assistant.mdx index 0ba82e35e65d9..46c84be210e5b 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityAIAssistant'] --- import observabilityAIAssistantObj from './observability_a_i_assistant.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 294 | 1 | 292 | 27 | +| 286 | 1 | 284 | 27 | ## Client @@ -65,9 +65,6 @@ Contact [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai ## Common -### Objects - - ### Functions diff --git a/api_docs/observability_a_i_assistant_app.mdx b/api_docs/observability_a_i_assistant_app.mdx index d847dce6c890d..026c5f4f0398a 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-08-28 +date: 2024-08-30 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 5a7011f5060ec..05211be47327b 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-08-28 +date: 2024-08-30 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 a72c932c61e4b..0df98628f2f78 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-08-28 +date: 2024-08-30 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 54238022c6ba4..97e27490b1152 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-08-28 +date: 2024-08-30 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 d2e0c684198f8..26e804c74aba9 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-08-28 +date: 2024-08-30 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 068b9d44fde19..905f061472be3 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-08-28 +date: 2024-08-30 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 9e005ff8a25fa..f63e19129cc2e 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-08-28 +date: 2024-08-30 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 c2adadb526038..a22ddf9a6ed04 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-08-28 +date: 2024-08-30 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 | |--------------|----------|------------------------| -| 848 | 723 | 46 | +| 850 | 724 | 46 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 52848 | 243 | 39700 | 1939 | +| 52869 | 243 | 39705 | 1941 | ## Plugin Directory @@ -121,7 +121,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 127 | 2 | 100 | 4 | | | [@elastic/security-scalability](https://github.com/orgs/elastic/teams/security-scalability) | Plugin implementing the Integration Assistant API and UI | 54 | 0 | 46 | 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-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 92 | 0 | 92 | 5 | +| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 43 | 0 | 43 | 4 | | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 5 | 0 | 5 | 2 | | | [@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 | @@ -136,7 +136,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/security-detection-engine](https://github.com/orgs/elastic/teams/security-detection-engine) | - | 226 | 0 | 97 | 52 | | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 13 | 0 | 11 | 7 | | | [@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. | 122 | 4 | 122 | 23 | -| | [@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. | 300 | 0 | 272 | 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. | 310 | 0 | 282 | 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 | @@ -151,7 +151,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 3 | 0 | 3 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 2 | 0 | 2 | 1 | | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 702 | 2 | 695 | 22 | -| | [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai-assistant) | - | 294 | 1 | 292 | 27 | +| | [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai-assistant) | - | 286 | 1 | 284 | 27 | | | [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai-assistant) | - | 4 | 0 | 4 | 0 | | | [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai-assistant) | - | 2 | 0 | 2 | 0 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | This plugin exposes and registers observability log consumption features. | 19 | 0 | 19 | 1 | @@ -179,7 +179,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | AI Assistant for Search | 6 | 0 | 6 | 0 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | Plugin hosting shared features for connectors | 19 | 0 | 19 | 3 | | | [@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 | 10 | 0 | +| | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 11 | 0 | 11 | 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. | 10 | 0 | 10 | 1 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 17 | 0 | 11 | 1 | @@ -220,7 +220,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 12 | 0 | 12 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 52 | 0 | 14 | 5 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 2 | 0 | 2 | 0 | -| | [@elastic/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) | The default editor used in most aggregation-based visualizations. | 70 | 0 | 63 | 4 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the gauge chart implementation using the elastic-charts library. The goal is to eventually deprecate the old implementation and keep only this. Until then, the library used is defined by the Legacy charts library advanced setting. | 7 | 0 | 7 | 2 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the heatmap implementation using the elastic-charts library. The goal is to eventually deprecate the old implementation and keep only this. Until then, the library used is defined by the Legacy heatmap charts library advanced setting. | 3 | 0 | 3 | 2 | | visTypeMarkdown | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds a markdown visualization type | 0 | 0 | 0 | 0 | @@ -274,8 +274,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 3 | 0 | 3 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 62 | 0 | 17 | 1 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 2 | 0 | 2 | 0 | -| | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 19 | 0 | 19 | 0 | -| | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 45 | 0 | 45 | 0 | +| | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 22 | 0 | 22 | 0 | +| | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 49 | 0 | 49 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 41 | 0 | 17 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 2 | 0 | 2 | 0 | | | [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) | - | 8 | 0 | 4 | 0 | @@ -286,8 +286,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 10 | 0 | 8 | 4 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 32 | 0 | 28 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 9 | 0 | 6 | 2 | -| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 39 | 0 | 38 | 0 | -| | [@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) | - | 45 | 0 | 44 | 0 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 7 | 0 | 7 | 0 | | | [@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 | @@ -496,13 +496,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 136 | 0 | 109 | 1 | | | [@elastic/docs](https://github.com/orgs/elastic/teams/docs) | - | 78 | 0 | 78 | 2 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 5 | 0 | 5 | 1 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 41 | 0 | 27 | 6 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 33 | 0 | 24 | 1 | -| | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 14 | 0 | 6 | 0 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 57 | 0 | 30 | 6 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 37 | 0 | 28 | 2 | +| | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 16 | 0 | 8 | 0 | | | [@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) | - | 156 | 0 | 130 | 9 | | | [@elastic/security-generative-ai](https://github.com/orgs/elastic/teams/security-generative-ai) | - | 346 | 0 | 320 | 0 | -| | [@elastic/obs-entities](https://github.com/orgs/elastic/teams/obs-entities) | - | 41 | 0 | 41 | 0 | +| | [@elastic/obs-entities](https://github.com/orgs/elastic/teams/obs-entities) | - | 43 | 0 | 43 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 55 | 0 | 40 | 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 | @@ -525,7 +525,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@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/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 16 | 0 | 16 | 1 | -| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 17 | 0 | 12 | 10 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 17 | 0 | 12 | 11 | | | [@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 | @@ -539,7 +539,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 7 | 1 | 7 | 1 | | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 9 | 0 | 9 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 52 | 12 | 43 | 0 | -| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 41 | 0 | 41 | 0 | +| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 48 | 0 | 48 | 0 | | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 60 | 0 | 60 | 4 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | - | 44 | 0 | 44 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 13 | 0 | 13 | 0 | @@ -561,7 +561,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 23 | 0 | 7 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 8 | 0 | 2 | 3 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 45 | 0 | 0 | 0 | -| | [@elastic/appex-sharedux @elastic/kibana-management](https://github.com/orgs/elastic/teams/appex-sharedux ) | - | 143 | 0 | 141 | 0 | +| | [@elastic/appex-sharedux @elastic/kibana-management](https://github.com/orgs/elastic/teams/appex-sharedux ) | - | 142 | 0 | 140 | 0 | | | [@elastic/appex-sharedux @elastic/kibana-management](https://github.com/orgs/elastic/teams/appex-sharedux ) | - | 20 | 0 | 11 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 88 | 0 | 10 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 56 | 0 | 6 | 0 | @@ -591,12 +591,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 8 | 0 | 0 | 0 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 2 | 0 | 1 | 0 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 34 | 0 | 0 | 0 | -| | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 44 | 0 | 38 | 1 | +| | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 46 | 0 | 40 | 1 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 18 | 0 | 18 | 0 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 42 | 1 | 35 | 1 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 22 | 0 | 16 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 120 | 0 | 120 | 3 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 55 | 1 | 50 | 0 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 2 | 0 | 2 | 0 | | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 10 | 0 | 10 | 2 | | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 5 | 0 | 5 | 0 | | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 99 | 1 | 99 | 0 | @@ -689,7 +690,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/security-detection-engine](https://github.com/orgs/elastic/teams/security-detection-engine) | - | 51 | 0 | 46 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 69 | 0 | 64 | 0 | | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 38 | 0 | 38 | 0 | -| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 3 | 0 | 3 | 0 | +| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 9 | 0 | 9 | 0 | | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 26 | 0 | 26 | 0 | | | [@elastic/appex-sharedux @elastic/kibana-management](https://github.com/orgs/elastic/teams/appex-sharedux ) | - | 1 | 0 | 1 | 0 | | | [@elastic/appex-sharedux @elastic/kibana-management @elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/appex-sharedux ) | - | 1 | 0 | 1 | 0 | @@ -759,7 +760,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) | - | 57 | 0 | 48 | 0 | +| | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 58 | 0 | 49 | 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 | 184 | 0 | 108 | 2 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 18 | 0 | 17 | 5 | @@ -771,7 +772,7 @@ 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) | - | 146 | 0 | 143 | 3 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 144 | 0 | 138 | 4 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 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) | - | 9 | 0 | 4 | 0 | diff --git a/api_docs/presentation_panel.mdx b/api_docs/presentation_panel.mdx index 641d47c9f5f0a..e3363a3014694 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-08-28 +date: 2024-08-30 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 37b03269293b4..e2f2852848be1 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-08-28 +date: 2024-08-30 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 fab60ef7c5701..9e593eec122d7 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-08-28 +date: 2024-08-30 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 dcfd28d4a0535..1a072e13a593c 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-08-28 +date: 2024-08-30 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 d37284be9f650..fd84164cae0fa 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-08-28 +date: 2024-08-30 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 561e75b4a4f7f..69213440eec35 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-08-28 +date: 2024-08-30 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 c86ffe56c7f06..6c6cd44ff554d 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] --- import rollupObj from './rollup.devdocs.json'; diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index c696e1b9651f8..faf00e76130ce 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ruleRegistry'] --- import ruleRegistryObj from './rule_registry.devdocs.json'; diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index 686d81b3734b0..7ad417bf141a6 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-08-28 +date: 2024-08-30 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 ec2ba5e1605ea..6044877b1c8b6 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] --- import savedObjectsObj from './saved_objects.devdocs.json'; diff --git a/api_docs/saved_objects_finder.devdocs.json b/api_docs/saved_objects_finder.devdocs.json index a5dfa604ab941..f23341ed4ab5d 100644 --- a/api_docs/saved_objects_finder.devdocs.json +++ b/api_docs/saved_objects_finder.devdocs.json @@ -549,9 +549,9 @@ "signature": [ { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "" diff --git a/api_docs/saved_objects_finder.mdx b/api_docs/saved_objects_finder.mdx index 42c589b751b8a..4a0226fdf8490 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-08-28 +date: 2024-08-30 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 b41376c144f9d..0013a7e2254f6 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-08-28 +date: 2024-08-30 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 8e7c4db956a56..0e35710043d07 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-08-28 +date: 2024-08-30 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 f0bbac608a7f7..3ef7e3514cde6 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] --- import savedObjectsTaggingOssObj from './saved_objects_tagging_oss.devdocs.json'; diff --git a/api_docs/saved_search.devdocs.json b/api_docs/saved_search.devdocs.json index 13e1c29fa1214..60a67177b7129 100644 --- a/api_docs/saved_search.devdocs.json +++ b/api_docs/saved_search.devdocs.json @@ -182,9 +182,9 @@ ", \"description\"> & { description?: string | undefined; references: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[]; }" @@ -304,9 +304,9 @@ ", \"description\"> & { description?: string | undefined; references: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.Reference", + "section": "def-server.Reference", "text": "Reference" }, "[]; }" @@ -422,9 +422,9 @@ "() => Promise<", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "<", diff --git a/api_docs/saved_search.mdx b/api_docs/saved_search.mdx index f0b5bd593ea82..ed085ec870629 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-08-28 +date: 2024-08-30 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 6ec4860b983ef..44d1ad60300f2 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-08-28 +date: 2024-08-30 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 3c66d7b67beb7..08602a8a858c8 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] --- import screenshottingObj from './screenshotting.devdocs.json'; diff --git a/api_docs/search_assistant.mdx b/api_docs/search_assistant.mdx index d3bc6c216225e..04d1d9a848b29 100644 --- a/api_docs/search_assistant.mdx +++ b/api_docs/search_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchAssistant title: "searchAssistant" image: https://source.unsplash.com/400x175/?github description: API docs for the searchAssistant plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchAssistant'] --- import searchAssistantObj from './search_assistant.devdocs.json'; diff --git a/api_docs/search_connectors.mdx b/api_docs/search_connectors.mdx index 4a782fa961bbd..4a2d6e5730602 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-08-28 +date: 2024-08-30 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 33ed9eed870a6..f5a3a0bda0161 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchHomepage'] --- import searchHomepageObj from './search_homepage.devdocs.json'; diff --git a/api_docs/search_indices.devdocs.json b/api_docs/search_indices.devdocs.json index e79f47a7894f0..749680afa98ae 100644 --- a/api_docs/search_indices.devdocs.json +++ b/api_docs/search_indices.devdocs.json @@ -17,7 +17,19 @@ "path": "x-pack/plugins/search_indices/public/types.ts", "deprecated": false, "trackAdoption": false, - "children": [], + "children": [ + { + "parentPluginId": "searchIndices", + "id": "def-public.SearchIndicesPluginSetup.enabled", + "type": "boolean", + "tags": [], + "label": "enabled", + "description": [], + "path": "x-pack/plugins/search_indices/public/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], "lifecycle": "setup", "initialIsOpen": true }, diff --git a/api_docs/search_indices.mdx b/api_docs/search_indices.mdx index 3d2f25a400883..940259c1777a5 100644 --- a/api_docs/search_indices.mdx +++ b/api_docs/search_indices.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchIndices title: "searchIndices" image: https://source.unsplash.com/400x175/?github description: API docs for the searchIndices plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchIndices'] --- import searchIndicesObj from './search_indices.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 | |-------------------|-----------|------------------------|-----------------| -| 10 | 0 | 10 | 0 | +| 11 | 0 | 11 | 0 | ## Client diff --git a/api_docs/search_inference_endpoints.mdx b/api_docs/search_inference_endpoints.mdx index f15f737461be9..7ff3897b329e8 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-08-28 +date: 2024-08-30 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 e0cfc03bd96ad..9ee6951036296 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchNotebooks'] --- import searchNotebooksObj from './search_notebooks.devdocs.json'; diff --git a/api_docs/search_playground.mdx b/api_docs/search_playground.mdx index 1633a0077152a..8687dca9f6cd6 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchPlayground'] --- import searchPlaygroundObj from './search_playground.devdocs.json'; diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 51b59312d28e5..e6ece5beb8f50 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] --- import securityObj from './security.devdocs.json'; diff --git a/api_docs/security_solution.devdocs.json b/api_docs/security_solution.devdocs.json index ae4e037e5e71d..9d4957972ff47 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\" | \"assistantBedrockChat\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsSentinelOneProcessesEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"responseActionScanEnabled\" | \"securitySolutionNotesEnabled\" | \"entityAlertPreviewDisabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"disableTimelineSaveTour\" | \"riskEnginePrivilegesRouteEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"unifiedComponentsInTimelineDisabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"manualRuleRunEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | \"dataIngestionHubEnabled\" | undefined" + "\"assistantKnowledgeBaseByDefault\" | \"assistantModelEvaluation\" | \"assistantBedrockChat\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsSentinelOneProcessesEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"securitySolutionNotesEnabled\" | \"entityAlertPreviewDisabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"disableTimelineSaveTour\" | \"riskEnginePrivilegesRouteEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"unifiedComponentsInTimelineDisabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"manualRuleRunEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | \"dataIngestionHubEnabled\" | 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\" | \"assistantBedrockChat\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsSentinelOneProcessesEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"responseActionScanEnabled\" | \"securitySolutionNotesEnabled\" | \"entityAlertPreviewDisabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"disableTimelineSaveTour\" | \"riskEnginePrivilegesRouteEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"unifiedComponentsInTimelineDisabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"manualRuleRunEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | \"dataIngestionHubEnabled\" | undefined" + "\"assistantKnowledgeBaseByDefault\" | \"assistantModelEvaluation\" | \"assistantBedrockChat\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsSentinelOneProcessesEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"securitySolutionNotesEnabled\" | \"entityAlertPreviewDisabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"disableTimelineSaveTour\" | \"riskEnginePrivilegesRouteEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"unifiedComponentsInTimelineDisabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"manualRuleRunEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | \"dataIngestionHubEnabled\" | undefined" ], "path": "x-pack/plugins/security_solution/public/common/links/types.ts", "deprecated": false, @@ -1931,7 +1931,7 @@ "label": "experimentalFeatures", "description": [], "signature": [ - "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly responseActionScanEnabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly assistantBedrockChat: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; }" + "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly assistantBedrockChat: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/public/types.ts", "deprecated": false, @@ -3082,7 +3082,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 responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly responseActionScanEnabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly assistantBedrockChat: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; }" + "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly assistantBedrockChat: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/server/plugin_contract.ts", "deprecated": false, @@ -3258,7 +3258,7 @@ "label": "ExperimentalFeatures", "description": [], "signature": [ - "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly responseActionScanEnabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly assistantBedrockChat: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; }" + "{ readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly securitySolutionNotesEnabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly assistantKnowledgeBaseByDefault: boolean; readonly assistantBedrockChat: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly unifiedComponentsInTimelineDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly manualRuleRunEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/common/experimental_features.ts", "deprecated": false, @@ -3324,7 +3324,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 responseActionUploadEnabled: true; readonly automatedProcessActionsEnabled: true; readonly responseActionsSentinelOneV1Enabled: true; readonly responseActionsSentinelOneV2Enabled: true; readonly responseActionsSentinelOneGetFileEnabled: true; readonly responseActionsSentinelOneKillProcessEnabled: true; readonly responseActionsSentinelOneProcessesEnabled: true; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: true; readonly responseActionScanEnabled: true; readonly securitySolutionNotesEnabled: false; readonly entityAlertPreviewDisabled: false; readonly assistantModelEvaluation: false; readonly assistantKnowledgeBaseByDefault: false; readonly assistantBedrockChat: true; readonly newUserDetailsFlyoutManagedUser: false; readonly riskScoringPersistence: true; readonly riskScoringRoutesEnabled: true; readonly esqlRulesDisabled: false; readonly protectionUpdatesEnabled: true; readonly disableTimelineSaveTour: false; readonly riskEnginePrivilegesRouteEnabled: true; readonly sentinelOneDataInAnalyzerEnabled: true; readonly sentinelOneManualHostActionsEnabled: true; readonly crowdstrikeDataInAnalyzerEnabled: true; readonly jamfDataInAnalyzerEnabled: true; readonly timelineEsqlTabDisabled: false; readonly unifiedComponentsInTimelineDisabled: false; readonly analyzerDatePickersAndSourcererDisabled: false; readonly prebuiltRulesCustomizationEnabled: false; readonly malwareOnWriteScanOptionAvailable: true; readonly unifiedManifestEnabled: true; readonly valueListItemsModalEnabled: true; readonly manualRuleRunEnabled: false; readonly filterProcessDescendantsForEventFiltersEnabled: true; readonly dataIngestionHubEnabled: false; }" + "{ readonly excludePoliciesInFilterEnabled: false; readonly kubernetesEnabled: true; readonly donutChartEmbeddablesEnabled: false; readonly previewTelemetryUrlEnabled: false; readonly extendedRuleExecutionLoggingEnabled: false; readonly socTrendsEnabled: false; readonly responseActionUploadEnabled: true; readonly automatedProcessActionsEnabled: true; readonly responseActionsSentinelOneV1Enabled: true; readonly responseActionsSentinelOneV2Enabled: true; readonly responseActionsSentinelOneGetFileEnabled: true; readonly responseActionsSentinelOneKillProcessEnabled: true; readonly responseActionsSentinelOneProcessesEnabled: true; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: true; readonly securitySolutionNotesEnabled: false; readonly entityAlertPreviewDisabled: false; readonly assistantModelEvaluation: false; readonly assistantKnowledgeBaseByDefault: false; readonly assistantBedrockChat: true; readonly newUserDetailsFlyoutManagedUser: false; readonly riskScoringPersistence: true; readonly riskScoringRoutesEnabled: true; readonly esqlRulesDisabled: false; readonly protectionUpdatesEnabled: true; readonly disableTimelineSaveTour: false; readonly riskEnginePrivilegesRouteEnabled: true; readonly sentinelOneDataInAnalyzerEnabled: true; readonly sentinelOneManualHostActionsEnabled: true; readonly crowdstrikeDataInAnalyzerEnabled: true; readonly jamfDataInAnalyzerEnabled: true; readonly timelineEsqlTabDisabled: false; readonly unifiedComponentsInTimelineDisabled: false; readonly analyzerDatePickersAndSourcererDisabled: false; readonly prebuiltRulesCustomizationEnabled: false; readonly malwareOnWriteScanOptionAvailable: true; readonly unifiedManifestEnabled: true; readonly valueListItemsModalEnabled: true; readonly manualRuleRunEnabled: false; readonly filterProcessDescendantsForEventFiltersEnabled: true; readonly dataIngestionHubEnabled: 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 12cd0747f67ac..e92282c9f2c8a 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-08-28 +date: 2024-08-30 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 26eb75c5676b4..5adaa8aa7bbcc 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-08-28 +date: 2024-08-30 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 420deaf4a6864..72a10170a30fb 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-08-28 +date: 2024-08-30 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 1bcd97986334a..5fe0a2a2c2741 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-08-28 +date: 2024-08-30 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 a7b8f5fbb8d9a..60e801fd83a65 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-08-28 +date: 2024-08-30 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 3a1698808326f..444e73a8ffbaf 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-08-28 +date: 2024-08-30 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 d3c2558fd1029..047adc77efbc5 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-08-28 +date: 2024-08-30 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 93db70c39645e..158ed72bf9e28 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-08-28 +date: 2024-08-30 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 77c13ac9e65c6..469ada4b9f336 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-08-28 +date: 2024-08-30 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 d107e897cdead..ac6d66ed9f556 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-08-28 +date: 2024-08-30 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 4c6dae13f492d..dbf1136df5d03 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-08-28 +date: 2024-08-30 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 07095a9d37e6c..8a068b655a8b4 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-08-28 +date: 2024-08-30 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 100a1342a360d..2e40c8f8d68bc 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-08-28 +date: 2024-08-30 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 47d4c81556bbe..842cd61033b71 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-08-28 +date: 2024-08-30 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 6a89c9363e756..dd5676df4fcdf 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-08-28 +date: 2024-08-30 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 29c532db3381d..ae0de637801e5 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-08-28 +date: 2024-08-30 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 fde7860d2974a..bfb70f69394be 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-08-28 +date: 2024-08-30 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 b740ca5fcf99c..521be7ade35d6 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] --- import telemetryManagementSectionObj from './telemetry_management_section.devdocs.json'; diff --git a/api_docs/threat_intelligence.mdx b/api_docs/threat_intelligence.mdx index eebe89ad28f57..0cc351146ec60 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-08-28 +date: 2024-08-30 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 0d8299cd0d6d7..b932cbc25538b 100644 --- a/api_docs/timelines.devdocs.json +++ b/api_docs/timelines.devdocs.json @@ -3696,14 +3696,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.test.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/containers/source/mock.ts" @@ -3816,14 +3808,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_badge.tsx" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/helpers.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/event_details/helpers.tsx" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/index.tsx" @@ -3924,6 +3908,14 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.tsx" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/utils.ts" diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index ab5f57767a04a..78f3a18e28ba1 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'timelines'] --- import timelinesObj from './timelines.devdocs.json'; diff --git a/api_docs/transform.mdx b/api_docs/transform.mdx index a741c06ba4c99..587b4df0b1bc5 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'transform'] --- import transformObj from './transform.devdocs.json'; diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index 05ae581989ff5..a59027484a933 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-08-28 +date: 2024-08-30 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 0fcd854f8b472..c097c053e38cb 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-08-28 +date: 2024-08-30 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 f6e2e3d249f0f..a5363614e1910 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-08-28 +date: 2024-08-30 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 4c8980d2bffa6..3c0d724788a6e 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedDocViewer'] --- import unifiedDocViewerObj from './unified_doc_viewer.devdocs.json'; diff --git a/api_docs/unified_histogram.mdx b/api_docs/unified_histogram.mdx index ef4a00301e7c6..ae57f3e50792c 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-08-28 +date: 2024-08-30 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 684a46155f78f..9a9d77b7496f2 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-08-28 +date: 2024-08-30 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 dbd401d44f6b9..1f2ba31159088 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-08-28 +date: 2024-08-30 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 9a8fe08952691..e50cf08987da7 100644 --- a/api_docs/uptime.mdx +++ b/api_docs/uptime.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uptime title: "uptime" image: https://source.unsplash.com/400x175/?github description: API docs for the uptime plugin -date: 2024-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uptime'] --- import uptimeObj from './uptime.devdocs.json'; diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index 0a51fdc440508..14ef6a64387e1 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] --- import urlForwardingObj from './url_forwarding.devdocs.json'; diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index bdfcd7bade60b..f8451e565e1c9 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] --- import usageCollectionObj from './usage_collection.devdocs.json'; diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index ce91ab22ef575..407263e87bb97 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] --- import uxObj from './ux.devdocs.json'; diff --git a/api_docs/vis_default_editor.devdocs.json b/api_docs/vis_default_editor.devdocs.json index 8f8b1b408ffd1..24aa865bbefc2 100644 --- a/api_docs/vis_default_editor.devdocs.json +++ b/api_docs/vis_default_editor.devdocs.json @@ -477,7 +477,15 @@ "\nDo not use this component anymore.\nPlease, use NumberInputOption in 'required_number_input.tsx'.\nIt is required for compatibility with TS 3.7.0\nThis should be removed in the future" ], "signature": [ - "({\n disabled,\n error,\n isInvalid,\n label,\n max,\n min,\n paramName,\n step,\n value = '',\n setValue,\n 'data-test-subj': dataTestSubj,\n}: NumberInputOptionProps) => JSX.Element" + "({\n disabled,\n error,\n isInvalid,\n label,\n max,\n min,\n paramName,\n step,\n value = '',\n setValue,\n 'data-test-subj': dataTestSubj,\n}: ", + { + "pluginId": "visDefaultEditor", + "scope": "public", + "docId": "kibVisDefaultEditorPluginApi", + "section": "def-public.NumberInputOptionProps", + "text": "NumberInputOptionProps" + }, + ") => JSX.Element" ], "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", "deprecated": false, @@ -491,7 +499,14 @@ "label": "{\n disabled,\n error,\n isInvalid,\n label,\n max,\n min,\n paramName,\n step,\n value = '',\n setValue,\n 'data-test-subj': dataTestSubj,\n}", "description": [], "signature": [ - "NumberInputOptionProps" + { + "pluginId": "visDefaultEditor", + "scope": "public", + "docId": "kibVisDefaultEditorPluginApi", + "section": "def-public.NumberInputOptionProps", + "text": "NumberInputOptionProps" + }, + "" ], "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", "deprecated": false, @@ -825,6 +840,217 @@ } ], "interfaces": [ + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps", + "type": "Interface", + "tags": [], + "label": "NumberInputOptionProps", + "description": [], + "signature": [ + { + "pluginId": "visDefaultEditor", + "scope": "public", + "docId": "kibVisDefaultEditorPluginApi", + "section": "def-public.NumberInputOptionProps", + "text": "NumberInputOptionProps" + }, + "" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.disabled", + "type": "CompoundType", + "tags": [], + "label": "disabled", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.error", + "type": "CompoundType", + "tags": [], + "label": "error", + "description": [], + "signature": [ + "boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.isInvalid", + "type": "CompoundType", + "tags": [], + "label": "isInvalid", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.label", + "type": "CompoundType", + "tags": [], + "label": "label", + "description": [], + "signature": [ + "boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.max", + "type": "number", + "tags": [], + "label": "max", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.min", + "type": "number", + "tags": [], + "label": "min", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.paramName", + "type": "Uncategorized", + "tags": [], + "label": "paramName", + "description": [], + "signature": [ + "ParamName" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.step", + "type": "number", + "tags": [], + "label": "step", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.value", + "type": "CompoundType", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "number | \"\" | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.datatestsubj", + "type": "string", + "tags": [], + "label": "'data-test-subj'", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.setValue", + "type": "Function", + "tags": [], + "label": "setValue", + "description": [], + "signature": [ + "(paramName: ParamName, value: number | \"\") => void" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.setValue.$1", + "type": "Uncategorized", + "tags": [], + "label": "paramName", + "description": [], + "signature": [ + "ParamName" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "visDefaultEditor", + "id": "def-public.NumberInputOptionProps.setValue.$2", + "type": "CompoundType", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "number | \"\"" + ], + "path": "src/plugins/vis_default_editor/public/components/options/number_input.tsx", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, { "parentPluginId": "visDefaultEditor", "id": "def-public.RangeValues", diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index affa5bd958368..1ea1414de95cb 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] --- import visDefaultEditorObj from './vis_default_editor.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 | |-------------------|-----------|------------------------|-----------------| -| 56 | 0 | 49 | 4 | +| 70 | 0 | 63 | 4 | ## Client diff --git a/api_docs/vis_type_gauge.mdx b/api_docs/vis_type_gauge.mdx index 2ac3e643a0008..bb12ad8f5de72 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-08-28 +date: 2024-08-30 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 37db7b74be776..391144b2f7021 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-08-28 +date: 2024-08-30 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 c31a6f4836327..64ca752437de4 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-08-28 +date: 2024-08-30 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 4a42084571360..6db70bc464160 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-08-28 +date: 2024-08-30 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 804d2b4324435..cff524df2dae1 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-08-28 +date: 2024-08-30 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 0b513eb4a3bf2..f323485d65eb2 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-08-28 +date: 2024-08-30 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 b1dcc17d4229c..1046d026f371f 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-08-28 +date: 2024-08-30 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 359438120c029..35e1cd413353d 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-08-28 +date: 2024-08-30 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 adba8af347c80..8af7554d7b879 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-08-28 +date: 2024-08-30 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 b49f7ebbcaa5f..e7df60cb03ea5 100644 --- a/api_docs/visualizations.devdocs.json +++ b/api_docs/visualizations.devdocs.json @@ -5671,9 +5671,9 @@ "(id: string) => Promise<{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "; meta: { outcome: \"exactMatch\" | \"aliasMatch\" | \"conflict\"; aliasTargetId?: string | undefined; aliasPurpose?: \"savedObjectConversion\" | \"savedObjectImport\" | undefined; }; }>" @@ -5719,17 +5719,17 @@ ">, \"contentTypeId\">) => Promise<{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "; meta?: undefined; }>" @@ -5757,9 +5757,9 @@ ">, \"contentTypeId\">" @@ -5791,17 +5791,17 @@ ", Pick<", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SavedObjectUpdateOptions", + "section": "def-server.SavedObjectUpdateOptions", "text": "SavedObjectUpdateOptions" }, ", \"references\">>, \"contentTypeId\">) => Promise<{ item: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadataPartial", + "section": "def-server.SOWithMetadataPartial", "text": "SOWithMetadataPartial" }, "; meta?: undefined; }>" @@ -5829,9 +5829,9 @@ ", Pick<", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SavedObjectUpdateOptions", + "section": "def-server.SavedObjectUpdateOptions", "text": "SavedObjectUpdateOptions" }, ", \"references\">>, \"contentTypeId\">" @@ -5903,9 +5903,9 @@ ", options?: object | undefined) => Promise<{ hits: ", { "pluginId": "@kbn/content-management-utils", - "scope": "common", + "scope": "server", "docId": "kibKbnContentManagementUtilsPluginApi", - "section": "def-common.SOWithMetadata", + "section": "def-server.SOWithMetadata", "text": "SOWithMetadata" }, "[]; pagination: { total: number; cursor?: string | undefined; }; }>" diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index d2b803eb7d02b..9c43e716c5dad 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-08-28 +date: 2024-08-30 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] --- import visualizationsObj from './visualizations.devdocs.json'; diff --git a/docs/api/dashboard-api.asciidoc b/docs/api/dashboard-api.asciidoc index 60df46b899f14..60360e406e372 100644 --- a/docs/api/dashboard-api.asciidoc +++ b/docs/api/dashboard-api.asciidoc @@ -1,7 +1,7 @@ [[dashboard-api]] == Import and export dashboard APIs -deprecated::[7.15.0,Both of these APIs have been deprecated in favor of the {api-kibana}/group/endpoint-saved-objects[saved objects API].] +deprecated::[7.15.0,Both of these APIs have been deprecated and will be removed in 9.0.0] Import and export dashboards with the corresponding saved objects, such as visualizations, saved searches, and data views. @@ -16,4 +16,4 @@ The following import and export dashboard APIs are available: * <> to export dashboards and corresponding saved objects include::dashboard/import-dashboard.asciidoc[] -include::dashboard/export-dashboard.asciidoc[] \ No newline at end of file +include::dashboard/export-dashboard.asciidoc[] diff --git a/docs/api/data-views.asciidoc b/docs/api/data-views.asciidoc index 62d1546bdfd45..f15d7d40f49b3 100644 --- a/docs/api/data-views.asciidoc +++ b/docs/api/data-views.asciidoc @@ -8,5 +8,3 @@ For the latest details, refer to {api-kibana}/group/endpoint-data-views[data vie WARNING: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future {kib} versions. -WARNING: Use the data views APIs for managing data views instead of lower-level <>. - diff --git a/docs/api/osquery-manager.asciidoc b/docs/api/osquery-manager.asciidoc index f1c6f5cc664ee..2607bdad1f54f 100644 --- a/docs/api/osquery-manager.asciidoc +++ b/docs/api/osquery-manager.asciidoc @@ -3,7 +3,7 @@ experimental[] Run live queries, manage packs and saved queries -WARNING: Use the osquery manager APIs for managing packs and saved queries instead of lower-level <>. +Use the osquery manager APIs for managing packs and saved queries. The following osquery manager APIs are available: diff --git a/docs/api/saved-objects.asciidoc b/docs/api/saved-objects.asciidoc index b8e7f00f54872..3e0e206b468e7 100644 --- a/docs/api/saved-objects.asciidoc +++ b/docs/api/saved-objects.asciidoc @@ -1,9 +1,4 @@ [[saved-objects-api]] == Saved objects APIs -Manage {kib} saved objects, including dashboards, visualizations, and more. - -For the latest details, refer to the {api-kibana}/group/endpoint-saved-objects[saved object API]. - -WARNING: Do not write documents directly to the `.kibana` index. When you write directly -to the `.kibana` index, the data becomes corrupted and permanently breaks future {kib} versions. +For the latest details, refer to the {api-kibana}/group/endpoint-saved-objects[saved objects API]. diff --git a/docs/api/short-urls.asciidoc b/docs/api/short-urls.asciidoc index ded639c897f3f..0b47efa83e02f 100644 --- a/docs/api/short-urls.asciidoc +++ b/docs/api/short-urls.asciidoc @@ -1,7 +1,14 @@ [[short-urls-api]] == Short URLs APIs -Manage {kib} short URLs. +experimental[] Manage {kib} short URLs. + +The following short urls APIs are available: + +* <> +* <> +* <> +* <> include::short-urls/create-short-url.asciidoc[] include::short-urls/get-short-url.asciidoc[] diff --git a/docs/management/connectors/action-types/cases-webhook.asciidoc b/docs/management/connectors/action-types/cases-webhook.asciidoc index e68b820101b8f..6451998c421e2 100644 --- a/docs/management/connectors/action-types/cases-webhook.asciidoc +++ b/docs/management/connectors/action-types/cases-webhook.asciidoc @@ -8,7 +8,7 @@ :frontmatter-tags-content-type: [how-to] :frontmatter-tags-user-goals: [configure] -The {webhook-cm} connector uses https://github.com/axios/axios[axios] to send POST, PUT, and GET requests to a case management RESTful API web service. +The {webhook-cm} connector uses https://github.com/axios/axios[axios] to send POST, PUT, and GET requests to a case management RESTful API web service. added:[8.15.0] [float] [[define-cases-webhook-ui]] @@ -195,244 +195,35 @@ The username for HTTP basic authentication. You can test connectors as you're creating or editing the connector in {kib}. For example: [role="screenshot"] -image::management/connectors/images/cases-webhook-test.gif[{webhook-cm} params test] +image::management/connectors/images/cases-webhook-test.png[{webhook-cm} params test] {webhook-cm} actions have the following configuration properties: Additional comments:: Additional information for the client, such as how to troubleshoot the issue. -// Case ID:: TBD +Case ID:: +A unique case identifier. Description:: The details about the incident. Labels:: The labels for the incident. -// Severity:: TBD +Severity:: +The severity of the case can be `critical`, `high`, `low`, or `medium`. -// Status:: TBD +Status:: +The status of the case can be `closed`, `in-progress` or `open`. -//Summary:: TBD +Summary:: +A brief case summary. -//Tags:: TBD - -Title:: A title for the issue, which is used for searching the contents of the knowledge base. +Tags:: +A list of tags that can be used to filter cases. [float] [[cases-webhook-connector-networking-configuration]] === Connector networking configuration Use the <> to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations. - -//// -[float] -[[cases-webhook-connector-full-example]] -== Full example with third-party system - -In the following example, we connect the {webhook-cm} Connector with a demo instance of {jira} (a third-party case management system). Refer to the https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/[{Jira} API documentation] to learn how to create an issue. - -NOTE: If you want to connect with {jira} quickly, we recommend using the <>. - -[float] -==== Step 1 - Set up connector - -In the {webhook-cm} connector create flyout, begin by entering a connector *Name*, for example, `Jira Test Connector`. Basic authentication will be used in this example, so keep the *Require authentication* option selected and enter the *Username* and *Password* for the test instance, for example, `test-user@elastic.co` and `notarealpassword`. We will not be setting any *Headers* for the requests. - -[role="screenshot"] -image::management/connectors/images/cases-webhook-step1.png[{webhook-cm} connector Step 1, {jira} example] - -[float] -==== Step 2 - Create case - -To find the required values for this step, refer to the https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-post[{jira} create issue method documentation]. - -{jira} create issue request method: `POST` - -{jira} create issue request URL: `/rest/api/2/issue` - -{jira} create issue request body: -[source,json] --- -{ - "fields": { - "summary": "Main order flow broken", - "description": "Order entry fails when selecting supplier.", - "labels": ["bugfix", "blitz_test"], - "project":{"key":"PROJ-123"}, - "issuetype":{"id":"10000"} - } -} --- - -{jira} create issue response body: -[source,json] --- -{ - "id": "10000", - "key": "ED-24", - "self": "https://your-domain.atlassian.net/rest/api/2/issue/10000", - "transition": { - "status": 200, - "errorCollection": { - "errorMessages": [], - "errors": {} - } - } -} --- -In the following screen capture, we enter `POST` as the *Create Case Method* and `https://testing-jira.atlassian.net/rest/api/2/issue` as the **Create Case Url**. In our example {jira} instance, the project key is "ROC" and the issuetype ID is "10024". We have entered the {jira} request JSON as the *Create Case Object*, updating the project key to "ROC" and the issuetype ID to "10024". We then use the Case variable selector to enter where we will map the Kibana case title, Kibana case description, and Kibana case tags. The {jira} response body contains an ID with the JSON key of "id", so we enter `id` as the *Create Case Response - Case ID Key*. -[role="screenshot"] -image::management/connectors/images/cases-webhook-step2.gif[{webhook-cm} connector Step 2, {jira} example] - -[float] -==== Step 3 - Get case information - -Next we'll need to look at {jira}'s https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-[Get issue method documentation] to find the values for this step. In the GET response JSON below, we thinned out some null and unrelated data so that we can focus on the fields we need. - -{jira} get issue request URL: `/rest/api/2/issue/{issueIdOrKey}` - -{jira} get issue response body: -[source,json] --- -{ - "id": "71964", - "self": "https://testing-jira.atlassian.net/rest/api/2/issue/71964", - "key": "ROC-584", - "fields": { - "issuetype": { - "self": "https://testing-jira.atlassian.net/rest/api/2/issuetype/10024", - "id": "10024", - "description": "An improvement or enhancement to an existing feature or task.", - "name": "Improvement", - "subtask": false, - "avatarId": 10310, - "hierarchyLevel": 0 - }, - "project": { - "self": "https://testing-jira.atlassian.net/rest/api/2/project/10021", - "id": "10021", - "key": "ROC", - "name": "ResponseOps Cases", - "projectTypeKey": "software", - "simplified": false - }, - "created": "2022-08-02T16:52:20.554+0300", - "priority": { - "name": "Medium", - "id": "3" - }, - "labels": ["kibanaTag"], - "updated": "2022-08-02T16:52:20.554+0300", - "status": { - "self": "https://testing-jira.atlassian.net/rest/api/2/status/10003", - "description": "", - "name": "To Do", - "id": "10003", - "statusCategory": { - "self": "https://testing-jira.atlassian.net/rest/api/2/statuscategory/2", - "id": 2, - "key": "new", - "colorName": "blue-gray", - "name": "To Do" - } - }, - "description": "Kibana Description", - "summary": "Kibana Title", - "creator": { - "self": "https://testing-jira.atlassian.net/rest/api/2/user?accountId=12345", - "accountId": "12345", - "emailAddress": "test-user@elastic.co", - "displayName": "MLR-QA", - "active": true, - "timeZone": "Europe/Athens", - "accountType": "atlassian" - }, - "reporter": { - "self": "https://testing-jira.atlassian.net/rest/api/2/user?accountId=12345", - "accountId": "12345", - "emailAddress": "test-user@elastic.co", - "displayName": "MLR-QA", - "active": true, - "timeZone": "Europe/Athens", - "accountType": "atlassian" - }, - "comment": { - "comments": [], - "self": "https://testing-jira.atlassian.net/rest/api/2/issue/71964/comment", - "maxResults": 0, - "total": 0, - "startAt": 0 - } - } -} --- - -To make the Get Case URL, we need `/rest/api/2/issue/{issueIdOrKey}`. We will fill in the value with the issue ID, which we stored in the last step as *Create Case Response - Case ID Key*. Using the variable selector on the Get Case URL input, we can see the issue ID is stored as a Mustache value `{{{external.system.id}}}`. So our value for *Get Case URL* will be `https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}`. - -In the response JSON we can see the title of the case is "ROC-538". The key for this value is `key` so we enter `key` as the *Get Case Response External Title Key* value. - -We also need the *External Case View URL*. https://support.atlassian.com/jira-software-cloud/docs/link-an-issue/[{jira}'s documentation] instructs you to get the link from the issue itself. The format for this link looks like `https://.atlassian.net/browse/`. We mapped `key` to the *Get Case Response External Title Key* and using the variable selector on the *External Case View URL* input, we can see the issue key is stored as a Mustache value `{{{external.system.title}}}`. Using this, the value for *External Case View URL* is `https://testing-jira.atlassian.net/browse/{{{external.system.title}}}`. -[role="screenshot"] -image::management/connectors/images/cases-webhook-step3.gif[{webhook-cm} connector Step 3, {jira} example] - -[float] -==== Step 4 - Comments and updates - -During this step, we need to set the REST API data for updates and comments. Let's look at {jira}'s https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-put[Edit issue documentation]. - -{jira} update issue request method: `PUT` - -{jira} update issue request URL: `/rest/api/2/issue/{issueIdOrKey}` - -{jira} update issue request body: -[source,json] --- -{ - "fields": { - "summary": "Main order flow broken", - "description": "Order entry fails when selecting supplier.", - "labels": ["bugfix", "blitz_test"], - "project":{"key":"PROJ-123"}, - "issuetype":{"id":"10000"} - } -} --- - -In the screen capture below, on Step 4 we enter `PUT` as the *Update Case Method* and `https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}` as the **Update Case Url** using the variable selector to insert the `{{{external.system.id}}}`. Just like the create case JSON, have entered the {jira} request JSON as the *Update Case Object*, updating the project key to "ROC" and the issuetype ID to "10024". We then use the Case variable selector to enter where we will map the Kibana case title, Kibana case description, and Kibana case tags. -[role="screenshot"] -image::management/connectors/images/cases-webhook-step4a.gif[{webhook-cm} connector Step 4 Update, {jira} example] - -Lastly we will look at {jira}'s https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-comments/#api-rest-api-2-issue-issueidorkey-comment-post[Add comment documentation] to fill out the optional comment REST fields. - -{jira} create comment request method: `POST` - -{jira} create comment request URL: `/rest/api/2/issue/{issueIdOrKey}/comment` - -{jira} create comment request body: -[source,json] --- -{ - "body": "Lorem ipsum dolor sit amet." -} --- - -In the following screen capture, we enter `POST` as the *Create Comment Method* and `https://testing-jira.atlassian.net/rest/api/2/issue/{{{external.system.id}}}/comment` as the **Create Comment Url** using the variable selector to insert the `{{{external.system.id}}}`. We enter the {jira} request JSON as the *Create Comment Object*, using the case variable selector to enter where we will map the case comment. -[role="screenshot"] -image::management/connectors/images/cases-webhook-step4b.gif[{webhook-cm} connector Step 4 Comments, {jira} example] - -[float] -[[cases-webhook-example-implementation]] -=== Implement connector in Kibana Cases -Let's take a look at how our new {webhook-cm} connector works within the case workflow. - -[float] -==== Create a case -[role="screenshot"] -image::management/connectors/images/cases-webhook-create.gif[{webhook-cm} connector Create, {jira} example] - -[float] -==== Update and comment on a case -[role="screenshot"] -image::management/connectors/images/cases-webhook-update.gif[{webhook-cm} connector Update, {jira} example] -//// \ No newline at end of file diff --git a/docs/management/connectors/images/cases-webhook-connector-comments.png b/docs/management/connectors/images/cases-webhook-connector-comments.png index fd94d59f51158..e033c067102d6 100644 Binary files a/docs/management/connectors/images/cases-webhook-connector-comments.png and b/docs/management/connectors/images/cases-webhook-connector-comments.png differ diff --git a/docs/management/connectors/images/cases-webhook-connector-create-case.png b/docs/management/connectors/images/cases-webhook-connector-create-case.png index 0401264e55a72..74ca30dc5df3b 100644 Binary files a/docs/management/connectors/images/cases-webhook-connector-create-case.png and b/docs/management/connectors/images/cases-webhook-connector-create-case.png differ diff --git a/docs/management/connectors/images/cases-webhook-connector-get-case.png b/docs/management/connectors/images/cases-webhook-connector-get-case.png index b280974434661..b072b84b59708 100644 Binary files a/docs/management/connectors/images/cases-webhook-connector-get-case.png and b/docs/management/connectors/images/cases-webhook-connector-get-case.png differ diff --git a/docs/management/connectors/images/cases-webhook-connector.png b/docs/management/connectors/images/cases-webhook-connector.png index f68c1ba0c295f..beab0bb6a513c 100644 Binary files a/docs/management/connectors/images/cases-webhook-connector.png and b/docs/management/connectors/images/cases-webhook-connector.png differ diff --git a/docs/management/connectors/images/cases-webhook-create.gif b/docs/management/connectors/images/cases-webhook-create.gif deleted file mode 100644 index 22343c08073b1..0000000000000 Binary files a/docs/management/connectors/images/cases-webhook-create.gif and /dev/null differ diff --git a/docs/management/connectors/images/cases-webhook-step1.png b/docs/management/connectors/images/cases-webhook-step1.png deleted file mode 100644 index 64827cb011c1c..0000000000000 Binary files a/docs/management/connectors/images/cases-webhook-step1.png and /dev/null differ diff --git a/docs/management/connectors/images/cases-webhook-step2.gif b/docs/management/connectors/images/cases-webhook-step2.gif deleted file mode 100644 index 01b322007f91e..0000000000000 Binary files a/docs/management/connectors/images/cases-webhook-step2.gif and /dev/null differ diff --git a/docs/management/connectors/images/cases-webhook-step3.gif b/docs/management/connectors/images/cases-webhook-step3.gif deleted file mode 100644 index 4e386dd3b871a..0000000000000 Binary files a/docs/management/connectors/images/cases-webhook-step3.gif and /dev/null differ diff --git a/docs/management/connectors/images/cases-webhook-step4a.gif b/docs/management/connectors/images/cases-webhook-step4a.gif deleted file mode 100644 index b33c21db41bbb..0000000000000 Binary files a/docs/management/connectors/images/cases-webhook-step4a.gif and /dev/null differ diff --git a/docs/management/connectors/images/cases-webhook-step4b.gif b/docs/management/connectors/images/cases-webhook-step4b.gif deleted file mode 100644 index e5c6a2b651839..0000000000000 Binary files a/docs/management/connectors/images/cases-webhook-step4b.gif and /dev/null differ diff --git a/docs/management/connectors/images/cases-webhook-test.gif b/docs/management/connectors/images/cases-webhook-test.gif deleted file mode 100644 index 5f42aedfa4888..0000000000000 Binary files a/docs/management/connectors/images/cases-webhook-test.gif and /dev/null differ diff --git a/docs/management/connectors/images/cases-webhook-test.png b/docs/management/connectors/images/cases-webhook-test.png new file mode 100644 index 0000000000000..6960a496df624 Binary files /dev/null and b/docs/management/connectors/images/cases-webhook-test.png differ diff --git a/docs/management/connectors/images/cases-webhook-update.gif b/docs/management/connectors/images/cases-webhook-update.gif deleted file mode 100644 index 7f09d1f122e52..0000000000000 Binary files a/docs/management/connectors/images/cases-webhook-update.gif and /dev/null differ diff --git a/docs/maps/connect-to-ems.asciidoc b/docs/maps/connect-to-ems.asciidoc index 879d4846ef3f1..e41d544d64e4d 100644 --- a/docs/maps/connect-to-ems.asciidoc +++ b/docs/maps/connect-to-ems.asciidoc @@ -1,6 +1,6 @@ :ems: Elastic Maps Service -:ems-docker-repo: docker.elastic.co/elastic-maps-service/elastic-maps-server-ubi8 -:ems-docker-image: {ems-docker-repo}:{version} +:ems-docker-repo: docker.elastic.co/elastic-maps-service/elastic-maps-server +:ems-docker-image: {ems-docker-repo}:{version}-amd64 :ems-headers-url: https://deployment-host [[maps-connect-to-ems]] @@ -195,7 +195,7 @@ One way to configure {hosted-ems} is to provide `elastic-maps-server.yml` via bi -------------------------------------------- version: '2' services: - {hosted-ems}: + ems-server: image: {ems-docker-image} volumes: - ./elastic-maps-server.yml:/usr/src/app/server/config/elastic-maps-server.yml @@ -214,7 +214,7 @@ These variables can be set with +docker-compose+ like this: ---------------------------------------------------------- version: '2' services: - {hosted-ems}: + ems-server: image: {ems-docker-image} environment: ELASTICSEARCH_HOST: http://elasticsearch.example.org diff --git a/oas_docs/.spectral.yaml b/oas_docs/.spectral.yaml index 7ff86442f9b9e..a3e5a469bc63b 100644 --- a/oas_docs/.spectral.yaml +++ b/oas_docs/.spectral.yaml @@ -47,6 +47,14 @@ rules: function: pattern functionOptions: notMatch: /(blacklist|whitelist|execute|kill)/i + property-description: + description: Properties should have descriptions. + message: "Each property should have a description" + severity: warn + given: $.components.schemas.*.properties.* + then: + field: description + function: defined # Examples operation-success-examples: formats: ['oas3_1'] diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index 1f5b3e095ea7a..f810ef1c95d8a 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -344,6 +344,715 @@ }, "openapi": "3.0.0", "paths": { + "/api/actions": { + "get": { + "deprecated": true, + "operationId": "%2Fapi%2Factions#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + } + ], + "responses": {}, + "summary": "Get all connectors", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/action": { + "post": { + "deprecated": true, + "operationId": "%2Fapi%2Factions%2Faction#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "actionTypeId": { + "description": "The connector type identifier.", + "type": "string" + }, + "config": { + "additionalProperties": {}, + "default": {}, + "type": "object" + }, + "name": { + "description": "The display name for the connector.", + "type": "string" + }, + "secrets": { + "additionalProperties": {}, + "default": {}, + "type": "object" + } + }, + "required": [ + "name", + "actionTypeId" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Create a connector", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/action/{id}": { + "delete": { + "deprecated": true, + "description": "WARNING: When you delete a connector, it cannot be recovered.", + "operationId": "%2Fapi%2Factions%2Faction%2F%7Bid%7D#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Delete a connector", + "tags": [ + "connectors" + ] + }, + "get": { + "deprecated": true, + "operationId": "%2Fapi%2Factions%2Faction%2F%7Bid%7D#1", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Get connector information", + "tags": [ + "connectors" + ] + }, + "put": { + "deprecated": true, + "operationId": "%2Fapi%2Factions%2Faction%2F%7Bid%7D#2", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "config": { + "additionalProperties": {}, + "default": {}, + "type": "object" + }, + "name": { + "type": "string" + }, + "secrets": { + "additionalProperties": {}, + "default": {}, + "type": "object" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Update a connector", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/action/{id}/_execute": { + "post": { + "deprecated": true, + "operationId": "%2Fapi%2Factions%2Faction%2F%7Bid%7D%2F_execute#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "params": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "params" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Run a connector", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/connector/{id}": { + "delete": { + "description": "WARNING: When you delete a connector, it cannot be recovered.", + "operationId": "%2Fapi%2Factions%2Fconnector%2F%7Bid%7D#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Delete a connector", + "tags": [ + "connectors" + ] + }, + "get": { + "operationId": "%2Fapi%2Factions%2Fconnector%2F%7Bid%7D#1", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Get connector information", + "tags": [ + "connectors" + ] + }, + "post": { + "operationId": "%2Fapi%2Factions%2Fconnector%2F%7Bid%3F%7D#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "in": "path", + "name": "id", + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "config": { + "additionalProperties": {}, + "default": {}, + "type": "object" + }, + "connector_type_id": { + "description": "The type of connector.", + "type": "string" + }, + "name": { + "description": "The display name for the connector.", + "type": "string" + }, + "secrets": { + "additionalProperties": {}, + "default": {}, + "type": "object" + } + }, + "required": [ + "name", + "connector_type_id" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Create a connector", + "tags": [ + "connectors" + ] + }, + "put": { + "operationId": "%2Fapi%2Factions%2Fconnector%2F%7Bid%7D#2", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "config": { + "additionalProperties": {}, + "default": {}, + "type": "object" + }, + "name": { + "description": "The display name for the connector.", + "type": "string" + }, + "secrets": { + "additionalProperties": {}, + "default": {}, + "type": "object" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Update a connector", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/connector/{id}/_execute": { + "post": { + "description": "You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems.", + "operationId": "%2Fapi%2Factions%2Fconnector%2F%7Bid%7D%2F_execute#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "params": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "params" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Run a connector", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/connector_types": { + "get": { + "description": "You do not need any Kibana feature privileges to run this API.", + "operationId": "%2Fapi%2Factions%2Fconnector_types#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases).", + "in": "query", + "name": "feature_id", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": {}, + "summary": "Get connector types", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/connectors": { + "get": { + "operationId": "%2Fapi%2Factions%2Fconnectors#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + } + ], + "responses": {}, + "summary": "Get all connectors", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/list_action_types": { + "get": { + "deprecated": true, + "operationId": "%2Fapi%2Factions%2Flist_action_types#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + } + ], + "responses": {}, + "summary": "Get connector types", + "tags": [ + "connectors" + ] + } + }, "/api/alerting/rule/{id}": { "delete": { "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D#2", @@ -5154,6 +5863,9 @@ { "name": "alerting" }, + { + "name": "connectors" + }, { "name": "system" } diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index 1f5b3e095ea7a..f810ef1c95d8a 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -344,6 +344,715 @@ }, "openapi": "3.0.0", "paths": { + "/api/actions": { + "get": { + "deprecated": true, + "operationId": "%2Fapi%2Factions#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + } + ], + "responses": {}, + "summary": "Get all connectors", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/action": { + "post": { + "deprecated": true, + "operationId": "%2Fapi%2Factions%2Faction#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "actionTypeId": { + "description": "The connector type identifier.", + "type": "string" + }, + "config": { + "additionalProperties": {}, + "default": {}, + "type": "object" + }, + "name": { + "description": "The display name for the connector.", + "type": "string" + }, + "secrets": { + "additionalProperties": {}, + "default": {}, + "type": "object" + } + }, + "required": [ + "name", + "actionTypeId" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Create a connector", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/action/{id}": { + "delete": { + "deprecated": true, + "description": "WARNING: When you delete a connector, it cannot be recovered.", + "operationId": "%2Fapi%2Factions%2Faction%2F%7Bid%7D#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Delete a connector", + "tags": [ + "connectors" + ] + }, + "get": { + "deprecated": true, + "operationId": "%2Fapi%2Factions%2Faction%2F%7Bid%7D#1", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Get connector information", + "tags": [ + "connectors" + ] + }, + "put": { + "deprecated": true, + "operationId": "%2Fapi%2Factions%2Faction%2F%7Bid%7D#2", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "config": { + "additionalProperties": {}, + "default": {}, + "type": "object" + }, + "name": { + "type": "string" + }, + "secrets": { + "additionalProperties": {}, + "default": {}, + "type": "object" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Update a connector", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/action/{id}/_execute": { + "post": { + "deprecated": true, + "operationId": "%2Fapi%2Factions%2Faction%2F%7Bid%7D%2F_execute#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "params": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "params" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Run a connector", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/connector/{id}": { + "delete": { + "description": "WARNING: When you delete a connector, it cannot be recovered.", + "operationId": "%2Fapi%2Factions%2Fconnector%2F%7Bid%7D#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Indicates a successful call." + } + }, + "summary": "Delete a connector", + "tags": [ + "connectors" + ] + }, + "get": { + "operationId": "%2Fapi%2Factions%2Fconnector%2F%7Bid%7D#1", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Get connector information", + "tags": [ + "connectors" + ] + }, + "post": { + "operationId": "%2Fapi%2Factions%2Fconnector%2F%7Bid%3F%7D#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "in": "path", + "name": "id", + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "config": { + "additionalProperties": {}, + "default": {}, + "type": "object" + }, + "connector_type_id": { + "description": "The type of connector.", + "type": "string" + }, + "name": { + "description": "The display name for the connector.", + "type": "string" + }, + "secrets": { + "additionalProperties": {}, + "default": {}, + "type": "object" + } + }, + "required": [ + "name", + "connector_type_id" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Create a connector", + "tags": [ + "connectors" + ] + }, + "put": { + "operationId": "%2Fapi%2Factions%2Fconnector%2F%7Bid%7D#2", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "config": { + "additionalProperties": {}, + "default": {}, + "type": "object" + }, + "name": { + "description": "The display name for the connector.", + "type": "string" + }, + "secrets": { + "additionalProperties": {}, + "default": {}, + "type": "object" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Update a connector", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/connector/{id}/_execute": { + "post": { + "description": "You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems.", + "operationId": "%2Fapi%2Factions%2Fconnector%2F%7Bid%7D%2F_execute#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "description": "An identifier for the connector.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "params": { + "additionalProperties": {}, + "type": "object" + } + }, + "required": [ + "params" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Indicates a successful call." + } + }, + "summary": "Run a connector", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/connector_types": { + "get": { + "description": "You do not need any Kibana feature privileges to run this API.", + "operationId": "%2Fapi%2Factions%2Fconnector_types#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases).", + "in": "query", + "name": "feature_id", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": {}, + "summary": "Get connector types", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/connectors": { + "get": { + "operationId": "%2Fapi%2Factions%2Fconnectors#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + } + ], + "responses": {}, + "summary": "Get all connectors", + "tags": [ + "connectors" + ] + } + }, + "/api/actions/list_action_types": { + "get": { + "deprecated": true, + "operationId": "%2Fapi%2Factions%2Flist_action_types#0", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + } + ], + "responses": {}, + "summary": "Get connector types", + "tags": [ + "connectors" + ] + } + }, "/api/alerting/rule/{id}": { "delete": { "operationId": "%2Fapi%2Falerting%2Frule%2F%7Bid%7D#2", @@ -5154,6 +5863,9 @@ { "name": "alerting" }, + { + "name": "connectors" + }, { "name": "system" } diff --git a/oas_docs/makefile b/oas_docs/makefile index 78e082494e301..d64e296b795a6 100644 --- a/oas_docs/makefile +++ b/oas_docs/makefile @@ -35,6 +35,10 @@ api-docs-serverless: ## Generate only kibana.serverless.yaml api-docs-lint: ## Run spectral API docs linter @npx @stoplight/spectral-cli lint "output/*.yaml" --ruleset ".spectral.yaml" +.PHONY: api-docs-lint-errs +api-docs-lint-errs: ## Run spectral API docs linter and return only errors + @npx @stoplight/spectral-cli lint "output/*.yaml" --ruleset ".spectral.yaml" -D + .PHONY: api-docs-lint-stateful api-docs-lint-stateful: ## Run spectral API docs linter on kibana.yaml @npx @stoplight/spectral-cli lint "output/kibana.yaml" --ruleset ".spectral.yaml" diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 8d81681f3789e..363fc33d89a3e 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -19031,10 +19031,25 @@ tags: - name: Fleet uninstall tokens - description: Machine learning name: ml - - description: >- - Manage Kibana saved objects, including dashboards, visualizations, and - more. + - description: > + Export sets of saved objects that you want to import into {kib}, resolve + import errors, and rotate an encryption key for encrypted saved objects + with the saved objects APIs. + + + To manage a specific type of saved object, use the corresponding APIs. + + For example, use: + + + [Data views](../group/endpoint-data-views) + + + Warning: Do not write documents directly to the `.kibana` index. When you + write directly to the `.kibana` index, the data becomes corrupted and + permanently breaks future Kibana versions. name: saved objects + x-displayName: Saved objects - description: 'SLO APIs enable you to define, manage and track service-level objectives' name: slo - name: system diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index dfe69b9be3400..d5ad2469780bc 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -27592,10 +27592,30 @@ tags: - name: Fleet uninstall tokens - description: Machine learning name: ml - - description: >- - Manage Kibana saved objects, including dashboards, visualizations, and - more. + - description: > + Export sets of saved objects that you want to import into {kib}, resolve + import errors, and rotate an encryption key for encrypted saved objects + with the saved objects APIs. + + + To manage a specific type of saved object, use the corresponding APIs. + + For example, use: + + + * [Data views](../group/endpoint-data-views) + + * [Spaces](https://www.elastic.co/guide/en/kibana/current/spaces-api.html) + + * [Short + URLs](https://www.elastic.co/guide/en/kibana/current/short-urls-api.html) + + + Warning: Do not write documents directly to the `.kibana` index. When you + write directly to the `.kibana` index, the data becomes corrupted and + permanently breaks future Kibana versions. name: saved objects + x-displayName: Saved objects - description: 'SLO APIs enable you to define, manage and track service-level objectives' name: slo - name: system diff --git a/oas_docs/overlays/kibana.overlays.serverless.yaml b/oas_docs/overlays/kibana.overlays.serverless.yaml index dc21647813180..5d1064eecb37e 100644 --- a/oas_docs/overlays/kibana.overlays.serverless.yaml +++ b/oas_docs/overlays/kibana.overlays.serverless.yaml @@ -50,10 +50,6 @@ actions: description: Change displayName update: x-displayName: "Machine learning" - - target: '$.tags[?(@.name=="saved objects")]' - description: Change displayName - update: - x-displayName: "Saved objects" - target: '$.tags[?(@.name=="slo")]' description: Change displayName update: diff --git a/oas_docs/overlays/kibana.overlays.yaml b/oas_docs/overlays/kibana.overlays.yaml index 926550ca085b7..cd3b40eeda819 100644 --- a/oas_docs/overlays/kibana.overlays.yaml +++ b/oas_docs/overlays/kibana.overlays.yaml @@ -65,10 +65,6 @@ actions: description: Change displayName update: x-displayName: "Machine learning" - - target: '$.tags[?(@.name=="saved objects")]' - description: Change displayName - update: - x-displayName: "Saved objects" - target: '$.tags[?(@.name=="slo")]' description: Change displayName update: diff --git a/oas_docs/scripts/merge_ess_oas.js b/oas_docs/scripts/merge_ess_oas.js index f54f7081889f4..52620dffd1389 100644 --- a/oas_docs/scripts/merge_ess_oas.js +++ b/oas_docs/scripts/merge_ess_oas.js @@ -14,7 +14,6 @@ const { REPO_ROOT } = require('@kbn/repo-info'); await merge({ sourceGlobs: [ `${REPO_ROOT}/oas_docs/bundle.json`, - `${REPO_ROOT}/x-pack/plugins/actions/docs/openapi/bundled.yaml`, `${REPO_ROOT}/x-pack/plugins/alerting/docs/openapi/bundled.yaml`, `${REPO_ROOT}/x-pack/plugins/cases/docs/openapi/bundled.yaml`, `${REPO_ROOT}/src/plugins/data_views/docs/openapi/bundled.yaml`, diff --git a/oas_docs/scripts/merge_ess_oas_staging.js b/oas_docs/scripts/merge_ess_oas_staging.js index 72b2aae4a4eff..7613672b6ac97 100644 --- a/oas_docs/scripts/merge_ess_oas_staging.js +++ b/oas_docs/scripts/merge_ess_oas_staging.js @@ -14,7 +14,6 @@ const { REPO_ROOT } = require('@kbn/repo-info'); await merge({ sourceGlobs: [ `${REPO_ROOT}/oas_docs/bundle.json`, - `${REPO_ROOT}/x-pack/plugins/actions/docs/openapi/bundled.yaml`, `${REPO_ROOT}/x-pack/plugins/alerting/docs/openapi/bundled.yaml`, `${REPO_ROOT}/x-pack/plugins/cases/docs/openapi/bundled.yaml`, `${REPO_ROOT}/src/plugins/data_views/docs/openapi/bundled.yaml`, diff --git a/oas_docs/scripts/merge_serverless_oas.js b/oas_docs/scripts/merge_serverless_oas.js index 67ae00522741e..e6fa2e2f2abca 100644 --- a/oas_docs/scripts/merge_serverless_oas.js +++ b/oas_docs/scripts/merge_serverless_oas.js @@ -14,7 +14,6 @@ const { REPO_ROOT } = require('@kbn/repo-info'); await merge({ sourceGlobs: [ `${REPO_ROOT}/oas_docs/bundle.serverless.json`, - `${REPO_ROOT}/x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml`, `${REPO_ROOT}/src/plugins/data_views/docs/openapi/bundled.yaml`, `${REPO_ROOT}/x-pack/plugins/ml/common/openapi/ml_apis_serverless.yaml`, `${REPO_ROOT}/packages/core/saved-objects/docs/openapi/bundled_serverless.yaml`, diff --git a/oas_docs/scripts/merge_serverless_oas_staging.js b/oas_docs/scripts/merge_serverless_oas_staging.js index ea932fc08f291..aa3df010ac15f 100644 --- a/oas_docs/scripts/merge_serverless_oas_staging.js +++ b/oas_docs/scripts/merge_serverless_oas_staging.js @@ -14,7 +14,6 @@ const { REPO_ROOT } = require('@kbn/repo-info'); await merge({ sourceGlobs: [ `${REPO_ROOT}/oas_docs/bundle.serverless.json`, - `${REPO_ROOT}/x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml`, `${REPO_ROOT}/src/plugins/data_views/docs/openapi/bundled.yaml`, `${REPO_ROOT}/x-pack/plugins/ml/common/openapi/ml_apis_serverless.yaml`, `${REPO_ROOT}/packages/core/saved-objects/docs/openapi/bundled_serverless.yaml`, diff --git a/package.json b/package.json index ce1f760416eb0..73f394430ac93 100644 --- a/package.json +++ b/package.json @@ -662,6 +662,7 @@ "@kbn/no-data-page-plugin": "link:src/plugins/no_data_page", "@kbn/notifications-plugin": "link:x-pack/plugins/notifications", "@kbn/object-versioning": "link:packages/kbn-object-versioning", + "@kbn/object-versioning-utils": "link:packages/kbn-object-versioning-utils", "@kbn/observability-ai-assistant-app-plugin": "link:x-pack/plugins/observability_solution/observability_ai_assistant_app", "@kbn/observability-ai-assistant-management-plugin": "link:x-pack/plugins/observability_solution/observability_ai_assistant_management", "@kbn/observability-ai-assistant-plugin": "link:x-pack/plugins/observability_solution/observability_ai_assistant", @@ -1459,7 +1460,7 @@ "@mapbox/vector-tile": "1.3.1", "@octokit/rest": "^17.11.2", "@parcel/watcher": "^2.1.0", - "@redocly/cli": "^1.19.0", + "@redocly/cli": "^1.20.1", "@statoscope/webpack-plugin": "^5.28.2", "@storybook/addon-a11y": "^6.5.16", "@storybook/addon-actions": "^6.5.16", @@ -1650,7 +1651,7 @@ "buildkite-test-collector": "^1.7.0", "callsites": "^3.1.0", "chance": "1.0.18", - "chromedriver": "^127.0.3", + "chromedriver": "^128.0.0", "clean-webpack-plugin": "^3.0.0", "cli-progress": "^3.12.0", "cli-table3": "^0.6.1", diff --git a/packages/content-management/favorites/README.mdx b/packages/content-management/favorites/README.mdx index e54f1baef2c98..0c5d5167595a6 100644 --- a/packages/content-management/favorites/README.mdx +++ b/packages/content-management/favorites/README.mdx @@ -28,9 +28,11 @@ import { FavoriteButton, } from '@kbn/content-management-favorites-public'; +const appName = 'my-app'; const favoriteObjectType = 'dashboard'; -const favoritesClient = new FavoritesClient('dashboard', { +const favoritesClient = new FavoritesClient(appName, favoriteObjectType, { http: core.http, + usageCollection: plugins.usageCollection, }); // wrap your content with the favorites context provider diff --git a/packages/content-management/favorites/favorites_public/src/components/favorite_button.tsx b/packages/content-management/favorites/favorites_public/src/components/favorite_button.tsx index a82933bd0f53e..19e5e28dd99ad 100644 --- a/packages/content-management/favorites/favorites_public/src/components/favorite_button.tsx +++ b/packages/content-management/favorites/favorites_public/src/components/favorite_button.tsx @@ -12,6 +12,7 @@ import classNames from 'classnames'; import { EuiButtonIcon, euiCanAnimate, EuiThemeComputed } from '@elastic/eui'; import { css } from '@emotion/react'; import { useFavorites, useRemoveFavorite, useAddFavorite } from '../favorites_query'; +import { useFavoritesClient } from '../favorites_context'; export interface FavoriteButtonProps { id: string; @@ -24,6 +25,8 @@ export const FavoriteButton = ({ id, className }: FavoriteButtonProps) => { const removeFavorite = useRemoveFavorite(); const addFavorite = useAddFavorite(); + const favoritesClient = useFavoritesClient(); + if (!data) return null; const isFavorite = data.favoriteIds.includes(id); @@ -40,6 +43,7 @@ export const FavoriteButton = ({ id, className }: FavoriteButtonProps) => { aria-label={title} iconType={'starFilled'} onClick={() => { + favoritesClient?.reportRemoveFavoriteClick(); removeFavorite.mutate({ id }); }} className={classNames(className, 'cm-favorite-button', { @@ -59,6 +63,7 @@ export const FavoriteButton = ({ id, className }: FavoriteButtonProps) => { aria-label={title} iconType={'starEmpty'} onClick={() => { + favoritesClient?.reportAddFavoriteClick(); addFavorite.mutate({ id }); }} className={classNames(className, 'cm-favorite-button', { diff --git a/packages/content-management/favorites/favorites_public/src/favorites_client.ts b/packages/content-management/favorites/favorites_public/src/favorites_client.ts index 58eea3a600de4..c79df94926ed4 100644 --- a/packages/content-management/favorites/favorites_public/src/favorites_client.ts +++ b/packages/content-management/favorites/favorites_public/src/favorites_client.ts @@ -7,6 +7,7 @@ */ import type { HttpStart } from '@kbn/core-http-browser'; +import type { UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; import type { GetFavoritesResponse } from '@kbn/content-management-favorites-server'; export interface FavoritesClientPublic { @@ -15,10 +16,16 @@ export interface FavoritesClientPublic { removeFavorite({ id }: { id: string }): Promise; getFavoriteType(): string; + reportAddFavoriteClick(): void; + reportRemoveFavoriteClick(): void; } export class FavoritesClient implements FavoritesClientPublic { - constructor(private favoriteObjectType: string, private deps: { http: HttpStart }) {} + constructor( + private readonly appName: string, + private readonly favoriteObjectType: string, + private readonly deps: { http: HttpStart; usageCollection?: UsageCollectionStart } + ) {} public async getFavorites(): Promise { return this.deps.http.get(`/internal/content_management/favorites/${this.favoriteObjectType}`); @@ -39,4 +46,11 @@ export class FavoritesClient implements FavoritesClientPublic { public getFavoriteType() { return this.favoriteObjectType; } + + public reportAddFavoriteClick() { + this.deps.usageCollection?.reportUiCounter(this.appName, 'click', 'add_favorite'); + } + public reportRemoveFavoriteClick() { + this.deps.usageCollection?.reportUiCounter(this.appName, 'click', 'remove_favorite'); + } } diff --git a/packages/content-management/favorites/favorites_public/tsconfig.json b/packages/content-management/favorites/favorites_public/tsconfig.json index 2e5ef8bc52347..3057c828fc3da 100644 --- a/packages/content-management/favorites/favorites_public/tsconfig.json +++ b/packages/content-management/favorites/favorites_public/tsconfig.json @@ -22,5 +22,6 @@ "@kbn/core-http-browser", "@kbn/content-management-favorites-server", "@kbn/i18n-react", + "@kbn/usage-collection-plugin", ] } diff --git a/packages/content-management/favorites/favorites_server/src/favorites_saved_object.ts b/packages/content-management/favorites/favorites_server/src/favorites_saved_object.ts index e7d88045860f4..4b283dbef29d7 100644 --- a/packages/content-management/favorites/favorites_server/src/favorites_saved_object.ts +++ b/packages/content-management/favorites/favorites_server/src/favorites_saved_object.ts @@ -21,13 +21,19 @@ const schemaV1 = schema.object({ favoriteIds: schema.arrayOf(schema.string()), }); +export const favoritesSavedObjectName = 'favorites'; + export const favoritesSavedObjectType: SavedObjectsType = { - name: 'favorites', + name: favoritesSavedObjectName, hidden: true, namespaceType: 'single', mappings: { dynamic: false, - properties: {}, + properties: { + userId: { type: 'keyword' }, + type: { type: 'keyword' }, + favoriteIds: { type: 'keyword' }, + }, }, modelVersions: { 1: { @@ -41,5 +47,22 @@ export const favoritesSavedObjectType: SavedObjectsType = { create: schemaV1, }, }, + 2: { + // the model stays the same, but we added the mappings for the snapshot telemetry needs + changes: [ + { + type: 'mappings_addition', + addedMappings: { + userId: { type: 'keyword' }, + type: { type: 'keyword' }, + favoriteIds: { type: 'keyword' }, + }, + }, + ], + schemas: { + forwardCompatibility: schemaV1.extends({}, { unknowns: 'ignore' }), + create: schemaV1, + }, + }, }, }; diff --git a/packages/content-management/favorites/favorites_server/src/favorites_usage_collection.ts b/packages/content-management/favorites/favorites_server/src/favorites_usage_collection.ts new file mode 100644 index 0000000000000..22aab861cc6f0 --- /dev/null +++ b/packages/content-management/favorites/favorites_server/src/favorites_usage_collection.ts @@ -0,0 +1,129 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { CoreSetup } from '@kbn/core-lifecycle-server'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +import type { estypes } from '@elastic/elasticsearch'; +import { favoritesSavedObjectName } from './favorites_saved_object'; + +interface FavoritesUsage { + [favorite_object_type: string]: { + total: number; + total_users_spaces: number; + avg_per_user_per_space: number; + max_per_user_per_space: number; + }; +} + +export function registerFavoritesUsageCollection({ + core, + usageCollection, +}: { + core: CoreSetup; + usageCollection: UsageCollectionSetup; +}) { + usageCollection.registerCollector( + usageCollection.makeUsageCollector({ + type: 'favorites', + isReady: () => true, + schema: { + DYNAMIC_KEY /* e.g. 'dashboard' */: { + total: { + type: 'long', + _meta: { description: 'Total favorite object count in this deployment' }, + }, + total_users_spaces: { + type: 'long', + _meta: { + description: + 'Total users per space that have favorited an object of this type in this deployment', + }, + }, + avg_per_user_per_space: { + type: 'double', + _meta: { + description: + 'Average favorite objects count of this type per user per space for this deployment, only counts users who have favorited at least one object of this type', + }, + }, + max_per_user_per_space: { + type: 'long', + _meta: { + description: + 'Max favorite objects count of this type per user per space for this deployment', + }, + }, + }, + }, + fetch: async (context) => { + const favoritesIndex = await core + .getStartServices() + .then(([{ savedObjects }]) => savedObjects.getIndexForType(favoritesSavedObjectName)); + + const response = await context.esClient.search< + unknown, + { types: estypes.AggregationsStringTermsAggregate } + >({ + index: favoritesIndex, + size: 0, + _source: false, + filter_path: ['aggregations'], + query: { + bool: { + filter: [ + { + term: { + type: 'favorites', + }, + }, + ], + }, + }, + runtime_mappings: { + number_of_favorites: { + type: 'long', + script: { + source: "emit(doc['favorites.favoriteIds'].length)", + }, + }, + }, + aggs: { + types: { + terms: { + field: 'favorites.type', + }, + aggs: { + stats: { + stats: { + field: 'number_of_favorites', + }, + }, + }, + }, + }, + }); + + const favoritesUsage: FavoritesUsage = {}; + + const typesBuckets = (response.aggregations?.types?.buckets ?? + []) as estypes.AggregationsStringTermsBucket[]; + + typesBuckets.forEach((bucket) => { + favoritesUsage[bucket.key] = { + total: bucket.stats.sum, + total_users_spaces: bucket.stats.count, + avg_per_user_per_space: bucket.stats.avg, + max_per_user_per_space: bucket.stats.max, + }; + }); + + return favoritesUsage; + }, + }) + ); +} diff --git a/packages/content-management/favorites/favorites_server/src/index.ts b/packages/content-management/favorites/favorites_server/src/index.ts index 729d4537717c9..c639bd53361d0 100644 --- a/packages/content-management/favorites/favorites_server/src/index.ts +++ b/packages/content-management/favorites/favorites_server/src/index.ts @@ -7,8 +7,10 @@ */ import type { CoreSetup, Logger } from '@kbn/core/server'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import { registerFavoritesRoutes } from './favorites_routes'; import { favoritesSavedObjectType } from './favorites_saved_object'; +import { registerFavoritesUsageCollection } from './favorites_usage_collection'; export type { GetFavoritesResponse } from './favorites_routes'; @@ -18,8 +20,21 @@ export type { GetFavoritesResponse } from './favorites_routes'; * * @param logger * @param core + * @param usageCollection */ -export function registerFavorites({ logger, core }: { core: CoreSetup; logger: Logger }) { +export function registerFavorites({ + logger, + core, + usageCollection, +}: { + core: CoreSetup; + logger: Logger; + usageCollection?: UsageCollectionSetup; +}) { core.savedObjects.registerType(favoritesSavedObjectType); registerFavoritesRoutes({ core, logger }); + + if (usageCollection) { + registerFavoritesUsageCollection({ core, usageCollection }); + } } diff --git a/packages/content-management/favorites/favorites_server/tsconfig.json b/packages/content-management/favorites/favorites_server/tsconfig.json index fd4fbfb554cf6..5a9ae392c875b 100644 --- a/packages/content-management/favorites/favorites_server/tsconfig.json +++ b/packages/content-management/favorites/favorites_server/tsconfig.json @@ -17,5 +17,7 @@ "@kbn/core", "@kbn/config-schema", "@kbn/core-saved-objects-api-server", + "@kbn/core-lifecycle-server", + "@kbn/usage-collection-plugin", ] } diff --git a/packages/core/saved-objects/docs/openapi/bundled.json b/packages/core/saved-objects/docs/openapi/bundled.json index 06010e44e1a19..36439a6b46749 100644 --- a/packages/core/saved-objects/docs/openapi/bundled.json +++ b/packages/core/saved-objects/docs/openapi/bundled.json @@ -20,7 +20,8 @@ "tags": [ { "name": "saved objects", - "description": "Manage Kibana saved objects, including dashboards, visualizations, and more." + "x-displayName": "Saved objects", + "description": "Export sets of saved objects that you want to import into {kib}, resolve import errors, and rotate an encryption key for encrypted saved objects with the saved objects APIs.\n\nTo manage a specific type of saved object, use the corresponding APIs.\nFor example, use:\n\n* [Data views](../group/endpoint-data-views)\n* [Spaces](https://www.elastic.co/guide/en/kibana/current/spaces-api.html)\n* [Short URLs](https://www.elastic.co/guide/en/kibana/current/short-urls-api.html)\n\nWarning: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future Kibana versions.\n" } ], "paths": { diff --git a/packages/core/saved-objects/docs/openapi/bundled.yaml b/packages/core/saved-objects/docs/openapi/bundled.yaml index d616131ac494e..130c1c8d0a252 100644 --- a/packages/core/saved-objects/docs/openapi/bundled.yaml +++ b/packages/core/saved-objects/docs/openapi/bundled.yaml @@ -12,7 +12,18 @@ servers: - url: / tags: - name: saved objects - description: Manage Kibana saved objects, including dashboards, visualizations, and more. + x-displayName: Saved objects + description: | + Export sets of saved objects that you want to import into {kib}, resolve import errors, and rotate an encryption key for encrypted saved objects with the saved objects APIs. + + To manage a specific type of saved object, use the corresponding APIs. + For example, use: + + * [Data views](../group/endpoint-data-views) + * [Spaces](https://www.elastic.co/guide/en/kibana/current/spaces-api.html) + * [Short URLs](https://www.elastic.co/guide/en/kibana/current/short-urls-api.html) + + Warning: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future Kibana versions. paths: /api/encrypted_saved_objects/_rotate_key: post: diff --git a/packages/core/saved-objects/docs/openapi/bundled_serverless.json b/packages/core/saved-objects/docs/openapi/bundled_serverless.json index 6bc767088bbec..61a2671c878cf 100644 --- a/packages/core/saved-objects/docs/openapi/bundled_serverless.json +++ b/packages/core/saved-objects/docs/openapi/bundled_serverless.json @@ -25,7 +25,8 @@ "tags": [ { "name": "saved objects", - "description": "Manage Kibana saved objects, including dashboards, visualizations, and more." + "x-displayName": "Saved objects", + "description": "Export sets of saved objects that you want to import into {kib}, resolve import errors, and rotate an encryption key for encrypted saved objects with the saved objects APIs.\n\nTo manage a specific type of saved object, use the corresponding APIs.\nFor example, use:\n\n[Data views](../group/endpoint-data-views)\n\nWarning: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future Kibana versions.\n" } ], "paths": { diff --git a/packages/core/saved-objects/docs/openapi/bundled_serverless.yaml b/packages/core/saved-objects/docs/openapi/bundled_serverless.yaml index a8dc8b30fffe2..00331902faa17 100644 --- a/packages/core/saved-objects/docs/openapi/bundled_serverless.yaml +++ b/packages/core/saved-objects/docs/openapi/bundled_serverless.yaml @@ -15,7 +15,16 @@ servers: default: localhost:5601 tags: - name: saved objects - description: Manage Kibana saved objects, including dashboards, visualizations, and more. + x-displayName: Saved objects + description: | + Export sets of saved objects that you want to import into {kib}, resolve import errors, and rotate an encryption key for encrypted saved objects with the saved objects APIs. + + To manage a specific type of saved object, use the corresponding APIs. + For example, use: + + [Data views](../group/endpoint-data-views) + + Warning: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future Kibana versions. paths: /api/saved_objects/_export: post: diff --git a/packages/core/saved-objects/docs/openapi/entrypoint.yaml b/packages/core/saved-objects/docs/openapi/entrypoint.yaml index ee20a72801647..5cd9039988186 100644 --- a/packages/core/saved-objects/docs/openapi/entrypoint.yaml +++ b/packages/core/saved-objects/docs/openapi/entrypoint.yaml @@ -10,7 +10,18 @@ info: url: https://www.elastic.co/licensing/elastic-license tags: - name: saved objects - description: Manage Kibana saved objects, including dashboards, visualizations, and more. + x-displayName: Saved objects + description: | + Export sets of saved objects that you want to import into {kib}, resolve import errors, and rotate an encryption key for encrypted saved objects with the saved objects APIs. + + To manage a specific type of saved object, use the corresponding APIs. + For example, use: + + * [Data views](../group/endpoint-data-views) + * [Spaces](https://www.elastic.co/guide/en/kibana/current/spaces-api.html) + * [Short URLs](https://www.elastic.co/guide/en/kibana/current/short-urls-api.html) + + Warning: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future Kibana versions. servers: - url: / paths: diff --git a/packages/core/saved-objects/docs/openapi/entrypoint_serverless.yaml b/packages/core/saved-objects/docs/openapi/entrypoint_serverless.yaml index ab3dcacf9a39d..69c742a8d7acd 100644 --- a/packages/core/saved-objects/docs/openapi/entrypoint_serverless.yaml +++ b/packages/core/saved-objects/docs/openapi/entrypoint_serverless.yaml @@ -10,7 +10,16 @@ info: url: https://www.elastic.co/licensing/elastic-license tags: - name: saved objects - description: Manage Kibana saved objects, including dashboards, visualizations, and more. + x-displayName: Saved objects + description: | + Export sets of saved objects that you want to import into {kib}, resolve import errors, and rotate an encryption key for encrypted saved objects with the saved objects APIs. + + To manage a specific type of saved object, use the corresponding APIs. + For example, use: + + [Data views](../group/endpoint-data-views) + + Warning: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future Kibana versions. servers: - url: 'https://{kibana_url}' variables: diff --git a/packages/kbn-check-mappings-update-cli/current_fields.json b/packages/kbn-check-mappings-update-cli/current_fields.json index 6138ac9d9eae1..0447ba6a226dd 100644 --- a/packages/kbn-check-mappings-update-cli/current_fields.json +++ b/packages/kbn-check-mappings-update-cli/current_fields.json @@ -436,7 +436,11 @@ "updated_by", "version" ], - "favorites": [], + "favorites": [ + "favoriteIds", + "type", + "userId" + ], "file": [ "FileKind", "Meta", diff --git a/packages/kbn-check-mappings-update-cli/current_mappings.json b/packages/kbn-check-mappings-update-cli/current_mappings.json index 8098f637b177f..bda2270001bd9 100644 --- a/packages/kbn-check-mappings-update-cli/current_mappings.json +++ b/packages/kbn-check-mappings-update-cli/current_mappings.json @@ -1484,7 +1484,17 @@ }, "favorites": { "dynamic": false, - "properties": {} + "properties": { + "favoriteIds": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "userId": { + "type": "keyword" + } + } }, "file": { "dynamic": false, diff --git a/packages/kbn-ebt-tools/BUILD.bazel b/packages/kbn-ebt-tools/BUILD.bazel new file mode 100644 index 0000000000000..7f916b42152ca --- /dev/null +++ b/packages/kbn-ebt-tools/BUILD.bazel @@ -0,0 +1,36 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") + +SRCS = glob( + [ + "**/*.ts", + "**/*.tsx", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +SHARED_DEPS = [ + "@npm//@elastic/ebt", + "@npm//@elastic/apm-rum-core", + "@npm//react", + "@npm//react-router-dom", +] + +js_library( + name = "kbn-ebt-tools", + package_name = "@kbn/ebt-tools", + srcs = ["package.json"] + SRCS, + deps = SHARED_DEPS, + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-ebt-tools/src/performance_metrics/context/use_page_ready.ts b/packages/kbn-ebt-tools/src/performance_metrics/context/use_page_ready.ts new file mode 100644 index 0000000000000..1a445322d5de0 --- /dev/null +++ b/packages/kbn-ebt-tools/src/performance_metrics/context/use_page_ready.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { useEffect, useState } from 'react'; +import { CustomMetrics } from './performance_context'; +import { usePerformanceContext } from '../../..'; + +export const usePageReady = (state: { customMetrics?: CustomMetrics; isReady: boolean }) => { + const { onPageReady } = usePerformanceContext(); + + const [isReported, setIsReported] = useState(false); + + useEffect(() => { + if (state.isReady && !isReported) { + onPageReady(state.customMetrics); + setIsReported(true); + } + }, [isReported, onPageReady, state.customMetrics, state.isReady]); +}; diff --git a/packages/kbn-ebt-tools/src/performance_metrics/index.tsx b/packages/kbn-ebt-tools/src/performance_metrics/index.tsx index 54c5fe5d62512..421600b0daa83 100644 --- a/packages/kbn-ebt-tools/src/performance_metrics/index.tsx +++ b/packages/kbn-ebt-tools/src/performance_metrics/index.tsx @@ -22,4 +22,5 @@ function dynamic, TRef = {}>(loader: L export { usePerformanceContext } from './context/use_performance_context'; export { perfomanceMarkers } from './performance_markers'; +export { usePageReady } from './context/use_page_ready'; export const PerformanceContextProvider = dynamic(() => import('./context/performance_context')); diff --git a/packages/kbn-esql-ast/src/pretty_print/__tests__/basic_pretty_printer.test.ts b/packages/kbn-esql-ast/src/pretty_print/__tests__/basic_pretty_printer.test.ts index 0afb4e8e42ce4..d6509a1e1601b 100644 --- a/packages/kbn-esql-ast/src/pretty_print/__tests__/basic_pretty_printer.test.ts +++ b/packages/kbn-esql-ast/src/pretty_print/__tests__/basic_pretty_printer.test.ts @@ -211,7 +211,7 @@ describe('single line query', () => { }); }); - describe('binary expression expression', () => { + describe('binary expression', () => { test('arithmetic expression', () => { const { text } = reprint('ROW 1 + 2'); @@ -235,6 +235,36 @@ describe('single line query', () => { expect(text).toBe('FROM a | WHERE a LIKE "b"'); }); + + test('inserts brackets where necessary due precedence', () => { + const { text } = reprint('FROM a | WHERE (1 + 2) * 3'); + + expect(text).toBe('FROM a | WHERE (1 + 2) * 3'); + }); + + test('inserts brackets where necessary due precedence - 2', () => { + const { text } = reprint('FROM a | WHERE (1 + 2) * (3 - 4)'); + + expect(text).toBe('FROM a | WHERE (1 + 2) * (3 - 4)'); + }); + + test('inserts brackets where necessary due precedence - 3', () => { + const { text } = reprint('FROM a | WHERE (1 + 2) * (3 - 4) / (5 + 6 + 7)'); + + expect(text).toBe('FROM a | WHERE (1 + 2) * (3 - 4) / (5 + 6 + 7)'); + }); + + test('inserts brackets where necessary due precedence - 4', () => { + const { text } = reprint('FROM a | WHERE (1 + (1 + 2)) * ((3 - 4) / (5 + 6 + 7))'); + + expect(text).toBe('FROM a | WHERE (1 + 1 + 2) * (3 - 4) / (5 + 6 + 7)'); + }); + + test('inserts brackets where necessary due precedence - 5', () => { + const { text } = reprint('FROM a | WHERE (1 + (1 + 2)) * (((3 - 4) / (5 + 6 + 7)) + 1)'); + + expect(text).toBe('FROM a | WHERE (1 + 1 + 2) * ((3 - 4) / (5 + 6 + 7) + 1)'); + }); }); }); diff --git a/packages/kbn-esql-ast/src/pretty_print/basic_pretty_printer.ts b/packages/kbn-esql-ast/src/pretty_print/basic_pretty_printer.ts index 0aa3ccd608cc6..b6adf29a75cc9 100644 --- a/packages/kbn-esql-ast/src/pretty_print/basic_pretty_printer.ts +++ b/packages/kbn-esql-ast/src/pretty_print/basic_pretty_printer.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import { binaryExpressionGroup } from '../ast/helpers'; import { ESQLAstCommand } from '../types'; import { ESQLAstExpressionNode, ESQLAstQueryNode, Visitor } from '../visitor'; import { LeafPrinter } from './leaf_printer'; @@ -135,10 +136,12 @@ export class BasicPrettyPrinter { .on('visitExpression', (ctx) => { return ''; }) + .on('visitSourceExpression', (ctx) => LeafPrinter.source(ctx.node)) .on('visitColumnExpression', (ctx) => LeafPrinter.column(ctx.node)) .on('visitLiteralExpression', (ctx) => LeafPrinter.literal(ctx.node)) .on('visitTimeIntervalLiteralExpression', (ctx) => LeafPrinter.timeInterval(ctx.node)) + .on('visitInlineCastExpression', (ctx) => { const value = ctx.value(); const wrapInBrackets = @@ -154,6 +157,7 @@ export class BasicPrettyPrinter { return `${valueFormatted}::${ctx.node.castType}`; }) + .on('visitListLiteralExpression', (ctx) => { let elements = ''; @@ -163,6 +167,7 @@ export class BasicPrettyPrinter { return `[${elements}]`; }) + .on('visitFunctionCallExpression', (ctx) => { const opts = this.opts; const node = ctx.node; @@ -183,7 +188,25 @@ export class BasicPrettyPrinter { case 'binary-expression': { operator = this.keyword(operator); - return `${ctx.visitArgument(0)} ${operator} ${ctx.visitArgument(1)}`; + const group = binaryExpressionGroup(ctx.node); + const [left, right] = ctx.arguments(); + const groupLeft = binaryExpressionGroup(left); + const groupRight = binaryExpressionGroup(right); + + let leftFormatted = ctx.visitArgument(0); + let rightFormatted = ctx.visitArgument(1); + + if (groupLeft && groupLeft < group) { + leftFormatted = `(${leftFormatted})`; + } + + if (groupRight && groupRight < group) { + rightFormatted = `(${rightFormatted})`; + } + + const formatted = `${leftFormatted} ${operator} ${rightFormatted}`; + + return formatted; } default: { if (opts.lowercaseFunctions) { @@ -200,9 +223,11 @@ export class BasicPrettyPrinter { } } }) + .on('visitRenameExpression', (ctx) => { return `${ctx.visitArgument(0)} ${this.keyword('AS')} ${ctx.visitArgument(1)}`; }) + .on('visitCommandOption', (ctx) => { const opts = this.opts; const option = opts.lowercaseOptions ? ctx.node.name : ctx.node.name.toUpperCase(); @@ -218,6 +243,7 @@ export class BasicPrettyPrinter { return optionFormatted; }) + .on('visitCommand', (ctx) => { const opts = this.opts; const cmd = opts.lowercaseCommands ? ctx.node.name : ctx.node.name.toUpperCase(); @@ -239,6 +265,7 @@ export class BasicPrettyPrinter { return cmdFormatted; }) + .on('visitQuery', (ctx) => { const opts = this.opts; const cmdSeparator = opts.multiline ? `\n${opts.pipeTab ?? ' '}| ` : ' | '; diff --git a/packages/kbn-esql-ast/src/pretty_print/wrapping_pretty_printer.ts b/packages/kbn-esql-ast/src/pretty_print/wrapping_pretty_printer.ts index 24381fbcda1a8..d4c2fe5cc20eb 100644 --- a/packages/kbn-esql-ast/src/pretty_print/wrapping_pretty_printer.ts +++ b/packages/kbn-esql-ast/src/pretty_print/wrapping_pretty_printer.ts @@ -332,6 +332,7 @@ export class WrappingPrettyPrinter { .on('visitRenameExpression', (ctx, inp: Input): Output => { const operator = this.keyword('AS'); + return this.visitBinaryExpression(ctx, operator, inp); }) diff --git a/packages/kbn-esql-utils/README.md b/packages/kbn-esql-utils/README.md index 8dc31041e86da..9b688555ea210 100644 --- a/packages/kbn-esql-utils/README.md +++ b/packages/kbn-esql-utils/README.md @@ -8,4 +8,4 @@ This package contains utilities for ES|QL. - *removeDropCommandsFromESQLQuery*: Use this function to remove all the occurences of the `drop` command from the query. - *appendToESQLQuery*: Use this function to append more pipes in an existing ES|QL query. It adds the additional commands in a new line. - *appendWhereClauseToESQLQuery*: Use this function to append where clause in an existing query. - +- *retieveMetadataColumns*: Use this function to get if there is a metadata option in the from command, and retrieve the columns if so diff --git a/packages/kbn-esql-utils/index.ts b/packages/kbn-esql-utils/index.ts index ecbd0f7728f38..80315a567fe09 100644 --- a/packages/kbn-esql-utils/index.ts +++ b/packages/kbn-esql-utils/index.ts @@ -24,6 +24,7 @@ export { getTimeFieldFromESQLQuery, getStartEndParams, hasStartEndParams, + retieveMetadataColumns, TextBasedLanguages, } from './src'; diff --git a/packages/kbn-esql-utils/src/index.ts b/packages/kbn-esql-utils/src/index.ts index d0b10ad486599..43d3fd75045c4 100644 --- a/packages/kbn-esql-utils/src/index.ts +++ b/packages/kbn-esql-utils/src/index.ts @@ -16,6 +16,7 @@ export { removeDropCommandsFromESQLQuery, hasTransformationalCommand, getTimeFieldFromESQLQuery, + retieveMetadataColumns, } from './utils/query_parsing_helpers'; export { appendToESQLQuery, appendWhereClauseToESQLQuery } from './utils/append_to_query'; export { 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 8bf4ebc682074..b5fdee7ad3976 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 @@ -12,6 +12,7 @@ import { removeDropCommandsFromESQLQuery, hasTransformationalCommand, getTimeFieldFromESQLQuery, + retieveMetadataColumns, } from './query_parsing_helpers'; describe('esql query helpers', () => { @@ -175,4 +176,17 @@ describe('esql query helpers', () => { ).toBe('event.timefield'); }); }); + + describe('retieveMetadataColumns', () => { + it('should return metadata columns if they exist', () => { + expect(retieveMetadataColumns('from a metadata _id, _ignored | eval b = 1')).toStrictEqual([ + '_id', + '_ignored', + ]); + }); + + it('should return empty columns if metadata doesnt exist', () => { + expect(retieveMetadataColumns('from a | eval b = 1')).toStrictEqual([]); + }); + }); }); diff --git a/packages/kbn-esql-utils/src/utils/query_parsing_helpers.ts b/packages/kbn-esql-utils/src/utils/query_parsing_helpers.ts index bdabcbfbdd6c8..4dd58a25cdcee 100644 --- a/packages/kbn-esql-utils/src/utils/query_parsing_helpers.ts +++ b/packages/kbn-esql-utils/src/utils/query_parsing_helpers.ts @@ -5,7 +5,13 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import type { ESQLSource, ESQLFunction, ESQLColumn, ESQLSingleAstItem } from '@kbn/esql-ast'; +import type { + ESQLSource, + ESQLFunction, + ESQLColumn, + ESQLSingleAstItem, + ESQLCommandOption, +} from '@kbn/esql-ast'; import { getAstAndSyntaxErrors, Walker, walk } from '@kbn/esql-ast'; const DEFAULT_ESQL_LIMIT = 1000; @@ -105,3 +111,14 @@ export const getTimeFieldFromESQLQuery = (esql: string) => { return column?.name; }; + +export const retieveMetadataColumns = (esql: string): string[] => { + const { ast } = getAstAndSyntaxErrors(esql); + const options: ESQLCommandOption[] = []; + + walk(ast, { + visitCommandOption: (node) => options.push(node), + }); + const metadataOptions = options.find(({ name }) => name === 'metadata'); + return metadataOptions?.args.map((column) => (column as ESQLColumn).name) ?? []; +}; diff --git a/packages/kbn-investigation-shared/src/rest_specs/index.ts b/packages/kbn-investigation-shared/src/rest_specs/index.ts index cb13c11886481..9022266becf2a 100644 --- a/packages/kbn-investigation-shared/src/rest_specs/index.ts +++ b/packages/kbn-investigation-shared/src/rest_specs/index.ts @@ -18,6 +18,7 @@ export type * from './create_item'; export type * from './delete_item'; export type * from './get_items'; export type * from './investigation_item'; +export type * from './update_note'; export * from './create'; export * from './create_note'; @@ -31,3 +32,4 @@ export * from './create_item'; export * from './delete_item'; export * from './get_items'; export * from './investigation_item'; +export * from './update_note'; diff --git a/packages/kbn-investigation-shared/src/rest_specs/update_note.ts b/packages/kbn-investigation-shared/src/rest_specs/update_note.ts new file mode 100644 index 0000000000000..22e84db8242d4 --- /dev/null +++ b/packages/kbn-investigation-shared/src/rest_specs/update_note.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 * as t from 'io-ts'; +import { investigationNoteResponseSchema } from './investigation_note'; + +const updateInvestigationNoteParamsSchema = t.type({ + path: t.type({ + investigationId: t.string, + noteId: t.string, + }), + body: t.type({ + content: t.string, + }), +}); + +const updateInvestigationNoteResponseSchema = investigationNoteResponseSchema; + +type UpdateInvestigationNoteParams = t.TypeOf< + typeof updateInvestigationNoteParamsSchema.props.body +>; +type UpdateInvestigationNoteResponse = t.OutputOf; + +export { updateInvestigationNoteParamsSchema, updateInvestigationNoteResponseSchema }; +export type { UpdateInvestigationNoteParams, UpdateInvestigationNoteResponse }; diff --git a/packages/kbn-io-ts-utils/src/props_to_schema/index.ts b/packages/kbn-io-ts-utils/src/props_to_schema/index.ts deleted file mode 100644 index 5915df1b0102e..0000000000000 --- a/packages/kbn-io-ts-utils/src/props_to_schema/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -import * as t from 'io-ts'; -import { PathReporter } from 'io-ts/lib/PathReporter'; -import { schema, Type } from '@kbn/config-schema'; -import { isLeft } from 'fp-ts/lib/Either'; - -export function propsToSchema>(type: T): Type> { - return schema.object( - {}, - { - unknowns: 'allow', - validate: (val) => { - const decoded = type.decode(val); - - if (isLeft(decoded)) { - return PathReporter.report(decoded).join('\n'); - } - }, - } - ); -} diff --git a/packages/kbn-io-ts-utils/src/strict_keys_rt/index.test.ts b/packages/kbn-io-ts-utils/src/strict_keys_rt/index.test.ts index 3751e3b2674af..4105d0c6c18f1 100644 --- a/packages/kbn-io-ts-utils/src/strict_keys_rt/index.test.ts +++ b/packages/kbn-io-ts-utils/src/strict_keys_rt/index.test.ts @@ -206,7 +206,38 @@ describe('strictKeysRt', () => { { type: t.array(t.type({ foo: t.string })), passes: [[{ foo: 'bar' }], [{ foo: 'baz' }, { foo: 'bar' }]], - fails: [], + fails: [{ foo: 'bar', bar: 'foo' }], + }, + { + type: t.type({ + nestedArray: t.array( + t.type({ + bar: t.string, + }) + ), + }), + passes: [ + { + nestedArray: [], + }, + { + nestedArray: [ + { + bar: 'foo', + }, + ], + }, + ], + fails: [ + { + nestedArray: [ + { + bar: 'foo', + foo: 'bar', + }, + ], + }, + ], }, ]; diff --git a/packages/kbn-io-ts-utils/src/strict_keys_rt/index.ts b/packages/kbn-io-ts-utils/src/strict_keys_rt/index.ts index 268b9055959c2..8e097d03300db 100644 --- a/packages/kbn-io-ts-utils/src/strict_keys_rt/index.ts +++ b/packages/kbn-io-ts-utils/src/strict_keys_rt/index.ts @@ -8,7 +8,7 @@ import * as t from 'io-ts'; import { either, isRight } from 'fp-ts/lib/Either'; -import { difference, isPlainObject, forEach } from 'lodash'; +import { difference, isPlainObject, forEach, isArray, castArray } from 'lodash'; import { MergeType } from '../merge_rt'; /* @@ -100,11 +100,31 @@ function getHandledKeys>( keys.handled.add(ownPrefix); } + const processObject = (typeForObject: t.Mixed, objectToProcess: Record) => { + const nextKeys = getHandledKeys(typeForObject, objectToProcess, ownPrefix); + nextKeys.all.forEach((k) => keys.all.add(k)); + nextKeys.handled.forEach((k) => keys.handled.add(k)); + }; + if (isPlainObject(value)) { - handlingTypes.forEach((i) => { - const nextKeys = getHandledKeys(i, value as Record, ownPrefix); - nextKeys.all.forEach((k) => keys.all.add(k)); - nextKeys.handled.forEach((k) => keys.handled.add(k)); + handlingTypes.forEach((typeAtIndex) => { + processObject(typeAtIndex, value as Record); + }); + } + + if (isArray(value)) { + handlingTypes.forEach((typeAtIndex) => { + if (!isParsableType(typeAtIndex) || typeAtIndex._tag !== 'ArrayType') { + return; + } + + const innerType = typeAtIndex.type; + + castArray(value).forEach((valueAtIndex) => { + if (isPlainObject(valueAtIndex)) { + processObject(innerType, valueAtIndex as Record); + } + }); }); } }); diff --git a/packages/kbn-io-ts-utils/tsconfig.json b/packages/kbn-io-ts-utils/tsconfig.json index 5145b1ee2a7f4..0ac791e1542ae 100644 --- a/packages/kbn-io-ts-utils/tsconfig.json +++ b/packages/kbn-io-ts-utils/tsconfig.json @@ -11,7 +11,6 @@ "**/*.ts" ], "kbn_references": [ - "@kbn/config-schema", "@kbn/core", "@kbn/datemath" ], diff --git a/packages/kbn-management/settings/setting_ids/index.ts b/packages/kbn-management/settings/setting_ids/index.ts index 2d09f5a2b2ad7..9f0c226717079 100644 --- a/packages/kbn-management/settings/setting_ids/index.ts +++ b/packages/kbn-management/settings/setting_ids/index.ts @@ -145,8 +145,6 @@ export const OBSERVABILITY_ENTITY_CENTRIC_EXPERIENCE = 'observability:entityCent export const OBSERVABILITY_LOGS_DATA_ACCESS_LOG_SOURCES_ID = 'observability:logSources'; export const OBSERVABILITY_AI_ASSISTANT_LOGS_INDEX_PATTERN_ID = 'observability:aiAssistantLogsIndexPattern'; -export const OBSERVABILITY_AI_ASSISTANT_RESPONSE_LANGUAGE = - 'observability:aiAssistantResponseLanguage'; export const OBSERVABILITY_AI_ASSISTANT_SIMULATED_FUNCTION_CALLING = 'observability:aiAssistantSimulatedFunctionCalling'; export const OBSERVABILITY_AI_ASSISTANT_SEARCH_CONNECTOR_INDEX_PATTERN = diff --git a/packages/kbn-object-versioning-utils/README.md b/packages/kbn-object-versioning-utils/README.md new file mode 100644 index 0000000000000..65b4bdd1206ec --- /dev/null +++ b/packages/kbn-object-versioning-utils/README.md @@ -0,0 +1,3 @@ +# @kbn/object-versioning-utils + +Exports common utils from `@kbn/object-versioning` that are safe to be used both in the server and the browser. diff --git a/packages/kbn-object-versioning-utils/index.ts b/packages/kbn-object-versioning-utils/index.ts new file mode 100644 index 0000000000000..650ac1804edec --- /dev/null +++ b/packages/kbn-object-versioning-utils/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may 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 { validateVersion } from './lib/validate_version'; diff --git a/packages/kbn-object-versioning-utils/jest.config.js b/packages/kbn-object-versioning-utils/jest.config.js new file mode 100644 index 0000000000000..2a127f38d568d --- /dev/null +++ b/packages/kbn-object-versioning-utils/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../..', + roots: ['/packages/kbn-object-versioning-utils'], +}; diff --git a/packages/kbn-object-versioning-utils/kibana.jsonc b/packages/kbn-object-versioning-utils/kibana.jsonc new file mode 100644 index 0000000000000..deba859afd364 --- /dev/null +++ b/packages/kbn-object-versioning-utils/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/object-versioning-utils", + "owner": "@elastic/appex-sharedux" +} diff --git a/packages/kbn-object-versioning-utils/lib/validate_version.ts b/packages/kbn-object-versioning-utils/lib/validate_version.ts new file mode 100644 index 0000000000000..8941e0ef9fdd1 --- /dev/null +++ b/packages/kbn-object-versioning-utils/lib/validate_version.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +// import type { Version } from '@kbn/object-versioning'; +// Declaring it directly to avoid circular dependencies. +type Version = number; + +export const validateVersion = ( + version: unknown +): { result: true; value: Version } | { result: false; value: null } => { + if (typeof version === 'string') { + const isValid = /^\d+$/.test(version); + if (isValid) { + const parsed = parseInt(version, 10); + if (Number.isNaN(parsed)) { + return { result: false, value: null }; + } + return { result: true, value: parsed }; + } + return { result: false, value: null }; + } else { + const isValid = Number.isInteger(version); + if (isValid) { + return { + result: true, + value: version as Version, + }; + } + return { + result: false, + value: null, + }; + } +}; diff --git a/packages/kbn-object-versioning-utils/package.json b/packages/kbn-object-versioning-utils/package.json new file mode 100644 index 0000000000000..f608c88ab44aa --- /dev/null +++ b/packages/kbn-object-versioning-utils/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/object-versioning-utils", + "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-object-versioning-utils/tsconfig.json b/packages/kbn-object-versioning-utils/tsconfig.json new file mode 100644 index 0000000000000..a9e9e3ad3baac --- /dev/null +++ b/packages/kbn-object-versioning-utils/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + ] +} diff --git a/packages/kbn-object-versioning/kibana.jsonc b/packages/kbn-object-versioning/kibana.jsonc index c79023fdec49d..00f87ac804f47 100644 --- a/packages/kbn-object-versioning/kibana.jsonc +++ b/packages/kbn-object-versioning/kibana.jsonc @@ -1,5 +1,5 @@ { - "type": "shared-common", + "type": "shared-server", "id": "@kbn/object-versioning", "owner": "@elastic/appex-sharedux" } diff --git a/packages/kbn-object-versioning/lib/utils.ts b/packages/kbn-object-versioning/lib/utils.ts index e5531578c55bb..2a75bca650de2 100644 --- a/packages/kbn-object-versioning/lib/utils.ts +++ b/packages/kbn-object-versioning/lib/utils.ts @@ -7,7 +7,6 @@ */ import type { Type, ValidationError } from '@kbn/config-schema'; -import { Version } from './types'; /** * Validate an object based on a schema. @@ -29,30 +28,4 @@ export const validateObj = (obj: unknown, objSchema?: Type): ValidationErro } }; -export const validateVersion = ( - version: unknown -): { result: true; value: Version } | { result: false; value: null } => { - if (typeof version === 'string') { - const isValid = /^\d+$/.test(version); - if (isValid) { - const parsed = parseInt(version, 10); - if (Number.isNaN(parsed)) { - return { result: false, value: null }; - } - return { result: true, value: parsed }; - } - return { result: false, value: null }; - } else { - const isValid = Number.isInteger(version); - if (isValid) { - return { - result: true, - value: version as Version, - }; - } - return { - result: false, - value: null, - }; - } -}; +export { validateVersion } from '@kbn/object-versioning-utils'; diff --git a/packages/kbn-object-versioning/tsconfig.json b/packages/kbn-object-versioning/tsconfig.json index 35c4b501af791..42c549aef3ce6 100644 --- a/packages/kbn-object-versioning/tsconfig.json +++ b/packages/kbn-object-versioning/tsconfig.json @@ -18,5 +18,6 @@ "kbn_references": [ "@kbn/config-schema", "@kbn/safer-lodash-set", + "@kbn/object-versioning-utils", ] } diff --git a/packages/kbn-reporting/common/schema_utils.ts b/packages/kbn-reporting/common/schema_utils.ts index 6e3d193489ec1..d32f93b237977 100644 --- a/packages/kbn-reporting/common/schema_utils.ts +++ b/packages/kbn-reporting/common/schema_utils.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { ByteSizeValue } from '@kbn/config-schema'; +import type { ByteSizeValue } from '@kbn/config-schema'; import moment from 'moment'; /* diff --git a/packages/kbn-server-http-tools/kibana.jsonc b/packages/kbn-server-http-tools/kibana.jsonc index c2b6aae999c2f..f540a5be09123 100644 --- a/packages/kbn-server-http-tools/kibana.jsonc +++ b/packages/kbn-server-http-tools/kibana.jsonc @@ -1,5 +1,5 @@ { - "type": "shared-common", + "type": "shared-server", "id": "@kbn/server-http-tools", "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-server-route-repository-client/index.ts b/packages/kbn-server-route-repository-client/index.ts index d2572e009bd66..dc2fd26f4ef53 100644 --- a/packages/kbn-server-route-repository-client/index.ts +++ b/packages/kbn-server-route-repository-client/index.ts @@ -7,4 +7,10 @@ */ export { createRepositoryClient } from './src/create_repository_client'; -export type { DefaultClientOptions } from '@kbn/server-route-repository-utils'; +export { isHttpFetchError } from './src/is_http_fetch_error'; + +export type { + DefaultClientOptions, + ClientRequestParamsOf, + RouteRepositoryClient, +} from '@kbn/server-route-repository-utils'; diff --git a/packages/kbn-server-route-repository-client/src/is_http_fetch_error.ts b/packages/kbn-server-route-repository-client/src/is_http_fetch_error.ts new file mode 100644 index 0000000000000..82d19cafb404e --- /dev/null +++ b/packages/kbn-server-route-repository-client/src/is_http_fetch_error.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { IHttpFetchError, isHttpFetchError as coreIsHttpFetchError } from '@kbn/core-http-browser'; + +interface ErrorBody { + statusCode: number; + message: string; + error: string; +} + +export function isHttpFetchError(error: unknown): error is IHttpFetchError { + return coreIsHttpFetchError(error); +} diff --git a/packages/kbn-server-route-repository-client/tsconfig.json b/packages/kbn-server-route-repository-client/tsconfig.json index 8ef10ede60a1a..8e70ce9851750 100644 --- a/packages/kbn-server-route-repository-client/tsconfig.json +++ b/packages/kbn-server-route-repository-client/tsconfig.json @@ -16,5 +16,6 @@ "kbn_references": [ "@kbn/server-route-repository-utils", "@kbn/core-lifecycle-browser", + "@kbn/core-http-browser", ] } diff --git a/packages/kbn-server-route-repository-utils/src/typings.ts b/packages/kbn-server-route-repository-utils/src/typings.ts index ff93e760a580a..92580c852e40e 100644 --- a/packages/kbn-server-route-repository-utils/src/typings.ts +++ b/packages/kbn-server-route-repository-utils/src/typings.ts @@ -20,6 +20,38 @@ import { z } from '@kbn/zod'; import * as t from 'io-ts'; import { RequiredKeys } from 'utility-types'; +type PathMaybeOptional }> = RequiredKeys< + T['path'] +> extends never + ? { path?: T['path'] } + : { path: T['path'] }; + +type QueryMaybeOptional }> = RequiredKeys< + T['query'] +> extends never + ? { query?: T['query'] } + : { query: T['query'] }; + +type BodyMaybeOptional }> = RequiredKeys< + T['body'] +> extends never + ? { body?: T['body'] } + : { body: T['body'] }; + +type ParamsMaybeOptional< + TPath extends Record, + TQuery extends Record, + TBody extends Record +> = PathMaybeOptional<{ path: TPath }> & + QueryMaybeOptional<{ query: TQuery }> & + BodyMaybeOptional<{ body: TBody }>; + +type ZodMaybeOptional = ParamsMaybeOptional< + T['path'], + T['query'], + T['body'] +>; + type MaybeOptional }> = RequiredKeys< T['params'] > extends never @@ -93,7 +125,7 @@ type ClientRequestParamsOfType = }> : TRouteParamsRT extends z.Schema ? MaybeOptional<{ - params: z.TypeOf; + params: ZodMaybeOptional>; }> : {}; @@ -104,7 +136,7 @@ type DecodedRequestParamsOfType = }> : TRouteParamsRT extends z.Schema ? MaybeOptional<{ - params: z.TypeOf; + params: ZodMaybeOptional>; }> : {}; @@ -162,7 +194,7 @@ type MaybeOptionalArgs> = RequiredKeys extends export type RouteRepositoryClient< TServerRouteRepository extends ServerRouteRepository, - TAdditionalClientOptions extends Record + TAdditionalClientOptions extends Record = DefaultClientOptions > = >( endpoint: TEndpoint, ...args: MaybeOptionalArgs< diff --git a/packages/kbn-server-route-repository/README.md b/packages/kbn-server-route-repository/README.md index f42bfb4390a20..c34cf6654ba43 100644 --- a/packages/kbn-server-route-repository/README.md +++ b/packages/kbn-server-route-repository/README.md @@ -88,9 +88,7 @@ The client can be created either in `setup` or `start`. > browser/plugin.ts ```javascript -import { isHttpFetchError } from '@kbn/core-http-browser'; -import { DefaultClientOptions } from '@kbn/server-route-repository-utils'; -import { createRepositoryClient } from '@kbn/server-route-repository-client'; +import { createRepositoryClient, isHttpFetchError, DefaultClientOptions } from '@kbn/server-route-repository-client'; import type { MyPluginRouteRepository } from '../server/plugin'; export type MyPluginRepositoryClient = diff --git a/packages/kbn-telemetry-tools/kibana.jsonc b/packages/kbn-telemetry-tools/kibana.jsonc index f36e6d272b81b..cf1d0def824e4 100644 --- a/packages/kbn-telemetry-tools/kibana.jsonc +++ b/packages/kbn-telemetry-tools/kibana.jsonc @@ -1,5 +1,5 @@ { - "type": "shared-common", + "type": "shared-server", "id": "@kbn/telemetry-tools", "devOnly": true, "owner": "@elastic/kibana-core" diff --git a/packages/kbn-telemetry-tools/src/tools/__fixture__/telemetry_collectors/externally_defined_usage_collector/index.ts b/packages/kbn-telemetry-tools/src/tools/__fixture__/telemetry_collectors/externally_defined_usage_collector/index.ts index 2b62900ae5c30..13f4a5bd8e281 100644 --- a/packages/kbn-telemetry-tools/src/tools/__fixture__/telemetry_collectors/externally_defined_usage_collector/index.ts +++ b/packages/kbn-telemetry-tools/src/tools/__fixture__/telemetry_collectors/externally_defined_usage_collector/index.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -// eslint-disable-next-line @kbn/imports/no_boundary_crossing import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import { getUsageCollector } from './get_usage_collector'; diff --git a/packages/kbn-ui-shared-deps-npm/BUILD.bazel b/packages/kbn-ui-shared-deps-npm/BUILD.bazel index 937cbe0c2a8ef..48f234b0bfe10 100644 --- a/packages/kbn-ui-shared-deps-npm/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-npm/BUILD.bazel @@ -37,6 +37,7 @@ RUNTIME_DEPS = [ "@npm//whatwg-fetch", "@npm//symbol-observable", "@npm//@babel/runtime", + "@npm//@elastic/apm-rum-core", "@npm//@elastic/charts", "@npm//@elastic/eui", "@npm//@elastic/numeral", diff --git a/packages/kbn-ui-shared-deps-npm/webpack.config.js b/packages/kbn-ui-shared-deps-npm/webpack.config.js index 294bffdaaa833..34b70f3ea6dfb 100644 --- a/packages/kbn-ui-shared-deps-npm/webpack.config.js +++ b/packages/kbn-ui-shared-deps-npm/webpack.config.js @@ -58,6 +58,7 @@ module.exports = (_, argv) => { '@babel/runtime/helpers/wrapNativeSuper', // modules from npm + '@elastic/apm-rum-core', '@elastic/charts', '@elastic/eui', '@elastic/eui/optimize/es/components/provider/nested', diff --git a/packages/kbn-ui-shared-deps-src/BUILD.bazel b/packages/kbn-ui-shared-deps-src/BUILD.bazel index cd723a8ed6401..d2e67ccd14ac6 100644 --- a/packages/kbn-ui-shared-deps-src/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-src/BUILD.bazel @@ -24,6 +24,7 @@ webpack_cli( "//packages/kbn-ui-theme", "//packages/kbn-i18n", "//packages/kbn-i18n-react", + "//packages/kbn-ebt-tools", "//packages/kbn-esql-ast", "//packages/kbn-monaco", "//packages/kbn-datemath", diff --git a/packages/kbn-ui-shared-deps-src/src/definitions.js b/packages/kbn-ui-shared-deps-src/src/definitions.js index 6f7bff397d320..abdf79b793986 100644 --- a/packages/kbn-ui-shared-deps-src/src/definitions.js +++ b/packages/kbn-ui-shared-deps-src/src/definitions.js @@ -31,7 +31,7 @@ const jsFilename = 'kbn-ui-shared-deps-src.js'; const cssDistFilename = 'kbn-ui-shared-deps-src.css'; /** - * Externals mapping inteded to be used in a webpack config + * Externals mapping intended to be used in a webpack config */ const externals = { /** @@ -102,6 +102,8 @@ const externals = { '@tanstack/react-query-devtools': '__kbnSharedDeps__.ReactQueryDevtools', '@kbn/code-editor': '__kbnSharedDeps__.KbnCodeEditor', '@kbn/esql-ast': '__kbnSharedDeps__.KbnEsqlAst', + '@kbn/ebt-tools': '__kbnSharedDeps__.KbnEbtTools', + '@elastic/apm-rum-core': '__kbnSharedDeps__.ElasticApmRumCore', }; module.exports = { distDir, jsFilename, cssDistFilename, externals }; diff --git a/packages/kbn-ui-shared-deps-src/src/entry.js b/packages/kbn-ui-shared-deps-src/src/entry.js index 5347952978780..dce5edf42b3cb 100644 --- a/packages/kbn-ui-shared-deps-src/src/entry.js +++ b/packages/kbn-ui-shared-deps-src/src/entry.js @@ -75,3 +75,5 @@ export const ReactQuery = require('@tanstack/react-query'); export const ReactQueryDevtools = require('@tanstack/react-query-devtools'); export const KbnCodeEditor = require('@kbn/code-editor'); export const KbnEsqlAst = require('@kbn/esql-ast'); +export const KbnEbtTools = require('@kbn/ebt-tools'); +export const ElasticApmRumCore = require('@elastic/apm-rum-core'); diff --git a/packages/kbn-utils/kibana.jsonc b/packages/kbn-utils/kibana.jsonc index 2c4efc0a67651..516d42bb2e8ba 100644 --- a/packages/kbn-utils/kibana.jsonc +++ b/packages/kbn-utils/kibana.jsonc @@ -1,5 +1,5 @@ { - "type": "shared-common", + "type": "shared-server", "id": "@kbn/utils", "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-visualization-ui-components/index.ts b/packages/kbn-visualization-ui-components/index.ts index c6d4d7a8c545c..44fcc3448aee2 100644 --- a/packages/kbn-visualization-ui-components/index.ts +++ b/packages/kbn-visualization-ui-components/index.ts @@ -31,7 +31,7 @@ export { ChartSwitchTrigger, } from './components'; -export { isFieldLensCompatible } from './util'; +export { isFieldLensCompatible, sharedSetOfIcons, hasIcon, iconSortCriteria } from './util'; export type { DataType, @@ -43,4 +43,4 @@ export type { ColorPickerProps, } from './components'; -export type { FormatFactory, LineStyle } from './types'; +export type { FormatFactory, LineStyle, SharedSetOfIcons } from './types'; diff --git a/packages/kbn-visualization-ui-components/types.ts b/packages/kbn-visualization-ui-components/types.ts index 2e72eb9a305cf..eb06837db4562 100644 --- a/packages/kbn-visualization-ui-components/types.ts +++ b/packages/kbn-visualization-ui-components/types.ts @@ -11,3 +11,18 @@ import type { IFieldFormat, SerializedFieldFormat } from '@kbn/field-formats-plu export type FormatFactory = (mapping?: SerializedFieldFormat) => IFieldFormat; export type LineStyle = 'solid' | 'dashed' | 'dotted'; + +// This is a line of shared icon names used by Reference Lines, Annotations and Metric chart +export type SharedSetOfIcons = + | 'empty' + | 'asterisk' + | 'alert' + | 'bell' + | 'bolt' + | 'bug' + | 'editorComment' + | 'flag' + | 'heart' + | 'mapMarker' + | 'starEmpty' + | 'tag'; diff --git a/packages/kbn-visualization-ui-components/util.ts b/packages/kbn-visualization-ui-components/util.ts index 2eb71ee858759..070d82ddf1ba3 100644 --- a/packages/kbn-visualization-ui-components/util.ts +++ b/packages/kbn-visualization-ui-components/util.ts @@ -7,6 +7,92 @@ */ import { DataViewField, isNestedField } from '@kbn/data-views-plugin/common'; +import { i18n } from '@kbn/i18n'; +import type { IconSet } from './components'; +import type { SharedSetOfIcons } from './types'; export const isFieldLensCompatible = (field: DataViewField) => !isNestedField(field) && (!!field.aggregatable || !!field.scripted); + +/** + * Icon checking logic. It makes sure an icon has actual content. + */ +export function hasIcon(icon: string | undefined): icon is string { + return icon != null && icon !== 'empty'; +} + +/** + * Sorting criteria for icons sets. It makes sure empty icon is always on top. + */ +export function iconSortCriteria(a: IconSet[number], b: IconSet[number]) { + if (a.value === 'empty') { + return -1; + } + if (b.value === 'empty') { + return 1; + } + return a.value.localeCompare(b.value); +} + +/** + * This is the minimal icons set. + * So far it is computed from Reference line and Metric chart icons. + * Needs to consider annotation icons set too in the future. + */ + +export const sharedSetOfIcons: IconSet = [ + { + value: 'empty', + label: i18n.translate('visualizationUiComponents.iconSelect.noIconLabel', { + defaultMessage: 'None', + }), + }, + { + value: 'asterisk', + label: i18n.translate('visualizationUiComponents.iconSelect.asteriskIconLabel', { + defaultMessage: 'Asterisk', + }), + }, + { + value: 'bell', + label: i18n.translate('visualizationUiComponents.iconSelect.bellIconLabel', { + defaultMessage: 'Bell', + }), + }, + { + value: 'bolt', + label: i18n.translate('visualizationUiComponents.iconSelect.boltIconLabel', { + defaultMessage: 'Bolt', + }), + }, + { + value: 'bug', + label: i18n.translate('visualizationUiComponents.iconSelect.bugIconLabel', { + defaultMessage: 'Bug', + }), + }, + { + value: 'editorComment', + label: i18n.translate('visualizationUiComponents.iconSelect.commentIconLabel', { + defaultMessage: 'Comment', + }), + }, + { + value: 'alert', + label: i18n.translate('visualizationUiComponents.iconSelect.alertIconLabel', { + defaultMessage: 'Alert', + }), + }, + { + value: 'flag', + label: i18n.translate('visualizationUiComponents.iconSelect.flagIconLabel', { + defaultMessage: 'Flag', + }), + }, + { + value: 'tag', + label: i18n.translate('visualizationUiComponents.iconSelect.tagIconLabel', { + defaultMessage: 'Tag', + }), + }, +]; diff --git a/packages/serverless/settings/observability_project/index.ts b/packages/serverless/settings/observability_project/index.ts index 07a9c84e210ff..bcaab96e8bd0a 100644 --- a/packages/serverless/settings/observability_project/index.ts +++ b/packages/serverless/settings/observability_project/index.ts @@ -34,7 +34,6 @@ export const OBSERVABILITY_PROJECT_SETTINGS = [ settings.OBSERVABILITY_APM_ENABLE_SERVICE_INVENTORY_TABLE_SEARCH_BAR, settings.OBSERVABILITY_ENTITY_CENTRIC_EXPERIENCE, settings.OBSERVABILITY_AI_ASSISTANT_LOGS_INDEX_PATTERN_ID, - settings.OBSERVABILITY_AI_ASSISTANT_RESPONSE_LANGUAGE, settings.OBSERVABILITY_AI_ASSISTANT_SIMULATED_FUNCTION_CALLING, settings.OBSERVABILITY_AI_ASSISTANT_SEARCH_CONNECTOR_INDEX_PATTERN, ]; 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 4c9a9fad340c8..de0afdf85ea16 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 @@ -98,7 +98,7 @@ describe('checking migration metadata changes on all registered SO types', () => "event_loop_delays_daily": "01b967e8e043801357503de09199dfa3853bab88", "exception-list": "4aebc4e61fb5d608cae48eaeb0977e8db21c61a4", "exception-list-agnostic": "6d3262d58eee28ac381ec9654f93126a58be6f5d", - "favorites": "ef282e9fb5a91df3cc88409a9f86d993fb51a6e9", + "favorites": "a68c7c8ae22eaddcca324d8b3bfc80a94e3eec3a", "file": "6b65ae5899b60ebe08656fd163ea532e557d3c98", "file-upload-usage-collection-telemetry": "06e0a8c04f991e744e09d03ab2bd7f86b2088200", "fileShare": "5be52de1747d249a221b5241af2838264e19aaa1", 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 8d6f83736d010..1a8806e8dd707 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; diff --git a/src/dev/run_quick_checks.ts b/src/dev/run_quick_checks.ts index cdb59bdce3cb2..2fe4b712bdbb1 100644 --- a/src/dev/run_quick_checks.ts +++ b/src/dev/run_quick_checks.ts @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -import { exec } from 'child_process'; +import { execFile } from 'child_process'; import { availableParallelism } from 'os'; -import { join, isAbsolute } from 'path'; -import { readdirSync, readFileSync } from 'fs'; +import { isAbsolute, join } from 'path'; +import { existsSync, readdirSync, readFileSync } from 'fs'; import { run, RunOptions } from '@kbn/dev-cli-runner'; import { REPO_ROOT } from '@kbn/repo-info'; @@ -54,7 +54,7 @@ void run(async ({ log, flagsReader }) => { targetFile: flagsReader.string('file'), targetDir: flagsReader.string('dir'), checks: flagsReader.string('checks'), - }); + }).map((script) => (isAbsolute(script) ? script : join(REPO_ROOT, script))); logger.write( `--- Running ${scriptsToRun.length} checks, with parallelism ${MAX_PARALLELISM}...`, @@ -108,7 +108,7 @@ function collectScriptsToRun(inputOptions: { } } -async function runAllChecks(scriptsToRun: string[]) { +async function runAllChecks(scriptsToRun: string[]): Promise { const checksRunning: Array> = []; const checksFinished: CheckResult[] = []; @@ -121,10 +121,20 @@ async function runAllChecks(scriptsToRun: string[]) { const check = runCheckAsync(script); checksRunning.push(check); - check.then((result) => { - checksRunning.splice(checksRunning.indexOf(check), 1); - checksFinished.push(result); - }); + check + .then((result) => { + checksRunning.splice(checksRunning.indexOf(check), 1); + checksFinished.push(result); + }) + .catch((error) => { + checksRunning.splice(checksRunning.indexOf(check), 1); + checksFinished.push({ + success: false, + script, + output: error.message, + durationMs: 0, + }); + }); } await sleep(1000); @@ -138,9 +148,10 @@ async function runCheckAsync(script: string): Promise { const startTime = Date.now(); return new Promise((resolve) => { - const scriptProcess = exec(script); + validateScriptPath(script); + const scriptProcess = execFile('bash', [script]); let output = ''; - const appendToOutput = (data: string | Buffer) => (output += data); + const appendToOutput = (data: string | Buffer) => (output += data.toString()); scriptProcess.stdout?.on('data', appendToOutput); scriptProcess.stderr?.on('data', appendToOutput); @@ -170,9 +181,10 @@ function printResults(startTimestamp: number, results: CheckResult[]) { logger.info(`- Total time: ${total}, effective: ${effective}`); results.forEach((result) => { - logger.write( - `--- ${result.success ? '✅' : '❌'} ${result.script}: ${humanizeTime(result.durationMs)}` - ); + const resultLabel = result.success ? '✅' : '❌'; + const scriptPath = stripRoot(result.script); + const runtime = humanizeTime(result.durationMs); + logger.write(`--- ${resultLabel} ${scriptPath}: ${runtime}`); if (result.success) { logger.debug(result.output); } else { @@ -194,3 +206,22 @@ function humanizeTime(ms: number) { return `${minutes}m ${seconds}s`; } } + +function validateScriptPath(scriptPath: string) { + if (!isAbsolute(scriptPath)) { + logger.error(`Invalid script path: ${scriptPath}`); + throw new Error('Invalid script path'); + } else if (!scriptPath.endsWith('.sh')) { + logger.error(`Invalid script extension: ${scriptPath}`); + throw new Error('Invalid script extension'); + } else if (!existsSync(scriptPath)) { + logger.error(`Script not found: ${scriptPath}`); + throw new Error('Script not found'); + } else { + return; + } +} + +function stripRoot(script: string) { + return script.replace(REPO_ROOT, ''); +} diff --git a/src/plugins/content_management/common/rpc/constants.ts b/src/plugins/content_management/common/rpc/constants.ts index 0a04ae308899b..08bc8dcb45152 100644 --- a/src/plugins/content_management/common/rpc/constants.ts +++ b/src/plugins/content_management/common/rpc/constants.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; -import { validateVersion } from '@kbn/object-versioning/lib/utils'; +import { validateVersion } from '@kbn/object-versioning-utils'; export const procedureNames = [ 'get', diff --git a/src/plugins/content_management/kibana.jsonc b/src/plugins/content_management/kibana.jsonc index 73878817d9d20..7ebfe75180658 100644 --- a/src/plugins/content_management/kibana.jsonc +++ b/src/plugins/content_management/kibana.jsonc @@ -6,6 +6,9 @@ "plugin": { "id": "contentManagement", "server": true, - "browser": true + "browser": true, + "optionalPlugins": [ + "usageCollection" + ] } } diff --git a/src/plugins/content_management/public/content_client/content_client.tsx b/src/plugins/content_management/public/content_client/content_client.tsx index caf7181472f03..e4c4323ff2e9e 100644 --- a/src/plugins/content_management/public/content_client/content_client.tsx +++ b/src/plugins/content_management/public/content_client/content_client.tsx @@ -7,7 +7,7 @@ */ import { QueryClient } from '@tanstack/react-query'; -import { validateVersion } from '@kbn/object-versioning/lib/utils'; +import { validateVersion } from '@kbn/object-versioning-utils'; import type { Version } from '@kbn/object-versioning'; import { createQueryObservable } from './query_observable'; import type { CrudClient } from '../crud_client'; diff --git a/src/plugins/content_management/public/registry/registry.ts b/src/plugins/content_management/public/registry/registry.ts index 97020f205843f..8f44c7fc42ddc 100644 --- a/src/plugins/content_management/public/registry/registry.ts +++ b/src/plugins/content_management/public/registry/registry.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { validateVersion } from '@kbn/object-versioning/lib/utils'; +import { validateVersion } from '@kbn/object-versioning-utils'; import type { ContentTypeDefinition } from './content_type_definition'; import { ContentType } from './content_type'; diff --git a/src/plugins/content_management/server/plugin.test.ts b/src/plugins/content_management/server/plugin.test.ts index d79bb7e827553..4c0e15553b6c8 100644 --- a/src/plugins/content_management/server/plugin.test.ts +++ b/src/plugins/content_management/server/plugin.test.ts @@ -80,14 +80,15 @@ const setup = () => { ...coreSetup, http, }, + pluginsSetup: {}, }; }; describe('ContentManagementPlugin', () => { describe('setup()', () => { test('should expose the core API', () => { - const { plugin, coreSetup } = setup(); - const api = plugin.setup(coreSetup); + const { plugin, coreSetup, pluginsSetup } = setup(); + const api = plugin.setup(coreSetup, pluginsSetup); expect(Object.keys(api).sort()).toEqual(['crud', 'eventBus', 'register']); expect(api.crud('')).toBe('mockedCrud'); @@ -97,8 +98,8 @@ describe('ContentManagementPlugin', () => { describe('RPC', () => { test('should create a rpc POST HTTP route on the router', () => { - const { plugin, coreSetup, router } = setup(); - plugin.setup(coreSetup); + const { plugin, coreSetup, router, pluginsSetup } = setup(); + plugin.setup(coreSetup, pluginsSetup); const [routeConfig]: Parameters = (router.post as jest.Mock).mock.calls[0]; @@ -106,8 +107,8 @@ describe('ContentManagementPlugin', () => { }); test('should register all the procedures in the RPC service and the route handler must send to each procedure the core request context + the request body as input', async () => { - const { plugin, coreSetup, router } = setup(); - plugin.setup(coreSetup); + const { plugin, coreSetup, router, pluginsSetup } = setup(); + plugin.setup(coreSetup, pluginsSetup); const [_, handler]: Parameters = (router.post as jest.Mock).mock.calls[0]; @@ -150,8 +151,8 @@ describe('ContentManagementPlugin', () => { }); test('should return error in custom error format', async () => { - const { plugin, coreSetup, router } = setup(); - plugin.setup(coreSetup); + const { plugin, coreSetup, router, pluginsSetup } = setup(); + plugin.setup(coreSetup, pluginsSetup); const [_, handler]: Parameters = (router.post as jest.Mock).mock.calls[0]; diff --git a/src/plugins/content_management/server/plugin.ts b/src/plugins/content_management/server/plugin.ts index de56805ed50de..db8a15f84a51c 100755 --- a/src/plugins/content_management/server/plugin.ts +++ b/src/plugins/content_management/server/plugin.ts @@ -59,7 +59,7 @@ export class ContentManagementPlugin }); } - public setup(core: CoreSetup) { + public setup(core: CoreSetup, plugins: ContentManagementServerSetupDependencies) { if (this.#eventStream) { this.#eventStream.setup({ core }); } @@ -75,7 +75,7 @@ export class ContentManagementPlugin contentRegistry, }); - registerFavorites({ core, logger: this.logger }); + registerFavorites({ core, logger: this.logger, usageCollection: plugins.usageCollection }); return { ...coreApi, diff --git a/src/plugins/content_management/server/types.ts b/src/plugins/content_management/server/types.ts index dbc401807975d..3209b6616d1c8 100644 --- a/src/plugins/content_management/server/types.ts +++ b/src/plugins/content_management/server/types.ts @@ -7,10 +7,12 @@ */ import type { Version } from '@kbn/object-versioning'; +import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import type { CoreApi, StorageContextGetTransformFn } from './core'; -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ContentManagementServerSetupDependencies {} +export interface ContentManagementServerSetupDependencies { + usageCollection?: UsageCollectionSetup; +} // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ContentManagementServerStartDependencies {} diff --git a/src/plugins/content_management/tsconfig.json b/src/plugins/content_management/tsconfig.json index fbbe897292ded..bba887cd887b1 100644 --- a/src/plugins/content_management/tsconfig.json +++ b/src/plugins/content_management/tsconfig.json @@ -17,6 +17,8 @@ "@kbn/saved-objects-settings", "@kbn/core-http-server", "@kbn/content-management-favorites-server", + "@kbn/usage-collection-plugin", + "@kbn/object-versioning-utils", ], "exclude": [ "target/**/*", diff --git a/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.stub.ts b/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.stub.ts index 57bc91e1fa973..1dba6e25df12c 100644 --- a/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.stub.ts +++ b/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.stub.ts @@ -14,5 +14,7 @@ import { DashboardFavoritesService } from './types'; export type DashboardFavoritesServiceFactory = PluginServiceFactory; export const dashboardFavoritesServiceFactory: DashboardFavoritesServiceFactory = () => { - return new FavoritesClient('dashboard', { http: httpServiceMock.createStartContract() }); + return new FavoritesClient('dashboards', 'dashboard', { + http: httpServiceMock.createStartContract(), + }); }; diff --git a/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.ts b/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.ts index 30342399a7f82..71f986bf4cffa 100644 --- a/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.ts +++ b/src/plugins/dashboard/public/services/dashboard_favorites/dashboard_favorites_service.ts @@ -10,6 +10,7 @@ import { FavoritesClient } from '@kbn/content-management-favorites-public'; import { KibanaPluginServiceFactory } from '@kbn/presentation-util-plugin/public'; import { DashboardStartDependencies } from '../../plugin'; import { DashboardFavoritesService } from './types'; +import { DASHBOARD_APP_ID, DASHBOARD_CONTENT_ID } from '../../dashboard_constants'; export type DashboardFavoritesServiceFactory = KibanaPluginServiceFactory< DashboardFavoritesService, @@ -18,6 +19,10 @@ export type DashboardFavoritesServiceFactory = KibanaPluginServiceFactory< export const dashboardFavoritesServiceFactory: DashboardFavoritesServiceFactory = ({ coreStart, + startPlugins, }) => { - return new FavoritesClient('dashboard', { http: coreStart.http }); + return new FavoritesClient(DASHBOARD_APP_ID, DASHBOARD_CONTENT_ID, { + http: coreStart.http, + usageCollection: startPlugins.usageCollection, + }); }; diff --git a/src/plugins/data/common/search/expressions/esql.ts b/src/plugins/data/common/search/expressions/esql.ts index 34ac9a1ccffc5..cc5bb94131a60 100644 --- a/src/plugins/data/common/search/expressions/esql.ts +++ b/src/plugins/data/common/search/expressions/esql.ts @@ -23,7 +23,12 @@ import { buildEsQuery, type Filter } from '@kbn/es-query'; import type { ESQLSearchParams, ESQLSearchResponse } from '@kbn/es-types'; import { getEsQueryConfig } from '../../es_query'; import { getTime } from '../../query'; -import { ESQL_ASYNC_SEARCH_STRATEGY, ESQL_TABLE_TYPE, KibanaContext } from '..'; +import { + ESQL_ASYNC_SEARCH_STRATEGY, + ESQL_TABLE_TYPE, + isRunningResponse, + type KibanaContext, +} from '..'; import { UiSettingsCommon } from '../..'; declare global { @@ -251,7 +256,9 @@ export const getEsqlFn = ({ getStartDependencies }: EsqlFnArguments) => { return throwError(() => error); }), tap({ - next({ rawResponse, requestParams }) { + next(response) { + if (isRunningResponse(response)) return; + const { rawResponse, requestParams } = response; logInspectorRequest() .stats({ hits: { diff --git a/src/plugins/data/config.mock.ts b/src/plugins/data/config.mock.ts index ab1d02cb63b31..b7c41754dc24d 100644 --- a/src/plugins/data/config.mock.ts +++ b/src/plugins/data/config.mock.ts @@ -7,7 +7,7 @@ */ import moment from 'moment/moment'; -import { SearchConfigSchema, SearchSessionsConfigSchema } from './config'; +import type { SearchConfigSchema, SearchSessionsConfigSchema } from './server/config'; export const getMockSearchConfig = ({ sessions: { enabled = true, defaultExpiration = moment.duration(7, 'd') } = { diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index fa03dc95f564f..09f3226eef57b 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -7,7 +7,7 @@ */ import { PluginInitializerContext } from '@kbn/core/public'; -import { ConfigSchema } from '../config'; +import type { ConfigSchema } from '../server/config'; /* * Filters: diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index 530cbe978c3d1..8e0eea12ed168 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -14,7 +14,7 @@ import { IStorageWrapper, createStartServicesGetter, } from '@kbn/kibana-utils-plugin/public'; -import { ConfigSchema } from '../config'; +import type { ConfigSchema } from '../server/config'; import type { DataPublicPluginSetup, DataPublicPluginStart, diff --git a/src/plugins/data/public/search/search_interceptor/search_interceptor.ts b/src/plugins/data/public/search/search_interceptor/search_interceptor.ts index 7f54c63592b14..95573127fdc90 100644 --- a/src/plugins/data/public/search/search_interceptor/search_interceptor.ts +++ b/src/plugins/data/public/search/search_interceptor/search_interceptor.ts @@ -73,7 +73,7 @@ import { toPartialResponseAfterTimeout } from './to_partial_response'; import { ISessionService, SearchSessionState } from '../session'; import { SearchResponseCache } from './search_response_cache'; import { SearchAbortController } from './search_abort_controller'; -import { SearchConfigSchema } from '../../../config'; +import type { SearchConfigSchema } from '../../../server/config'; import type { SearchServiceStartDependencies } from '../search_service'; import { createRequestHash } from './create_request_hash'; diff --git a/src/plugins/data/public/search/search_service.ts b/src/plugins/data/public/search/search_service.ts index 0bdc33cb59303..07afdc0514c55 100644 --- a/src/plugins/data/public/search/search_service.ts +++ b/src/plugins/data/public/search/search_service.ts @@ -62,7 +62,7 @@ import { SHARD_DELAY_AGG_NAME, } from '../../common/search/aggs/buckets/shard_delay'; import { aggShardDelay } from '../../common/search/aggs/buckets/shard_delay_fn'; -import { ConfigSchema } from '../../config'; +import type { ConfigSchema } from '../../server/config'; import { NowProviderInternalContract } from '../now_provider'; import { DataPublicPluginStart, DataStartDependencies } from '../types'; import { AggsService } from './aggs'; diff --git a/src/plugins/data/public/search/session/session_service.ts b/src/plugins/data/public/search/session/session_service.ts index 5b936fb72a88d..b3c3e94f18b54 100644 --- a/src/plugins/data/public/search/session/session_service.ts +++ b/src/plugins/data/public/search/session/session_service.ts @@ -39,7 +39,7 @@ import { i18n } from '@kbn/i18n'; import moment from 'moment'; import { ISearchOptions } from '@kbn/search-types'; import { SearchUsageCollector } from '../..'; -import { ConfigSchema } from '../../../config'; +import type { ConfigSchema } from '../../../server/config'; import type { SessionMeta, SessionStateContainer, diff --git a/src/plugins/data/public/search/session/sessions_mgmt/application/index.tsx b/src/plugins/data/public/search/session/sessions_mgmt/application/index.tsx index b0a15ca405743..b0c4330c35e5a 100644 --- a/src/plugins/data/public/search/session/sessions_mgmt/application/index.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/application/index.tsx @@ -17,7 +17,7 @@ import { APP } from '..'; import { SearchSessionsMgmtAPI } from '../lib/api'; import { AsyncSearchIntroDocumentation } from '../lib/documentation'; import { renderApp } from './render'; -import { SearchSessionsConfigSchema } from '../../../../../config'; +import type { SearchSessionsConfigSchema } from '../../../../../server/config'; export class SearchSessionsMgmtApp { constructor( diff --git a/src/plugins/data/public/search/session/sessions_mgmt/components/main.test.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/main.test.tsx index 38ccbb9646dee..97b446cae47c1 100644 --- a/src/plugins/data/public/search/session/sessions_mgmt/components/main.test.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/main.test.tsx @@ -20,7 +20,7 @@ import { LocaleWrapper } from '../__mocks__'; import { SearchSessionsMgmtMain } from './main'; import { SharePluginStart } from '@kbn/share-plugin/public'; import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; -import { SearchSessionsConfigSchema } from '../../../../../config'; +import type { SearchSessionsConfigSchema } from '../../../../../server/config'; import { createSearchUsageCollectorMock } from '../../../collectors/mocks'; let mockCoreSetup: MockedKeys; diff --git a/src/plugins/data/public/search/session/sessions_mgmt/components/main.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/main.tsx index 009e3ce7d9b07..af5e1c3bc9a8c 100644 --- a/src/plugins/data/public/search/session/sessions_mgmt/components/main.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/main.tsx @@ -14,7 +14,7 @@ import type { SearchSessionsMgmtAPI } from '../lib/api'; import type { AsyncSearchIntroDocumentation } from '../lib/documentation'; import { SearchSessionsMgmtTable } from './table'; import { SearchSessionsDeprecatedWarning } from '../../search_sessions_deprecation_message'; -import { SearchSessionsConfigSchema } from '../../../../../config'; +import type { SearchSessionsConfigSchema } from '../../../../../server/config'; import { SearchUsageCollector } from '../../../collectors'; interface Props { diff --git a/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.test.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.test.tsx index 6394deeab843b..efe35f206dc5f 100644 --- a/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.test.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.test.tsx @@ -20,7 +20,7 @@ import { LocaleWrapper } from '../../__mocks__'; import { SearchSessionsMgmtTable } from './table'; import { SharePluginStart } from '@kbn/share-plugin/public'; import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; -import { SearchSessionsConfigSchema } from '../../../../../../config'; +import type { SearchSessionsConfigSchema } from '../../../../../../server/config'; import { createSearchUsageCollectorMock } from '../../../../collectors/mocks'; let mockCoreSetup: MockedKeys; diff --git a/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.tsx index 833ad3ec7e75e..649a3d4316a5e 100644 --- a/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.tsx @@ -21,7 +21,7 @@ import { OnActionComplete } from '../actions'; import { getAppFilter } from './app_filter'; import { getStatusFilter } from './status_filter'; import { SearchUsageCollector } from '../../../../collectors'; -import { SearchSessionsConfigSchema } from '../../../../../../config'; +import type { SearchSessionsConfigSchema } from '../../../../../../server/config'; interface Props { core: CoreStart; diff --git a/src/plugins/data/public/search/session/sessions_mgmt/index.ts b/src/plugins/data/public/search/session/sessions_mgmt/index.ts index 7b95305f6e568..59437bf27b6e4 100644 --- a/src/plugins/data/public/search/session/sessions_mgmt/index.ts +++ b/src/plugins/data/public/search/session/sessions_mgmt/index.ts @@ -15,7 +15,7 @@ import type { ISessionsClient, SearchUsageCollector } from '../../..'; import { SEARCH_SESSIONS_MANAGEMENT_ID } from '../constants'; import type { SearchSessionsMgmtAPI } from './lib/api'; import type { AsyncSearchIntroDocumentation } from './lib/documentation'; -import { SearchSessionsConfigSchema } from '../../../../config'; +import type { SearchSessionsConfigSchema } from '../../../../server/config'; export interface IManagementSectionsPluginsSetup { management: ManagementSetup; diff --git a/src/plugins/data/public/search/session/sessions_mgmt/lib/api.test.ts b/src/plugins/data/public/search/session/sessions_mgmt/lib/api.test.ts index 52b72afd30ab3..a765bb8a0a2d4 100644 --- a/src/plugins/data/public/search/session/sessions_mgmt/lib/api.test.ts +++ b/src/plugins/data/public/search/session/sessions_mgmt/lib/api.test.ts @@ -16,7 +16,7 @@ import { SearchSessionStatus } from '../../../../../common'; import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; import { SharePluginStart } from '@kbn/share-plugin/public'; import { SearchSessionsMgmtAPI } from './api'; -import { SearchSessionsConfigSchema } from '../../../../../config'; +import type { SearchSessionsConfigSchema } from '../../../../../server/config'; let mockCoreSetup: MockedKeys; let mockCoreStart: MockedKeys; diff --git a/src/plugins/data/public/search/session/sessions_mgmt/lib/api.ts b/src/plugins/data/public/search/session/sessions_mgmt/lib/api.ts index f5abbc4c77de8..5c426942034f6 100644 --- a/src/plugins/data/public/search/session/sessions_mgmt/lib/api.ts +++ b/src/plugins/data/public/search/session/sessions_mgmt/lib/api.ts @@ -22,7 +22,7 @@ import { import { ISessionsClient } from '../../sessions_client'; import { SearchUsageCollector } from '../../../collectors'; import { SearchSessionsFindResponse, SearchSessionStatus } from '../../../../../common'; -import { SearchSessionsConfigSchema } from '../../../../../config'; +import type { SearchSessionsConfigSchema } from '../../../../../server/config'; type LocatorsStart = SharePluginStart['url']['locators']; diff --git a/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.test.tsx b/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.test.tsx index 3fd53ccfddec2..643cd6b6286f6 100644 --- a/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.test.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.test.tsx @@ -21,7 +21,7 @@ import { SearchSessionsMgmtAPI } from './api'; import { getColumns } from './get_columns'; import { SharePluginStart } from '@kbn/share-plugin/public'; import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; -import { SearchSessionsConfigSchema } from '../../../../../config'; +import type { SearchSessionsConfigSchema } from '../../../../../server/config'; import { createSearchUsageCollectorMock } from '../../../collectors/mocks'; let mockCoreSetup: MockedKeys; diff --git a/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.tsx b/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.tsx index 371ffac111e84..07862651f60ab 100644 --- a/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.tsx @@ -30,7 +30,7 @@ import { SearchSessionsMgmtAPI } from './api'; import { getExpirationStatus } from './get_expiration_status'; import { UISession } from '../types'; import { SearchUsageCollector } from '../../../collectors'; -import { SearchSessionsConfigSchema } from '../../../../../config'; +import type { SearchSessionsConfigSchema } from '../../../../../server/config'; // Helper function: translate an app string to EuiIcon-friendly string const appToIcon = (app: string) => { diff --git a/src/plugins/data/public/search/session/sessions_mgmt/lib/get_expiration_status.ts b/src/plugins/data/public/search/session/sessions_mgmt/lib/get_expiration_status.ts index cde183f569f93..b80b315aaea8c 100644 --- a/src/plugins/data/public/search/session/sessions_mgmt/lib/get_expiration_status.ts +++ b/src/plugins/data/public/search/session/sessions_mgmt/lib/get_expiration_status.ts @@ -8,7 +8,7 @@ import { i18n } from '@kbn/i18n'; import moment from 'moment'; -import { SearchSessionsConfigSchema } from '../../../../../config'; +import type { SearchSessionsConfigSchema } from '../../../../../server/config'; export const getExpirationStatus = (config: SearchSessionsConfigSchema, expires: string | null) => { const tNow = moment.utc().valueOf(); diff --git a/src/plugins/data/config.ts b/src/plugins/data/server/config.ts similarity index 100% rename from src/plugins/data/config.ts rename to src/plugins/data/server/config.ts diff --git a/src/plugins/data/server/index.ts b/src/plugins/data/server/index.ts index 7a41c20094d6e..e9292342f917e 100644 --- a/src/plugins/data/server/index.ts +++ b/src/plugins/data/server/index.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import { ConfigSchema, configSchema } from '../config'; +import { ConfigSchema, configSchema } from './config'; import type { DataServerPlugin, DataPluginSetup, DataPluginStart } from './plugin'; export { getEsQueryConfig, DEFAULT_QUERY_LANGUAGE } from '../common'; diff --git a/src/plugins/data/server/plugin.ts b/src/plugins/data/server/plugin.ts index 77f90393a6164..296d59dc2f632 100644 --- a/src/plugins/data/server/plugin.ts +++ b/src/plugins/data/server/plugin.ts @@ -12,7 +12,7 @@ import { BfetchServerSetup } from '@kbn/bfetch-plugin/server'; import { PluginStart as DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import { FieldFormatsSetup, FieldFormatsStart } from '@kbn/field-formats-plugin/server'; -import { ConfigSchema } from '../config'; +import { ConfigSchema } from './config'; import type { ISearchSetup, ISearchStart } from './search'; import { DatatableUtilitiesService } from './datatable_utilities'; import { SearchService } from './search/search_service'; diff --git a/src/plugins/data/server/search/search_service.ts b/src/plugins/data/server/search/search_service.ts index 09bee9bb8bab8..b9449b7f5da11 100644 --- a/src/plugins/data/server/search/search_service.ts +++ b/src/plugins/data/server/search/search_service.ts @@ -90,7 +90,7 @@ import { SHARD_DELAY_AGG_NAME, } from '../../common/search/aggs/buckets/shard_delay'; import { aggShardDelay } from '../../common/search/aggs/buckets/shard_delay_fn'; -import { ConfigSchema } from '../../config'; +import { ConfigSchema } from '../config'; import { SearchSessionService } from './session'; import { registerBsearchRoute } from './routes/bsearch'; import { enhancedEsSearchStrategyProvider } from './strategies/ese_search'; diff --git a/src/plugins/data/server/search/session/get_session_status.test.ts b/src/plugins/data/server/search/session/get_session_status.test.ts index 1d59fd11c471e..128c19220c2f3 100644 --- a/src/plugins/data/server/search/session/get_session_status.test.ts +++ b/src/plugins/data/server/search/session/get_session_status.test.ts @@ -10,7 +10,7 @@ import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; import { getSessionStatus } from './get_session_status'; import { SearchSessionSavedObjectAttributes, SearchSessionStatus } from '../../../common'; import moment from 'moment'; -import { SearchSessionsConfigSchema } from '../../../config'; +import { SearchSessionsConfigSchema } from '../../config'; const mockInProgressSearchResponse = { body: { diff --git a/src/plugins/data/server/search/session/get_session_status.ts b/src/plugins/data/server/search/session/get_session_status.ts index e1cb50a6c4cd4..57bae3c38e9a7 100644 --- a/src/plugins/data/server/search/session/get_session_status.ts +++ b/src/plugins/data/server/search/session/get_session_status.ts @@ -10,7 +10,7 @@ import moment from 'moment'; import { ElasticsearchClient } from '@kbn/core/server'; import { SearchSessionSavedObjectAttributes, SearchSessionStatus } from '../../../common'; import { SearchStatus } from './types'; -import { SearchSessionsConfigSchema } from '../../../config'; +import { SearchSessionsConfigSchema } from '../../config'; import { getSearchStatus } from './get_search_status'; export async function getSessionStatus( diff --git a/src/plugins/data/server/search/session/mocks.ts b/src/plugins/data/server/search/session/mocks.ts index 339ef628356db..a5bbb06a5621a 100644 --- a/src/plugins/data/server/search/session/mocks.ts +++ b/src/plugins/data/server/search/session/mocks.ts @@ -8,7 +8,7 @@ import moment from 'moment'; import type { IScopedSearchSessionsClient } from './types'; -import { SearchSessionsConfigSchema } from '../../../config'; +import { SearchSessionsConfigSchema } from '../../config'; export function createSearchSessionsClientMock(): jest.Mocked { return { diff --git a/src/plugins/data/server/search/session/session_service.test.ts b/src/plugins/data/server/search/session/session_service.test.ts index 5a31cefe7b998..5f596da374703 100644 --- a/src/plugins/data/server/search/session/session_service.test.ts +++ b/src/plugins/data/server/search/session/session_service.test.ts @@ -17,7 +17,7 @@ import { SearchSessionService } from './session_service'; import { createRequestHash } from './utils'; import moment from 'moment'; import { coreMock } from '@kbn/core/server/mocks'; -import { ConfigSchema } from '../../../config'; +import { ConfigSchema } from '../../config'; import type { AuthenticatedUser } from '@kbn/core/server'; import { SEARCH_SESSION_TYPE, SearchSessionStatus } from '../../../common'; import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; diff --git a/src/plugins/data/server/search/session/session_service.ts b/src/plugins/data/server/search/session/session_service.ts index efd41990493b3..ef367b552983d 100644 --- a/src/plugins/data/server/search/session/session_service.ts +++ b/src/plugins/data/server/search/session/session_service.ts @@ -32,7 +32,7 @@ import { } from '../../../common'; import { ISearchSessionService, NoSearchIdInSessionError } from '../..'; import { createRequestHash } from './utils'; -import { ConfigSchema, SearchSessionsConfigSchema } from '../../../config'; +import { ConfigSchema, SearchSessionsConfigSchema } from '../../config'; import { getSessionStatus } from './get_session_status'; export interface SearchSessionDependencies { diff --git a/src/plugins/data/server/search/session/types.ts b/src/plugins/data/server/search/session/types.ts index cc3d604f50efc..02cb9cad55bb7 100644 --- a/src/plugins/data/server/search/session/types.ts +++ b/src/plugins/data/server/search/session/types.ts @@ -19,7 +19,7 @@ import { SearchSessionSavedObjectAttributes, SearchSessionStatusResponse, } from '../../../common/search'; -import { SearchSessionsConfigSchema } from '../../../config'; +import { SearchSessionsConfigSchema } from '../../config'; export { SearchStatus } from '../../../common/search'; diff --git a/src/plugins/data/server/search/strategies/common/async_utils.ts b/src/plugins/data/server/search/strategies/common/async_utils.ts index ca33a01ac8064..6c2d4b98bc5a1 100644 --- a/src/plugins/data/server/search/strategies/common/async_utils.ts +++ b/src/plugins/data/server/search/strategies/common/async_utils.ts @@ -11,7 +11,7 @@ import { AsyncSearchGetRequest, } from '@elastic/elasticsearch/lib/api/types'; import { ISearchOptions } from '@kbn/search-types'; -import { SearchConfigSchema } from '../../../../config'; +import { SearchConfigSchema } from '../../../config'; /** @internal 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 9db01189ff66d..2bf6ff4f68601 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 @@ -10,7 +10,7 @@ import type { TransportResult } from '@elastic/elasticsearch'; import { tap } from 'rxjs'; import type { IScopedClusterClient, Logger } from '@kbn/core/server'; import { getKbnServerError } from '@kbn/kibana-utils-plugin/server'; -import { SearchConfigSchema } from '../../../../config'; +import { SearchConfigSchema } from '../../../config'; import { EqlSearchStrategyRequest, EqlSearchStrategyResponse, 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 8c5a8ad204a72..d4933357e0334 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 @@ -31,7 +31,7 @@ import { getTotalLoaded, shimHitsTotal, } from '../es_search'; -import { SearchConfigSchema } from '../../../../config'; +import { SearchConfigSchema } from '../../../config'; import { sanitizeRequestParams } from '../../sanitize_request_params'; export const enhancedEsSearchStrategyProvider = ( diff --git a/src/plugins/data/server/search/strategies/ese_search/request_utils.ts b/src/plugins/data/server/search/strategies/ese_search/request_utils.ts index ec182534e089f..d3341b192660c 100644 --- a/src/plugins/data/server/search/strategies/ese_search/request_utils.ts +++ b/src/plugins/data/server/search/strategies/ese_search/request_utils.ts @@ -12,7 +12,7 @@ import { AsyncSearchSubmitRequest } from '@elastic/elasticsearch/lib/api/types'; import { ISearchOptions } from '@kbn/search-types'; import { UI_SETTINGS } from '../../../../common'; import { getDefaultSearchParams } from '../es_search'; -import { SearchConfigSchema } from '../../../../config'; +import { SearchConfigSchema } from '../../../config'; import { getCommonDefaultAsyncGetParams, getCommonDefaultAsyncSubmitParams, 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 a204b6ca69cca..a8623d99e1632 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 @@ -22,7 +22,7 @@ import { getKbnSearchError } from '../../report_search_error'; import type { ISearchStrategy, SearchStrategyDependencies } from '../../types'; import type { IAsyncSearchOptions } from '../../../../common'; import { toAsyncKibanaSearchResponse } from './response_utils'; -import { SearchConfigSchema } from '../../../../config'; +import { SearchConfigSchema } from '../../../config'; // `drop_null_columns` is going to change the response // now we get `all_columns` and `columns` diff --git a/src/plugins/data/server/search/strategies/sql_search/request_utils.ts b/src/plugins/data/server/search/strategies/sql_search/request_utils.ts index 1a2540796d690..a608409467824 100644 --- a/src/plugins/data/server/search/strategies/sql_search/request_utils.ts +++ b/src/plugins/data/server/search/strategies/sql_search/request_utils.ts @@ -8,7 +8,7 @@ import { SqlGetAsyncRequest, SqlQueryRequest } from '@elastic/elasticsearch/lib/api/types'; import { ISearchOptions } from '@kbn/search-types'; -import { SearchConfigSchema } from '../../../../config'; +import { SearchConfigSchema } from '../../../config'; import { getCommonDefaultAsyncGetParams, getCommonDefaultAsyncSubmitParams, 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 55ed1bfecb995..c71e926d764db 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 @@ -22,7 +22,7 @@ import type { import { pollSearch } from '../../../../common'; import { getDefaultAsyncGetParams, getDefaultAsyncSubmitParams } from './request_utils'; import { toAsyncKibanaSearchResponse } from './response_utils'; -import { SearchConfigSchema } from '../../../../config'; +import { SearchConfigSchema } from '../../../config'; export const sqlSearchStrategyProvider = ( searchConfig: SearchConfigSchema, diff --git a/src/plugins/data/tsconfig.json b/src/plugins/data/tsconfig.json index cc6ced2bef611..1b2fc9ed85e93 100644 --- a/src/plugins/data/tsconfig.json +++ b/src/plugins/data/tsconfig.json @@ -7,7 +7,6 @@ "common/**/*", "public/**/*", "server/**/*", - "config.ts", "config.mock.ts", "common/**/*.json", "public/**/*.json", diff --git a/src/plugins/embeddable/public/add_panel_flyout/add_panel_flyout.tsx b/src/plugins/embeddable/public/add_panel_flyout/add_panel_flyout.tsx index 1c9e9c00c8b12..d767e8f7e7c8e 100644 --- a/src/plugins/embeddable/public/add_panel_flyout/add_panel_flyout.tsx +++ b/src/plugins/embeddable/public/add_panel_flyout/add_panel_flyout.tsx @@ -82,9 +82,11 @@ const runAddTelemetry = ( export const AddPanelFlyout = ({ container, onAddPanel, + modalTitleId, }: { container: PresentationContainer; onAddPanel?: (id: string) => void; + modalTitleId?: string; }) => { const legacyFactoriesBySavedObjectType: LegacyFactoryMap = useMemo(() => { return [...embeddableStart.getEmbeddableFactories()] @@ -187,7 +189,7 @@ export const AddPanelFlyout = ({ <> -

+

{i18n.translate('embeddableApi.addPanel.Title', { defaultMessage: 'Add from library' })}

diff --git a/src/plugins/embeddable/public/add_panel_flyout/open_add_panel_flyout.tsx b/src/plugins/embeddable/public/add_panel_flyout/open_add_panel_flyout.tsx index 5bda8fd235c77..d8dec543780f5 100644 --- a/src/plugins/embeddable/public/add_panel_flyout/open_add_panel_flyout.tsx +++ b/src/plugins/embeddable/public/add_panel_flyout/open_add_panel_flyout.tsx @@ -9,7 +9,7 @@ import React, { Suspense } from 'react'; import { OverlayRef } from '@kbn/core/public'; -import { EuiLoadingSpinner } from '@elastic/eui'; +import { EuiLoadingSpinner, htmlIdGenerator } from '@elastic/eui'; import { toMountPoint } from '@kbn/react-kibana-mount'; import { PresentationContainer } from '@kbn/presentation-containers'; @@ -20,6 +20,8 @@ const LazyAddPanelFlyout = React.lazy(async () => { return { default: module.AddPanelFlyout }; }); +const htmlId = htmlIdGenerator('modalTitleId'); + export const openAddPanelFlyout = ({ container, onAddPanel, @@ -29,21 +31,28 @@ export const openAddPanelFlyout = ({ onAddPanel?: (id: string) => void; onClose?: () => void; }): OverlayRef => { + const modalTitleId = htmlId(); + // send the overlay ref to the root embeddable if it is capable of tracking overlays const flyoutSession = core.overlays.openFlyout( toMountPoint( }> - + , core ), { - 'data-test-subj': 'dashboardAddPanel', ownFocus: true, onClose: (overlayRef) => { if (onClose) onClose(); overlayRef.close(); }, + 'data-test-subj': 'dashboardAddPanel', + 'aria-labelledby': modalTitleId, } ); diff --git a/src/plugins/home/public/application/kibana_services.ts b/src/plugins/home/public/application/kibana_services.ts index 14a1dfa794ccb..9b699f2f84e59 100644 --- a/src/plugins/home/public/application/kibana_services.ts +++ b/src/plugins/home/public/application/kibana_services.ts @@ -28,7 +28,7 @@ import { TutorialService } from '../services/tutorials'; import { AddDataService } from '../services/add_data'; import { FeatureCatalogueRegistry } from '../services/feature_catalogue'; import { EnvironmentService } from '../services/environment'; -import { ConfigSchema } from '../../config'; +import type { ConfigSchema } from '../../server/config'; import type { WelcomeService } from '../services/welcome'; export interface HomeKibanaServices { diff --git a/src/plugins/home/public/plugin.ts b/src/plugins/home/public/plugin.ts index b002918c6a001..30ae716da886c 100644 --- a/src/plugins/home/public/plugin.ts +++ b/src/plugins/home/public/plugin.ts @@ -23,7 +23,7 @@ import { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public'; import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public'; import { PLUGIN_ID, HOME_APP_BASE_PATH } from '../common/constants'; import { setServices } from './application/kibana_services'; -import { ConfigSchema } from '../config'; +import type { ConfigSchema } from '../server/config'; import { EnvironmentService, EnvironmentServiceSetup, diff --git a/src/plugins/home/config.ts b/src/plugins/home/server/config.ts similarity index 100% rename from src/plugins/home/config.ts rename to src/plugins/home/server/config.ts diff --git a/src/plugins/home/server/index.ts b/src/plugins/home/server/index.ts index d1763b2833b3e..2413ae39f3230 100644 --- a/src/plugins/home/server/index.ts +++ b/src/plugins/home/server/index.ts @@ -23,7 +23,7 @@ export type { ScopedTutorialContextFactory, } from './services'; import { PluginInitializerContext, PluginConfigDescriptor } from '@kbn/core/server'; -import { configSchema, ConfigSchema } from '../config'; +import { configSchema, ConfigSchema } from './config'; export const config: PluginConfigDescriptor = { exposeToBrowser: { diff --git a/src/plugins/home/tsconfig.json b/src/plugins/home/tsconfig.json index 01caa2a2c16cc..7f8ce49f3c854 100644 --- a/src/plugins/home/tsconfig.json +++ b/src/plugins/home/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "target/types", "isolatedModules": true }, - "include": ["common/**/*", "public/**/*", "server/**/*", "config.ts", ".storybook/**/*"], + "include": ["common/**/*", "public/**/*", "server/**/*", ".storybook/**/*"], "kbn_references": [ "@kbn/core", "@kbn/data-views-plugin", diff --git a/src/plugins/input_control_vis/public/index.ts b/src/plugins/input_control_vis/public/index.ts index fe76e6bc05fc1..0ef4c4748d7fd 100644 --- a/src/plugins/input_control_vis/public/index.ts +++ b/src/plugins/input_control_vis/public/index.ts @@ -8,7 +8,7 @@ import { PluginInitializerContext } from '@kbn/core/public'; import { InputControlVisPlugin as Plugin } from './plugin'; -import { InputControlPublicConfig } from '../config'; +import type { InputControlPublicConfig } from '../server/config'; export function plugin(initializerContext: PluginInitializerContext) { return new Plugin(initializerContext); diff --git a/src/plugins/input_control_vis/public/plugin.ts b/src/plugins/input_control_vis/public/plugin.ts index 3cd54c2596a29..8e83c39dd4009 100644 --- a/src/plugins/input_control_vis/public/plugin.ts +++ b/src/plugins/input_control_vis/public/plugin.ts @@ -20,7 +20,7 @@ import { PANEL_BADGE_TRIGGER } from '@kbn/embeddable-plugin/public'; import { createInputControlVisFn } from './input_control_fn'; import { getInputControlVisRenderer } from './input_control_vis_renderer'; import { createInputControlVisTypeDefinition } from './input_control_vis_type'; -import { InputControlPublicConfig } from '../config'; +import type { InputControlPublicConfig } from '../server/config'; import { InputControlDeprecationBadge } from './deprecation_badge'; type InputControlVisCoreSetup = CoreSetup; diff --git a/src/plugins/input_control_vis/config.ts b/src/plugins/input_control_vis/server/config.ts similarity index 100% rename from src/plugins/input_control_vis/config.ts rename to src/plugins/input_control_vis/server/config.ts diff --git a/src/plugins/input_control_vis/server/index.ts b/src/plugins/input_control_vis/server/index.ts index 46f04d5a4bbdf..1075f03c2b785 100644 --- a/src/plugins/input_control_vis/server/index.ts +++ b/src/plugins/input_control_vis/server/index.ts @@ -9,7 +9,7 @@ import type { CoreSetup, PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; import type { VisualizationsServerSetup } from '@kbn/visualizations-plugin/server'; -import { configSchema, InputControlConfig } from '../config'; +import { configSchema, InputControlConfig } from './config'; export const config: PluginConfigDescriptor = { exposeToBrowser: { diff --git a/src/plugins/inspector/public/views/requests/components/request_selector.tsx b/src/plugins/inspector/public/views/requests/components/request_selector.tsx index 0a3a113f07664..84aa916c2fe9f 100644 --- a/src/plugins/inspector/public/views/requests/components/request_selector.tsx +++ b/src/plugins/inspector/public/views/requests/components/request_selector.tsx @@ -114,6 +114,7 @@ export class RequestSelector extends Component { } > diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts index 3a8c0b9b6076a..8bc81a6f1d497 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts @@ -487,10 +487,6 @@ export const stackManagementSchema: MakeSchemaFrom = { type: 'keyword', _meta: { description: 'Non-default value of setting.' }, }, - 'observability:aiAssistantResponseLanguage': { - type: 'keyword', - _meta: { description: 'Non-default value of setting.' }, - }, 'observability:aiAssistantSimulatedFunctionCalling': { type: 'boolean', _meta: { description: 'Non-default value of setting.' }, diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts index 92e507ebef855..9821fd1bad43f 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts @@ -55,7 +55,6 @@ export interface UsageStats { 'observability:logsExplorer:allowedDataViews': string[]; 'observability:logSources': string[]; 'observability:aiAssistantLogsIndexPattern': string; - 'observability:aiAssistantResponseLanguage': string; 'observability:aiAssistantSimulatedFunctionCalling': boolean; 'observability:aiAssistantSearchConnectorIndexPattern': string; 'visualization:heatmap:maxBuckets': number; diff --git a/src/plugins/maps_ems/public/index.ts b/src/plugins/maps_ems/public/index.ts index 48158e74f3e83..ebeeed1e59e6f 100644 --- a/src/plugins/maps_ems/public/index.ts +++ b/src/plugins/maps_ems/public/index.ts @@ -9,14 +9,14 @@ import type { PluginInitializerContext } from '@kbn/core/public'; import type { EMSClient } from '@elastic/ems-client'; import { MapsEmsPlugin } from './plugin'; -import type { MapConfig } from '../config'; +import type { MapConfig } from '../server/config'; import type { EMSSettings } from '../common'; export function plugin(initializerContext: PluginInitializerContext) { return new MapsEmsPlugin(initializerContext); } -export type { MapConfig, TileMapConfig } from '../config'; +export type { MapConfig, TileMapConfig } from '../server/config'; export type { EMSConfig } from '../common'; // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/src/plugins/maps_ems/public/kibana_services.ts b/src/plugins/maps_ems/public/kibana_services.ts index 6e49b58fbae81..7438779d843d9 100644 --- a/src/plugins/maps_ems/public/kibana_services.ts +++ b/src/plugins/maps_ems/public/kibana_services.ts @@ -8,7 +8,7 @@ import { LicensingPluginStart } from '@kbn/licensing-plugin/public'; import { ILicense } from '@kbn/licensing-plugin/common/types'; -import type { MapConfig } from '../config'; +import type { MapConfig } from '../server/config'; import { LICENSE_CHECK_ID } from '../common'; let kibanaVersion: string; diff --git a/src/plugins/maps_ems/public/plugin.ts b/src/plugins/maps_ems/public/plugin.ts index 3632799f645e1..f0f0413ca4382 100644 --- a/src/plugins/maps_ems/public/plugin.ts +++ b/src/plugins/maps_ems/public/plugin.ts @@ -15,7 +15,7 @@ import { getIsEnterprisePlus, } from './kibana_services'; import type { MapsEmsPluginPublicSetup, MapsEmsPluginPublicStart } from '.'; -import type { MapConfig } from '../config'; +import type { MapConfig } from '../server/config'; import { createEMSSettings } from '../common/ems_settings'; import { createEMSClientLazy } from './lazy_load_bundle'; diff --git a/src/plugins/maps_ems/config.ts b/src/plugins/maps_ems/server/config.ts similarity index 99% rename from src/plugins/maps_ems/config.ts rename to src/plugins/maps_ems/server/config.ts index 5535809f04316..6c40b4ae4dcbe 100644 --- a/src/plugins/maps_ems/config.ts +++ b/src/plugins/maps_ems/server/config.ts @@ -16,7 +16,7 @@ import { DEFAULT_EMS_ROADMAP_ID, DEFAULT_EMS_ROADMAP_DESATURATED_ID, DEFAULT_EMS_DARKMAP_ID, -} from './common'; +} from '../common'; const tileMapConfigOptionsSchema = schema.object({ attribution: schema.string({ defaultValue: '' }), diff --git a/src/plugins/maps_ems/server/index.ts b/src/plugins/maps_ems/server/index.ts index 0fea54b0ba974..aa86d70fff6e4 100644 --- a/src/plugins/maps_ems/server/index.ts +++ b/src/plugins/maps_ems/server/index.ts @@ -7,7 +7,7 @@ */ import { PluginInitializerContext, PluginConfigDescriptor } from '@kbn/core/server'; -import { MapConfig, mapConfigSchema } from '../config'; +import { MapConfig, mapConfigSchema } from './config'; export type { EMSSettings } from '../common'; export type { MapsEmsPluginServerSetup } from './plugin'; diff --git a/src/plugins/maps_ems/server/plugin.ts b/src/plugins/maps_ems/server/plugin.ts index 255fbaf4f912a..b53663056db75 100644 --- a/src/plugins/maps_ems/server/plugin.ts +++ b/src/plugins/maps_ems/server/plugin.ts @@ -9,7 +9,7 @@ import { ILicense, LicensingPluginSetup } from '@kbn/licensing-plugin/server'; import { Plugin, PluginInitializerContext } from '@kbn/core-plugins-server'; import { CoreSetup } from '@kbn/core-lifecycle-server'; -import { MapConfig } from '../config'; +import { MapConfig } from './config'; import { LICENSE_CHECK_ID, EMSSettings } from '../common'; export interface MapsEmsPluginServerSetup { diff --git a/src/plugins/maps_ems/tsconfig.json b/src/plugins/maps_ems/tsconfig.json index e8ed41cf54f36..95c001e37d28d 100644 --- a/src/plugins/maps_ems/tsconfig.json +++ b/src/plugins/maps_ems/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "outDir": "target/types", }, - "include": ["common/**/*", "public/**/*", "server/**/*", "./config.ts"], + "include": ["common/**/*", "public/**/*", "server/**/*"], "kbn_references": [ "@kbn/core", "@kbn/licensing-plugin", diff --git a/src/plugins/no_data_page/public/plugin.ts b/src/plugins/no_data_page/public/plugin.ts index 910208f0f94be..dc7dff0e0781e 100644 --- a/src/plugins/no_data_page/public/plugin.ts +++ b/src/plugins/no_data_page/public/plugin.ts @@ -8,7 +8,7 @@ import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; import type { NoDataPagePublicSetup, NoDataPagePublicStart } from './types'; -import type { NoDataPageConfig } from '../config'; +import type { NoDataPageConfig } from '../server/config'; export class NoDataPagePlugin implements Plugin { constructor(private initializerContext: PluginInitializerContext) {} diff --git a/src/plugins/no_data_page/config.ts b/src/plugins/no_data_page/server/config.ts similarity index 100% rename from src/plugins/no_data_page/config.ts rename to src/plugins/no_data_page/server/config.ts diff --git a/src/plugins/no_data_page/server/index.ts b/src/plugins/no_data_page/server/index.ts index ba02a016a9676..cabe47bf65a33 100644 --- a/src/plugins/no_data_page/server/index.ts +++ b/src/plugins/no_data_page/server/index.ts @@ -8,7 +8,7 @@ import { PluginConfigDescriptor } from '@kbn/core-plugins-server'; -import { configSchema, NoDataPageConfig } from '../config'; +import { configSchema, NoDataPageConfig } from './config'; export const config: PluginConfigDescriptor = { exposeToBrowser: { diff --git a/src/plugins/no_data_page/tsconfig.json b/src/plugins/no_data_page/tsconfig.json index bab1c8c23edfb..e92a0c1560380 100644 --- a/src/plugins/no_data_page/tsconfig.json +++ b/src/plugins/no_data_page/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "outDir": "target/types" }, - "include": ["common/**/*", "public/**/*", "server/**/*", "config.ts"], + "include": ["common/**/*", "public/**/*", "server/**/*"], "kbn_references": [ "@kbn/core", "@kbn/core-plugins-browser", diff --git a/src/plugins/share/public/index.ts b/src/plugins/share/public/index.ts index f212081133b2d..842f31bf11dc9 100644 --- a/src/plugins/share/public/index.ts +++ b/src/plugins/share/public/index.ts @@ -8,7 +8,7 @@ import type { PluginInitializerContext } from '@kbn/core/public'; -export type { ConfigSchema } from '../common/config'; +export type { ConfigSchema } from '../server/config'; export { CSV_QUOTE_VALUES_SETTING, CSV_SEPARATOR_SETTING } from '../common/constants'; diff --git a/src/plugins/share/common/config.ts b/src/plugins/share/server/config.ts similarity index 100% rename from src/plugins/share/common/config.ts rename to src/plugins/share/server/config.ts diff --git a/src/plugins/share/server/index.ts b/src/plugins/share/server/index.ts index 5f61ba8693814..c3bac70cc6e25 100644 --- a/src/plugins/share/server/index.ts +++ b/src/plugins/share/server/index.ts @@ -7,7 +7,7 @@ */ import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import { ConfigSchema, configSchema } from '../common/config'; +import { ConfigSchema, configSchema } from './config'; export type { SharePublicSetup as SharePluginSetup, diff --git a/src/plugins/telemetry/schema/kbn_packages.json b/src/plugins/telemetry/schema/kbn_packages.json index f33b6b66da1f9..7e2c3aad5c59f 100644 --- a/src/plugins/telemetry/schema/kbn_packages.json +++ b/src/plugins/telemetry/schema/kbn_packages.json @@ -1,4 +1,36 @@ { "properties": { + "favorites": { + "properties": { + "DYNAMIC_KEY": { + "properties": { + "total": { + "type": "long", + "_meta": { + "description": "Total favorite object count in this deployment" + } + }, + "total_users_spaces": { + "type": "long", + "_meta": { + "description": "Total users per space that have favorited an object of this type in this deployment" + } + }, + "avg_per_user_per_space": { + "type": "double", + "_meta": { + "description": "Average favorite objects count of this type per user per space for this deployment, only counts users who have favorited at least one object of this type" + } + }, + "max_per_user_per_space": { + "type": "long", + "_meta": { + "description": "Max favorite objects count of this type per user per space for this deployment" + } + } + } + } + } + } } } diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index ebd98b2190c12..8563b5beaf57c 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -10456,12 +10456,6 @@ "description": "Non-default value of setting." } }, - "observability:aiAssistantResponseLanguage": { - "type": "keyword", - "_meta": { - "description": "Non-default value of setting." - } - }, "observability:aiAssistantSimulatedFunctionCalling": { "type": "boolean", "_meta": { diff --git a/src/plugins/telemetry/tsconfig.json b/src/plugins/telemetry/tsconfig.json index 2286d13f25e9c..09d5aa25c914b 100644 --- a/src/plugins/telemetry/tsconfig.json +++ b/src/plugins/telemetry/tsconfig.json @@ -11,6 +11,7 @@ "../../../typings/**/*", "schema/oss_plugins.json", "schema/oss_root.json", + "schema/kbn_packages.json" ], "kbn_references": [ "@kbn/core", diff --git a/src/plugins/unified_search/public/autocomplete/autocomplete_service.ts b/src/plugins/unified_search/public/autocomplete/autocomplete_service.ts index 97d128df5a782..93effe9d24d57 100644 --- a/src/plugins/unified_search/public/autocomplete/autocomplete_service.ts +++ b/src/plugins/unified_search/public/autocomplete/autocomplete_service.ts @@ -17,7 +17,7 @@ import { } from './providers/value_suggestion_provider'; import type { ValueSuggestionsGetFn } from './providers/value_suggestion_provider'; -import { ConfigSchema } from '../../config'; +import type { ConfigSchema } from '../../server/config'; import { createUsageCollector } from './collectors'; import { KUERY_LANGUAGE_NAME, diff --git a/src/plugins/unified_search/public/index.ts b/src/plugins/unified_search/public/index.ts index fb689eb3e2d3b..2103a20fb7b83 100755 --- a/src/plugins/unified_search/public/index.ts +++ b/src/plugins/unified_search/public/index.ts @@ -7,7 +7,7 @@ */ import { PluginInitializerContext } from '@kbn/core/public'; -import { ConfigSchema } from '../config'; +import type { ConfigSchema } from '../server/config'; export type { IndexPatternSelectProps } from './index_pattern_select'; export type { QueryStringInputProps } from './query_string_input'; export { QueryStringInput } from './query_string_input'; diff --git a/src/plugins/unified_search/public/plugin.ts b/src/plugins/unified_search/public/plugin.ts index 0e1b2569470b4..ed4c8cebca82d 100755 --- a/src/plugins/unified_search/public/plugin.ts +++ b/src/plugins/unified_search/public/plugin.ts @@ -11,7 +11,7 @@ import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import { APPLY_FILTER_TRIGGER } from '@kbn/data-plugin/public'; import { createQueryStringInput } from './query_string_input/get_query_string_input'; import { UPDATE_FILTER_REFERENCES_TRIGGER, updateFilterReferencesTrigger } from './triggers'; -import { ConfigSchema } from '../config'; +import type { ConfigSchema } from '../server/config'; import { setIndexPatterns, setTheme, setOverlays, setAnalytics, setI18n } from './services'; import { AutocompleteService } from './autocomplete/autocomplete_service'; import { createSearchBar } from './search_bar/create_search_bar'; diff --git a/src/plugins/unified_search/server/autocomplete/autocomplete_service.ts b/src/plugins/unified_search/server/autocomplete/autocomplete_service.ts index d1969c381a7ce..2ef0469ae91ed 100644 --- a/src/plugins/unified_search/server/autocomplete/autocomplete_service.ts +++ b/src/plugins/unified_search/server/autocomplete/autocomplete_service.ts @@ -10,7 +10,7 @@ import moment from 'moment'; import { clone } from 'lodash'; import { CoreSetup, Plugin, PluginInitializerContext } from '@kbn/core/server'; import { registerRoutes } from './routes'; -import { ConfigSchema } from '../../config'; +import { ConfigSchema } from '../config'; export class AutocompleteService implements Plugin { private valueSuggestionsEnabled: boolean = true; diff --git a/src/plugins/unified_search/server/autocomplete/routes.ts b/src/plugins/unified_search/server/autocomplete/routes.ts index 4b4321fdf9b8a..24f1384142367 100644 --- a/src/plugins/unified_search/server/autocomplete/routes.ts +++ b/src/plugins/unified_search/server/autocomplete/routes.ts @@ -9,7 +9,7 @@ import { Observable } from 'rxjs'; import { CoreSetup } from '@kbn/core/server'; import { registerValueSuggestionsRoute } from './value_suggestions_route'; -import { ConfigSchema } from '../../config'; +import { ConfigSchema } from '../config'; export function registerRoutes({ http }: CoreSetup, config$: Observable): void { const router = http.createRouter(); diff --git a/src/plugins/unified_search/server/autocomplete/terms_agg.test.ts b/src/plugins/unified_search/server/autocomplete/terms_agg.test.ts index dbc1dc0608d77..6ac7ac55af8c1 100644 --- a/src/plugins/unified_search/server/autocomplete/terms_agg.test.ts +++ b/src/plugins/unified_search/server/autocomplete/terms_agg.test.ts @@ -8,7 +8,7 @@ import { coreMock } from '@kbn/core/server/mocks'; import { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server'; -import { ConfigSchema } from '../../config'; +import { ConfigSchema } from '../config'; import type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; import type { DataViewField, FieldSpec } from '@kbn/data-views-plugin/common'; import { termsAggSuggestions } from './terms_agg'; diff --git a/src/plugins/unified_search/server/autocomplete/terms_agg.ts b/src/plugins/unified_search/server/autocomplete/terms_agg.ts index d87b5696de19f..3b526b6aa536a 100644 --- a/src/plugins/unified_search/server/autocomplete/terms_agg.ts +++ b/src/plugins/unified_search/server/autocomplete/terms_agg.ts @@ -11,7 +11,7 @@ import { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/serve import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { getFieldSubtypeNested } from '@kbn/data-plugin/common'; import type { FieldSpec } from '@kbn/data-views-plugin/common'; -import { ConfigSchema } from '../../config'; +import { ConfigSchema } from '../config'; import { findIndexPatternById, getFieldByName } from '../data_views'; export async function termsAggSuggestions( diff --git a/src/plugins/unified_search/server/autocomplete/terms_enum.test.ts b/src/plugins/unified_search/server/autocomplete/terms_enum.test.ts index d434c6472cce7..8d0dd846426ec 100644 --- a/src/plugins/unified_search/server/autocomplete/terms_enum.test.ts +++ b/src/plugins/unified_search/server/autocomplete/terms_enum.test.ts @@ -9,7 +9,7 @@ import { termsEnumSuggestions } from './terms_enum'; import { coreMock } from '@kbn/core/server/mocks'; import { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server'; -import { ConfigSchema } from '../../config'; +import { ConfigSchema } from '../config'; import type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; import { TermsEnumResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { DataViewField } from '@kbn/data-views-plugin/common'; diff --git a/src/plugins/unified_search/server/autocomplete/terms_enum.ts b/src/plugins/unified_search/server/autocomplete/terms_enum.ts index ee46785582ca1..b567bea17a352 100644 --- a/src/plugins/unified_search/server/autocomplete/terms_enum.ts +++ b/src/plugins/unified_search/server/autocomplete/terms_enum.ts @@ -10,7 +10,7 @@ import { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/serve import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { FieldSpec } from '@kbn/data-views-plugin/common'; import { findIndexPatternById, getFieldByName } from '../data_views'; -import { ConfigSchema } from '../../config'; +import { ConfigSchema } from '../config'; export async function termsEnumSuggestions( config: ConfigSchema, diff --git a/src/plugins/unified_search/server/autocomplete/value_suggestions_route.ts b/src/plugins/unified_search/server/autocomplete/value_suggestions_route.ts index 00a5d3eba3a13..4f2146ec18dbb 100644 --- a/src/plugins/unified_search/server/autocomplete/value_suggestions_route.ts +++ b/src/plugins/unified_search/server/autocomplete/value_suggestions_route.ts @@ -11,7 +11,7 @@ import { IRouter } from '@kbn/core/server'; import { firstValueFrom, Observable } from 'rxjs'; import { getRequestAbortedSignal } from '@kbn/data-plugin/server'; import { getKbnServerError, reportServerError } from '@kbn/kibana-utils-plugin/server'; -import type { ConfigSchema } from '../../config'; +import type { ConfigSchema } from '../config'; import { termsEnumSuggestions } from './terms_enum'; import { termsAggSuggestions } from './terms_agg'; diff --git a/src/plugins/unified_search/config.ts b/src/plugins/unified_search/server/config.ts similarity index 100% rename from src/plugins/unified_search/config.ts rename to src/plugins/unified_search/server/config.ts diff --git a/src/plugins/unified_search/server/index.ts b/src/plugins/unified_search/server/index.ts index 8f786e0ed1077..e0ca8f39c661f 100644 --- a/src/plugins/unified_search/server/index.ts +++ b/src/plugins/unified_search/server/index.ts @@ -7,7 +7,7 @@ */ import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import { ConfigSchema, configSchema } from '../config'; +import { ConfigSchema, configSchema } from './config'; import type { UnifiedSearchServerPlugin, UnifiedSearchServerPluginSetup, diff --git a/src/plugins/unified_search/server/mocks.ts b/src/plugins/unified_search/server/mocks.ts index 48708e5f2955e..33d68a57ea9db 100644 --- a/src/plugins/unified_search/server/mocks.ts +++ b/src/plugins/unified_search/server/mocks.ts @@ -8,7 +8,7 @@ import moment from 'moment'; import { Observable } from 'rxjs'; -import { ConfigSchema } from '../config'; +import { ConfigSchema } from './config'; import { AutocompleteSetup } from './autocomplete'; const autocompleteSetupMock: jest.Mocked = { diff --git a/src/plugins/unified_search/server/plugin.ts b/src/plugins/unified_search/server/plugin.ts index 6328eeba2f416..498c960e05fea 100644 --- a/src/plugins/unified_search/server/plugin.ts +++ b/src/plugins/unified_search/server/plugin.ts @@ -7,7 +7,7 @@ */ import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/server'; -import { ConfigSchema } from '../config'; +import { ConfigSchema } from './config'; import { AutocompleteService } from './autocomplete'; import { AutocompleteSetup } from './autocomplete/autocomplete_service'; diff --git a/src/plugins/unified_search/tsconfig.json b/src/plugins/unified_search/tsconfig.json index fc830033a69b7..909c0031b5a31 100644 --- a/src/plugins/unified_search/tsconfig.json +++ b/src/plugins/unified_search/tsconfig.json @@ -5,10 +5,8 @@ }, "include": [ "public/**/*", - "config.ts", "public/**/*.json", "server/**/*", - "config.ts", ], "kbn_references": [ "@kbn/core", diff --git a/src/plugins/vis_type_markdown/public/plugin.ts b/src/plugins/vis_type_markdown/public/plugin.ts index 66f46ce3bdbc0..28a6fdf55af32 100644 --- a/src/plugins/vis_type_markdown/public/plugin.ts +++ b/src/plugins/vis_type_markdown/public/plugin.ts @@ -12,7 +12,7 @@ import { VisualizationsSetup } from '@kbn/visualizations-plugin/public'; import { markdownVisDefinition } from './markdown_vis'; import { createMarkdownVisFn } from './markdown_fn'; -import { ConfigSchema } from '../config'; +import type { ConfigSchema } from '../server/config'; import { getMarkdownVisRenderer } from './markdown_renderer'; /** @internal */ diff --git a/src/plugins/vis_type_markdown/config.ts b/src/plugins/vis_type_markdown/server/config.ts similarity index 100% rename from src/plugins/vis_type_markdown/config.ts rename to src/plugins/vis_type_markdown/server/config.ts diff --git a/src/plugins/vis_type_markdown/server/index.ts b/src/plugins/vis_type_markdown/server/index.ts index 3f3bae7d810d6..51ae7250d894f 100644 --- a/src/plugins/vis_type_markdown/server/index.ts +++ b/src/plugins/vis_type_markdown/server/index.ts @@ -8,7 +8,7 @@ import { PluginConfigDescriptor } from '@kbn/core/server'; -import { configSchema, ConfigSchema } from '../config'; +import { configSchema, ConfigSchema } from './config'; export const config: PluginConfigDescriptor = { schema: configSchema, diff --git a/src/plugins/vis_types/gauge/public/index.ts b/src/plugins/vis_types/gauge/public/index.ts index 4219955467edb..4e5a880cde1ad 100755 --- a/src/plugins/vis_types/gauge/public/index.ts +++ b/src/plugins/vis_types/gauge/public/index.ts @@ -7,7 +7,7 @@ */ import { PluginInitializerContext } from '@kbn/core/public'; -import { GaugePublicConfig } from '../config'; +import type { GaugePublicConfig } from '../server/config'; import { VisTypeGaugePlugin } from './plugin'; export function plugin(initializerContext: PluginInitializerContext) { diff --git a/src/plugins/vis_types/gauge/public/plugin.ts b/src/plugins/vis_types/gauge/public/plugin.ts index 67d58e5790239..49fa0f2c79966 100755 --- a/src/plugins/vis_types/gauge/public/plugin.ts +++ b/src/plugins/vis_types/gauge/public/plugin.ts @@ -10,7 +10,7 @@ import { CoreSetup, CoreStart, PluginInitializerContext } from '@kbn/core/public import { VisualizationsSetup } from '@kbn/visualizations-plugin/public'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; -import { GaugePublicConfig } from '../config'; +import type { GaugePublicConfig } from '../server/config'; import { LEGACY_GAUGE_CHARTS_LIBRARY } from '../common'; import { VisTypeGaugePluginSetup } from './types'; import { gaugeVisType, goalVisType } from './vis_type'; diff --git a/src/plugins/vis_types/gauge/config.ts b/src/plugins/vis_types/gauge/server/config.ts similarity index 100% rename from src/plugins/vis_types/gauge/config.ts rename to src/plugins/vis_types/gauge/server/config.ts diff --git a/src/plugins/vis_types/gauge/server/index.ts b/src/plugins/vis_types/gauge/server/index.ts index e6d35075c8fb0..a3c672fb7f258 100755 --- a/src/plugins/vis_types/gauge/server/index.ts +++ b/src/plugins/vis_types/gauge/server/index.ts @@ -7,7 +7,7 @@ */ import { PluginInitializerContext, PluginConfigDescriptor } from '@kbn/core/server'; -import { configSchema, GaugeConfig } from '../config'; +import { configSchema, GaugeConfig } from './config'; export const config: PluginConfigDescriptor = { exposeToBrowser: { diff --git a/src/plugins/vis_types/gauge/server/plugin.ts b/src/plugins/vis_types/gauge/server/plugin.ts index f7b51c5d5af86..940ba2e21d89b 100755 --- a/src/plugins/vis_types/gauge/server/plugin.ts +++ b/src/plugins/vis_types/gauge/server/plugin.ts @@ -11,7 +11,7 @@ import { schema } from '@kbn/config-schema'; import { CoreSetup, Plugin, PluginInitializerContext, UiSettingsParams } from '@kbn/core/server'; import type { VisualizationsServerSetup } from '@kbn/visualizations-plugin/server'; -import { GaugeConfig } from '../config'; +import { GaugeConfig } from './config'; import { LEGACY_GAUGE_CHARTS_LIBRARY } from '../common'; diff --git a/src/plugins/vis_types/heatmap/public/index.ts b/src/plugins/vis_types/heatmap/public/index.ts index 595b0ab3507e3..73fef1fdb33f5 100644 --- a/src/plugins/vis_types/heatmap/public/index.ts +++ b/src/plugins/vis_types/heatmap/public/index.ts @@ -7,7 +7,7 @@ */ import { PluginInitializerContext } from '@kbn/core/public'; -import { HeatmapPublicConfig } from '../config'; +import type { HeatmapPublicConfig } from '../server/config'; import { VisTypeHeatmapPlugin } from './plugin'; export { heatmapVisType } from './vis_type'; diff --git a/src/plugins/vis_types/heatmap/public/plugin.ts b/src/plugins/vis_types/heatmap/public/plugin.ts index f2ce2614ec9be..5d8028a00e006 100644 --- a/src/plugins/vis_types/heatmap/public/plugin.ts +++ b/src/plugins/vis_types/heatmap/public/plugin.ts @@ -13,7 +13,7 @@ import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; -import { HeatmapPublicConfig } from '../config'; +import type { HeatmapPublicConfig } from '../server/config'; import { LEGACY_HEATMAP_CHARTS_LIBRARY } from '../common'; import { heatmapVisType } from './vis_type'; import { setDataViewsStart } from './services'; diff --git a/src/plugins/vis_types/heatmap/config.ts b/src/plugins/vis_types/heatmap/server/config.ts similarity index 100% rename from src/plugins/vis_types/heatmap/config.ts rename to src/plugins/vis_types/heatmap/server/config.ts diff --git a/src/plugins/vis_types/heatmap/server/index.ts b/src/plugins/vis_types/heatmap/server/index.ts index 34c3783b62c9b..2cc4836b96d0d 100644 --- a/src/plugins/vis_types/heatmap/server/index.ts +++ b/src/plugins/vis_types/heatmap/server/index.ts @@ -7,7 +7,7 @@ */ import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import { configSchema, HeatmapConfig } from '../config'; +import { configSchema, HeatmapConfig } from './config'; export const config: PluginConfigDescriptor = { exposeToBrowser: { diff --git a/src/plugins/vis_types/heatmap/server/plugin.ts b/src/plugins/vis_types/heatmap/server/plugin.ts index dcc1c7c65babe..ebd2c12763133 100644 --- a/src/plugins/vis_types/heatmap/server/plugin.ts +++ b/src/plugins/vis_types/heatmap/server/plugin.ts @@ -11,7 +11,7 @@ import { schema } from '@kbn/config-schema'; import { CoreSetup, Plugin, PluginInitializerContext, UiSettingsParams } from '@kbn/core/server'; import type { VisualizationsServerSetup } from '@kbn/visualizations-plugin/server'; -import { HeatmapConfig } from '../config'; +import { HeatmapConfig } from './config'; import { LEGACY_HEATMAP_CHARTS_LIBRARY } from '../common'; diff --git a/src/plugins/vis_types/metric/public/index.ts b/src/plugins/vis_types/metric/public/index.ts index fdc19b16c9980..9568fcfad7386 100644 --- a/src/plugins/vis_types/metric/public/index.ts +++ b/src/plugins/vis_types/metric/public/index.ts @@ -7,7 +7,7 @@ */ import { PluginInitializerContext } from '@kbn/core/public'; -import { MetricPublicConfig } from '../config'; +import type { MetricPublicConfig } from '../server/config'; import { MetricVisPlugin as Plugin } from './plugin'; export function plugin(initializerContext: PluginInitializerContext) { diff --git a/src/plugins/vis_types/metric/public/plugin.ts b/src/plugins/vis_types/metric/public/plugin.ts index a8be4ca753f0c..7ca3775f8f534 100644 --- a/src/plugins/vis_types/metric/public/plugin.ts +++ b/src/plugins/vis_types/metric/public/plugin.ts @@ -10,7 +10,7 @@ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/cor import { VisualizationsSetup } from '@kbn/visualizations-plugin/public'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { createMetricVisTypeDefinition } from './metric_vis_type'; -import { MetricPublicConfig } from '../config'; +import type { MetricPublicConfig } from '../server/config'; import { setDataViewsStart } from './services'; /** @internal */ diff --git a/src/plugins/vis_types/metric/config.ts b/src/plugins/vis_types/metric/server/config.ts similarity index 100% rename from src/plugins/vis_types/metric/config.ts rename to src/plugins/vis_types/metric/server/config.ts diff --git a/src/plugins/vis_types/metric/server/index.ts b/src/plugins/vis_types/metric/server/index.ts index bc8d0b0f0f685..490cc996b1bdb 100644 --- a/src/plugins/vis_types/metric/server/index.ts +++ b/src/plugins/vis_types/metric/server/index.ts @@ -9,7 +9,7 @@ import { CoreSetup, PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; import type { VisualizationsServerSetup } from '@kbn/visualizations-plugin/server'; -import { configSchema, MetricConfig } from '../config'; +import { configSchema, MetricConfig } from './config'; export const config: PluginConfigDescriptor = { exposeToBrowser: { diff --git a/src/plugins/vis_types/pie/public/index.ts b/src/plugins/vis_types/pie/public/index.ts index 46110193aefa4..ade2e09b9e4eb 100644 --- a/src/plugins/vis_types/pie/public/index.ts +++ b/src/plugins/vis_types/pie/public/index.ts @@ -8,7 +8,7 @@ import type { PluginInitializerContext } from '@kbn/core/public'; import { VisTypePiePlugin } from './plugin'; -import type { PiePublicConfig } from '../config'; +import type { PiePublicConfig } from '../server/config'; export { pieVisType } from './vis_type'; export type { Dimensions, Dimension } from './types'; diff --git a/src/plugins/vis_types/pie/public/plugin.ts b/src/plugins/vis_types/pie/public/plugin.ts index 31b5591c77a9d..9169c6b101c6c 100644 --- a/src/plugins/vis_types/pie/public/plugin.ts +++ b/src/plugins/vis_types/pie/public/plugin.ts @@ -18,7 +18,7 @@ import { ChartsPluginSetup } from '@kbn/charts-plugin/public'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; -import type { PiePublicConfig } from '../config'; +import type { PiePublicConfig } from '../server/config'; import { pieVisType } from './vis_type'; import { setDataViewsStart } from './services'; diff --git a/src/plugins/vis_types/pie/config.ts b/src/plugins/vis_types/pie/server/config.ts similarity index 100% rename from src/plugins/vis_types/pie/config.ts rename to src/plugins/vis_types/pie/server/config.ts diff --git a/src/plugins/vis_types/pie/server/index.ts b/src/plugins/vis_types/pie/server/index.ts index 6b139e916adc9..b9eedd469e909 100644 --- a/src/plugins/vis_types/pie/server/index.ts +++ b/src/plugins/vis_types/pie/server/index.ts @@ -7,7 +7,7 @@ */ import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import { configSchema, PieConfig } from '../config'; +import { configSchema, PieConfig } from './config'; export const config: PluginConfigDescriptor = { exposeToBrowser: { diff --git a/src/plugins/vis_types/pie/server/plugin.ts b/src/plugins/vis_types/pie/server/plugin.ts index 133220039a73d..6a4683ab9bc21 100644 --- a/src/plugins/vis_types/pie/server/plugin.ts +++ b/src/plugins/vis_types/pie/server/plugin.ts @@ -8,7 +8,7 @@ import { CoreSetup, Plugin, PluginInitializerContext } from '@kbn/core/server'; import type { VisualizationsServerSetup } from '@kbn/visualizations-plugin/server'; -import type { PieConfig } from '../config'; +import type { PieConfig } from './config'; interface PluginSetupDependencies { visualizations: VisualizationsServerSetup; diff --git a/src/plugins/vis_types/table/public/index.ts b/src/plugins/vis_types/table/public/index.ts index c8ac2a7db912f..d0f51c139b22c 100644 --- a/src/plugins/vis_types/table/public/index.ts +++ b/src/plugins/vis_types/table/public/index.ts @@ -7,7 +7,7 @@ */ import { PluginInitializerContext } from '@kbn/core/public'; -import { TablePublicConfig } from '../config'; +import type { TablePublicConfig } from '../server/config'; import { TableVisPlugin as Plugin } from './plugin'; export function plugin(initializerContext: PluginInitializerContext) { diff --git a/src/plugins/vis_types/table/public/plugin.ts b/src/plugins/vis_types/table/public/plugin.ts index 992e10cdd247d..1fd9af86c5a16 100644 --- a/src/plugins/vis_types/table/public/plugin.ts +++ b/src/plugins/vis_types/table/public/plugin.ts @@ -12,7 +12,7 @@ import type { VisualizationsSetup } from '@kbn/visualizations-plugin/public'; import type { UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; -import { TablePublicConfig } from '../config'; +import type { TablePublicConfig } from '../server/config'; import { setDataViewsStart, setFormatService } from './services'; import { registerTableVis } from './register_vis'; diff --git a/src/plugins/vis_types/table/config.ts b/src/plugins/vis_types/table/server/config.ts similarity index 100% rename from src/plugins/vis_types/table/config.ts rename to src/plugins/vis_types/table/server/config.ts diff --git a/src/plugins/vis_types/table/server/index.ts b/src/plugins/vis_types/table/server/index.ts index 9c8fa74c1fe6b..e3bc344317420 100644 --- a/src/plugins/vis_types/table/server/index.ts +++ b/src/plugins/vis_types/table/server/index.ts @@ -8,7 +8,7 @@ import { CoreSetup, PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; import type { VisualizationsServerSetup } from '@kbn/visualizations-plugin/server'; -import { configSchema, TableConfig } from '../config'; +import { configSchema, TableConfig } from './config'; import { VIS_TYPE_TABLE } from '../common'; export const config: PluginConfigDescriptor = { diff --git a/src/plugins/vis_types/tagcloud/public/index.ts b/src/plugins/vis_types/tagcloud/public/index.ts index b5d626cce5b0f..2747eb67354b0 100644 --- a/src/plugins/vis_types/tagcloud/public/index.ts +++ b/src/plugins/vis_types/tagcloud/public/index.ts @@ -7,7 +7,7 @@ */ import { PluginInitializerContext } from '@kbn/core/public'; -import { TagcloudPublicConfig } from '../config'; +import type { TagcloudPublicConfig } from '../server/config'; import { TagCloudPlugin as Plugin } from './plugin'; export function plugin(initializerContext: PluginInitializerContext) { diff --git a/src/plugins/vis_types/tagcloud/public/plugin.ts b/src/plugins/vis_types/tagcloud/public/plugin.ts index ec5ae6afaaad2..6111bfae9f62c 100644 --- a/src/plugins/vis_types/tagcloud/public/plugin.ts +++ b/src/plugins/vis_types/tagcloud/public/plugin.ts @@ -11,7 +11,7 @@ import { VisualizationsSetup } from '@kbn/visualizations-plugin/public'; import { ChartsPluginSetup } from '@kbn/charts-plugin/public'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { getTagCloudVisTypeDefinition } from './tag_cloud_type'; -import { TagcloudPublicConfig } from '../config'; +import type { TagcloudPublicConfig } from '../server/config'; import { setDataViewsStart } from './services'; /** @internal */ diff --git a/src/plugins/vis_types/tagcloud/config.ts b/src/plugins/vis_types/tagcloud/server/config.ts similarity index 100% rename from src/plugins/vis_types/tagcloud/config.ts rename to src/plugins/vis_types/tagcloud/server/config.ts diff --git a/src/plugins/vis_types/tagcloud/server/index.ts b/src/plugins/vis_types/tagcloud/server/index.ts index aba626fba32e7..f8cd2c59cb8aa 100644 --- a/src/plugins/vis_types/tagcloud/server/index.ts +++ b/src/plugins/vis_types/tagcloud/server/index.ts @@ -8,7 +8,7 @@ import { CoreSetup, PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; import type { VisualizationsServerSetup } from '@kbn/visualizations-plugin/server'; -import { configSchema, TagcloudConfig } from '../config'; +import { configSchema, TagcloudConfig } from './config'; export const config: PluginConfigDescriptor = { exposeToBrowser: { diff --git a/src/plugins/vis_types/timelion/public/index.ts b/src/plugins/vis_types/timelion/public/index.ts index a11a20865e80a..932ca1b7cc312 100644 --- a/src/plugins/vis_types/timelion/public/index.ts +++ b/src/plugins/vis_types/timelion/public/index.ts @@ -7,7 +7,7 @@ */ import { PluginInitializerContext } from '@kbn/core/public'; -import type { TimelionPublicConfig } from '../config'; +import type { TimelionPublicConfig } from '../server/config'; import { TimelionVisPlugin as Plugin } from './plugin'; export function plugin(initializerContext: PluginInitializerContext) { diff --git a/src/plugins/vis_types/timelion/public/plugin.ts b/src/plugins/vis_types/timelion/public/plugin.ts index a4c412c12fbd6..c8221b088435e 100644 --- a/src/plugins/vis_types/timelion/public/plugin.ts +++ b/src/plugins/vis_types/timelion/public/plugin.ts @@ -40,7 +40,7 @@ import { import { getArgValueSuggestions } from './helpers/arg_value_suggestions'; import { getTimelionVisRenderer } from './timelion_vis_renderer'; -import type { TimelionPublicConfig } from '../config'; +import type { TimelionPublicConfig } from '../server/config'; /** @internal */ export interface TimelionVisDependencies extends Partial { diff --git a/src/plugins/vis_types/timelion/config.ts b/src/plugins/vis_types/timelion/server/config.ts similarity index 100% rename from src/plugins/vis_types/timelion/config.ts rename to src/plugins/vis_types/timelion/server/config.ts diff --git a/src/plugins/vis_types/timelion/server/index.ts b/src/plugins/vis_types/timelion/server/index.ts index e9b312c8731b0..87511de25e13d 100644 --- a/src/plugins/vis_types/timelion/server/index.ts +++ b/src/plugins/vis_types/timelion/server/index.ts @@ -7,7 +7,7 @@ */ import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import { configSchema, TimelionConfig } from '../config'; +import { configSchema, TimelionConfig } from './config'; export const config: PluginConfigDescriptor = { exposeToBrowser: { diff --git a/src/plugins/vis_types/timelion/server/plugin.ts b/src/plugins/vis_types/timelion/server/plugin.ts index 5665f80108aa6..0b56536c4262f 100644 --- a/src/plugins/vis_types/timelion/server/plugin.ts +++ b/src/plugins/vis_types/timelion/server/plugin.ts @@ -12,7 +12,7 @@ import type { PluginStart, DataRequestHandlerContext } from '@kbn/data-plugin/se import type { PluginStart as DataViewPluginStart } from '@kbn/data-views-plugin/server'; import { CoreSetup, PluginInitializerContext, Plugin } from '@kbn/core/server'; import type { VisualizationsServerSetup } from '@kbn/visualizations-plugin/server'; -import type { TimelionConfig } from '../config'; +import type { TimelionConfig } from './config'; import { TIMELION_VIS_NAME } from '../common/constants'; import loadFunctions from './lib/load_functions'; import { functionsRoute } from './routes/functions'; diff --git a/src/plugins/vis_types/timeseries/public/index.ts b/src/plugins/vis_types/timeseries/public/index.ts index 8574f4922f772..01022a1411ec8 100644 --- a/src/plugins/vis_types/timeseries/public/index.ts +++ b/src/plugins/vis_types/timeseries/public/index.ts @@ -7,7 +7,7 @@ */ import { PluginInitializerContext } from '@kbn/core/public'; -import { VisTypeTimeseriesPublicConfig } from '../config'; +import type { VisTypeTimeseriesPublicConfig } from '../server/config'; import { MetricsPlugin as Plugin } from './plugin'; export function plugin( diff --git a/src/plugins/vis_types/timeseries/public/plugin.ts b/src/plugins/vis_types/timeseries/public/plugin.ts index 432bce9c367c9..eb1bffa46ce4c 100644 --- a/src/plugins/vis_types/timeseries/public/plugin.ts +++ b/src/plugins/vis_types/timeseries/public/plugin.ts @@ -19,7 +19,7 @@ import type { IUiSettingsClient } from '@kbn/core/public'; import type { HttpSetup } from '@kbn/core-http-browser'; import type { DocLinksStart } from '@kbn/core-doc-links-browser'; import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; -import { VisTypeTimeseriesPublicConfig } from '../config'; +import type { VisTypeTimeseriesPublicConfig } from '../server/config'; import { EditorController, TSVB_EDITOR_NAME } from './application/editor_controller'; diff --git a/src/plugins/vis_types/timeseries/config.ts b/src/plugins/vis_types/timeseries/server/config.ts similarity index 100% rename from src/plugins/vis_types/timeseries/config.ts rename to src/plugins/vis_types/timeseries/server/config.ts diff --git a/src/plugins/vis_types/timeseries/server/index.ts b/src/plugins/vis_types/timeseries/server/index.ts index 9ecb8a92d27d8..98e18a534919f 100644 --- a/src/plugins/vis_types/timeseries/server/index.ts +++ b/src/plugins/vis_types/timeseries/server/index.ts @@ -7,7 +7,7 @@ */ import { PluginInitializerContext, PluginConfigDescriptor } from '@kbn/core/server'; -import { VisTypeTimeseriesConfig, config as configSchema } from '../config'; +import { VisTypeTimeseriesConfig, config as configSchema } from './config'; export type { VisTypeTimeseriesSetup } from './plugin'; diff --git a/src/plugins/vis_types/timeseries/server/plugin.ts b/src/plugins/vis_types/timeseries/server/plugin.ts index 6435840269bbe..6f7a33e9d8af5 100644 --- a/src/plugins/vis_types/timeseries/server/plugin.ts +++ b/src/plugins/vis_types/timeseries/server/plugin.ts @@ -26,7 +26,7 @@ import type { PluginStart as DataViewsPublicPluginStart } from '@kbn/data-views- import type { FieldFormatsRegistry } from '@kbn/field-formats-plugin/common'; import type { VisualizationsServerSetup } from '@kbn/visualizations-plugin/server'; import { VIS_TYPE } from '../common/constants'; -import { VisTypeTimeseriesConfig } from '../config'; +import { VisTypeTimeseriesConfig } from './config'; import { getVisData } from './lib/get_vis_data'; import { visDataRoutes } from './routes/vis'; import { fieldsRoutes } from './routes/fields'; diff --git a/src/plugins/vis_types/vega/public/index.ts b/src/plugins/vis_types/vega/public/index.ts index 746432663dcfd..c8b9a42cb2f44 100644 --- a/src/plugins/vis_types/vega/public/index.ts +++ b/src/plugins/vis_types/vega/public/index.ts @@ -7,7 +7,7 @@ */ import { PluginInitializerContext } from '@kbn/core/public'; -import { ConfigSchema } from '../config'; +import type { ConfigSchema } from '../server/config'; import { VegaPlugin as Plugin } from './plugin'; export function plugin(initializerContext: PluginInitializerContext) { diff --git a/src/plugins/vis_types/vega/public/plugin.ts b/src/plugins/vis_types/vega/public/plugin.ts index 96e383979b854..63eed196790dc 100644 --- a/src/plugins/vis_types/vega/public/plugin.ts +++ b/src/plugins/vis_types/vega/public/plugin.ts @@ -30,7 +30,7 @@ import { createVegaFn } from './vega_fn'; import { createVegaTypeDefinition } from './vega_type'; import type { IServiceSettings } from './vega_view/vega_map_view/service_settings/service_settings_types'; -import { ConfigSchema } from '../config'; +import type { ConfigSchema } from '../server/config'; import { getVegaInspectorView } from './vega_inspector'; import { getVegaVisRenderer } from './vega_vis_renderer'; diff --git a/src/plugins/vis_types/vega/config.ts b/src/plugins/vis_types/vega/server/config.ts similarity index 100% rename from src/plugins/vis_types/vega/config.ts rename to src/plugins/vis_types/vega/server/config.ts diff --git a/src/plugins/vis_types/vega/server/index.ts b/src/plugins/vis_types/vega/server/index.ts index b761d69922372..08da62350a355 100644 --- a/src/plugins/vis_types/vega/server/index.ts +++ b/src/plugins/vis_types/vega/server/index.ts @@ -8,7 +8,7 @@ import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import { configSchema, ConfigSchema } from '../config'; +import { configSchema, ConfigSchema } from './config'; export const config: PluginConfigDescriptor = { exposeToBrowser: { diff --git a/src/plugins/vis_types/vislib/public/plugin.ts b/src/plugins/vis_types/vislib/public/plugin.ts index d53751f0bd6ab..72792426d93b5 100644 --- a/src/plugins/vis_types/vislib/public/plugin.ts +++ b/src/plugins/vis_types/vislib/public/plugin.ts @@ -16,7 +16,7 @@ import type { UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; import { LEGACY_HEATMAP_CHARTS_LIBRARY } from '@kbn/vis-type-heatmap-plugin/common'; import { LEGACY_GAUGE_CHARTS_LIBRARY } from '@kbn/vis-type-gauge-plugin/common'; -import { VislibPublicConfig } from '../config'; +import type { VislibPublicConfig } from '../server/config'; import { setAnalytics, setI18n, setUsageCollectionStart } from './services'; import { heatmapVisTypeDefinition } from './heatmap'; diff --git a/src/plugins/vis_types/vislib/config.ts b/src/plugins/vis_types/vislib/server/config.ts similarity index 100% rename from src/plugins/vis_types/vislib/config.ts rename to src/plugins/vis_types/vislib/server/config.ts diff --git a/src/plugins/vis_types/vislib/server/index.ts b/src/plugins/vis_types/vislib/server/index.ts index 03b3d03d7fc25..83853197d551a 100644 --- a/src/plugins/vis_types/vislib/server/index.ts +++ b/src/plugins/vis_types/vislib/server/index.ts @@ -7,7 +7,7 @@ */ import { PluginConfigDescriptor } from '@kbn/core/server'; -import { configSchema, VislibConfig } from '../config'; +import { configSchema, VislibConfig } from './config'; export const config: PluginConfigDescriptor = { exposeToBrowser: { diff --git a/src/plugins/vis_types/xy/public/index.ts b/src/plugins/vis_types/xy/public/index.ts index b8ec6b68d001f..c322993375575 100644 --- a/src/plugins/vis_types/xy/public/index.ts +++ b/src/plugins/vis_types/xy/public/index.ts @@ -8,7 +8,7 @@ import type { PluginInitializerContext } from '@kbn/core/public'; import { VisTypeXyPlugin as Plugin } from './plugin'; -import type { XyPublicConfig } from '../config'; +import type { XyPublicConfig } from '../server/config'; export type { VisTypeXyPluginSetup } from './plugin'; diff --git a/src/plugins/vis_types/xy/public/plugin.ts b/src/plugins/vis_types/xy/public/plugin.ts index 820f2f72f1e62..92c00b6c64c92 100644 --- a/src/plugins/vis_types/xy/public/plugin.ts +++ b/src/plugins/vis_types/xy/public/plugin.ts @@ -10,7 +10,7 @@ import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kb import type { VisualizationsSetup } from '@kbn/visualizations-plugin/public'; import type { ChartsPluginSetup } from '@kbn/charts-plugin/public'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; -import type { XyPublicConfig } from '../config'; +import type { XyPublicConfig } from '../server/config'; import { setUISettings, setPalettesService, setDataViewsStart } from './services'; import { visTypesDefinitions } from './vis_types'; diff --git a/src/plugins/vis_types/xy/config.ts b/src/plugins/vis_types/xy/server/config.ts similarity index 100% rename from src/plugins/vis_types/xy/config.ts rename to src/plugins/vis_types/xy/server/config.ts diff --git a/src/plugins/vis_types/xy/server/index.ts b/src/plugins/vis_types/xy/server/index.ts index f0484adf9a5ec..8d3bd1241f413 100644 --- a/src/plugins/vis_types/xy/server/index.ts +++ b/src/plugins/vis_types/xy/server/index.ts @@ -7,7 +7,7 @@ */ import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import { configSchema, XyConfig } from '../config'; +import { configSchema, XyConfig } from './config'; export const config: PluginConfigDescriptor = { exposeToBrowser: { diff --git a/src/plugins/vis_types/xy/server/plugin.ts b/src/plugins/vis_types/xy/server/plugin.ts index b77c02030a8a4..be44f9daa8edf 100644 --- a/src/plugins/vis_types/xy/server/plugin.ts +++ b/src/plugins/vis_types/xy/server/plugin.ts @@ -8,7 +8,7 @@ import { CoreSetup, Plugin, PluginInitializerContext } from '@kbn/core/server'; import type { VisualizationsServerSetup } from '@kbn/visualizations-plugin/server'; -import type { XyConfig } from '../config'; +import type { XyConfig } from './config'; interface PluginSetupDependencies { visualizations: VisualizationsServerSetup; diff --git a/src/plugins/visualizations/common/content_management/cm_services.ts b/src/plugins/visualizations/server/content_management/cm_services.ts similarity index 100% rename from src/plugins/visualizations/common/content_management/cm_services.ts rename to src/plugins/visualizations/server/content_management/cm_services.ts diff --git a/src/plugins/visualizations/common/content_management/v1/cm_services.ts b/src/plugins/visualizations/server/content_management/v1/cm_services.ts similarity index 100% rename from src/plugins/visualizations/common/content_management/v1/cm_services.ts rename to src/plugins/visualizations/server/content_management/v1/cm_services.ts diff --git a/src/plugins/visualizations/server/content_management/visualization_storage.ts b/src/plugins/visualizations/server/content_management/visualization_storage.ts index 17a3e73b51479..61aa924f7bd99 100644 --- a/src/plugins/visualizations/server/content_management/visualization_storage.ts +++ b/src/plugins/visualizations/server/content_management/visualization_storage.ts @@ -9,7 +9,7 @@ import { SOContentStorage } from '@kbn/content-management-utils'; import { Logger } from '@kbn/logging'; -import { cmServicesDefinition } from '../../common/content_management/cm_services'; +import { cmServicesDefinition } from './cm_services'; import type { VisualizationContentType, VisualizationCrudTypes, diff --git a/test/functional/apps/console/monaco/_misc_console_behavior.ts b/test/functional/apps/console/monaco/_misc_console_behavior.ts index f9b93872740ad..b952533c71a07 100644 --- a/test/functional/apps/console/monaco/_misc_console_behavior.ts +++ b/test/functional/apps/console/monaco/_misc_console_behavior.ts @@ -91,7 +91,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await PageObjects.console.monaco.getCurrentLineNumber()).to.be(4); }); - describe('open documentation', () => { + // FLAKY: https://github.com/elastic/kibana/issues/190321 + describe.skip('open documentation', () => { const requests = ['GET _search', 'GET test_index/_search', 'GET /_search']; requests.forEach((request) => { it('should open documentation when Ctrl+/ is pressed', async () => { diff --git a/test/functional/apps/discover/esql/_esql_view.ts b/test/functional/apps/discover/esql/_esql_view.ts index 11ea6a9ac4b22..7bdcb1bfe17fb 100644 --- a/test/functional/apps/discover/esql/_esql_view.ts +++ b/test/functional/apps/discover/esql/_esql_view.ts @@ -325,6 +325,31 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(requestNames).to.contain('Visualization'); }); }); + + describe('with slow queries', () => { + it('should show only one entry in inspector for table/visualization', async function () { + await PageObjects.discover.selectTextBaseLang(); + const testQuery = `from kibana_sample_data_flights | limit 10`; + await monacoEditor.setCodeEditorValue(testQuery); + + await browser.execute(() => { + window.ELASTIC_ESQL_DELAY_SECONDS = 5; + }); + await testSubjects.click('querySubmitButton'); + await PageObjects.header.waitUntilLoadingHasFinished(); + await browser.execute(() => { + window.ELASTIC_ESQL_DELAY_SECONDS = undefined; + }); + + await inspector.open(); + const requestNames = (await inspector.getRequestNames()).split(','); + const requestTotalTime = await inspector.getRequestTotalTime(); + expect(requestTotalTime).to.be.greaterThan(5000); + expect(requestNames.length).to.be(2); + expect(requestNames).to.contain('Table'); + expect(requestNames).to.contain('Visualization'); + }); + }); }); describe('query history', () => { diff --git a/test/functional/services/inspector.ts b/test/functional/services/inspector.ts index 348f37281156e..af695ad0a308a 100644 --- a/test/functional/services/inspector.ts +++ b/test/functional/services/inspector.ts @@ -328,4 +328,9 @@ export class InspectorService extends FtrService { return value === comboBoxOptions; } + + public async getRequestTotalTime() { + const [ms] = (await this.testSubjects.getVisibleText('inspectorRequestTotalTime')).split('ms'); + return parseFloat(ms); + } } diff --git a/test/plugin_functional/test_suites/saved_objects_management/hidden_types.ts b/test/plugin_functional/test_suites/saved_objects_management/hidden_types.ts index 8e7adb504ebee..1eac63022d6d6 100644 --- a/test/plugin_functional/test_suites/saved_objects_management/hidden_types.ts +++ b/test/plugin_functional/test_suites/saved_objects_management/hidden_types.ts @@ -8,6 +8,7 @@ import path from 'path'; import expect from '@kbn/expect'; +import { byIdAscComparator } from '@kbn/core-saved-objects-import-export-server-internal/src/export/utils'; import { PluginFunctionalProviderContext } from '../../services'; const fixturePaths = { @@ -47,11 +48,13 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide .expect(200) .then((resp) => { expect( - resp.body.saved_objects.map((obj: any) => ({ - id: obj.id, - type: obj.type, - hidden: obj.meta.hiddenType, - })) + resp.body.saved_objects + .map((obj: any) => ({ + id: obj.id, + type: obj.type, + hidden: obj.meta.hiddenType, + })) + .sort(byIdAscComparator) ).to.eql([ { id: 'obj_1', diff --git a/test/tsconfig.json b/test/tsconfig.json index b03067c0440ae..9f9f062a16492 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -78,5 +78,6 @@ "@kbn/default-nav-analytics", "@kbn/default-nav-management", "@kbn/default-nav-devtools", + "@kbn/core-saved-objects-import-export-server-internal", ] } diff --git a/tsconfig.base.json b/tsconfig.base.json index ab942aab15550..44bb897bea1c2 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1252,6 +1252,8 @@ "@kbn/notifications-plugin/*": ["x-pack/plugins/notifications/*"], "@kbn/object-versioning": ["packages/kbn-object-versioning"], "@kbn/object-versioning/*": ["packages/kbn-object-versioning/*"], + "@kbn/object-versioning-utils": ["packages/kbn-object-versioning-utils"], + "@kbn/object-versioning-utils/*": ["packages/kbn-object-versioning-utils/*"], "@kbn/observability-ai-assistant-app-plugin": ["x-pack/plugins/observability_solution/observability_ai_assistant_app"], "@kbn/observability-ai-assistant-app-plugin/*": ["x-pack/plugins/observability_solution/observability_ai_assistant_app/*"], "@kbn/observability-ai-assistant-management-plugin": ["x-pack/plugins/observability_solution/observability_ai_assistant_management"], diff --git a/x-pack/packages/kbn-cloud-security-posture-common/index.ts b/x-pack/packages/kbn-cloud-security-posture-common/index.ts index f4d7ac2e34dd9..66a98d5e398c3 100644 --- a/x-pack/packages/kbn-cloud-security-posture-common/index.ts +++ b/x-pack/packages/kbn-cloud-security-posture-common/index.ts @@ -16,7 +16,8 @@ export type { BaseCspSetupBothPolicy, BaseCspSetupStatus, CspSetupStatus, - CspFinding, -} from './types'; +} from './types/status'; +export type { CspFinding } from './types/findings'; +export type { BenchmarksCisId } from './types/benchmark'; export * from './constants'; -export type { CspBenchmarkRuleMetadata, CspBenchmarkRulesStates } from './schema/rules'; +export { extractErrorMessage, buildMutedRulesFilter } from './utils/helpers'; diff --git a/x-pack/packages/kbn-cloud-security-posture-common/jest.config.js b/x-pack/packages/kbn-cloud-security-posture-common/jest.config.js new file mode 100644 index 0000000000000..d6f06d2bcc21c --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/jest.config.js @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../..', + roots: ['/x-pack/packages/kbn-cloud-security-posture-common'], +}; diff --git a/x-pack/packages/kbn-cloud-security-posture-common/schema/rules.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules.ts deleted file mode 100644 index 67bb37e4e1702..0000000000000 --- a/x-pack/packages/kbn-cloud-security-posture-common/schema/rules.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { TypeOf, schema } from '@kbn/config-schema'; -import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '../constants'; - -export type CspBenchmarkRuleMetadata = TypeOf; - -export const cspBenchmarkRuleMetadataSchema = schema.object({ - audit: schema.string(), - benchmark: schema.object({ - name: schema.string(), - posture_type: schema.maybe( - schema.oneOf([schema.literal(CSPM_POLICY_TEMPLATE), schema.literal(KSPM_POLICY_TEMPLATE)]) - ), - id: schema.string(), - version: schema.string(), - rule_number: schema.maybe(schema.string()), - }), - default_value: schema.maybe(schema.string()), - description: schema.string(), - id: schema.string(), - impact: schema.maybe(schema.string()), - name: schema.string(), - profile_applicability: schema.string(), - rationale: schema.string(), - references: schema.maybe(schema.string()), - rego_rule_id: schema.string(), - remediation: schema.string(), - section: schema.string(), - tags: schema.arrayOf(schema.string()), - version: schema.string(), -}); - -export const ruleStateAttributes = schema.object({ - muted: schema.boolean(), - benchmark_id: schema.string(), - benchmark_version: schema.string(), - rule_number: schema.string(), - rule_id: schema.string(), -}); - -export const rulesStates = schema.recordOf(schema.string(), ruleStateAttributes); - -export type CspBenchmarkRulesStates = TypeOf; diff --git a/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/index.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/index.ts new file mode 100644 index 0000000000000..b8b927b3d1c5f --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * as rulesV1 from './v1'; +export * as rulesV2 from './v2'; +export * as rulesV3 from './v3'; +export * as rulesV4 from './v4'; +export * as rulesV5 from './v5'; diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/index.tsx b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/latest.ts similarity index 81% rename from x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/index.tsx rename to x-pack/packages/kbn-cloud-security-posture-common/schema/rules/latest.ts index bd63354936703..b56fab649ade5 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/index.tsx +++ b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/latest.ts @@ -5,4 +5,4 @@ * 2.0. */ -export { AnnotationsPanel } from './annotations_panel'; +export * from './v5'; diff --git a/x-pack/plugins/cloud_security_posture/common/types/rules/v1.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v1.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/types/rules/v1.ts rename to x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v1.ts diff --git a/x-pack/plugins/cloud_security_posture/common/types/rules/v2.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v2.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/types/rules/v2.ts rename to x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v2.ts diff --git a/x-pack/plugins/cloud_security_posture/common/types/rules/v3.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v3.ts similarity index 73% rename from x-pack/plugins/cloud_security_posture/common/types/rules/v3.ts rename to x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v3.ts index 7c0a536de79a5..a00bf1a8077e6 100644 --- a/x-pack/plugins/cloud_security_posture/common/types/rules/v3.ts +++ b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v3.ts @@ -6,8 +6,7 @@ */ import { schema, TypeOf } from '@kbn/config-schema'; - -import { cspBenchmarkRuleMetadataSchema } from '@kbn/cloud-security-posture-common/schema'; +import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '../../constants'; export const DEFAULT_BENCHMARK_RULES_PER_PAGE = 25; @@ -15,8 +14,36 @@ export const DEFAULT_BENCHMARK_RULES_PER_PAGE = 25; export type FindCspBenchmarkRuleRequest = TypeOf; +export type CspBenchmarkRuleMetadata = TypeOf; + export type CspBenchmarkRule = TypeOf; +export const cspBenchmarkRuleMetadataSchema = schema.object({ + audit: schema.string(), + benchmark: schema.object({ + name: schema.string(), + posture_type: schema.maybe( + schema.oneOf([schema.literal(CSPM_POLICY_TEMPLATE), schema.literal(KSPM_POLICY_TEMPLATE)]) + ), + id: schema.string(), + version: schema.string(), + rule_number: schema.maybe(schema.string()), + }), + default_value: schema.maybe(schema.string()), + description: schema.string(), + id: schema.string(), + impact: schema.maybe(schema.string()), + name: schema.string(), + profile_applicability: schema.string(), + rationale: schema.string(), + references: schema.maybe(schema.string()), + rego_rule_id: schema.string(), + remediation: schema.string(), + section: schema.string(), + tags: schema.arrayOf(schema.string()), + version: schema.string(), +}); + export const cspBenchmarkRuleSchema = schema.object({ metadata: cspBenchmarkRuleMetadataSchema, }); diff --git a/x-pack/plugins/cloud_security_posture/common/types/rules/v4.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v4.ts similarity index 86% rename from x-pack/plugins/cloud_security_posture/common/types/rules/v4.ts rename to x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v4.ts index 231fb4c65a9bb..4f05a15f555b5 100644 --- a/x-pack/plugins/cloud_security_posture/common/types/rules/v4.ts +++ b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v4.ts @@ -6,11 +6,15 @@ */ import { schema, TypeOf } from '@kbn/config-schema'; -import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common'; -import { ruleStateAttributes, rulesStates } from '@kbn/cloud-security-posture-common/schema'; -import { BenchmarksCisId } from '../latest'; +import { BenchmarksCisId } from '../../types/benchmark'; import { DEFAULT_BENCHMARK_RULES_PER_PAGE } from './v3'; -export type { cspBenchmarkRuleSchema, CspBenchmarkRule, FindCspBenchmarkRuleResponse } from './v3'; +export type { + cspBenchmarkRuleMetadataSchema, + CspBenchmarkRuleMetadata, + cspBenchmarkRuleSchema, + CspBenchmarkRule, + FindCspBenchmarkRuleResponse, +} from './v3'; export type FindCspBenchmarkRuleRequest = TypeOf; @@ -22,6 +26,8 @@ export type CspBenchmarkRulesBulkActionRequestSchema = TypeOf< export type RuleStateAttributes = TypeOf; +export type CspBenchmarkRulesStates = TypeOf; + export type CspSettings = TypeOf; export const findCspBenchmarkRuleRequestSchema = schema.object({ @@ -137,6 +143,16 @@ export interface CspBenchmarkRulesBulkActionResponse { message: string; } +const ruleStateAttributes = schema.object({ + muted: schema.boolean(), + benchmark_id: schema.string(), + benchmark_version: schema.string(), + rule_number: schema.string(), + rule_id: schema.string(), +}); + +const rulesStates = schema.recordOf(schema.string(), ruleStateAttributes); + export const cspSettingsSchema = schema.object({ rules: rulesStates, }); diff --git a/x-pack/plugins/cloud_security_posture/common/types/rules/v5.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v5.ts similarity index 93% rename from x-pack/plugins/cloud_security_posture/common/types/rules/v5.ts rename to x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v5.ts index 1d70528d457ea..6f30ed446531a 100644 --- a/x-pack/plugins/cloud_security_posture/common/types/rules/v5.ts +++ b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/v5.ts @@ -7,13 +7,20 @@ import { schema, TypeOf } from '@kbn/config-schema'; import { DEFAULT_BENCHMARK_RULES_PER_PAGE } from './v3'; -export type { cspBenchmarkRuleSchema, CspBenchmarkRule, FindCspBenchmarkRuleResponse } from './v3'; +export type { + cspBenchmarkRuleMetadataSchema, + CspBenchmarkRuleMetadata, + cspBenchmarkRuleSchema, + CspBenchmarkRule, + FindCspBenchmarkRuleResponse, +} from './v3'; export type { PageUrlParams, rulesToUpdate, CspBenchmarkRulesBulkActionRequestSchema, CspBenchmarkRulesBulkActionResponse, RuleStateAttributes, + CspBenchmarkRulesStates, cspSettingsSchema, CspSettings, BulkActionBenchmarkRulesResponse, diff --git a/x-pack/packages/kbn-cloud-security-posture-common/tsconfig.json b/x-pack/packages/kbn-cloud-security-posture-common/tsconfig.json index 1eb47d23c1542..17961df586258 100644 --- a/x-pack/packages/kbn-cloud-security-posture-common/tsconfig.json +++ b/x-pack/packages/kbn-cloud-security-posture-common/tsconfig.json @@ -16,5 +16,7 @@ ], "kbn_references": [ "@kbn/config-schema", + "@kbn/data-views-plugin", + "@kbn/i18n", ] } diff --git a/x-pack/packages/kbn-cloud-security-posture-common/types/benchmark.ts b/x-pack/packages/kbn-cloud-security-posture-common/types/benchmark.ts new file mode 100644 index 0000000000000..ed661879558e7 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/types/benchmark.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 type BenchmarksCisId = 'cis_k8s' | 'cis_azure' | 'cis_aws' | 'cis_eks' | 'cis_gcp'; diff --git a/x-pack/packages/kbn-cloud-security-posture-common/types.ts b/x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts similarity index 54% rename from x-pack/packages/kbn-cloud-security-posture-common/types.ts rename to x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts index 7a9d5fee09c8f..8a7a563fb26c7 100644 --- a/x-pack/packages/kbn-cloud-security-posture-common/types.ts +++ b/x-pack/packages/kbn-cloud-security-posture-common/types/findings.ts @@ -4,46 +4,15 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { EcsDataStream, EcsEvent } from '@elastic/ecs'; -import type { CspBenchmarkRuleMetadata } from './schema/rules'; - -export type CspStatusCode = - | 'indexed' // latest findings index exists and has results - | 'indexing' // index timeout was not surpassed since installation, assumes data is being indexed - | 'unprivileged' // user lacks privileges for the latest findings index - | 'index-timeout' // index timeout was surpassed since installation - | 'not-deployed' // no healthy agents were deployed - | 'not-installed' // number of installed csp integrations is 0; - | 'waiting_for_results'; // have healthy agents but no findings at all, assumes data is being indexed for the 1st time - -export type IndexStatus = - | 'not-empty' // Index contains documents - | 'empty' // Index doesn't contain documents (or doesn't exist) - | 'unprivileged'; // User doesn't have access to query the index - -export interface IndexDetails { - index: string; - status: IndexStatus; -} - -export interface BaseCspSetupBothPolicy { - status: CspStatusCode; - installedPackagePolicies: number; - healthyAgents: number; -} - -export interface BaseCspSetupStatus { - indicesDetails: IndexDetails[]; - latestPackageVersion: string; - cspm: BaseCspSetupBothPolicy; - kspm: BaseCspSetupBothPolicy; - vuln_mgmt: BaseCspSetupBothPolicy; - isPluginInitialized: boolean; - installedPackageVersion?: string | undefined; - hasMisconfigurationsFindings?: boolean; -} -export type CspSetupStatus = BaseCspSetupStatus; +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { EcsDataStream, EcsEvent } from '@elastic/ecs'; +import type { CspBenchmarkRuleMetadata } from '../schema/rules/latest'; export interface CspFinding { '@timestamp': string; diff --git a/x-pack/packages/kbn-cloud-security-posture-common/types/status.ts b/x-pack/packages/kbn-cloud-security-posture-common/types/status.ts new file mode 100644 index 0000000000000..92ad6ee126b8a --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/types/status.ts @@ -0,0 +1,51 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export type CspStatusCode = + | 'indexed' // latest findings index exists and has results + | 'indexing' // index timeout was not surpassed since installation, assumes data is being indexed + | 'unprivileged' // user lacks privileges for the latest findings index + | 'index-timeout' // index timeout was surpassed since installation + | 'not-deployed' // no healthy agents were deployed + | 'not-installed' // number of installed csp integrations is 0; + | 'waiting_for_results'; // have healthy agents but no findings at all, assumes data is being indexed for the 1st time + +export type IndexStatus = + | 'not-empty' // Index contains documents + | 'empty' // Index doesn't contain documents (or doesn't exist) + | 'unprivileged'; // User doesn't have access to query the index + +export interface IndexDetails { + index: string; + status: IndexStatus; +} + +export interface BaseCspSetupBothPolicy { + status: CspStatusCode; + installedPackagePolicies: number; + healthyAgents: number; +} + +export interface BaseCspSetupStatus { + indicesDetails: IndexDetails[]; + latestPackageVersion: string; + cspm: BaseCspSetupBothPolicy; + kspm: BaseCspSetupBothPolicy; + vuln_mgmt: BaseCspSetupBothPolicy; + isPluginInitialized: boolean; + installedPackageVersion?: string | undefined; + hasMisconfigurationsFindings?: boolean; +} + +export type CspSetupStatus = BaseCspSetupStatus; diff --git a/x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts b/x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts new file mode 100644 index 0000000000000..7e5f4f1d8120a --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts @@ -0,0 +1,141 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { extractErrorMessage, defaultErrorMessage, buildMutedRulesFilter } from './helpers'; + +const fallbackMessage = 'thisIsAFallBackMessage'; + +describe('test helper methods', () => { + describe('extractErrorMessage Test', () => { + it('should return error message if input is instance of Error', () => { + const errorMessage = 'thisIsInstanceOfErrorMessage'; + const error = new Error(errorMessage); + const extractedErrorMessage = extractErrorMessage(error, fallbackMessage); + + expect(extractedErrorMessage).toMatch(errorMessage); + }); + + it('should return string if input is string', () => { + const error: string = 'thisIsAString'; + const extractedErrorMessage = extractErrorMessage(error, fallbackMessage); + + expect(extractedErrorMessage).toMatch(error); + }); + + it('should return fallbackMessage is input is not string nor instance of Error', () => { + const error: number = 12345; + const extractedErrorMessage = extractErrorMessage(error, fallbackMessage); + + expect(extractedErrorMessage).toMatch(fallbackMessage); + }); + + it('should return default message when input is not string nor instance of Error and fallbackMessage is not provided', () => { + const error: number = 12345; + const extractedErrorMessage = extractErrorMessage(error); + + expect(extractedErrorMessage).toMatch(defaultErrorMessage); + }); + }); + + describe('buildMutedRulesFilter Test', () => { + it('should return an empty array if no rules are muted', () => { + const rulesStates = { + rule1: { + muted: false, + benchmark_id: '1', + benchmark_version: '1.0', + rule_number: '1', + rule_id: '11', + }, + rule2: { + muted: false, + benchmark_id: '2', + benchmark_version: '1.0', + rule_number: '2', + rule_id: '22', + }, + }; + + expect(buildMutedRulesFilter(rulesStates)).toEqual([]); + }); + + it('should return the correct query for a single muted rule', () => { + const rulesStates = { + rule1: { + muted: true, + benchmark_id: '1', + benchmark_version: '1.0', + rule_number: '1', + rule_id: '11', + }, + rule2: { + muted: false, + benchmark_id: '2', + benchmark_version: '1.0', + rule_number: '2', + rule_id: '22', + }, + }; + + const expectedQuery = [ + { + bool: { + must: [ + { term: { 'rule.benchmark.id': '1' } }, + { term: { 'rule.benchmark.version': '1.0' } }, + { term: { 'rule.benchmark.rule_number': '1' } }, + ], + }, + }, + ]; + + expect(buildMutedRulesFilter(rulesStates)).toEqual(expectedQuery); + }); + + it('should return the correct queries for multiple muted rules', () => { + const rulesStates = { + rule1: { + muted: true, + benchmark_id: '1', + benchmark_version: '1.0', + rule_number: '1', + rule_id: '11', + }, + rule2: { + muted: true, + benchmark_id: '2', + benchmark_version: '1.0', + rule_number: '2', + rule_id: '22', + }, + }; + + const expectedQuery = [ + { + bool: { + must: [ + { term: { 'rule.benchmark.id': '1' } }, + { term: { 'rule.benchmark.version': '1.0' } }, + { term: { 'rule.benchmark.rule_number': '1' } }, + ], + }, + }, + { + bool: { + must: [ + { term: { 'rule.benchmark.id': '2' } }, + { term: { 'rule.benchmark.version': '1.0' } }, + { term: { 'rule.benchmark.rule_number': '2' } }, + ], + }, + }, + ]; + + expect(buildMutedRulesFilter(rulesStates)).toEqual(expectedQuery); + }); + }); +}); diff --git a/x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts b/x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts new file mode 100644 index 0000000000000..7c26c61778137 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.ts @@ -0,0 +1,43 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { QueryDslQueryContainer } from '@kbn/data-views-plugin/common/types'; +import { i18n } from '@kbn/i18n'; +import type { CspBenchmarkRulesStates } from '../schema/rules/latest'; + +export const defaultErrorMessage = i18n.translate('xpack.csp.common.utils.helpers.unknownError', { + defaultMessage: 'Unknown Error', +}); + +export const extractErrorMessage = (e: unknown, fallbackMessage?: string): string => { + if (e instanceof Error) return e.message; + if (typeof e === 'string') return e; + + return fallbackMessage ?? defaultErrorMessage; +}; + +export const buildMutedRulesFilter = ( + rulesStates: CspBenchmarkRulesStates +): QueryDslQueryContainer[] => { + const mutedRules = Object.fromEntries( + Object.entries(rulesStates).filter(([key, value]) => value.muted === true) + ); + + const mutedRulesFilterQuery = Object.keys(mutedRules).map((key) => { + const rule = mutedRules[key]; + return { + bool: { + must: [ + { term: { 'rule.benchmark.id': rule.benchmark_id } }, + { term: { 'rule.benchmark.version': rule.benchmark_version } }, + { term: { 'rule.benchmark.rule_number': rule.rule_number } }, + ], + }, + }; + }); + + return mutedRulesFilterQuery; +}; diff --git a/x-pack/packages/kbn-cloud-security-posture/index.ts b/x-pack/packages/kbn-cloud-security-posture/index.ts index a0e4ba8dbc1b2..bb40ae57eca2a 100644 --- a/x-pack/packages/kbn-cloud-security-posture/index.ts +++ b/x-pack/packages/kbn-cloud-security-posture/index.ts @@ -6,3 +6,4 @@ */ export * from './type'; +export { showErrorToast } from './src/utils/show_error_toast'; diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_setup_status_api.ts b/x-pack/packages/kbn-cloud-security-posture/src/hooks/use_csp_setup_status_api.ts similarity index 84% rename from x-pack/plugins/cloud_security_posture/public/common/api/use_setup_status_api.ts rename to x-pack/packages/kbn-cloud-security-posture/src/hooks/use_csp_setup_status_api.ts index 003f841772285..f77e1e5c12c8d 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_setup_status_api.ts +++ b/x-pack/packages/kbn-cloud-security-posture/src/hooks/use_csp_setup_status_api.ts @@ -6,16 +6,17 @@ */ import { useQuery, type UseQueryOptions } from '@tanstack/react-query'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import type { CoreStart } from '@kbn/core/public'; import { STATUS_API_CURRENT_VERSION, STATUS_ROUTE_PATH } from '@kbn/cloud-security-posture-common'; import type { CspSetupStatus } from '@kbn/cloud-security-posture-common'; -import { useKibana } from '../hooks/use_kibana'; const getCspSetupStatusQueryKey = 'csp_status_key'; export const useCspSetupStatusApi = ( options?: UseQueryOptions ) => { - const { http } = useKibana().services; + const { http } = useKibana().services; return useQuery( [getCspSetupStatusQueryKey], () => http.get(STATUS_ROUTE_PATH, { version: STATUS_API_CURRENT_VERSION }), diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_get_benchmark_rules_state_api.ts b/x-pack/packages/kbn-cloud-security-posture/src/hooks/use_get_benchmark_rules_state_api.ts similarity index 81% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_get_benchmark_rules_state_api.ts rename to x-pack/packages/kbn-cloud-security-posture/src/hooks/use_get_benchmark_rules_state_api.ts index cf79ef80b1196..06270d9bc710a 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_get_benchmark_rules_state_api.ts +++ b/x-pack/packages/kbn-cloud-security-posture/src/hooks/use_get_benchmark_rules_state_api.ts @@ -10,13 +10,14 @@ import { CSP_GET_BENCHMARK_RULES_STATE_API_CURRENT_VERSION, CSP_GET_BENCHMARK_RULES_STATE_ROUTE_PATH, } from '@kbn/cloud-security-posture-common'; -import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common'; -import { useKibana } from '../../../common/hooks/use_kibana'; +import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common/schema/rules/latest'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import type { CoreStart } from '@kbn/core/public'; export const getRuleStatesKey = ['get_rules_state_key']; export const useGetCspBenchmarkRulesStatesApi = () => { - const { http } = useKibana().services; + const { http } = useKibana().services; return useQuery(getRuleStatesKey, () => http.get(CSP_GET_BENCHMARK_RULES_STATE_ROUTE_PATH, { version: CSP_GET_BENCHMARK_RULES_STATE_API_CURRENT_VERSION, diff --git a/x-pack/plugins/cloud_security_posture/public/common/utils/show_error_toast.ts b/x-pack/packages/kbn-cloud-security-posture/src/utils/show_error_toast.ts similarity index 90% rename from x-pack/plugins/cloud_security_posture/public/common/utils/show_error_toast.ts rename to x-pack/packages/kbn-cloud-security-posture/src/utils/show_error_toast.ts index 75316d9495b26..060ae8c3b69ee 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/utils/show_error_toast.ts +++ b/x-pack/packages/kbn-cloud-security-posture/src/utils/show_error_toast.ts @@ -4,9 +4,10 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ + import type { CoreStart } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; -import { extractErrorMessage } from '../../../common/utils/helpers'; +import { extractErrorMessage } from '@kbn/cloud-security-posture-common'; const SEARCH_FAILED_TEXT = i18n.translate( 'xpack.csp.findings.findingsErrorToast.searchFailedTitle', diff --git a/x-pack/packages/kbn-cloud-security-posture/tsconfig.json b/x-pack/packages/kbn-cloud-security-posture/tsconfig.json index a2652215c4e79..152c3fe8a8b29 100644 --- a/x-pack/packages/kbn-cloud-security-posture/tsconfig.json +++ b/x-pack/packages/kbn-cloud-security-posture/tsconfig.json @@ -33,5 +33,8 @@ "@kbn/es-query", "@kbn/cloud-plugin", "@kbn/spaces-plugin", + "@kbn/kibana-react-plugin", + "@kbn/cloud-security-posture-common", + "@kbn/i18n", ] } diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_body/empty_convo.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_body/empty_convo.tsx index 6c09c8c9680c9..38f64c8bab2a4 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_body/empty_convo.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_body/empty_convo.tsx @@ -38,7 +38,7 @@ export const EmptyConvo: React.FC = ({ setIsSettingsModalVisible, }) => { return ( - + = ({ text-align: center; `} > - + 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 348fbb1ad3496..89518940799ee 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 @@ -106,6 +106,7 @@ export const FlyoutNavigation = memo( size="xs" color="primary" iconType="newChat" + data-test-subj="newChatFromOverlay" onClick={onConversationCreate} disabled={isLoading || !isAssistantEnabled} > 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 9b75c2e9e7c53..03016f143b6b0 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 @@ -59,6 +59,7 @@ export const AssistantTitle: React.FC<{ `} > ( onConversationSelected({ cId: conversation.id, cTitle: conversation.title }) } label={conversation.title} + data-test-subj={`conversation-select-${conversation.title}`} isActive={ !isEmpty(conversation.id) ? conversation.id === currentConversation?.id 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 965d1fee1761f..372132bd7b074 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/index.tsx @@ -443,7 +443,7 @@ const AssistantComponent: React.FC = ({ overflow: hidden; `} > - + = ({ {Object.keys(selectedPromptContexts) .sort() - .map((id) => ( + .map((id, i) => ( { it('shows the expected name in the dropdownDisplay', () => { render({option.dropdownDisplay}); - expect(screen.getByTestId('name')).toHaveTextContent(mockSystemPrompt.name); + expect(screen.getByTestId(`systemPrompt-${mockSystemPrompt.name}`)).toHaveTextContent( + mockSystemPrompt.name + ); }); it('shows the expected prompt content in the dropdownDisplay', () => { 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 4d9fae2c43749..7d54d347964e4 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 @@ -44,7 +44,7 @@ export const getOptionFromPrompt = ({ ), dropdownDisplay: ( <> - {name} + {name} {/* Empty content tooltip gets around :hover styles from SuperSelectOptionButton */} 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 1cf00944d51de..871ed28fc8765 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 @@ -43,7 +43,6 @@ const SystemPromptComponent: React.FC = ({ data-test-subj="systemPrompt" isClearable={true} isSettingsModalVisible={isSettingsModalVisible} - onSystemPromptSelectionChange={onSystemPromptSelectionChange} selectedPrompt={selectedPrompt} setIsSettingsModalVisible={setIsSettingsModalVisible} /> diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_settings.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_settings.tsx index 7b8e451449884..6f4cd976846c2 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_settings.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_settings.tsx @@ -33,7 +33,7 @@ export const SystemPromptSettings: React.FC = React.m return ( <> -

{i18n.SETTINGS_TITLE}

+

{i18n.SETTINGS_TITLE}

{i18n.SETTINGS_DESCRIPTION} diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/prompt_context_selector/prompt_context_selector.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/prompt_context_selector/prompt_context_selector.tsx index eedb560019f0c..835047a8da8c0 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/prompt_context_selector/prompt_context_selector.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/prompt_context_selector/prompt_context_selector.tsx @@ -88,6 +88,7 @@ export const PromptContextSelector: React.FC = React.memo( = React.memo( > onClickAddQuickPrompt(badge)} onClickAriaLabel={badge.name} > diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/upgrade_license_cta/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/upgrade_license_cta/index.tsx index e07f84eb0d487..4908b580552fb 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/upgrade_license_cta/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/upgrade_license_cta/index.tsx @@ -25,6 +25,7 @@ export const UpgradeLicenseCallToAction: React.FC = ({ http }) => { const basePath = http.basePath.get(); return ( = React.memo( dropdownDisplay: ( - + {connector.name} {connectorDetails && ( diff --git a/x-pack/packages/kbn-entities-schema/src/rest_spec/create.ts b/x-pack/packages/kbn-entities-schema/src/rest_spec/create.ts index 9f223b9051f8c..c6ee26d3a3d26 100644 --- a/x-pack/packages/kbn-entities-schema/src/rest_spec/create.ts +++ b/x-pack/packages/kbn-entities-schema/src/rest_spec/create.ts @@ -6,9 +6,10 @@ */ import { z } from '@kbn/zod'; +import { BooleanFromString } from '@kbn/zod-helpers'; export const createEntityDefinitionQuerySchema = z.object({ - installOnly: z.optional(z.coerce.boolean()).default(false), + installOnly: z.optional(BooleanFromString).default(false), }); export type CreateEntityDefinitionQuery = z.infer; diff --git a/x-pack/packages/kbn-entities-schema/src/rest_spec/delete.ts b/x-pack/packages/kbn-entities-schema/src/rest_spec/delete.ts index 0ce8f1b330d89..0bac10c2be264 100644 --- a/x-pack/packages/kbn-entities-schema/src/rest_spec/delete.ts +++ b/x-pack/packages/kbn-entities-schema/src/rest_spec/delete.ts @@ -6,13 +6,14 @@ */ import { z } from '@kbn/zod'; +import { BooleanFromString } from '@kbn/zod-helpers'; export const deleteEntityDefinitionParamsSchema = z.object({ id: z.string(), }); export const deleteEntityDefinitionQuerySchema = z.object({ - deleteData: z.optional(z.coerce.boolean().default(false)), + deleteData: z.optional(BooleanFromString).default(false), }); export type DeleteEntityDefinitionQuery = z.infer; 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 ae612c27a24b5..74be36cc5d802 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 @@ -59,4 +59,20 @@ export const entityDefinitionSchema = z.object({ installStartedAt: z.optional(z.string()), }); +export const entityDefinitionUpdateSchema = entityDefinitionSchema + .omit({ + id: true, + managed: true, + installStatus: true, + installStartedAt: true, + }) + .partial() + .merge( + z.object({ + history: z.optional(entityDefinitionSchema.shape.history.partial()), + version: semVerSchema, + }) + ); + export type EntityDefinition = z.infer; +export type EntityDefinitionUpdate = z.infer; diff --git a/x-pack/packages/kbn-entities-schema/tsconfig.json b/x-pack/packages/kbn-entities-schema/tsconfig.json index ecde0c1e3a46e..0fdbba4b7e793 100644 --- a/x-pack/packages/kbn-entities-schema/tsconfig.json +++ b/x-pack/packages/kbn-entities-schema/tsconfig.json @@ -16,5 +16,6 @@ ], "kbn_references": [ "@kbn/zod", + "@kbn/zod-helpers", ] } diff --git a/x-pack/packages/ml/trained_models_utils/index.ts b/x-pack/packages/ml/trained_models_utils/index.ts index 293f6662f5011..c6137faf6f76a 100644 --- a/x-pack/packages/ml/trained_models_utils/index.ts +++ b/x-pack/packages/ml/trained_models_utils/index.ts @@ -36,4 +36,5 @@ export { LATEST_ELSER_MODEL_ID, LATEST_E5_MODEL_ID, ElserModels, + isLocalModel, } 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 a453360e6b94f..caf4ce56b3482 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 @@ -284,3 +284,9 @@ export type InferenceAPIConfigResponse = { model?: string; }; } & InferenceServiceSettings; + +export function isLocalModel( + model: InferenceServiceSettings +): model is LocalInferenceServiceSettings { + return ['elser', 'elasticsearch'].includes((model as LocalInferenceServiceSettings).service); +} 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 ae1289b2a9e2e..6e4392e3f737e 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 @@ -273,8 +273,15 @@ Object { "keys": Object { "content": Object { "flags": Object { + "default": [Function], "error": [Function], + "presence": "optional", }, + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], "rules": Array [ Object { "args": Object { @@ -285,6 +292,33 @@ Object { ], "type": "string", }, + "rawContent": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "items": Array [ + Object { + "flags": Object { + "error": [Function], + "presence": "optional", + }, + "metas": Array [ + Object { + "x-oas-any-type": true, + }, + ], + "type": "any", + }, + ], + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "type": "array", + }, "role": Object { "flags": Object { "error": [Function], @@ -300,6 +334,14 @@ Object { "type": "string", }, }, + "rules": Array [ + Object { + "args": Object { + "method": [Function], + }, + "name": "custom", + }, + ], "type": "object", }, ], @@ -419,6 +461,86 @@ Object { ], "type": "number", }, + "toolChoice": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "keys": Object { + "name": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "rules": Array [ + Object { + "args": Object { + "method": [Function], + }, + "name": "custom", + }, + ], + "type": "string", + }, + "type": Object { + "flags": Object { + "error": [Function], + }, + "matches": Array [ + Object { + "schema": Object { + "allow": Array [ + "auto", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + Object { + "schema": Object { + "allow": Array [ + "any", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + Object { + "schema": Object { + "allow": Array [ + "tool", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + ], + "type": "alternatives", + }, + }, + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "type": "object", + }, "tools": Object { "flags": Object { "default": [Function], @@ -556,8 +678,15 @@ Object { "keys": Object { "content": Object { "flags": Object { + "default": [Function], "error": [Function], + "presence": "optional", }, + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], "rules": Array [ Object { "args": Object { @@ -568,6 +697,33 @@ Object { ], "type": "string", }, + "rawContent": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "items": Array [ + Object { + "flags": Object { + "error": [Function], + "presence": "optional", + }, + "metas": Array [ + Object { + "x-oas-any-type": true, + }, + ], + "type": "any", + }, + ], + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "type": "array", + }, "role": Object { "flags": Object { "error": [Function], @@ -583,6 +739,14 @@ Object { "type": "string", }, }, + "rules": Array [ + Object { + "args": Object { + "method": [Function], + }, + "name": "custom", + }, + ], "type": "object", }, ], @@ -702,6 +866,86 @@ Object { ], "type": "number", }, + "toolChoice": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "keys": Object { + "name": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "rules": Array [ + Object { + "args": Object { + "method": [Function], + }, + "name": "custom", + }, + ], + "type": "string", + }, + "type": Object { + "flags": Object { + "error": [Function], + }, + "matches": Array [ + Object { + "schema": Object { + "allow": Array [ + "auto", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + Object { + "schema": Object { + "allow": Array [ + "any", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + Object { + "schema": Object { + "allow": Array [ + "tool", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + ], + "type": "alternatives", + }, + }, + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "type": "object", + }, "tools": Object { "flags": Object { "default": [Function], @@ -839,14 +1083,51 @@ Object { "keys": Object { "content": Object { "flags": Object { + "default": [Function], "error": [Function], + "presence": "optional", }, "metas": Array [ Object { - "x-oas-any-type": true, + "x-oas-optional": true, }, ], - "type": "any", + "rules": Array [ + Object { + "args": Object { + "method": [Function], + }, + "name": "custom", + }, + ], + "type": "string", + }, + "rawContent": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "items": Array [ + Object { + "flags": Object { + "error": [Function], + "presence": "optional", + }, + "metas": Array [ + Object { + "x-oas-any-type": true, + }, + ], + "type": "any", + }, + ], + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "type": "array", }, "role": Object { "flags": Object { @@ -863,6 +1144,14 @@ Object { "type": "string", }, }, + "rules": Array [ + Object { + "args": Object { + "method": [Function], + }, + "name": "custom", + }, + ], "type": "object", }, ], @@ -982,6 +1271,86 @@ Object { ], "type": "number", }, + "toolChoice": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "keys": Object { + "name": Object { + "flags": Object { + "default": [Function], + "error": [Function], + "presence": "optional", + }, + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "rules": Array [ + Object { + "args": Object { + "method": [Function], + }, + "name": "custom", + }, + ], + "type": "string", + }, + "type": Object { + "flags": Object { + "error": [Function], + }, + "matches": Array [ + Object { + "schema": Object { + "allow": Array [ + "auto", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + Object { + "schema": Object { + "allow": Array [ + "any", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + Object { + "schema": Object { + "allow": Array [ + "tool", + ], + "flags": Object { + "error": [Function], + "only": true, + }, + "type": "any", + }, + }, + ], + "type": "alternatives", + }, + }, + "metas": Array [ + Object { + "x-oas-optional": true, + }, + ], + "type": "object", + }, "tools": Object { "flags": Object { "default": [Function], diff --git a/x-pack/plugins/actions/server/routes/connector/get/get.ts b/x-pack/plugins/actions/server/routes/connector/get/get.ts index 29d917702af4f..4519673a400fe 100644 --- a/x-pack/plugins/actions/server/routes/connector/get/get.ts +++ b/x-pack/plugins/actions/server/routes/connector/get/get.ts @@ -27,11 +27,16 @@ export const getConnectorRoute = ( access: 'public', summary: `Get connector information`, tags: ['oas-tag:connectors'], - // description: - // 'You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.', }, validate: { - params: getConnectorParamsSchemaV1, + request: { + params: getConnectorParamsSchemaV1, + }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, router.handleLegacyErrors( diff --git a/x-pack/plugins/actions/server/routes/create.ts b/x-pack/plugins/actions/server/routes/create.ts index 2803c5d31d603..f7e8b61707d70 100644 --- a/x-pack/plugins/actions/server/routes/create.ts +++ b/x-pack/plugins/actions/server/routes/create.ts @@ -63,16 +63,21 @@ export const createActionRoute = ( access: 'public', summary: 'Create a connector', tags: ['oas-tag:connectors'], - // description: - // 'You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.', }, validate: { - params: schema.maybe( - schema.object({ - id: schema.maybe(schema.string()), - }) - ), - body: bodySchema, + request: { + params: schema.maybe( + schema.object({ + id: schema.maybe(schema.string()), + }) + ), + body: bodySchema, + }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, router.handleLegacyErrors( diff --git a/x-pack/plugins/actions/server/routes/delete.ts b/x-pack/plugins/actions/server/routes/delete.ts index 8e2dd21952ab6..8b25fe66c9eb2 100644 --- a/x-pack/plugins/actions/server/routes/delete.ts +++ b/x-pack/plugins/actions/server/routes/delete.ts @@ -29,11 +29,17 @@ export const deleteActionRoute = ( access: 'public', summary: `Delete a connector`, description: 'WARNING: When you delete a connector, it cannot be recovered.', - // You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. tags: ['oas-tag:connectors'], }, validate: { - params: paramSchema, + request: { + params: paramSchema, + }, + response: { + 204: { + description: 'Indicates a successful call.', + }, + }, }, }, router.handleLegacyErrors( diff --git a/x-pack/plugins/actions/server/routes/execute.ts b/x-pack/plugins/actions/server/routes/execute.ts index 83b6e72652b06..6f2ad11e20588 100644 --- a/x-pack/plugins/actions/server/routes/execute.ts +++ b/x-pack/plugins/actions/server/routes/execute.ts @@ -46,12 +46,18 @@ export const executeActionRoute = ( summary: `Run a connector`, description: 'You can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems.', - // You must have `read` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges. If you use an index connector, you must also have `all`, `create`, `index`, or `write` indices privileges. tags: ['oas-tag:connectors'], }, validate: { - body: bodySchema, - params: paramSchema, + request: { + body: bodySchema, + params: paramSchema, + }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, router.handleLegacyErrors( diff --git a/x-pack/plugins/actions/server/routes/legacy/create.ts b/x-pack/plugins/actions/server/routes/legacy/create.ts index 3fd8c77759122..d668b1fbc19d2 100644 --- a/x-pack/plugins/actions/server/routes/legacy/create.ts +++ b/x-pack/plugins/actions/server/routes/legacy/create.ts @@ -40,7 +40,14 @@ export const createActionRoute = ( deprecated: true, }, validate: { - body: bodySchema, + request: { + body: bodySchema, + }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, router.handleLegacyErrors( diff --git a/x-pack/plugins/actions/server/routes/legacy/delete.ts b/x-pack/plugins/actions/server/routes/legacy/delete.ts index e2df62e5ec4bd..2204095e03801 100644 --- a/x-pack/plugins/actions/server/routes/legacy/delete.ts +++ b/x-pack/plugins/actions/server/routes/legacy/delete.ts @@ -35,7 +35,14 @@ export const deleteActionRoute = ( deprecated: true, }, validate: { - params: paramSchema, + request: { + params: paramSchema, + }, + response: { + 204: { + description: 'Indicates a successful call.', + }, + }, }, }, router.handleLegacyErrors(async function (context, req, res) { diff --git a/x-pack/plugins/actions/server/routes/legacy/execute.ts b/x-pack/plugins/actions/server/routes/legacy/execute.ts index abe8971baf1cf..88e75aadb627c 100644 --- a/x-pack/plugins/actions/server/routes/legacy/execute.ts +++ b/x-pack/plugins/actions/server/routes/legacy/execute.ts @@ -40,8 +40,15 @@ export const executeActionRoute = ( tags: ['oas-tag:connectors'], }, validate: { - body: bodySchema, - params: paramSchema, + request: { + body: bodySchema, + params: paramSchema, + }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, router.handleLegacyErrors(async function (context, req, res) { diff --git a/x-pack/plugins/actions/server/routes/legacy/get.ts b/x-pack/plugins/actions/server/routes/legacy/get.ts index e95c88fca7c45..524b3522ed541 100644 --- a/x-pack/plugins/actions/server/routes/legacy/get.ts +++ b/x-pack/plugins/actions/server/routes/legacy/get.ts @@ -34,7 +34,14 @@ export const getActionRoute = ( tags: ['oas-tag:connectors'], }, validate: { - params: paramSchema, + request: { + params: paramSchema, + }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, router.handleLegacyErrors(async function (context, req, res) { diff --git a/x-pack/plugins/actions/server/routes/legacy/update.ts b/x-pack/plugins/actions/server/routes/legacy/update.ts index f07682706fc19..5f234c8bf55a9 100644 --- a/x-pack/plugins/actions/server/routes/legacy/update.ts +++ b/x-pack/plugins/actions/server/routes/legacy/update.ts @@ -40,8 +40,15 @@ export const updateActionRoute = ( tags: ['oas-tag:connectors'], }, validate: { - body: bodySchema, - params: paramSchema, + request: { + body: bodySchema, + params: paramSchema, + }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, router.handleLegacyErrors(async function (context, req, res) { diff --git a/x-pack/plugins/actions/server/routes/update.ts b/x-pack/plugins/actions/server/routes/update.ts index 0077c1632877b..efb4d036b1e48 100644 --- a/x-pack/plugins/actions/server/routes/update.ts +++ b/x-pack/plugins/actions/server/routes/update.ts @@ -58,12 +58,17 @@ export const updateActionRoute = ( access: 'public', summary: `Update a connector`, tags: ['oas-tag:connectors'], - // description: - // 'You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.', }, validate: { - body: bodySchema, - params: paramSchema, + request: { + body: bodySchema, + params: paramSchema, + }, + response: { + 200: { + description: 'Indicates a successful call.', + }, + }, }, }, router.handleLegacyErrors( diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/embeddable_menu.tsx b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/embeddable_menu.tsx index 42124e39c07c0..55b63c18081b8 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/embeddable_menu.tsx +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/embeddable_menu.tsx @@ -158,7 +158,12 @@ export const PatternAnalysisSettings: FC = ({ values={{ minimumTimeRangeOption, categoryCount }} /> - ) : null} + ) : ( + + )} } > diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/minimum_time_range.ts b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/minimum_time_range.ts index 623f76919063f..3380d5e31e833 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/minimum_time_range.ts +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/minimum_time_range.ts @@ -7,6 +7,8 @@ import { i18n } from '@kbn/i18n'; import type { unitOfTime } from 'moment'; +export const DEFAULT_MINIMUM_TIME_RANGE_OPTION: MinimumTimeRangeOption = 'No minimum'; + export type MinimumTimeRangeOption = 'No minimum' | '1 week' | '1 month' | '3 months' | '6 months'; type MinimumTimeRange = Record< @@ -17,7 +19,7 @@ type MinimumTimeRange = Record< export const MINIMUM_TIME_RANGE: MinimumTimeRange = { 'No minimum': { label: i18n.translate('xpack.aiops.logCategorization.minimumTimeRange.noMin', { - defaultMessage: 'No minimum', + defaultMessage: 'Use range specified in time selector', }), factor: 0, unit: 'w', diff --git a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/use_minimum_time_range.ts b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/use_minimum_time_range.ts index 3bb3c0ab1ad5f..50328a2ef345c 100644 --- a/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/use_minimum_time_range.ts +++ b/x-pack/plugins/aiops/public/components/log_categorization/log_categorization_for_embeddable/use_minimum_time_range.ts @@ -15,7 +15,7 @@ import { useStorage } from '@kbn/ml-local-storage'; import type { MappingRuntimeFields } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { useAiopsAppContext } from '../../../hooks/use_aiops_app_context'; import type { MinimumTimeRangeOption } from './minimum_time_range'; -import { MINIMUM_TIME_RANGE } from './minimum_time_range'; +import { DEFAULT_MINIMUM_TIME_RANGE_OPTION, MINIMUM_TIME_RANGE } from './minimum_time_range'; import type { AiOpsKey, AiOpsStorageMapped } from '../../../types/storage'; import { AIOPS_PATTERN_ANALYSIS_MINIMUM_TIME_RANGE_PREFERENCE } from '../../../types/storage'; @@ -85,7 +85,7 @@ export function useMinimumTimeRange() { const [minimumTimeRangeOption, setMinimumTimeRangeOption] = useStorage< AiOpsKey, AiOpsStorageMapped - >(AIOPS_PATTERN_ANALYSIS_MINIMUM_TIME_RANGE_PREFERENCE, '1 week'); + >(AIOPS_PATTERN_ANALYSIS_MINIMUM_TIME_RANGE_PREFERENCE, DEFAULT_MINIMUM_TIME_RANGE_OPTION); const cancelRequest = useCallback(() => { abortController.current.abort(); diff --git a/x-pack/plugins/aiops/public/embeddables/pattern_analysis/pattern_analysis_initializer.tsx b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/pattern_analysis_initializer.tsx index 4ed1dadf3dc1e..f44fff343fb50 100644 --- a/x-pack/plugins/aiops/public/embeddables/pattern_analysis/pattern_analysis_initializer.tsx +++ b/x-pack/plugins/aiops/public/embeddables/pattern_analysis/pattern_analysis_initializer.tsx @@ -38,7 +38,10 @@ import { DEFAULT_PROBABILITY, RANDOM_SAMPLER_OPTION, } from '../../components/log_categorization/sampling_menu/random_sampler'; -import type { MinimumTimeRangeOption } from '../../components/log_categorization/log_categorization_for_embeddable/minimum_time_range'; +import { + DEFAULT_MINIMUM_TIME_RANGE_OPTION, + type MinimumTimeRangeOption, +} from '../../components/log_categorization/log_categorization_for_embeddable/minimum_time_range'; import { getMessageField } from '../../components/log_categorization/utils'; import { FieldSelector } from '../../components/log_categorization/log_categorization_for_embeddable/field_selector'; import { SamplingPanel } from '../../components/log_categorization/sampling_menu/sampling_panel'; @@ -67,7 +70,7 @@ export const PatternAnalysisEmbeddableInitializer: FC( pick( initialInput ?? { - minimumTimeRangeOption: '1 week', + minimumTimeRangeOption: DEFAULT_MINIMUM_TIME_RANGE_OPTION, randomSamplerMode: RANDOM_SAMPLER_OPTION.ON_AUTOMATIC, randomSamplerProbability: DEFAULT_PROBABILITY, }, diff --git a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts index f43ffc6096dcf..c7c795359aaee 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts @@ -3214,7 +3214,8 @@ describe('bulkEdit()', () => { value: ['test-1'], }, ], - paramsModifier: async (params) => { + paramsModifier: async (rule) => { + const params = rule.params; params.index = ['test-index-*']; return { modifiedParams: params, isParamsUpdateSkipped: false, skipReasons: [] }; @@ -3431,7 +3432,8 @@ describe('bulkEdit()', () => { value: ['test-1'], }, ], - paramsModifier: async (params) => { + paramsModifier: async (rule) => { + const params = rule.params; params.index = ['test-index-*']; return { modifiedParams: params, isParamsUpdateSkipped: false, skipReasons: [] }; diff --git a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts index 8bd10fe722c1d..81dd189116949 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts @@ -16,7 +16,7 @@ import { SavedObjectsUpdateResponse, } from '@kbn/core/server'; import { validateAndAuthorizeSystemActions } from '../../../../lib/validate_authorize_system_actions'; -import { RuleAction, RuleSystemAction } from '../../../../../common'; +import { Rule, RuleAction, RuleSystemAction } from '../../../../../common'; import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { BulkActionSkipResult } from '../../../../../common/bulk_edit'; import { RuleTypeRegistry } from '../../../../types'; @@ -505,7 +505,8 @@ async function updateRuleAttributesAndParamsInMemory( validateScheduleInterval(context, updatedRule.schedule.interval, ruleType.id, rule.id); const { modifiedParams: ruleParams, isParamsUpdateSkipped } = paramsModifier - ? await paramsModifier(updatedRule.params) + ? // TODO (http-versioning): Remove the cast when all rule types are fixed + await paramsModifier(updatedRule as Rule) : { modifiedParams: updatedRule.params, isParamsUpdateSkipped: true, diff --git a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/types/bulk_edit_rules_options.ts b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/types/bulk_edit_rules_options.ts index c099cde044363..7c30f6583865e 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/types/bulk_edit_rules_options.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/types/bulk_edit_rules_options.ts @@ -12,14 +12,15 @@ import { bulkEditOperationsSchema, bulkEditOperationSchema, } from '../schemas'; -import { RuleParams, RuleDomain, Rule } from '../../../types'; +import { RuleParams, RuleDomain } from '../../../types'; +import { Rule } from '../../../../../../common'; export type BulkEditRuleSnoozeSchedule = TypeOf; export type BulkEditOperation = TypeOf; export type BulkEditOperations = TypeOf; export type ParamsModifier = ( - params: Params + rule: Rule ) => Promise>; interface ParamsModifierResult { diff --git a/x-pack/plugins/alerting/server/routes/index.ts b/x-pack/plugins/alerting/server/routes/index.ts index c1fd477922fb9..cf32ddf503ad4 100644 --- a/x-pack/plugins/alerting/server/routes/index.ts +++ b/x-pack/plugins/alerting/server/routes/index.ts @@ -8,7 +8,7 @@ import { IRouter } from '@kbn/core/server'; import { UsageCounter } from '@kbn/usage-collection-plugin/server'; import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; -import type { ConfigSchema } from '@kbn/unified-search-plugin/config'; +import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config'; import { Observable } from 'rxjs'; import { GetAlertIndicesAlias, ILicenseState } from '../lib'; import { defineLegacyRoutes } from './legacy'; diff --git a/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_alerts.test.ts b/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_alerts.test.ts index fd6c014664121..205e90c5e8425 100644 --- a/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_alerts.test.ts +++ b/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_alerts.test.ts @@ -6,7 +6,7 @@ */ import { httpServerMock, httpServiceMock } from '@kbn/core-http-server-mocks'; -import type { ConfigSchema } from '@kbn/unified-search-plugin/config'; +import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config'; import { dataPluginMock } from '@kbn/unified-search-plugin/server/mocks'; import { termsAggSuggestions } from '@kbn/unified-search-plugin/server/autocomplete/terms_agg'; import { Observable } from 'rxjs'; diff --git a/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_alerts.ts b/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_alerts.ts index 47a603014a119..e2feb464ea6d2 100644 --- a/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_alerts.ts +++ b/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_alerts.ts @@ -10,7 +10,7 @@ import { IRouter } from '@kbn/core/server'; import { firstValueFrom, Observable } from 'rxjs'; import { getRequestAbortedSignal } from '@kbn/data-plugin/server'; import { termsAggSuggestions } from '@kbn/unified-search-plugin/server/autocomplete/terms_agg'; -import type { ConfigSchema } from '@kbn/unified-search-plugin/config'; +import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config'; import { UsageCounter } from '@kbn/usage-collection-plugin/server'; import { getKbnServerError, reportServerError } from '@kbn/kibana-utils-plugin/server'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; diff --git a/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_rules.test.ts b/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_rules.test.ts index e29f15bafa08a..42211d3a0f6e5 100644 --- a/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_rules.test.ts +++ b/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_rules.test.ts @@ -6,7 +6,7 @@ */ import { httpServerMock, httpServiceMock } from '@kbn/core-http-server-mocks'; -import type { ConfigSchema } from '@kbn/unified-search-plugin/config'; +import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config'; import { dataPluginMock } from '@kbn/unified-search-plugin/server/mocks'; import { termsAggSuggestions } from '@kbn/unified-search-plugin/server/autocomplete/terms_agg'; import { Observable } from 'rxjs'; diff --git a/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_rules.ts b/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_rules.ts index 6c34efb214c34..06e98b168f937 100644 --- a/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_rules.ts +++ b/x-pack/plugins/alerting/server/routes/suggestions/values_suggestion_rules.ts @@ -10,7 +10,7 @@ import { IRouter } from '@kbn/core/server'; import { firstValueFrom, Observable } from 'rxjs'; import { getRequestAbortedSignal } from '@kbn/data-plugin/server'; import { termsAggSuggestions } from '@kbn/unified-search-plugin/server/autocomplete/terms_agg'; -import type { ConfigSchema } from '@kbn/unified-search-plugin/config'; +import type { ConfigSchema } from '@kbn/unified-search-plugin/server/config'; import { UsageCounter } from '@kbn/usage-collection-plugin/server'; import { getKbnServerError, reportServerError } from '@kbn/kibana-utils-plugin/server'; import { ALERTING_CASES_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server/src/saved_objects_index_pattern'; diff --git a/x-pack/plugins/canvas/kibana.jsonc b/x-pack/plugins/canvas/kibana.jsonc index 1f6a3bf5554b4..f752f37443fef 100644 --- a/x-pack/plugins/canvas/kibana.jsonc +++ b/x-pack/plugins/canvas/kibana.jsonc @@ -12,7 +12,6 @@ "canvas" ], "requiredPlugins": [ - "bfetch", "charts", "data", "dataViews", diff --git a/x-pack/plugins/canvas/public/plugin.tsx b/x-pack/plugins/canvas/public/plugin.tsx index 495dea5873f95..5f385ce5f079b 100644 --- a/x-pack/plugins/canvas/public/plugin.tsx +++ b/x-pack/plugins/canvas/public/plugin.tsx @@ -27,7 +27,6 @@ import { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; import { EmbeddableStart } from '@kbn/embeddable-plugin/public'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import { Start as InspectorStart } from '@kbn/inspector-plugin/public'; -import { BfetchPublicSetup } from '@kbn/bfetch-plugin/public'; import { PresentationUtilPluginStart } from '@kbn/presentation-util-plugin/public'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { ContentManagementPublicStart } from '@kbn/content-management-plugin/public'; @@ -53,7 +52,6 @@ export interface CanvasSetupDeps { expressions: ExpressionsSetup; home?: HomePublicPluginSetup; usageCollection?: UsageCollectionSetup; - bfetch: BfetchPublicSetup; charts: ChartsPluginSetup; uiActions: UiActionsSetup; } diff --git a/x-pack/plugins/canvas/public/setup_expressions.ts b/x-pack/plugins/canvas/public/setup_expressions.ts index 655daef80f856..848fb9a12b0cd 100644 --- a/x-pack/plugins/canvas/public/setup_expressions.ts +++ b/x-pack/plugins/canvas/public/setup_expressions.ts @@ -21,7 +21,7 @@ export const setupExpressions = async ({ coreSetup: CoreSetup; setupPlugins: CanvasSetupDeps; }) => { - const { expressions, bfetch } = setupPlugins; + const { expressions } = setupPlugins; const loadServerFunctionWrappers = async () => { if (!cached) { @@ -29,7 +29,6 @@ export const setupExpressions = async ({ const serverFunctionList = await coreSetup.http.get(API_ROUTE_FUNCTIONS, { version: '1', }); - const batchedFunction = bfetch.batchedFunction({ url: API_ROUTE_FUNCTIONS }); const { serialize } = serializeProvider(expressions.getTypes()); // For every sever-side function, register a client-side @@ -43,7 +42,10 @@ export const setupExpressions = async ({ const fn = () => ({ ...serverFunctionList[functionName], fn: (input: any, args: any) => { - return batchedFunction({ functionName, args, context: serialize(input) }); + return coreSetup.http.post(API_ROUTE_FUNCTIONS, { + body: JSON.stringify({ functionName, args, context: serialize(input) }), + version: '1', + }); }, }); diff --git a/x-pack/plugins/canvas/server/plugin.ts b/x-pack/plugins/canvas/server/plugin.ts index 36a6fbbd0e3e2..074d29ec977f9 100644 --- a/x-pack/plugins/canvas/server/plugin.ts +++ b/x-pack/plugins/canvas/server/plugin.ts @@ -11,7 +11,6 @@ import { PluginStart as DataPluginStart, } from '@kbn/data-plugin/server'; import { ExpressionsServerSetup } from '@kbn/expressions-plugin/server'; -import { BfetchServerSetup } from '@kbn/bfetch-plugin/server'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import { HomeServerPluginSetup } from '@kbn/home-plugin/server'; import { EmbeddableSetup } from '@kbn/embeddable-plugin/server'; @@ -33,7 +32,6 @@ interface PluginsSetup { embeddable: EmbeddableSetup; features: FeaturesPluginSetup; home: HomeServerPluginSetup; - bfetch: BfetchServerSetup; data: DataPluginSetup; reporting?: ReportingServerPluginSetup; usageCollection?: UsageCollectionSetup; @@ -81,7 +79,6 @@ export class CanvasPlugin implements Plugin { initRoutes({ router: canvasRouter, expressions: expressionsSetup, - bfetch: plugins.bfetch, logger: this.logger, }); diff --git a/x-pack/plugins/canvas/server/routes/functions/functions.ts b/x-pack/plugins/canvas/server/routes/functions/functions.ts index 73036b35af05b..3a8ff207fa000 100644 --- a/x-pack/plugins/canvas/server/routes/functions/functions.ts +++ b/x-pack/plugins/canvas/server/routes/functions/functions.ts @@ -6,6 +6,7 @@ */ import { serializeProvider } from '@kbn/expressions-plugin/common'; +import { schema } from '@kbn/config-schema'; import { RouteInitializerDeps } from '..'; import { API_ROUTE_FUNCTIONS } from '../../../common/lib/constants'; @@ -32,7 +33,43 @@ export function initializeGetFunctionsRoute(deps: RouteInitializerDeps) { } export function initializeBatchFunctionsRoute(deps: RouteInitializerDeps) { - const { bfetch, expressions } = deps; + const { router, expressions } = deps; + router.versioned + .post({ + path: API_ROUTE_FUNCTIONS, + access: 'internal', + }) + .addVersion( + { + version: '1', + validate: { + request: { + body: schema.object({ + functionName: schema.string(), + args: schema.object({}, { unknowns: 'allow' }), + context: schema.object({}, { unknowns: 'allow' }), + }), + }, + }, + }, + async (context, request, response) => { + const handlers = { + environment: 'server', + }; + const fnCall: FunctionCall = { + functionName: request.body.functionName, + args: request.body.args, + context: request.body.context, + }; + const result = await runFunction(handlers, fnCall); + if (typeof result === 'undefined') { + throw new Error(`Function ${fnCall.functionName} did not return anything.`); + } + return response.ok({ + body: result, + }); + } + ); async function runFunction(handlers: { environment: string }, fnCall: FunctionCall) { const { functionName, args, context } = fnCall; @@ -46,23 +83,4 @@ export function initializeBatchFunctionsRoute(deps: RouteInitializerDeps) { return result; } - - /** - * Register an endpoint that executes a batch of functions, and streams the - * results back using ND-JSON. - */ - bfetch.addBatchProcessingRoute(API_ROUTE_FUNCTIONS, (request) => { - return { - onBatchItem: async (fnCall: FunctionCall) => { - const handlers = { - environment: 'server', - }; - const result = await runFunction(handlers, fnCall); - if (typeof result === 'undefined') { - throw new Error(`Function ${fnCall.functionName} did not return anything.`); - } - return result; - }, - }; - }); } diff --git a/x-pack/plugins/canvas/server/routes/index.ts b/x-pack/plugins/canvas/server/routes/index.ts index 9b2d712b17c5f..80dc1b56e3dba 100644 --- a/x-pack/plugins/canvas/server/routes/index.ts +++ b/x-pack/plugins/canvas/server/routes/index.ts @@ -7,7 +7,6 @@ import { IRouter, Logger } from '@kbn/core/server'; import { ExpressionsServerSetup } from '@kbn/expressions-plugin/server'; -import { BfetchServerSetup } from '@kbn/bfetch-plugin/server'; import { initCustomElementsRoutes } from './custom_elements'; import { initShareablesRoutes } from './shareables'; import { initWorkpadRoutes } from './workpad'; @@ -19,7 +18,6 @@ export interface RouteInitializerDeps { router: IRouter; logger: Logger; expressions: ExpressionsServerSetup; - bfetch: BfetchServerSetup; } export function initRoutes(deps: RouteInitializerDeps) { diff --git a/x-pack/plugins/canvas/server/routes/test_helpers.ts b/x-pack/plugins/canvas/server/routes/test_helpers.ts index 30d63576ed6f2..ded9076909cb9 100644 --- a/x-pack/plugins/canvas/server/routes/test_helpers.ts +++ b/x-pack/plugins/canvas/server/routes/test_helpers.ts @@ -10,13 +10,11 @@ import { loggingSystemMock, elasticsearchServiceMock, } from '@kbn/core/server/mocks'; -import { bfetchPluginMock } from '@kbn/bfetch-plugin/server/mocks'; import { expressionsPluginMock } from '@kbn/expressions-plugin/server/mocks'; export function getMockedRouterDeps() { const httpService = httpServiceMock.createSetupContract(); const elasticsearch = elasticsearchServiceMock.createSetup(); - const bfetch = bfetchPluginMock.createSetupContract(); const expressions = expressionsPluginMock.createSetupContract(); const router = httpService.createRouter(); @@ -24,7 +22,6 @@ export function getMockedRouterDeps() { router, expressions, elasticsearch, - bfetch, logger: loggingSystemMock.create().get(), }; } diff --git a/x-pack/plugins/canvas/tsconfig.json b/x-pack/plugins/canvas/tsconfig.json index 124d2c660e9fe..85121b72c868c 100644 --- a/x-pack/plugins/canvas/tsconfig.json +++ b/x-pack/plugins/canvas/tsconfig.json @@ -27,7 +27,6 @@ "kbn_references": [ { "path": "../../../src/setup_node_env/tsconfig.json" }, "@kbn/core", - "@kbn/bfetch-plugin", "@kbn/charts-plugin", "@kbn/data-plugin", "@kbn/share-plugin", diff --git a/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.test.tsx b/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.test.tsx index 60a19df11b04a..7ee2dc2796c28 100644 --- a/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.test.tsx +++ b/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.test.tsx @@ -460,4 +460,18 @@ describe('EditAssigneesSelectable', () => { ], }); }); + + it('renders even with no assignee set yet', async () => { + const selectedCases = [{ ...basicCase, assignees: [] }]; + const result = appMock.render( + + ); + + await waitFor(() => { + expect(result.getByTestId('cases-actions-assignees-edit-selectable')).toBeInTheDocument(); + }); + + expect(result.getByPlaceholderText('Find a user')).toBeInTheDocument(); + expect(result.getByText('Selected: 0')).toBeInTheDocument(); + }); }); diff --git a/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.tsx b/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.tsx index 0d4bd261647d1..52c9ab896f1cd 100644 --- a/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.tsx +++ b/x-pack/plugins/cases/public/components/actions/assignees/edit_assignees_selectable.tsx @@ -79,7 +79,7 @@ const EditAssigneesSelectableComponent: React.FC = ({ [selectedCases] ); - const { data, isLoading: isLoadingUserProfiles } = useBulkGetUserProfiles({ + const { data, isFetching: isLoadingUserProfiles } = useBulkGetUserProfiles({ uids: Array.from(assignees.values()), }); diff --git a/x-pack/plugins/cloud_security_posture/common/types/benchmarks/v2.ts b/x-pack/plugins/cloud_security_posture/common/types/benchmarks/v2.ts index efcdd38f4e9b3..d0619d4a72dde 100644 --- a/x-pack/plugins/cloud_security_posture/common/types/benchmarks/v2.ts +++ b/x-pack/plugins/cloud_security_posture/common/types/benchmarks/v2.ts @@ -7,12 +7,11 @@ // Optionally, re-export the entire set of types. Interfaces and types declared after this will override v1 declarations. import { schema } from '@kbn/config-schema'; +import type { BenchmarksCisId } from '@kbn/cloud-security-posture-common'; import type { BenchmarkScore } from './v1'; export type { BenchmarkScore } from './v1'; -export type BenchmarksCisId = 'cis_k8s' | 'cis_azure' | 'cis_aws' | 'cis_eks' | 'cis_gcp'; - export interface Benchmark { id: BenchmarksCisId; name: string; diff --git a/x-pack/plugins/cloud_security_posture/common/types/index.ts b/x-pack/plugins/cloud_security_posture/common/types/index.ts index c59071d114251..144a2d2e9afda 100644 --- a/x-pack/plugins/cloud_security_posture/common/types/index.ts +++ b/x-pack/plugins/cloud_security_posture/common/types/index.ts @@ -5,22 +5,8 @@ * 2.0. */ -export * as rulesV1 from './rules/v1'; -export * as rulesV2 from './rules/v2'; -export * as rulesV3 from './rules/v3'; -export * as rulesV4 from './rules/v4'; -export * as rulesV5 from './rules/v5'; - export * as benchmarkV1 from './benchmarks/v1'; export * as benchmarkV2 from './benchmarks/v2'; // Explicit export of everything from latest -export type { - CspBenchmarkRule, - FindCspBenchmarkRuleRequest, - FindCspBenchmarkRuleResponse, - BenchmarkScore, - Benchmark, - GetBenchmarkResponse, - BenchmarkRuleSelectParams, -} from './latest'; +export type { BenchmarkScore, Benchmark, GetBenchmarkResponse } from './latest'; diff --git a/x-pack/plugins/cloud_security_posture/common/types/latest.ts b/x-pack/plugins/cloud_security_posture/common/types/latest.ts index 32006fe5b5aef..7844ef6e36f18 100644 --- a/x-pack/plugins/cloud_security_posture/common/types/latest.ts +++ b/x-pack/plugins/cloud_security_posture/common/types/latest.ts @@ -5,5 +5,4 @@ * 2.0. */ -export * from './rules/v5'; export * from './benchmarks/v2'; diff --git a/x-pack/plugins/cloud_security_posture/common/types_old.ts b/x-pack/plugins/cloud_security_posture/common/types_old.ts index b5e399e4e639c..c6531605bc328 100644 --- a/x-pack/plugins/cloud_security_posture/common/types_old.ts +++ b/x-pack/plugins/cloud_security_posture/common/types_old.ts @@ -5,7 +5,7 @@ * 2.0. */ import { type TypeOf } from '@kbn/config-schema'; -import type { CspBenchmarkRuleMetadata } from '@kbn/cloud-security-posture-common'; +import type { CspBenchmarkRuleMetadata } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import type { CspFinding } from '@kbn/cloud-security-posture-common'; import { SUPPORTED_CLOUDBEAT_INPUTS, SUPPORTED_POLICY_TEMPLATES } from './constants'; diff --git a/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts b/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts index fa514fe0fc2a5..2e859ae314cb1 100644 --- a/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts +++ b/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { CspBenchmarkRuleMetadata } from '@kbn/cloud-security-posture-common'; +import type { CspBenchmarkRuleMetadata } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { convertRuleTagsToMatchAllKQL, convertRuleTagsToMatchAnyKQL, diff --git a/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.ts b/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.ts index 4ae8385290955..ae888cde81c28 100644 --- a/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.ts +++ b/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { CspBenchmarkRuleMetadata } from '@kbn/cloud-security-posture-common'; +import type { CspBenchmarkRuleMetadata } from '@kbn/cloud-security-posture-common/schema/rules/latest'; const CSP_RULE_TAG = 'Cloud Security'; const CSP_RULE_TAG_USE_CASE = 'Use Case: Configuration Audit'; diff --git a/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts b/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts index 950803c2c65c9..90e11734d72c6 100644 --- a/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts +++ b/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts @@ -6,7 +6,7 @@ */ import { Truthy } from 'lodash'; -import type { BaseCspSetupStatus } from '@kbn/cloud-security-posture-common'; +import type { BaseCspSetupStatus, BenchmarksCisId } from '@kbn/cloud-security-posture-common'; import { NewPackagePolicy, NewPackagePolicyInput, @@ -15,6 +15,8 @@ import { PackagePolicyInput, UpdatePackagePolicy, } from '@kbn/fleet-plugin/common'; +import type { BenchmarkRuleSelectParams } from '@kbn/cloud-security-posture-common/schema/rules/latest'; +import type { BenchmarkRuleSelectParams as BenchmarkRuleSelectParamsV4 } from '@kbn/cloud-security-posture-common/schema/rules/v4'; import { CLOUD_SECURITY_POSTURE_PACKAGE_NAME, CLOUDBEAT_VANILLA, @@ -31,8 +33,6 @@ import type { AzureCredentialsType, RuleSection, } from '../types_old'; -import type { BenchmarkRuleSelectParams, BenchmarksCisId } from '../types/latest'; -import type { BenchmarkRuleSelectParams as BenchmarkRuleSelectParamsV1 } from '../types/rules/v4'; /** * @example @@ -44,13 +44,6 @@ export const isNonNullable = (v: T): v is NonNullable => export const truthy = (value: T): value is Truthy => !!value; -export const extractErrorMessage = (e: unknown, defaultMessage = 'Unknown Error'): string => { - if (e instanceof Error) return e.message; - if (typeof e === 'string') return e; - - return defaultMessage; // TODO: i18n -}; - export const getBenchmarkFilter = (type: BenchmarkId, section?: RuleSection): string => `${CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE}.attributes.metadata.benchmark.id: "${type}"${ section @@ -236,7 +229,7 @@ export const getCloudProviderNameFromAbbreviation = (cloudProvider: string) => { export const getBenchmarkFilterQuery = ( benchmarkId: BenchmarkId, benchmarkVersion?: string, - selectParams?: BenchmarkRuleSelectParamsV1 + selectParams?: BenchmarkRuleSelectParamsV4 ): string => { const baseQuery = `${CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE}.attributes.metadata.benchmark.id:${benchmarkId} AND ${CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE}.attributes.metadata.benchmark.version:"v${benchmarkVersion}"`; const sectionQuery = selectParams?.section diff --git a/x-pack/plugins/cloud_security_posture/common/utils/rules_states.ts b/x-pack/plugins/cloud_security_posture/common/utils/rules_states.ts index 9a142729e410b..e2351d3ddcaa9 100644 --- a/x-pack/plugins/cloud_security_posture/common/utils/rules_states.ts +++ b/x-pack/plugins/cloud_security_posture/common/utils/rules_states.ts @@ -4,31 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { QueryDslQueryContainer } from '@kbn/data-views-plugin/common/types'; -import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common'; - -export const buildMutedRulesFilter = ( - rulesStates: CspBenchmarkRulesStates -): QueryDslQueryContainer[] => { - const mutedRules = Object.fromEntries( - Object.entries(rulesStates).filter(([key, value]) => value.muted === true) - ); - - const mutedRulesFilterQuery = Object.keys(mutedRules).map((key) => { - const rule = mutedRules[key]; - return { - bool: { - must: [ - { term: { 'rule.benchmark.id': rule.benchmark_id } }, - { term: { 'rule.benchmark.version': rule.benchmark_version } }, - { term: { 'rule.benchmark.rule_number': rule.rule_number } }, - ], - }, - }; - }); - - return mutedRulesFilterQuery; -}; export const buildRuleKey = (benchmarkId: string, benchmarkVersion: string, ruleNumber: string) => { return `${benchmarkId};${benchmarkVersion};${ruleNumber}`; diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts index 6207885b60ab0..af488c4bb81b3 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts @@ -7,8 +7,8 @@ import { useBenchmarkDynamicValues } from './use_benchmark_dynamic_values'; import { renderHook } from '@testing-library/react-hooks/dom'; +import type { BenchmarksCisId } from '@kbn/cloud-security-posture-common'; import { useCspIntegrationLink } from '../navigation/use_csp_integration_link'; -import { BenchmarksCisId } from '../../../common/types/benchmarks/v2'; jest.mock('../navigation/use_csp_integration_link'); diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.ts b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.ts index 7f9a2b5fd35f6..7540b96797a18 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.ts @@ -7,8 +7,8 @@ import { i18n } from '@kbn/i18n'; import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '@kbn/cloud-security-posture-common'; +import type { BenchmarksCisId } from '@kbn/cloud-security-posture-common'; import { useCspIntegrationLink } from '../navigation/use_csp_integration_link'; -import { BenchmarksCisId } from '../../../common/types/benchmarks/v2'; type BenchmarkDynamicNames = | { diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx index 22fc6b4ae65f8..9e2275c62e31c 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx @@ -24,7 +24,7 @@ import { NoDataPage } from '@kbn/kibana-react-plugin/public'; const chance = new Chance(); -jest.mock('../common/api/use_setup_status_api'); +jest.mock('@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'); jest.mock('../common/api/use_license_management_locator_api'); jest.mock('../common/hooks/use_is_subscription_status_valid'); jest.mock('../common/navigation/use_csp_integration_link'); 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 7590e998cd0c2..d62f86651f93f 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 @@ -39,7 +39,7 @@ import { } from '../../../common/constants'; import { useParams } from 'react-router-dom'; import { createReactQueryResponse } from '../../test/fixtures/react_query'; -import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { usePackagePolicyList } from '../../common/api/use_package_policy_list'; import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl'; import { @@ -67,7 +67,7 @@ jest.mock('react-router-dom', () => ({ integration: undefined, }), })); -jest.mock('../../common/api/use_setup_status_api'); +jest.mock('@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'); jest.mock('../../common/api/use_package_policy_list'); jest.mock('../../common/hooks/use_is_subscription_status_valid'); jest.mock('../../common/api/use_license_management_locator_api'); diff --git a/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.tsx b/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.tsx index 096c6f0e8aae5..9c8f2da45f8e8 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.tsx @@ -22,6 +22,7 @@ import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '@kbn/cloud-security-posture-common'; import type { IndexDetails, CspStatusCode } from '@kbn/cloud-security-posture-common'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { FullSizeCenteredPage } from '../full_size_centered_page'; import { useCISIntegrationPoliciesLink } from '../../common/navigation/use_navigate_to_cis_integration_policies'; import { @@ -30,7 +31,6 @@ import { NO_FINDINGS_STATUS_TEST_SUBJ, } from '../test_subjects'; import { CloudPosturePage, PACKAGE_NOT_INSTALLED_TEST_SUBJECT } from '../cloud_posture_page'; -import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; import type { PostureTypes } from '../../../common/types_old'; import noDataIllustration from '../../assets/illustrations/no_data_illustration.svg'; import { useCspIntegrationLink } from '../../common/navigation/use_csp_integration_link'; 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 a15cf0aacd6fa..074e75915a5b7 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 @@ -22,10 +22,10 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; import type { IndexDetails } from '@kbn/cloud-security-posture-common'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { VULN_MGMT_POLICY_TEMPLATE } from '../../common/constants'; import { FullSizeCenteredPage } from './full_size_centered_page'; import { CloudPosturePage } from './cloud_posture_page'; -import { useCspSetupStatusApi } from '../common/api/use_setup_status_api'; import { NO_VULNERABILITIES_STATUS_TEST_SUBJ, CNVM_NOT_INSTALLED_ACTION_SUBJ, diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx index f625470fb08c5..e11095bb622f0 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx @@ -14,13 +14,13 @@ import { TestProvider } from '../../test/test_provider'; import { Benchmarks } from './benchmarks'; import * as TEST_SUBJ from './test_subjects'; import { useCspBenchmarkIntegrationsV2 } from './use_csp_benchmark_integrations'; -import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { useCspIntegrationLink } from '../../common/navigation/use_csp_integration_link'; import { ERROR_STATE_TEST_SUBJECT } from './benchmarks_table'; import { useLicenseManagementLocatorApi } from '../../common/api/use_license_management_locator_api'; jest.mock('./use_csp_benchmark_integrations'); -jest.mock('../../common/api/use_setup_status_api'); +jest.mock('@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'); jest.mock('../../common/api/use_license_management_locator_api'); jest.mock('../../common/hooks/use_is_subscription_status_valid'); jest.mock('../../common/navigation/use_csp_integration_link'); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx index 13b4750317810..dd6b8ce45318b 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx @@ -21,6 +21,8 @@ import { FormattedMessage } from '@kbn/i18n-react'; import useDebounce from 'react-use/lib/useDebounce'; import { i18n } from '@kbn/i18n'; import { pagePathGetters } from '@kbn/fleet-plugin/public'; +import { extractErrorMessage } from '@kbn/cloud-security-posture-common'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { CLOUD_SECURITY_POSTURE_PACKAGE_NAME } from '../../../common/constants'; import { CloudPosturePageTitle } from '../../components/cloud_posture_page_title'; import { CloudPosturePage } from '../../components/cloud_posture_page'; @@ -29,7 +31,7 @@ import { useCspBenchmarkIntegrationsV2, UseCspBenchmarkIntegrationsProps, } from './use_csp_benchmark_integrations'; -import { extractErrorMessage, getBenchmarkCisName } from '../../../common/utils/helpers'; +import { getBenchmarkCisName } from '../../../common/utils/helpers'; import * as TEST_SUBJ from './test_subjects'; import { LOCAL_STORAGE_PAGE_SIZE_BENCHMARK_KEY, @@ -37,7 +39,6 @@ import { } from '../../common/constants'; import { usePageSize } from '../../common/hooks/use_page_size'; import { useKibana } from '../../common/hooks/use_kibana'; -import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; import { NoFindingsStates } from '../../components/no_findings_states'; const SEARCH_DEBOUNCE_MS = 300; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.tsx b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.tsx index 2da4cc06ddd5d..ea08ce0398146 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.tsx @@ -21,9 +21,10 @@ import React, { useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { generatePath } from 'react-router-dom'; +import type { BenchmarksCisId } from '@kbn/cloud-security-posture-common'; import { FINDINGS_GROUPING_OPTIONS } from '../../common/constants'; import { useNavigateFindings } from '../../common/hooks/use_navigate_findings'; -import type { BenchmarkScore, Benchmark, BenchmarksCisId } from '../../../common/types/latest'; +import type { BenchmarkScore, Benchmark } from '../../../common/types/latest'; import * as TEST_SUBJ from './test_subjects'; import { isCommonError } from '../../components/cloud_posture_page'; import { FullSizeCenteredPage } from '../../components/full_size_centered_page'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx index 46b0e59612083..11d7a71118eae 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx @@ -12,7 +12,7 @@ import type { BaseCspSetupStatus, CspStatusCode } from '@kbn/cloud-security-post import { render, screen } from '@testing-library/react'; import { TestProvider } from '../../test/test_provider'; import { ComplianceDashboard, getDefaultTab } from '.'; -import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { useLicenseManagementLocatorApi } from '../../common/api/use_license_management_locator_api'; import { useKspmStatsApi, useCspmStatsApi } from '../../common/api/use_stats_api'; import { @@ -36,7 +36,7 @@ import { ComplianceDashboardDataV2 } from '../../../common/types_old'; import { cloudPosturePages } from '../../common/navigation/constants'; import { MemoryRouter } from 'react-router-dom'; -jest.mock('../../common/api/use_setup_status_api'); +jest.mock('@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'); jest.mock('../../common/api/use_stats_api'); jest.mock('../../common/api/use_license_management_locator_api'); jest.mock('../../common/hooks/use_is_subscription_status_valid'); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.tsx b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.tsx index 1629a000d5e64..16037fa204766 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.tsx @@ -15,6 +15,7 @@ import { Route, Routes } from '@kbn/shared-ux-router'; import { Redirect, useHistory, useLocation } from 'react-router-dom'; import { CSPM_POLICY_TEMPLATE, KSPM_POLICY_TEMPLATE } from '@kbn/cloud-security-posture-common'; import type { BaseCspSetupStatus } from '@kbn/cloud-security-posture-common'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { NO_FINDINGS_STATUS_TEST_SUBJ } from '../../components/test_subjects'; import { useCspIntegrationLink } from '../../common/navigation/use_csp_integration_link'; import type { PosturePolicyTemplate, ComplianceDashboardDataV2 } from '../../../common/types_old'; @@ -35,7 +36,6 @@ import { CLOUD_POSTURE_DASHBOARD_PAGE_HEADER, } from './test_subjects'; import { useCspmStatsApi, useKspmStatsApi } from '../../common/api/use_stats_api'; -import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; import { NoFindingsStates } from '../../components/no_findings_states'; import { SummarySection } from './dashboard_sections/summary_section'; import { BenchmarksSection } from './dashboard_sections/benchmarks_section'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.tsx b/x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.tsx index f17a8039db885..3f088e799239b 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.tsx @@ -8,8 +8,8 @@ import React from 'react'; import { Redirect, useLocation } from 'react-router-dom'; import { Routes, Route } from '@kbn/shared-ux-router'; import { TrackApplicationView } from '@kbn/usage-collection-plugin/public'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { CDR_MISCONFIGURATIONS_DATA_VIEW_ID_PREFIX } from '../../../common/constants'; -import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; import { NoFindingsStates } from '../../components/no_findings_states'; import { CloudPosturePage, defaultLoadingRenderer } from '../../components/cloud_posture_page'; import { useDataView } from '../../common/api/use_data_view'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx index 532998f0f712f..75234c0495f51 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx @@ -11,8 +11,8 @@ import { GenericBuckets, GroupingQuery, RootAggregation } from '@kbn/grouping/sr import { useQuery } from '@tanstack/react-query'; import { lastValueFrom } from 'rxjs'; import { CDR_MISCONFIGURATIONS_INDEX_PATTERN } from '@kbn/cloud-security-posture-common'; +import { showErrorToast } from '@kbn/cloud-security-posture'; import { useKibana } from '../../../common/hooks/use_kibana'; -import { showErrorToast } from '../../../common/utils/show_error_toast'; // Elasticsearch returns `null` when a sub-aggregation cannot be computed type NumberOrNull = number | null; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts index 5a77337ba171c..f8cd0238ef0bb 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts @@ -11,18 +11,18 @@ import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-ty import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { buildDataTableRecord } from '@kbn/discover-utils'; import { EsHitRecord } from '@kbn/discover-utils/types'; -import { MAX_FINDINGS_TO_LOAD } from '@kbn/cloud-security-posture-common'; +import { showErrorToast } from '@kbn/cloud-security-posture'; +import { MAX_FINDINGS_TO_LOAD, buildMutedRulesFilter } from '@kbn/cloud-security-posture-common'; import { CDR_MISCONFIGURATIONS_INDEX_PATTERN, LATEST_FINDINGS_RETENTION_POLICY, } from '@kbn/cloud-security-posture-common'; -import type { CspBenchmarkRulesStates, CspFinding } from '@kbn/cloud-security-posture-common'; +import type { CspFinding } from '@kbn/cloud-security-posture-common'; +import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import type { FindingsBaseEsQuery } from '@kbn/cloud-security-posture'; +import { useGetCspBenchmarkRulesStatesApi } from '@kbn/cloud-security-posture/src/hooks/use_get_benchmark_rules_state_api'; import { useKibana } from '../../../common/hooks/use_kibana'; import { getAggregationCount, getFindingsCountAggQuery } from '../utils/utils'; -import { showErrorToast } from '../../../common/utils/show_error_toast'; -import { useGetCspBenchmarkRulesStatesApi } from './use_get_benchmark_rules_state_api'; -import { buildMutedRulesFilter } from '../../../../common/utils/rules_states'; interface UseFindingsOptions extends FindingsBaseEsQuery { sort: string[][]; 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 d94f063933b0e..cc409fb95024d 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 @@ -15,7 +15,11 @@ import { } from '@kbn/grouping/src'; import { useMemo } from 'react'; import { buildEsQuery, Filter } from '@kbn/es-query'; -import { LATEST_FINDINGS_RETENTION_POLICY } from '@kbn/cloud-security-posture-common'; +import { + LATEST_FINDINGS_RETENTION_POLICY, + buildMutedRulesFilter, +} from '@kbn/cloud-security-posture-common'; +import { useGetCspBenchmarkRulesStatesApi } from '@kbn/cloud-security-posture/src/hooks/use_get_benchmark_rules_state_api'; import { FINDINGS_GROUPING_OPTIONS, LOCAL_STORAGE_FINDINGS_GROUPING_KEY, @@ -36,8 +40,6 @@ import { } from './constants'; import { useCloudSecurityGrouping } from '../../../components/cloud_security_grouping'; import { getFilters } from '../utils/get_filters'; -import { useGetCspBenchmarkRulesStatesApi } from './use_get_benchmark_rules_state_api'; -import { buildMutedRulesFilter } from '../../../../common/utils/rules_states'; const getTermAggregation = (key: keyof FindingsGroupingAggregation, field: string) => ({ [key]: { diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/create_detection_rule_from_benchmark.ts b/x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/create_detection_rule_from_benchmark.ts index 289c6c2cb153f..0ce1b7d09e897 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/create_detection_rule_from_benchmark.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/create_detection_rule_from_benchmark.ts @@ -7,7 +7,7 @@ import { HttpSetup } from '@kbn/core/public'; import { LATEST_FINDINGS_RETENTION_POLICY } from '@kbn/cloud-security-posture-common'; -import { CspBenchmarkRule } from '../../../../common/types/latest'; +import type { CspBenchmarkRule } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { FINDINGS_INDEX_PATTERN } from '../../../../common/constants'; import { createDetectionRule } from '../../../common/api/create_detection_rule'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx index f8d91d5250234..b3995e405ba73 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx @@ -10,11 +10,11 @@ import { EuiSpacer, EuiTab, EuiTabs, EuiTitle } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { Redirect, useHistory, useLocation, matchPath } from 'react-router-dom'; import { Routes, Route } from '@kbn/shared-ux-router'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { Configurations } from '../configurations'; import { cloudPosturePages, findingsNavigation } from '../../common/navigation/constants'; import { LOCAL_STORAGE_FINDINGS_LAST_SELECTED_TAB_KEY } from '../../common/constants'; import { VULNERABILITIES_INDEX_NAME, FINDINGS_INDEX_NAME } from '../../../common/constants'; -import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; import { getStatusForIndexName } from '../../../common/utils/helpers'; import { Vulnerabilities } from '../vulnerabilities'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/index.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/index.tsx index 365af617b7f28..f404b6a82d215 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/index.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/index.tsx @@ -10,6 +10,7 @@ import { generatePath, Link, type RouteComponentProps } from 'react-router-dom'; import { EuiButtonEmpty, EuiFlexGroup, EuiPageHeader, EuiSpacer, EuiFlexItem } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; +import type { PageUrlParams } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { CloudPosturePageTitle } from '../../components/cloud_posture_page_title'; import { RulesContainer } from './rules_container'; import { cloudPosturePages } from '../../common/navigation/constants'; @@ -18,7 +19,6 @@ import { useSecuritySolutionContext } from '../../application/security_solution_ import { useCspBenchmarkIntegrationsV2 } from '../benchmarks/use_csp_benchmark_integrations'; import { CISBenchmarkIcon } from '../../components/cis_benchmark_icon'; import { getBenchmarkCisName } from '../../../common/utils/helpers'; -import { PageUrlParams } from '../../../common/types/latest'; export const Rules = ({ match: { params } }: RouteComponentProps) => { const benchmarksInfo = useCspBenchmarkIntegrationsV2(); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx index 642aff1ef267d..ff427e7809454 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx @@ -12,16 +12,16 @@ import { render, screen } from '@testing-library/react'; import { QueryClient } from '@tanstack/react-query'; import { TestProvider } from '../../test/test_provider'; import { type RouteComponentProps } from 'react-router-dom'; -import { PageUrlParams } from '../../../common/types/latest'; +import type { PageUrlParams } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { createReactQueryResponse } from '../../test/fixtures/react_query'; import { coreMock } from '@kbn/core/public/mocks'; -import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { useCspIntegrationLink } from '../../common/navigation/use_csp_integration_link'; import { useLicenseManagementLocatorApi } from '../../common/api/use_license_management_locator_api'; import { useCspBenchmarkIntegrationsV2 } from '../benchmarks/use_csp_benchmark_integrations'; import * as TEST_SUBJECTS from './test_subjects'; -jest.mock('../../common/api/use_setup_status_api'); +jest.mock('@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'); jest.mock('../../common/api/use_license_management_locator_api'); jest.mock('../../common/hooks/use_is_subscription_status_valid'); jest.mock('../../common/navigation/use_csp_integration_link'); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx index d81b834f9c933..4718dbae911ae 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx @@ -13,7 +13,7 @@ import { useFindCspBenchmarkRule } from './use_csp_benchmark_rules'; import * as TEST_SUBJECTS from './test_subjects'; import { Chance } from 'chance'; import { TestProvider } from '../../test/test_provider'; -import type { CspBenchmarkRule } from '../../../common/types/latest'; +import type { CspBenchmarkRule } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { useParams } from 'react-router-dom'; import { coreMock } from '@kbn/core/public/mocks'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx index c134e405f8a3c..1b1af9aab4292 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx @@ -8,9 +8,14 @@ import React, { useState, useMemo, useEffect } from 'react'; import compareVersions from 'compare-versions'; import { EuiSpacer } from '@elastic/eui'; import { useParams, useHistory, generatePath } from 'react-router-dom'; +import type { + CspBenchmarkRule, + PageUrlParams, + RuleStateAttributes, +} from '@kbn/cloud-security-posture-common/schema/rules/latest'; +import { extractErrorMessage } from '@kbn/cloud-security-posture-common'; import { benchmarksNavigation } from '../../common/navigation/constants'; import { buildRuleKey } from '../../../common/utils/rules_states'; -import { extractErrorMessage } from '../../../common/utils/helpers'; import { RulesTable } from './rules_table'; import { RulesTableHeader } from './rules_table_header'; import { useFindCspBenchmarkRule, type RulesQuery } from './use_csp_benchmark_rules'; @@ -18,11 +23,6 @@ import * as TEST_SUBJECTS from './test_subjects'; import { RuleFlyout } from './rules_flyout'; import { LOCAL_STORAGE_PAGE_SIZE_RULES_KEY } from '../../common/constants'; import { usePageSize } from '../../common/hooks/use_page_size'; -import type { - CspBenchmarkRule, - PageUrlParams, - RuleStateAttributes, -} from '../../../common/types/latest'; import { useCspGetRulesStates } from './use_csp_rules_state'; import { RulesCounters } from './rules_counters'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_detection_rule_counter.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_detection_rule_counter.tsx index b47b55149743c..70d1d951b50b5 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_detection_rule_counter.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_detection_rule_counter.tsx @@ -7,7 +7,7 @@ import type { HttpSetup } from '@kbn/core/public'; import React from 'react'; -import { CspBenchmarkRule } from '../../../common/types/latest'; +import type { CspBenchmarkRule } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { getFindingsDetectionRuleSearchTags } from '../../../common/utils/detection_rules'; import { DetectionRuleCounter } from '../../components/detection_rule_counter'; import { createDetectionRuleFromBenchmarkRule } from '../configurations/utils/create_detection_rule_from_benchmark'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_flyout.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_flyout.tsx index 0bafc004a5e11..7447d82d251ee 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_flyout.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_flyout.tsx @@ -23,7 +23,7 @@ import { import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { HttpSetup } from '@kbn/core/public'; -import type { CspBenchmarkRuleMetadata } from '@kbn/cloud-security-posture-common'; +import type { CspBenchmarkRuleMetadata } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { getRuleList } from '../configurations/findings_flyout/rule_tab'; import { getRemediationList } from '../configurations/findings_flyout/overview_tab'; import * as TEST_SUBJECTS from './test_subjects'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx index cd205bb7f6b7b..6c28df502e5fc 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx @@ -8,6 +8,7 @@ import React from 'react'; import { act, renderHook } from '@testing-library/react-hooks'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { useKibana } from '@kbn/kibana-react-plugin/public'; +import type { RuleStateAttributes } from '@kbn/cloud-security-posture-common/schema/rules/v4'; import { useChangeCspRuleState, createRulesWithUpdatedState, @@ -17,7 +18,6 @@ import { CSP_RULES_STATES_QUERY_KEY } from './use_csp_rules_state'; import { BENCHMARK_INTEGRATION_QUERY_KEY_V2 } from '../benchmarks/use_csp_benchmark_integrations'; import { CSPM_STATS_QUERY_KEY, KSPM_STATS_QUERY_KEY } from '../../common/api'; import { CSP_BENCHMARK_RULES_BULK_ACTION_ROUTE_PATH } from '../../../common/constants'; -import { RuleStateAttributes } from '../../../common/types/rules/v4'; const initialRules = { rule_1: { diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.tsx index 9b616062b0050..e570603636942 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.tsx @@ -10,13 +10,13 @@ import { toMountPoint } from '@kbn/react-kibana-mount'; import { EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n as kbnI18n } from '@kbn/i18n'; +import type { + CspBenchmarkRulesBulkActionResponse, + RuleStateAttributes, +} from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { CSP_RULES_STATES_QUERY_KEY } from './use_csp_rules_state'; import { CSPM_STATS_QUERY_KEY, KSPM_STATS_QUERY_KEY } from '../../common/api'; import { BENCHMARK_INTEGRATION_QUERY_KEY_V2 } from '../benchmarks/use_csp_benchmark_integrations'; -import { - CspBenchmarkRulesBulkActionResponse, - RuleStateAttributes, -} from '../../../common/types/latest'; import { CSP_BENCHMARK_RULES_BULK_ACTION_ROUTE_PATH } from '../../../common/constants'; import { CloudSecurityPostureStartServices } from '../../types'; import { useKibana } from '../../common/hooks/use_kibana'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_benchmark_rules.ts b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_benchmark_rules.ts index fd8c5bf794935..8c62485bf4a8c 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_benchmark_rules.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_benchmark_rules.ts @@ -8,7 +8,7 @@ import { useQuery } from '@tanstack/react-query'; import { FindCspBenchmarkRuleRequest, FindCspBenchmarkRuleResponse, -} from '../../../common/types/latest'; +} from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { useKibana } from '../../common/hooks/use_kibana'; import { diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules_state.ts b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules_state.ts index 640dc92274481..e6535d90006e4 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules_state.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules_state.ts @@ -7,7 +7,7 @@ import { useQuery } from '@tanstack/react-query'; import { CSP_GET_BENCHMARK_RULES_STATE_ROUTE_PATH } from '@kbn/cloud-security-posture-common'; -import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common'; +import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { useKibana } from '../../common/hooks/use_kibana'; export const CSP_RULES_STATES_QUERY_KEY = ['csp_rules_states_v1']; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx index 79cb2aad7e60e..50e712612302b 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx @@ -10,9 +10,9 @@ import type { IKibanaSearchResponse } from '@kbn/search-types'; import { GenericBuckets, GroupingQuery, RootAggregation } from '@kbn/grouping/src'; import { useQuery } from '@tanstack/react-query'; import { lastValueFrom } from 'rxjs'; +import { showErrorToast } from '@kbn/cloud-security-posture'; import { LATEST_VULNERABILITIES_INDEX_PATTERN } from '../../../../common/constants'; import { useKibana } from '../../../common/hooks/use_kibana'; -import { showErrorToast } from '../../../common/utils/show_error_toast'; // Elasticsearch returns `null` when a sub-aggregation cannot be computed type NumberOrNull = number | null; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx index 3b1d3a156f305..aa1603fc9e985 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx @@ -17,7 +17,7 @@ import { import { buildDataTableRecord } from '@kbn/discover-utils'; import { EsHitRecord } from '@kbn/discover-utils/types'; import { MAX_FINDINGS_TO_LOAD } from '@kbn/cloud-security-posture-common'; -import { FindingsBaseEsQuery } from '@kbn/cloud-security-posture'; +import { FindingsBaseEsQuery, showErrorToast } from '@kbn/cloud-security-posture'; import { VULNERABILITY_FIELDS } from '../../../common/constants'; import { CspVulnerabilityFinding } from '../../../../common/schemas'; import { @@ -25,7 +25,6 @@ import { LATEST_VULNERABILITIES_RETENTION_POLICY, } from '../../../../common/constants'; import { useKibana } from '../../../common/hooks/use_kibana'; -import { showErrorToast } from '../../../common/utils/show_error_toast'; import { getCaseInsensitiveSortScript } from '../utils/custom_sort_script'; type LatestFindingsRequest = IKibanaSearchRequest; type LatestFindingsResponse = IKibanaSearchResponse< diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities.tsx index 5940b022a0b90..6d3b2e5cf1b77 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities.tsx @@ -6,9 +6,9 @@ */ import React from 'react'; import { Routes, Route } from '@kbn/shared-ux-router'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { CDR_VULNERABILITIES_DATA_VIEW_ID_PREFIX } from '../../../common/constants'; import { NoVulnerabilitiesStates } from '../../components/no_vulnerabilities_states'; -import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; import { CloudPosturePage } from '../../components/cloud_posture_page'; import { findingsNavigation } from '../../common/navigation/constants'; import { useDataView } from '../../common/api/use_data_view'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx index c9e13c15613a5..59fa1cfa0ef92 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx @@ -12,7 +12,7 @@ import { LATEST_VULNERABILITIES_INDEX_DEFAULT_NS, VULN_MGMT_POLICY_TEMPLATE, } from '../../../common/constants'; -import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { useDataView } from '../../common/api/use_data_view'; import { createReactQueryResponse } from '../../test/fixtures/react_query'; import { useCISIntegrationPoliciesLink } from '../../common/navigation/use_navigate_to_cis_integration_policies'; @@ -28,7 +28,7 @@ import { useLicenseManagementLocatorApi } from '../../common/api/use_license_man import { createStubDataView } from '@kbn/data-views-plugin/common/stubs'; jest.mock('../../common/api/use_data_view'); -jest.mock('../../common/api/use_setup_status_api'); +jest.mock('@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'); jest.mock('../../common/api/use_license_management_locator_api'); jest.mock('../../common/hooks/use_is_subscription_status_valid'); jest.mock('../../common/navigation/use_navigate_to_cis_integration_policies'); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx index 6203adbb11d28..0d477ef77d831 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx @@ -14,7 +14,7 @@ import { } from '../../../common/constants'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; import { discoverPluginMock } from '@kbn/discover-plugin/public/mocks'; -import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { createReactQueryResponse } from '../../test/fixtures/react_query'; import { useCISIntegrationPoliciesLink } from '../../common/navigation/use_navigate_to_cis_integration_policies'; import { useCspIntegrationLink } from '../../common/navigation/use_csp_integration_link'; @@ -32,7 +32,7 @@ import { useVulnerabilityDashboardApi } from '../../common/api/use_vulnerability import { mockCnvmDashboardData } from './_mocks_/vulnerability_dashboard.mock'; jest.mock('../../common/api/use_data_view'); -jest.mock('../../common/api/use_setup_status_api'); +jest.mock('@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'); jest.mock('../../common/api/use_license_management_locator_api'); jest.mock('../../common/hooks/use_is_subscription_status_valid'); jest.mock('../../common/navigation/use_navigate_to_cis_integration_policies'); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.tsx index 33c1a5fdad4d7..9ca46a8e3640b 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.tsx @@ -7,9 +7,9 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiPageHeader, EuiSpacer } from '@elastic/eui'; +import { useCspSetupStatusApi } from '@kbn/cloud-security-posture/src/hooks/use_csp_setup_status_api'; import { useVulnerabilityDashboardApi } from '../../common/api/use_vulnerability_dashboard_api'; import { VulnerabilityTrendGraph } from './vulnerability_trend_graph'; -import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; import { NoVulnerabilitiesStates } from '../../components/no_vulnerabilities_states'; import { VULNERABILITY_DASHBOARD_CONTAINER, diff --git a/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/muted_rules_stats_collector.ts b/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/muted_rules_stats_collector.ts index 63fc68caff47b..e5acf7b992e22 100644 --- a/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/muted_rules_stats_collector.ts +++ b/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/muted_rules_stats_collector.ts @@ -10,8 +10,8 @@ import { SavedObjectsClientContract, } from '@kbn/core-saved-objects-api-server'; import type { Logger } from '@kbn/core/server'; +import type { CspBenchmarkRule } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../../../common/constants'; -import { CspBenchmarkRule } from '../../../../common/types/latest'; import { getCspBenchmarkRulesStatesHandler } from '../../../routes/benchmark_rules/get_states/v1'; import { MutedRulesStats } from './types'; diff --git a/x-pack/plugins/cloud_security_posture/server/plugin.ts b/x-pack/plugins/cloud_security_posture/server/plugin.ts index f3a0192149142..b373b6d80c5ee 100755 --- a/x-pack/plugins/cloud_security_posture/server/plugin.ts +++ b/x-pack/plugins/cloud_security_posture/server/plugin.ts @@ -24,6 +24,10 @@ import type { TaskManagerSetupContract, TaskManagerStartContract, } from '@kbn/task-manager-plugin/server'; +import type { + CspBenchmarkRule, + CspSettings, +} from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { isCspPackage } from '../common/utils/helpers'; import { isSubscriptionAllowed } from '../common/utils/subscription'; import { cleanupCredentials } from '../common/utils/helpers'; @@ -47,7 +51,6 @@ import { } from './tasks/findings_stats_task'; import { registerCspmUsageCollector } from './lib/telemetry/collectors/register'; import { CloudSecurityPostureConfig } from './config'; -import { CspBenchmarkRule, CspSettings } from '../common/types/latest'; export class CspPlugin implements diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.ts index 63a9201b1f265..5ac233f5be0f5 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.ts @@ -9,8 +9,8 @@ import { transformError } from '@kbn/securitysolution-es-utils'; import { CspBenchmarkRulesBulkActionRequestSchema, cspBenchmarkRulesBulkActionRequestSchema, - CspBenchmarkRulesBulkActionResponse, -} from '../../../../common/types/rules/v4'; +} from '@kbn/cloud-security-posture-common/schema/rules/v4'; +import type { CspBenchmarkRulesBulkActionResponse } from '@kbn/cloud-security-posture-common/schema/rules/v4'; import { CspRouter } from '../../../types'; import { CSP_BENCHMARK_RULES_BULK_ACTION_ROUTE_PATH } from '../../../../common/constants'; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts index e733f6cc96003..ce70dfb7bfc47 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts @@ -6,14 +6,14 @@ */ import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; -import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common'; +import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import type { FindResult, RulesClient } from '@kbn/alerting-plugin/server'; import type { RuleParams } from '@kbn/alerting-plugin/server/application/rule/types'; import type { CspBenchmarkRule, RulesToUpdate, CspSettings, -} from '../../../../common/types/rules/v4'; +} from '@kbn/cloud-security-posture-common/schema/rules/v4'; import { convertRuleTagsToMatchAllKQL, generateBenchmarkRuleTags, diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/v1.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/v1.ts index ce68e094c0ba1..24aa7106e1705 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/v1.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/v1.ts @@ -7,6 +7,10 @@ import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; import { Logger } from '@kbn/core/server'; import type { RulesClient } from '@kbn/alerting-plugin/server'; +import type { + BulkActionBenchmarkRulesResponse, + RulesToUpdate, +} from '@kbn/cloud-security-posture-common/schema/rules/v4'; import { buildRuleKey } from '../../../../common/utils/rules_states'; import { getBenchmarkRules, @@ -14,10 +18,6 @@ import { setRulesStates, updateBenchmarkRulesStates, } from './utils'; -import type { - BulkActionBenchmarkRulesResponse, - RulesToUpdate, -} from '../../../../common/types/rules/v4'; const muteStatesMap = { mute: true, diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts index a2814e4b48ff0..0ce455ae35cec 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts @@ -5,8 +5,8 @@ * 2.0. */ +import type { CspBenchmarkRule } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { getSortedCspBenchmarkRulesTemplates } from './utils'; -import { CspBenchmarkRule } from '../../../../common/types/latest'; describe('getSortedCspBenchmarkRules', () => { it('sorts by metadata.benchmark.rule_number, invalid semantic version still should still get sorted and empty values should be sorted last', () => { diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.ts index c1b481b01f2cd..3e4373ad8fedb 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.ts @@ -9,15 +9,11 @@ import { FindCspBenchmarkRuleRequest, FindCspBenchmarkRuleResponse, findCspBenchmarkRuleRequestSchema, -} from '../../../../common/types/latest'; -import { - FindCspBenchmarkRuleRequest as FindCspBenchmarkRuleRequestV1, - findCspBenchmarkRuleRequestSchema as findCspBenchmarkRuleRequestSchemaV1, -} from '../../../../common/types/rules/v3'; -import { - FindCspBenchmarkRuleRequest as FindCspBenchmarkRuleRequestV2, - findCspBenchmarkRuleRequestSchema as findCspBenchmarkRuleRequestSchemaV2, -} from '../../../../common/types/rules/v4'; +} from '@kbn/cloud-security-posture-common/schema/rules/latest'; +import { findCspBenchmarkRuleRequestSchema as findCspBenchmarkRuleRequestSchemaV1 } from '@kbn/cloud-security-posture-common/schema/rules/v3'; +import type { FindCspBenchmarkRuleRequest as FindCspBenchmarkRuleRequestV1 } from '@kbn/cloud-security-posture-common/schema/rules/v3'; +import { findCspBenchmarkRuleRequestSchema as findCspBenchmarkRuleRequestSchemaV2 } from '@kbn/cloud-security-posture-common/schema/rules/v4'; +import type { FindCspBenchmarkRuleRequest as FindCspBenchmarkRuleRequestV2 } from '@kbn/cloud-security-posture-common/schema/rules/v4'; import { FIND_CSP_BENCHMARK_RULE_ROUTE_PATH } from '../../../../common/constants'; import { CspRouter } from '../../../types'; import { findBenchmarkRuleHandler as findRuleHandlerV1 } from './v1'; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/utils.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/utils.ts index f118ed0e8c56d..17e4f44fd10e5 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/utils.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/utils.ts @@ -8,11 +8,10 @@ import semverValid from 'semver/functions/valid'; import semverCompare from 'semver/functions/compare'; import { NewPackagePolicy } from '@kbn/fleet-plugin/common'; import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; +import type { CspBenchmarkRule } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { PACKAGE_POLICY_SAVED_OBJECT_TYPE } from '../../benchmarks/benchmarks'; import { getBenchmarkFromPackagePolicy } from '../../../../common/utils/helpers'; -import type { CspBenchmarkRule } from '../../../../common/types/latest'; - export const getSortedCspBenchmarkRulesTemplates = ( cspBenchmarkRules: CspBenchmarkRule[], sortDirection: 'asc' | 'desc' diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v1.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v1.ts index a1d5668ba8c22..c8db792e6a9bd 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v1.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v1.ts @@ -5,14 +5,14 @@ * 2.0. */ import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; -import { getBenchmarkFilter } from '../../../../common/utils/helpers'; -import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../../../common/constants'; -import { getBenchmarkIdFromPackagePolicyId, getSortedCspBenchmarkRulesTemplates } from './utils'; -import type { CspBenchmarkRule } from '../../../../common/types/latest'; +import type { CspBenchmarkRule } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import type { FindCspBenchmarkRuleRequest, FindCspBenchmarkRuleResponse, -} from '../../../../common/types/rules/v3'; +} from '@kbn/cloud-security-posture-common/schema/rules/v3'; +import { getBenchmarkFilter } from '../../../../common/utils/helpers'; +import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../../../common/constants'; +import { getBenchmarkIdFromPackagePolicyId, getSortedCspBenchmarkRulesTemplates } from './utils'; export const findBenchmarkRuleHandler = async ( soClient: SavedObjectsClientContract, diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v2.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v2.ts index e7db9544b7dd3..858463e94fa5f 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v2.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v2.ts @@ -6,14 +6,14 @@ */ import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; -import { getBenchmarkFilterQuery } from '../../../../common/utils/helpers'; -import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../../../common/constants'; - import type { CspBenchmarkRule, FindCspBenchmarkRuleRequest, FindCspBenchmarkRuleResponse, -} from '../../../../common/types/rules/v4'; +} from '@kbn/cloud-security-posture-common/schema/rules/v4'; +import { getBenchmarkFilterQuery } from '../../../../common/utils/helpers'; +import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../../../common/constants'; + import { getSortedCspBenchmarkRulesTemplates } from './utils'; export const findBenchmarkRuleHandler = async ( diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v3.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v3.ts index c3b77a1a38ac3..f1797c0673755 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v3.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v3.ts @@ -6,14 +6,14 @@ */ import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; -import { getBenchmarkFilterQueryV2 } from '../../../../common/utils/helpers'; -import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../../../common/constants'; - import type { CspBenchmarkRule, FindCspBenchmarkRuleRequest, FindCspBenchmarkRuleResponse, -} from '../../../../common/types/latest'; +} from '@kbn/cloud-security-posture-common/schema/rules/latest'; +import { getBenchmarkFilterQueryV2 } from '../../../../common/utils/helpers'; +import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../../../common/constants'; + import { getSortedCspBenchmarkRulesTemplates } from './utils'; export const findBenchmarkRuleHandler = async ( diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/get_states.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/get_states.ts index 44dd77cc67059..6099921efdc61 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/get_states.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/get_states.ts @@ -7,7 +7,7 @@ import { transformError } from '@kbn/securitysolution-es-utils'; import { CSP_GET_BENCHMARK_RULES_STATE_ROUTE_PATH } from '@kbn/cloud-security-posture-common'; -import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common'; +import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { CspRouter } from '../../../types'; import { getCspBenchmarkRulesStatesHandler } from './v1'; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/v1.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/v1.ts index 1c7ddccf91bba..e6c2e90cd9886 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/v1.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/v1.ts @@ -10,13 +10,13 @@ import { } from '@kbn/core-saved-objects-api-server'; import { transformError } from '@kbn/securitysolution-es-utils'; import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common'; -import { CspSettings } from '../../../../common/types/rules/v4'; +import { buildMutedRulesFilter } from '@kbn/cloud-security-posture-common'; +import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common/schema/rules/latest'; +import type { CspSettings } from '@kbn/cloud-security-posture-common/schema/rules/v4'; import { INTERNAL_CSP_SETTINGS_SAVED_OBJECT_ID, INTERNAL_CSP_SETTINGS_SAVED_OBJECT_TYPE, } from '../../../../common/constants'; -import { buildMutedRulesFilter } from '../../../../common/utils/rules_states'; export const createCspSettingObject = async (soClient: SavedObjectsClientContract) => { return soClient.create( diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/utilities.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/utilities.ts index d7ce82da9d98c..166349d863fb2 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/utilities.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/utilities.ts @@ -7,9 +7,9 @@ import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; +import { CspBenchmarkRule } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../../common/constants'; -import { CspBenchmarkRule } from '../../../common/types/latest'; import { BenchmarkId } from '../../../common/types_old'; import { getBenchmarkFilter } from '../../../common/utils/helpers'; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/v2.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/v2.ts index 55e32fdb45a8f..327a2da76f336 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/v2.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/v2.ts @@ -9,12 +9,13 @@ import { QueryDslQueryContainer } from '@kbn/data-views-plugin/common/types'; import { MappingRuntimeFields } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; +import type { CspBenchmarkRule } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE, LATEST_FINDINGS_INDEX_DEFAULT_NS, } from '../../../common/constants'; -import { CspBenchmarkRule, Benchmark } from '../../../common/types/latest'; +import { Benchmark } from '../../../common/types/latest'; import { getClusters } from '../compliance_dashboard/get_clusters'; import { getStats } from '../compliance_dashboard/get_stats'; import { getSafePostureTypeRuntimeMapping } from '../../../common/runtime_mappings/get_safe_posture_type_runtime_mapping'; diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts b/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts index ebf90aa500097..dc8c93ae4bc93 100644 --- a/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts +++ b/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts @@ -7,7 +7,7 @@ import { SECURITY_SOLUTION_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; import { SavedObjectsType } from '@kbn/core/server'; -import { rulesV1, rulesV2, rulesV3 } from '../../common/types'; +import { rulesV1, rulesV2, rulesV3 } from '@kbn/cloud-security-posture-common/schema/rules'; import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../common/constants'; import { cspBenchmarkRuleMigrations } from './migrations'; import { cspBenchmarkRuleSavedObjectMapping } from './mappings'; diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts b/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts index f1c61df75b4fc..676828367f638 100644 --- a/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts +++ b/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts @@ -7,7 +7,7 @@ import { SavedObjectsType } from '@kbn/core/server'; import { SECURITY_SOLUTION_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; -import { cspSettingsSchema } from '../../common/types/rules/v4'; +import { cspSettingsSchema } from '@kbn/cloud-security-posture-common/schema/rules/v4'; import { cspSettingsSavedObjectMapping } from './mappings'; import { INTERNAL_CSP_SETTINGS_SAVED_OBJECT_TYPE } from '../../common/constants'; diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/migrations/csp_benchmark_rule.ts b/x-pack/plugins/cloud_security_posture/server/saved_objects/migrations/csp_benchmark_rule.ts index e440342d2083d..942f2a2fc648a 100644 --- a/x-pack/plugins/cloud_security_posture/server/saved_objects/migrations/csp_benchmark_rule.ts +++ b/x-pack/plugins/cloud_security_posture/server/saved_objects/migrations/csp_benchmark_rule.ts @@ -10,7 +10,7 @@ import { SavedObjectUnsanitizedDoc, SavedObjectMigrationContext, } from '@kbn/core/server'; -import { rulesV1, rulesV2, rulesV3 } from '../../../common/types'; +import { rulesV1, rulesV2, rulesV3 } from '@kbn/cloud-security-posture-common/schema/rules'; function migrateCspBenchmarkRuleToV840( doc: SavedObjectUnsanitizedDoc, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/index_error.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/index_error.tsx index 49a3ca412a547..951fb942a7fa8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/index_error.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/index_error.tsx @@ -118,7 +118,9 @@ export const IndexError: React.FC = ({ indexName }) => { if (isLocalModel(model)) { const modelId = model.service_settings.model_id; const modelStats = trainedModelStats?.trained_model_stats.find( - (value) => value.model_id === modelId + (value) => + value.model_id === modelId && + value.deployment_stats?.deployment_id === field.source.inference_id ); if (!modelStats || modelStats.deployment_stats?.state !== 'started') { return { diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/create_api_key.test.ts b/x-pack/plugins/enterprise_search/server/lib/indices/create_api_key.test.ts index d89126f549a1b..43bea033a2e3d 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/create_api_key.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/create_api_key.test.ts @@ -5,14 +5,12 @@ * 2.0. */ -import { KibanaRequest } from '@kbn/core/server'; -import { securityMock } from '@kbn/security-plugin/server/mocks'; +import { securityServiceMock } from '@kbn/core-security-server-mocks'; import { createApiKey } from './create_api_key'; describe('createApiKey lib function', () => { - const security = securityMock.createStart(); - const request = {} as KibanaRequest; + const security = securityServiceMock.createRequestHandlerContext(); const indexName = 'my-index'; const keyName = '{indexName}-key'; @@ -31,11 +29,9 @@ describe('createApiKey lib function', () => { }); it('should create an api key via the security plugin', async () => { - await expect(createApiKey(request, security, indexName, keyName)).resolves.toEqual( - createResponse - ); + await expect(createApiKey(security, indexName, keyName)).resolves.toEqual(createResponse); - expect(security.authc.apiKeys.create).toHaveBeenCalledWith(request, { + expect(security.authc.apiKeys.create).toHaveBeenCalledWith({ name: keyName, role_descriptors: { [`${indexName}-key-role`]: { diff --git a/x-pack/plugins/enterprise_search/server/lib/indices/create_api_key.ts b/x-pack/plugins/enterprise_search/server/lib/indices/create_api_key.ts index 0c1a62c4d30db..b5d7fb7cf22e9 100644 --- a/x-pack/plugins/enterprise_search/server/lib/indices/create_api_key.ts +++ b/x-pack/plugins/enterprise_search/server/lib/indices/create_api_key.ts @@ -5,19 +5,16 @@ * 2.0. */ -import { KibanaRequest } from '@kbn/core/server'; - -import { SecurityPluginStart } from '@kbn/security-plugin/server'; +import type { SecurityRequestHandlerContext } from '@kbn/core-security-server'; import { toAlphanumeric } from '../../../common/utils/to_alphanumeric'; export const createApiKey = async ( - request: KibanaRequest, - security: SecurityPluginStart, + security: SecurityRequestHandlerContext, indexName: string, keyName: string ) => { - return await security.authc.apiKeys.create(request, { + return await security.authc.apiKeys.create({ name: keyName, role_descriptors: { [`${toAlphanumeric(indexName)}-key-role`]: { diff --git a/x-pack/plugins/enterprise_search/server/plugin.ts b/x-pack/plugins/enterprise_search/server/plugin.ts index a03429729bf2f..d021b1b3cd634 100644 --- a/x-pack/plugins/enterprise_search/server/plugin.ts +++ b/x-pack/plugins/enterprise_search/server/plugin.ts @@ -25,7 +25,7 @@ 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'; -import { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server'; +import { SecurityPluginSetup } from '@kbn/security-plugin/server'; import { SpacesPluginStart } from '@kbn/spaces-plugin/server'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; @@ -104,7 +104,6 @@ interface PluginsSetup { export interface PluginsStart { data: DataPluginStart; - security: SecurityPluginStart; spaces?: SpacesPluginStart; } @@ -284,9 +283,7 @@ export class EnterpriseSearchPlugin implements Plugin { registerAnalyticsRoutes({ ...dependencies, data, savedObjects: coreStart.savedObjects }); }); - void getStartServices().then(([, { security: securityStart }]) => { - registerApiKeysRoutes(dependencies, securityStart); - }); + registerApiKeysRoutes(dependencies); /** * Bootstrap the routes, saved objects, and collector for telemetry diff --git a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/api_keys.ts b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/api_keys.ts index 8b94de5e6955c..71e00bed27910 100644 --- a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/api_keys.ts +++ b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/api_keys.ts @@ -7,16 +7,11 @@ import { schema } from '@kbn/config-schema'; -import { SecurityPluginStart } from '@kbn/security-plugin/server'; - import { createApiKey } from '../../lib/indices/create_api_key'; import { RouteDependencies } from '../../plugin'; import { elasticsearchErrorHandler } from '../../utils/elasticsearch_error_handler'; -export function registerApiKeysRoutes( - { log, router }: RouteDependencies, - security: SecurityPluginStart -) { +export function registerApiKeysRoutes({ log, router }: RouteDependencies) { router.post( { path: '/internal/enterprise_search/{indexName}/api_keys', @@ -32,8 +27,9 @@ export function registerApiKeysRoutes( elasticsearchErrorHandler(log, async (context, request, response) => { const indexName = decodeURIComponent(request.params.indexName); const { keyName } = request.body; + const { security: coreSecurity } = await context.core; - const createResponse = await createApiKey(request, security, indexName, keyName); + const createResponse = await createApiKey(coreSecurity, indexName, keyName); if (!createResponse) { throw new Error('Unable to create API Key'); @@ -118,7 +114,8 @@ export function registerApiKeysRoutes( }, }, async (context, request, response) => { - const result = await security.authc.apiKeys.create(request, request.body); + const { security: coreSecurity } = await context.core; + const result = await coreSecurity.authc.apiKeys.create(request.body); if (result) { const apiKey = { ...result, beats_logstash_format: `${result.id}:${result.api_key}` }; return response.ok({ body: apiKey }); diff --git a/x-pack/plugins/enterprise_search/tsconfig.json b/x-pack/plugins/enterprise_search/tsconfig.json index 86cf6c3968005..58b1526e14baf 100644 --- a/x-pack/plugins/enterprise_search/tsconfig.json +++ b/x-pack/plugins/enterprise_search/tsconfig.json @@ -81,6 +81,8 @@ "@kbn/core-chrome-browser", "@kbn/navigation-plugin", "@kbn/search-homepage", - "@kbn/security-plugin-types-common" + "@kbn/security-plugin-types-common", + "@kbn/core-security-server", + "@kbn/core-security-server-mocks" ] } diff --git a/x-pack/plugins/fleet/common/openapi/bundled.json b/x-pack/plugins/fleet/common/openapi/bundled.json index 989955b748ed5..fc9e292bdeff7 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.json +++ b/x-pack/plugins/fleet/common/openapi/bundled.json @@ -4112,6 +4112,17 @@ "tags": [ "Fleet enrollment API keys" ], + "parameters": [ + { + "$ref": "#/components/parameters/page_size" + }, + { + "$ref": "#/components/parameters/page_index" + }, + { + "$ref": "#/components/parameters/kuery" + } + ], "responses": { "200": { "description": "OK", @@ -4157,8 +4168,7 @@ "$ref": "#/components/responses/error" } }, - "operationId": "get-enrollment-api-keys", - "parameters": [] + "operationId": "get-enrollment-api-keys" }, "post": { "summary": "Create enrollment API key", @@ -4191,6 +4201,28 @@ "$ref": "#/components/responses/error" } }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the enrollment API key. Must be unique." + }, + "policy_id": { + "type": "string", + "description": "The ID of the agent policy the Elastic Agent will be enrolled in." + } + }, + "required": [ + "policy_id" + ] + } + } + } + }, "operationId": "create-enrollment-api-keys", "parameters": [ { @@ -4241,7 +4273,7 @@ "operationId": "get-enrollment-api-key" }, "delete": { - "summary": "Delete enrollment API key by ID", + "summary": "Revoke enrollment API key by ID by marking it as inactive", "tags": [ "Fleet enrollment API keys" ], @@ -8199,19 +8231,24 @@ "type": "string" }, "api_key_id": { - "type": "string" + "type": "string", + "description": "The ID of the API key in the Security API." }, "api_key": { - "type": "string" + "type": "string", + "description": "The enrollment API key (token) used for enrolling Elastic Agents." }, "name": { - "type": "string" + "type": "string", + "description": "The name of the enrollment API key." }, "active": { - "type": "boolean" + "type": "boolean", + "description": "When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents." }, "policy_id": { - "type": "string" + "type": "string", + "description": "The ID of the agent policy the Elastic Agent will be enrolled in." }, "created_at": { "type": "string" diff --git a/x-pack/plugins/fleet/common/openapi/bundled.yaml b/x-pack/plugins/fleet/common/openapi/bundled.yaml index fe1c2fc68c58a..2a1a18326fc31 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.yaml +++ b/x-pack/plugins/fleet/common/openapi/bundled.yaml @@ -2561,6 +2561,10 @@ paths: summary: List enrollment API keys tags: - Fleet enrollment API keys + parameters: + - $ref: '#/components/parameters/page_size' + - $ref: '#/components/parameters/page_index' + - $ref: '#/components/parameters/kuery' responses: '200': description: OK @@ -2592,7 +2596,6 @@ paths: '400': $ref: '#/components/responses/error' operationId: get-enrollment-api-keys - parameters: [] post: summary: Create enrollment API key tags: @@ -2613,6 +2616,22 @@ paths: - created '400': $ref: '#/components/responses/error' + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the enrollment API key. Must be unique. + policy_id: + type: string + description: >- + The ID of the agent policy the Elastic Agent will be + enrolled in. + required: + - policy_id operationId: create-enrollment-api-keys parameters: - $ref: '#/components/parameters/kbn_xsrf' @@ -2643,7 +2662,7 @@ paths: $ref: '#/components/responses/error' operationId: get-enrollment-api-key delete: - summary: Delete enrollment API key by ID + summary: Revoke enrollment API key by ID by marking it as inactive tags: - Fleet enrollment API keys responses: @@ -5279,14 +5298,21 @@ components: type: string api_key_id: type: string + description: The ID of the API key in the Security API. api_key: type: string + description: The enrollment API key (token) used for enrolling Elastic Agents. name: type: string + description: The name of the enrollment API key. active: type: boolean + description: >- + When false, the enrollment API key is revoked and cannot be used for + enrolling Elastic Agents. policy_id: type: string + description: The ID of the agent policy the Elastic Agent will be enrolled in. created_at: type: string required: diff --git a/x-pack/plugins/fleet/common/openapi/components/schemas/enrollment_api_key.yaml b/x-pack/plugins/fleet/common/openapi/components/schemas/enrollment_api_key.yaml index 7be406cf5b831..e1ce2243dc29f 100644 --- a/x-pack/plugins/fleet/common/openapi/components/schemas/enrollment_api_key.yaml +++ b/x-pack/plugins/fleet/common/openapi/components/schemas/enrollment_api_key.yaml @@ -5,14 +5,19 @@ properties: type: string api_key_id: type: string + description: The ID of the API key in the Security API. api_key: type: string + description: The enrollment API key (token) used for enrolling Elastic Agents. name: type: string + description: The name of the enrollment API key. active: type: boolean + description: When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. policy_id: type: string + description: The ID of the agent policy the Elastic Agent will be enrolled in. created_at: type: string required: diff --git a/x-pack/plugins/fleet/common/openapi/paths/enrollment_api_keys.yaml b/x-pack/plugins/fleet/common/openapi/paths/enrollment_api_keys.yaml index 625ad82e3f3f2..7da2e9374353b 100644 --- a/x-pack/plugins/fleet/common/openapi/paths/enrollment_api_keys.yaml +++ b/x-pack/plugins/fleet/common/openapi/paths/enrollment_api_keys.yaml @@ -2,6 +2,10 @@ get: summary: List enrollment API keys tags: - Fleet enrollment API keys + parameters: + - $ref: ../components/parameters/page_size.yaml + - $ref: ../components/parameters/page_index.yaml + - $ref: ../components/parameters/kuery.yaml responses: '200': description: OK @@ -33,7 +37,6 @@ get: '400': $ref: ../components/responses/error.yaml operationId: get-enrollment-api-keys - parameters: [] post: summary: Create enrollment API key tags: @@ -54,6 +57,20 @@ post: - created '400': $ref: ../components/responses/error.yaml + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the enrollment API key. Must be unique. + policy_id: + type: string + description: The ID of the agent policy the Elastic Agent will be enrolled in. + required: + - policy_id operationId: create-enrollment-api-keys parameters: - $ref: ../components/headers/kbn_xsrf.yaml diff --git a/x-pack/plugins/fleet/common/openapi/paths/enrollment_api_keys@{key_id}.yaml b/x-pack/plugins/fleet/common/openapi/paths/enrollment_api_keys@{key_id}.yaml index f3bdc459d6ccf..f0f8be73d8666 100644 --- a/x-pack/plugins/fleet/common/openapi/paths/enrollment_api_keys@{key_id}.yaml +++ b/x-pack/plugins/fleet/common/openapi/paths/enrollment_api_keys@{key_id}.yaml @@ -24,7 +24,7 @@ get: $ref: ../components/responses/error.yaml operationId: get-enrollment-api-key delete: - summary: Delete enrollment API key by ID + summary: Revoke enrollment API key by ID by marking it as inactive tags: - Fleet enrollment API keys responses: diff --git a/x-pack/plugins/fleet/cypress/tasks/integrations.ts b/x-pack/plugins/fleet/cypress/tasks/integrations.ts index 5fa2860980027..002aaadefa859 100644 --- a/x-pack/plugins/fleet/cypress/tasks/integrations.ts +++ b/x-pack/plugins/fleet/cypress/tasks/integrations.ts @@ -25,16 +25,8 @@ export const addIntegration = ({ useExistingPolicy } = { useExistingPolicy: fals cy.getBySel(EXISTING_HOSTS_TAB).click(); cy.wait('@agentStatus'); } else { - // speeding up creating with unchecking system and agent integration + // speeding up creating with unchecking system integration cy.getBySel(AGENT_POLICY_SYSTEM_MONITORING_CHECKBOX).uncheck({ force: true }); - cy.get('.euiAccordion__button').click(); - - cy.get('*[id^="logs_"]').uncheck({ - force: true, - }); - cy.get('*[id^="metrics_"]').uncheck({ - force: true, - }); } cy.getBySel(CREATE_PACKAGE_POLICY_SAVE_BTN).should('be.enabled').click(); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_integration.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_integration.tsx index 6ab901cb5e27c..a08c6bfe22496 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_integration.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_integration.tsx @@ -6,29 +6,15 @@ */ import React from 'react'; -import { - EuiAccordion, - EuiDescribedFormGroup, - EuiForm, - EuiHorizontalRule, - EuiSpacer, -} from '@elastic/eui'; +import { EuiDescribedFormGroup, EuiForm } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import styled from 'styled-components'; import type { NewAgentPolicy, AgentPolicy } from '../../../types'; -import { AgentPolicyAdvancedOptionsContent } from './agent_policy_advanced_fields'; import { AgentPolicyGeneralFields } from './agent_policy_general_fields'; import { AgentPolicyFormSystemMonitoringCheckbox } from './agent_policy_system_monitoring_field'; import type { ValidationResults } from './agent_policy_validation'; -const StyledEuiAccordion = styled(EuiAccordion)` - .ingest-active-button { - color: ${(props) => props.theme.eui.euiColorPrimary}; - } -`; - interface Props { agentPolicy: Partial; updateAgentPolicy: (u: Partial) => void; @@ -80,27 +66,6 @@ export const AgentPolicyIntegrationForm: React.FunctionComponent = ({ updateSysMonitoring={updateSysMonitoring} /> - <> - - - - } - buttonClassName="ingest-active-button" - > - - - - ); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_validation.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_validation.tsx index bb4e39b265f06..a52c2b488139c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_validation.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_validation.tsx @@ -38,20 +38,20 @@ export const agentPolicyFormValidation = ( errors.namespace = [namespaceValidation.error]; } - if (agentPolicy.unenroll_timeout && agentPolicy.unenroll_timeout < 0) { + if (agentPolicy.unenroll_timeout !== undefined && agentPolicy.unenroll_timeout <= 0) { errors.unenroll_timeout = [ , ]; } - if (agentPolicy.inactivity_timeout && agentPolicy.inactivity_timeout < 0) { + if (agentPolicy.inactivity_timeout !== undefined && agentPolicy.inactivity_timeout <= 0) { errors.inactivity_timeout = [ , ]; } diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/use_policies.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/use_policies.tsx new file mode 100644 index 0000000000000..e910471e24c97 --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/use_policies.tsx @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { SO_SEARCH_LIMIT } from '../../../../../../../../../common'; +import { useGetAgentPolicies } from '../../../../../../../../hooks'; + +export const useAllNonManagedAgentPolicies = () => { + const { data: agentPoliciesData, error: err } = useGetAgentPolicies({ + page: 1, + perPage: SO_SEARCH_LIMIT, + sortField: 'name', + sortOrder: 'asc', + full: false, // package_policies will always be empty + noAgentCount: true, // agentPolicy.agents will always be 0, + kuery: 'ingest-agent-policies.is_managed:false', + }); + if (err) { + // eslint-disable-next-line no-console + console.debug('Could not retrieve agent policies'); + } + return agentPoliciesData?.items || []; +}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_hosts.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_hosts.test.tsx index b925b4e3172fd..7d1962939d1fa 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_hosts.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_hosts.test.tsx @@ -15,6 +15,14 @@ import { useGetAgentPolicies } from '../../../../../hooks'; import type { AgentPolicy, PackageInfo } from '../../../../../types'; import { StepSelectHosts } from './step_select_hosts'; +import { useAllNonManagedAgentPolicies } from './components/use_policies'; + +jest.mock('./components/use_policies', () => { + return { + ...jest.requireActual('./components/use_policies'), + useAllNonManagedAgentPolicies: jest.fn(), + }; +}); jest.mock('../../../../../hooks', () => { return { @@ -121,6 +129,9 @@ describe('StepSelectHosts', () => { items: [{ id: '1', name: 'Agent policy 1', namespace: 'default' }], }, }); + (useAllNonManagedAgentPolicies as jest.MockedFunction).mockReturnValue([ + { id: '1', name: 'Agent policy 1', namespace: 'default' }, + ]); render(); @@ -140,6 +151,9 @@ describe('StepSelectHosts', () => { items: [{ id: '1', name: 'Agent policy 1', namespace: 'default' }], }, }); + (useAllNonManagedAgentPolicies as jest.MockedFunction).mockReturnValue([ + { id: '1', name: 'Agent policy 1', namespace: 'default' }, + ]); render(); @@ -164,6 +178,10 @@ describe('StepSelectHosts', () => { ], }, }); + (useAllNonManagedAgentPolicies as jest.MockedFunction).mockReturnValue([ + { id: '1', name: 'Agent policy 1', namespace: 'default' }, + { id: '2', name: 'Agent policy 2', namespace: 'default' }, + ]); render(); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_hosts.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_hosts.tsx index 4416b7340ef36..c4504e6596353 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_hosts.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_hosts.tsx @@ -5,20 +5,20 @@ * 2.0. */ -import React, { useEffect, useMemo } from 'react'; +import React, { useEffect } from 'react'; import type { EuiTabbedContentTab } from '@elastic/eui'; import { EuiTabbedContent } from '@elastic/eui'; import styled from 'styled-components'; -import { useGetAgentPolicies } from '../../../../../hooks'; import type { AgentPolicy, NewAgentPolicy, PackageInfo } from '../../../../../types'; -import { AgentPolicyIntegrationForm } from '../../../components'; -import { SO_SEARCH_LIMIT } from '../../../../../constants'; import type { ValidationResults } from '../../../components/agent_policy_validation'; import { incrementPolicyName } from '../../../../../services'; +import { AgentPolicyIntegrationForm } from '../../../components'; + import { StepSelectAgentPolicy } from './step_select_agent_policy'; +import { useAllNonManagedAgentPolicies } from './components/use_policies'; export enum SelectedPolicyTab { NEW = 'new', @@ -60,23 +60,7 @@ export const StepSelectHosts: React.FunctionComponent = ({ selectedAgentPolicyIds, initialSelectedTabIndex, }) => { - let existingAgentPolicies: AgentPolicy[] = []; - const { data: agentPoliciesData, error: err } = useGetAgentPolicies({ - page: 1, - perPage: SO_SEARCH_LIMIT, - sortField: 'name', - sortOrder: 'asc', - full: false, // package_policies will always be empty - noAgentCount: true, // agentPolicy.agents will always be 0 - }); - if (err) { - // eslint-disable-next-line no-console - console.debug('Could not retrieve agent policies'); - } - existingAgentPolicies = useMemo( - () => agentPoliciesData?.items.filter((policy) => !policy.is_managed) || [], - [agentPoliciesData?.items] - ); + const existingAgentPolicies: AgentPolicy[] = useAllNonManagedAgentPolicies(); useEffect(() => { if (existingAgentPolicies.length > 0) { 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 5cafedee7db7b..141622410076d 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 @@ -102,7 +102,7 @@ export function useSetupTechnology({ const [newAgentlessPolicy, setNewAgentlessPolicy] = useState( generateNewAgentPolicyWithDefaults({ supports_agentless: true, - monitoring_enabled: [], + monitoring_enabled: ['logs', 'metrics'], }) ); 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 9dbdcafdc94bb..195d41221d424 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 @@ -28,6 +28,20 @@ import { useConfig, } from '../../../../hooks'; +jest.mock('../components/steps/components/use_policies', () => { + return { + ...jest.requireActual('../components/steps/components/use_policies'), + useAllNonManagedAgentPolicies: jest.fn().mockReturnValue([ + { + id: 'agent-policy-1', + name: 'Agent policy 1', + namespace: 'default', + unprivileged_agents: 1, + }, + ]), + }; +}); + jest.mock('../../../../hooks', () => { return { ...jest.requireActual('../../../../hooks'), @@ -126,6 +140,8 @@ jest.mock('react-router-dom', () => ({ import { AGENTLESS_POLICY_ID } from '../../../../../../../common/constants'; +import { useAllNonManagedAgentPolicies } from '../components/steps/components/use_policies'; + import { CreatePackagePolicySinglePage } from '.'; import { SETUP_TECHNOLOGY_SELECTOR_TEST_SUBJ } from './components/setup_technology_selector'; @@ -702,6 +718,9 @@ describe('When on the package policy create page', () => { isLoading: false, resendRequest: jest.fn(), }); + (useAllNonManagedAgentPolicies as jest.MockedFunction).mockReturnValue([ + { id: AGENTLESS_POLICY_ID, name: 'Agentless CSPM', namespace: 'default' }, + ]); await act(async () => { render(); @@ -848,7 +867,7 @@ describe('When on the package policy create page', () => { expect(sendCreateAgentPolicy).toHaveBeenCalledWith( expect.objectContaining({ - monitoring_enabled: [], + monitoring_enabled: ['logs', 'metrics'], name: 'Agentless policy for nginx-1', supports_agentless: true, }), diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/components/step_edit_hosts.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/components/step_edit_hosts.test.tsx new file mode 100644 index 0000000000000..064624d364a92 --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/components/step_edit_hosts.test.tsx @@ -0,0 +1,182 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { act, fireEvent, waitFor } from '@testing-library/react'; + +import type { TestRenderer } from '../../../../../../mock'; +import { createFleetTestRendererMock } from '../../../../../../mock'; + +import { useGetAgentPolicies } from '../../../../hooks'; +import type { AgentPolicy, PackageInfo } from '../../../../types'; + +import { useAllNonManagedAgentPolicies } from '../../create_package_policy_page/components/steps/components/use_policies'; + +import { StepEditHosts } from './step_edit_hosts'; + +jest.mock('../../create_package_policy_page/components/steps/components/use_policies', () => { + return { + ...jest.requireActual( + '../../create_package_policy_page/components/steps/components/use_policies' + ), + useAllNonManagedAgentPolicies: jest.fn(), + }; +}); + +jest.mock('../../../../hooks', () => { + return { + ...jest.requireActual('../../../../hooks'), + useGetAgentPolicies: jest.fn(), + useGetOutputs: jest.fn().mockResolvedValue({ + data: [], + isLoading: false, + }), + sendGetOneAgentPolicy: jest.fn().mockImplementation((id) => + Promise.resolve({ + data: { item: { id, name: `Agent policy ${id}` } }, + }) + ), + }; +}); + +describe('StepEditHosts', () => { + const packageInfo: PackageInfo = { + name: 'apache', + version: '1.0.0', + description: '', + format_version: '', + release: 'ga', + owner: { github: '' }, + title: 'Apache', + latestVersion: '', + assets: {} as any, + status: 'not_installed', + vars: [], + }; + const agentPolicies: AgentPolicy[] = [ + { + id: '1', + namespace: 'default', + name: 'Agent policy 1', + is_managed: false, + status: 'active', + updated_at: '', + updated_by: '', + revision: 1, + package_policies: [], + is_protected: false, + }, + { + id: '2', + namespace: 'default', + name: 'Agent policy 2', + is_managed: false, + status: 'active', + updated_at: '', + updated_by: '', + revision: 1, + package_policies: [], + is_protected: false, + }, + ]; + const newAgentPolicy = { + name: '', + namespace: 'default', + }; + const validation = {}; + + let testRenderer: TestRenderer; + let renderResult: ReturnType; + const render = () => + (renderResult = testRenderer.render( + + )); + beforeEach(() => { + testRenderer = createFleetTestRendererMock(); + }); + + it('should display create form when no agent policies', () => { + (useGetAgentPolicies as jest.MockedFunction).mockReturnValue({ + data: { + items: [], + }, + }); + + render(); + + waitFor(() => { + expect(renderResult.getByText('Agent policy 1')).toBeInTheDocument(); + }); + expect(renderResult.queryByRole('tablist')).not.toBeInTheDocument(); + }); + + it('should display new policy button and existing policies when agent policies exist', () => { + (useGetAgentPolicies as jest.MockedFunction).mockReturnValue({ + data: { + items: [{ id: '1', name: 'Agent policy 1', namespace: 'default' }], + }, + }); + (useAllNonManagedAgentPolicies as jest.MockedFunction).mockReturnValue([ + { id: '1', name: 'Agent policy 1', namespace: 'default' }, + ]); + + render(); + + expect(renderResult.getByTestId('createNewAgentPolicyButton')).toBeInTheDocument(); + expect( + renderResult.container.querySelector('[data-test-subj="agentPolicySelect"]')?.textContent + ).toContain('Agent policy 1'); + }); + + it('should display dropdown without preselected value when mulitple agent policies', () => { + (useGetAgentPolicies as jest.MockedFunction).mockReturnValue({ + data: { + items: [ + { id: '1', name: 'Agent policy 1', namespace: 'default' }, + { id: '2', name: 'Agent policy 2', namespace: 'default' }, + ], + }, + }); + + render(); + + waitFor(() => { + expect(renderResult.getByText('At least one agent policy is required.')).toBeInTheDocument(); + }); + }); + + it('should display delete button when add button clicked', () => { + (useGetAgentPolicies as jest.MockedFunction).mockReturnValue({ + data: { + items: [{ id: '1', name: 'Agent policy 1', namespace: 'default' }], + }, + }); + (useAllNonManagedAgentPolicies as jest.MockedFunction).mockReturnValue([ + { id: '1', name: 'Agent policy 1', namespace: 'default' }, + ]); + + render(); + + act(() => { + fireEvent.click(renderResult.getByTestId('createNewAgentPolicyButton').closest('button')!); + }); + + expect(renderResult.getByTestId('deleteNewAgentPolicyButton')).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/components/step_edit_hosts.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/components/step_edit_hosts.tsx new file mode 100644 index 0000000000000..64d104172af53 --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/components/step_edit_hosts.tsx @@ -0,0 +1,153 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useEffect, useState } from 'react'; + +import { FormattedMessage } from '@kbn/i18n-react'; + +import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiTitle } from '@elastic/eui'; + +import type { AgentPolicy, NewAgentPolicy, PackageInfo } from '../../../../types'; +import { AgentPolicyIntegrationForm } from '../../components'; +import type { ValidationResults } from '../../components/agent_policy_validation'; + +import { incrementPolicyName } from '../../../../services'; + +import { StepSelectAgentPolicy } from '../../create_package_policy_page/components/steps/step_select_agent_policy'; +import { SelectedPolicyTab } from '../../create_package_policy_page/components'; +import { useAllNonManagedAgentPolicies } from '../../create_package_policy_page/components/steps/components/use_policies'; + +interface Props { + agentPolicies: AgentPolicy[]; + updateAgentPolicies: (u: AgentPolicy[]) => void; + newAgentPolicy: Partial; + updateNewAgentPolicy: (u: Partial) => void; + withSysMonitoring: boolean; + updateSysMonitoring: (newValue: boolean) => void; + validation: ValidationResults; + packageInfo?: PackageInfo; + setHasAgentPolicyError: (hasError: boolean) => void; + selectedAgentPolicyIds: string[]; + updateSelectedTab: (tab: SelectedPolicyTab) => void; +} + +export const StepEditHosts: React.FunctionComponent = ({ + agentPolicies, + updateAgentPolicies, + newAgentPolicy, + updateNewAgentPolicy, + withSysMonitoring, + updateSysMonitoring, + validation, + packageInfo, + setHasAgentPolicyError, + selectedAgentPolicyIds, + updateSelectedTab, +}) => { + const [showCreateAgentPolicy, setShowCreateAgentPolicy] = useState(false); + const existingAgentPolicies: AgentPolicy[] = useAllNonManagedAgentPolicies(); + + useEffect(() => { + if (existingAgentPolicies.length > 0) { + updateNewAgentPolicy({ + ...newAgentPolicy, + name: incrementPolicyName(existingAgentPolicies), + }); + } + }, [existingAgentPolicies.length]); // eslint-disable-line react-hooks/exhaustive-deps + + return existingAgentPolicies.length > 0 ? ( + + + +

+ +

+
+
+ + + + + + + + +

+ +

+
+
+ {!showCreateAgentPolicy && ( + + { + setShowCreateAgentPolicy(true); + updateSelectedTab(SelectedPolicyTab.NEW); + }} + data-test-subj="createNewAgentPolicyButton" + > + + + + )} + {showCreateAgentPolicy && ( + <> + + + + + { + setShowCreateAgentPolicy(false); + updateSelectedTab(SelectedPolicyTab.EXISTING); + }} + data-test-subj="deleteNewAgentPolicyButton" + > + + + + + )} +
+ ) : ( + + ); +}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/hooks/use_package_policy_steps.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/hooks/use_package_policy_steps.tsx index 1041c91510318..3d1e29240c733 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/hooks/use_package_policy_steps.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/hooks/use_package_policy_steps.tsx @@ -13,7 +13,7 @@ import type { EuiStepProps } from '@elastic/eui'; import { useSpaceSettingsContext } from '../../../../../../hooks/use_space_settings_context'; import type { AgentPolicy, NewAgentPolicy, NewPackagePolicy } from '../../../../../../../common'; import { generateNewAgentPolicyWithDefaults } from '../../../../../../../common/services'; -import { SelectedPolicyTab, StepSelectHosts } from '../../create_package_policy_page/components'; +import { SelectedPolicyTab } from '../../create_package_policy_page/components'; import type { PackageInfo } from '../../../../types'; import { SetupTechnology } from '../../../../types'; import { @@ -22,6 +22,7 @@ import { } from '../../create_package_policy_page/single_page_layout/hooks'; import { agentPolicyFormValidation } from '../../components'; import { createAgentPolicyIfNeeded } from '../../create_package_policy_page/single_page_layout/hooks/form'; +import { StepEditHosts } from '../components/step_edit_hosts'; interface Params { configureStep: React.ReactNode; @@ -142,7 +143,7 @@ export function usePackagePolicySteps({ const stepSelectAgentPolicy = useMemo( () => ( - policy.id)} - initialSelectedTabIndex={1} /> ), [ diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.test.tsx index 6669f3dfa332f..f893f7a7e7aeb 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.test.tsx @@ -31,6 +31,15 @@ import { EditPackagePolicyPage } from '.'; type MockFn = jest.MockedFunction; +jest.mock('../create_package_policy_page/components/steps/components/use_policies', () => { + return { + ...jest.requireActual('../create_package_policy_page/components/steps/components/use_policies'), + useAllNonManagedAgentPolicies: jest + .fn() + .mockReturnValue([{ id: 'agent-policy-1', name: 'Agent policy 1' }]), + }; +}); + jest.mock('../../../hooks', () => { return { ...jest.requireActual('../../../hooks'), @@ -515,7 +524,7 @@ describe('edit package policy page', () => { jest.clearAllMocks(); }); - it('should create agent policy with sys monitoring when new hosts is selected', async () => { + it('should create agent policy with sys monitoring when new agent policy button is clicked', async () => { await act(async () => { render(); }); @@ -528,7 +537,7 @@ describe('edit package policy page', () => { }); await act(async () => { - fireEvent.click(renderResult.getByTestId('newHostsTab')); + fireEvent.click(renderResult.getByTestId('createNewAgentPolicyButton')); }); await act(async () => { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.tsx index 6ab01d06f52dd..dcbd29c1ef74e 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.tsx @@ -98,6 +98,7 @@ export const AgentPolicyListPage: React.FunctionComponent<{}> = () => { sortField: sorting?.field, sortOrder: sorting?.direction, kuery: search, + noAgentCount: false, // Explicitly fetch agent count full: true, }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/helpers.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/helpers.tsx index 82fc266a04bcc..e37452da2ac5d 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/helpers.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/helpers.tsx @@ -69,7 +69,7 @@ export const getAction = (type?: string, actionId?: string) => { // handling a special case of force unenrollment coming from an automatic task // we know what kind of action is from the actionId prefix if (actionId?.includes('UnenrollInactiveAgentsTask-')) - return actionNames.AUTOMATICAL_FORCE_UNENROLL; + return actionNames.AUTOMATIC_FORCE_UNENROLL; return actionNames[type ?? 'ACTION'] ?? actionNames.ACTION; }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/hooks/use_fetch_agents_data.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/hooks/use_fetch_agents_data.test.tsx index 5640890b3f810..db4cff14e4804 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/hooks/use_fetch_agents_data.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/hooks/use_fetch_agents_data.test.tsx @@ -21,6 +21,13 @@ jest.mock('../../../../hooks', () => ({ ...jest.requireActual('../../../../hooks'), sendGetAgents: jest.fn().mockResolvedValue({ data: { + statusSummary: {}, + items: [ + { + id: 'agent123', + policy_id: 'agent-policy-1', + }, + ], total: 5, }, }), @@ -32,6 +39,19 @@ jest.mock('../../../../hooks', () => ({ totalInactive: 2, }, }), + sendBulkGetAgentPolicies: jest.fn().mockReturnValue({ + data: { + items: [ + { id: 'agent-policy-1', name: 'Agent policy 1', namespace: 'default' }, + { + id: 'agent-policy-managed', + name: 'Managed Agent policy', + namespace: 'default', + managed: true, + }, + ], + }, + }), sendGetAgentPolicies: jest.fn().mockReturnValue({ data: { items: [ @@ -104,7 +124,7 @@ describe('useFetchAgentsData', () => { }); expect(result?.current.selectedStatus).toEqual(['healthy', 'unhealthy', 'updating', 'offline']); - expect(result?.current.agentPolicies).toEqual([ + expect(result?.current.allAgentPolicies).toEqual([ { id: 'agent-policy-1', name: 'Agent policy 1', @@ -124,17 +144,11 @@ describe('useFetchAgentsData', () => { name: 'Agent policy 1', namespace: 'default', }, - 'agent-policy-managed': { - id: 'agent-policy-managed', - managed: true, - name: 'Managed Agent policy', - namespace: 'default', - }, }); expect(result?.current.kuery).toEqual( 'status:online or (status:error or status:degraded) or (status:updating or status:unenrolling or status:enrolling) or status:offline' ); - expect(result?.current.currentRequestRef).toEqual({ current: 1 }); + expect(result?.current.currentRequestRef).toEqual({ current: 2 }); expect(result?.current.pagination).toEqual({ currentPage: 1, pageSize: 5 }); expect(result?.current.pageSizeOptions).toEqual([5, 20, 50]); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/hooks/use_fetch_agents_data.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/hooks/use_fetch_agents_data.tsx index e67d0e83c28e0..2c9fcfe2b16c6 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/hooks/use_fetch_agents_data.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/hooks/use_fetch_agents_data.tsx @@ -23,6 +23,7 @@ import { sendGetAgentPolicies, useAuthz, sendGetActionStatus, + sendBulkGetAgentPolicies, } from '../../../../hooks'; import { AgentStatusKueryHelper, ExperimentalFeaturesService } from '../../../../services'; import { LEGACY_AGENT_POLICY_SAVED_OBJECT_TYPE, SO_SEARCH_LIMIT } from '../../../../constants'; @@ -32,8 +33,59 @@ import { getKuery } from '../utils/get_kuery'; const REFRESH_INTERVAL_MS = 30000; const MAX_AGENT_ACTIONS = 100; -export function useFetchAgentsData() { +/** Allow to fetch full agent policy using a cache */ +function useFullAgentPolicyFetcher() { const authz = useAuthz(); + const fetchedAgentPoliciesRef = useRef<{ + [k: string]: AgentPolicy; + }>({}); + + const fetchPolicies = useCallback( + async (policiesIds: string[]) => { + const policiesToFetchIds = policiesIds.reduce((acc, policyId) => { + if (!fetchedAgentPoliciesRef.current[policyId]) { + acc.push(policyId); + } + return acc; + }, [] as string[]); + + if (policiesToFetchIds.length) { + const bulkGetAgentPoliciesResponse = await sendBulkGetAgentPolicies(policiesToFetchIds, { + full: authz.fleet.readAgentPolicies, + }); + + if (bulkGetAgentPoliciesResponse.error) { + throw bulkGetAgentPoliciesResponse.error; + } + + if (!bulkGetAgentPoliciesResponse.data) { + throw new Error('Invalid bulk GET agent policies response'); + } + bulkGetAgentPoliciesResponse.data.items.forEach((agentPolicy) => { + fetchedAgentPoliciesRef.current[agentPolicy.id] = agentPolicy; + }); + } + + return policiesIds.reduce((acc, policyId) => { + if (fetchedAgentPoliciesRef.current[policyId]) { + acc.push(fetchedAgentPoliciesRef.current[policyId]); + } + return acc; + }, [] as AgentPolicy[]); + }, + [authz.fleet.readAgentPolicies] + ); + + return useMemo( + () => ({ + fetchPolicies, + }), + [fetchPolicies] + ); +} + +export function useFetchAgentsData() { + const fullAgentPolicyFecher = useFullAgentPolicyFetcher(); const { displayAgentMetrics } = ExperimentalFeaturesService.get(); const { notifications } = useStartServices(); @@ -117,6 +169,9 @@ export function useFetchAgentsData() { const [totalInactiveAgents, setTotalInactiveAgents] = useState(0); const [totalManagedAgentIds, setTotalManagedAgentIds] = useState([]); const [managedAgentsOnCurrentPage, setManagedAgentsOnCurrentPage] = useState(0); + const [agentPoliciesIndexedById, setAgentPoliciesIndexedByIds] = useState<{ + [k: string]: AgentPolicy; + }>({}); const [latestAgentActionErrors, setLatestAgentActionErrors] = useState([]); @@ -180,7 +235,6 @@ export function useFetchAgentsData() { }), ]); - isLoadingVar.current = false; // Return if a newer request has been triggered if (currentRequestRef.current !== currentRequest) { return; @@ -211,6 +265,25 @@ export function useFetchAgentsData() { if (!statusSummary) { throw new Error('Invalid GET /agents response - no status summary'); } + // Fetch agent policies, use a local cache + const policyIds = agentsResponse.data.items.map((agent) => agent.policy_id as string); + + const policies = await fullAgentPolicyFecher.fetchPolicies(policyIds); + + isLoadingVar.current = false; + // Return if a newe request has been triggerd + if (currentRequestRef.current !== currentRequest) { + return; + } + + setAgentPoliciesIndexedByIds( + policies.reduce((acc, agentPolicy) => { + acc[agentPolicy.id] = agentPolicy; + + return acc; + }, {} as { [k: string]: AgentPolicy }) + ); + setAgentsStatus(agentStatusesToSummary(statusSummary)); const newAllTags = agentTagsResponse.data.items; @@ -264,6 +337,7 @@ export function useFetchAgentsData() { setLatestAgentActionErrors(allRecentActionErrors); } } catch (error) { + isLoadingVar.current = false; notifications.toasts.addError(error, { title: i18n.translate('xpack.fleet.agentList.errorFetchingDataTitle', { defaultMessage: 'Error fetching agents', @@ -275,6 +349,7 @@ export function useFetchAgentsData() { fetchDataAsync(); }, [ + fullAgentPolicyFecher, pagination.currentPage, pagination.pageSize, kuery, @@ -302,20 +377,12 @@ export function useFetchAgentsData() { const agentPoliciesRequest = useGetAgentPolicies({ page: 1, perPage: SO_SEARCH_LIMIT, - full: authz.fleet.readAgentPolicies, }); - const agentPolicies = useMemo( - () => (agentPoliciesRequest.data ? agentPoliciesRequest.data.items : []), - [agentPoliciesRequest] + const allAgentPolicies = useMemo( + () => agentPoliciesRequest.data?.items || [], + [agentPoliciesRequest.data] ); - const agentPoliciesIndexedById = useMemo(() => { - return agentPolicies.reduce((acc, agentPolicy) => { - acc[agentPolicy.id] = agentPolicy; - - return acc; - }, {} as { [k: string]: AgentPolicy }); - }, [agentPolicies]); return { allTags, @@ -341,7 +408,7 @@ export function useFetchAgentsData() { setSelectedStatus, selectedTags, setSelectedTags, - agentPolicies, + allAgentPolicies, agentPoliciesRequest, agentPoliciesIndexedById, pagination, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx index f7b3b1588b31b..985e709ba22d0 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx @@ -47,6 +47,14 @@ jest.mock('../../../hooks', () => ({ }, useFleetStatus: jest.fn().mockReturnValue({}), sendGetAgentStatus: jest.fn(), + sendBulkGetAgentPolicies: jest.fn().mockResolvedValue({ + data: { + items: [ + { id: 'policy1', is_managed: false }, + { id: 'managed_policy', is_managed: true }, + ], + }, + }), sendGetAgentPolicies: jest.fn().mockResolvedValue({ data: { items: [] } }), sendGetAgentTags: jest.fn().mockReturnValue({ data: { items: ['tag1', 'tag2'] } }), useAuthz: jest diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx index c1e1f83f49103..0535bc9c6af62 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx @@ -101,7 +101,7 @@ export const AgentListPage: React.FunctionComponent<{}> = () => { setSelectedStatus, selectedTags, setSelectedTags, - agentPolicies, + allAgentPolicies, agentPoliciesRequest, agentPoliciesIndexedById, pagination, @@ -286,14 +286,14 @@ export const AgentListPage: React.FunctionComponent<{}> = () => { refreshAgentActivity={isLoading} setSearch={setSearch} setSelectedStatus={setSelectedStatus} - agentPolicies={agentPolicies} + agentPolicies={allAgentPolicies} /> ) : null} {enrollmentFlyout.isOpen ? ( p.id === enrollmentFlyout.selectedPolicyId)} + agentPolicy={allAgentPolicies.find((p) => p.id === enrollmentFlyout.selectedPolicyId)} onClose={() => { setEnrollmentFlyoutState({ isOpen: false }); fetchData(); @@ -401,7 +401,7 @@ export const AgentListPage: React.FunctionComponent<{}> = () => { )} {/* Search and filter bar */} { const authz = useAuthz(); const { - data: agentPolicies, + data: packagePolicies, isLoading: areAgentPoliciesLoading, isFetched: areAgentsFetched, - } = useGetAgentPoliciesQuery( + } = useGetPackagePoliciesQuery( { - full: true, + kuery: `${LEGACY_PACKAGE_POLICY_SAVED_OBJECT_TYPE}.package.name:${FLEET_SERVER_PACKAGE}`, }, { enabled: authz.fleet.readAgentPolicies, } ); + const policyIds = [...new Set(packagePolicies?.items.flatMap((item) => item.policy_ids) ?? [])]; + // now get all agents that are NOT part of a fleet server policy - const serverPolicyIdsQuery = (agentPolicies?.items || []) - .filter((item) => policyHasFleetServer(item)) - .map((p) => `policy_id:${p.id}`) - .join(' or '); + const serverPolicyIdsQuery = policyIds.map((policyId) => `policy_id:${policyId}`).join(' or '); // get agents that are not unenrolled and not fleet server const kuery = 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 ef9f9f34a7eda..1b4e6565efc01 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 @@ -31,7 +31,7 @@ import { useAuthz, } from '../../hooks'; import { FLEET_SERVER_PACKAGE, MAX_FLYOUT_WIDTH } from '../../constants'; -import type { PackagePolicy, AgentPolicy } from '../../types'; +import type { PackagePolicy } from '../../types'; import { Loading } from '..'; @@ -57,11 +57,6 @@ export const AgentEnrollmentFlyout: React.FunctionComponent = ({ isIntegrationFlow, installedPackagePolicy, }) => { - const findPolicyById = (policies: AgentPolicy[], id: string | undefined) => { - if (!id) return undefined; - return policies.find((p) => p.id === id); - }; - const authz = useAuthz(); const fleetStatus = useFleetStatus(); @@ -87,7 +82,7 @@ export const AgentEnrollmentFlyout: React.FunctionComponent = ({ const selectedPolicy = agentPolicyWithPackagePolicies ? agentPolicyWithPackagePolicies - : findPolicyById(agentPolicies, selectedPolicyId); + : undefined; const hasNoFleetServerHost = fleetStatus.isReady && !fleetServerHost; diff --git a/x-pack/plugins/fleet/public/hooks/use_agent_enrollment_flyout_data.ts b/x-pack/plugins/fleet/public/hooks/use_agent_enrollment_flyout_data.ts index 5066366893b0d..2472331025510 100644 --- a/x-pack/plugins/fleet/public/hooks/use_agent_enrollment_flyout_data.ts +++ b/x-pack/plugins/fleet/public/hooks/use_agent_enrollment_flyout_data.ts @@ -10,8 +10,6 @@ import { useMemo } from 'react'; import type { AgentPolicy } from '../types'; import { SO_SEARCH_LIMIT } from '../constants'; -import { useAuthz } from './use_authz'; - import { useGetAgentPolicies, useGetEnrollmentSettings } from './use_request'; interface AgentEnrollmentFlyoutData { @@ -22,7 +20,6 @@ interface AgentEnrollmentFlyoutData { } export function useAgentEnrollmentFlyoutData(): AgentEnrollmentFlyoutData { - const authz = useAuthz(); const { data: agentPoliciesData, isInitialRequest: isInitialAgentPolicyRequest, @@ -31,7 +28,6 @@ export function useAgentEnrollmentFlyoutData(): AgentEnrollmentFlyoutData { } = useGetAgentPolicies({ page: 1, perPage: SO_SEARCH_LIMIT, - full: authz.fleet.readAgentPolicies, }); const { diff --git a/x-pack/plugins/fleet/public/hooks/use_package_installations.tsx b/x-pack/plugins/fleet/public/hooks/use_package_installations.tsx deleted file mode 100644 index 9147d781336de..0000000000000 --- a/x-pack/plugins/fleet/public/hooks/use_package_installations.tsx +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { useMemo } from 'react'; -import semverLt from 'semver/functions/lt'; - -import { installationStatuses } from '../../common/constants'; -import type { PackagePolicy } from '../types'; - -import { useGetPackagesQuery } from './use_request/epm'; -import { useGetAgentPoliciesQuery } from './use_request/agent_policy'; - -interface UpdatableIntegration { - currentVersion: string; - policiesToUpgrade: Array<{ - id: string; - name: string; - agentsCount: number; - pkgPolicyId: string; - pkgPolicyName: string; - pkgPolicyIntegrationVersion: string; - }>; -} - -export const usePackageInstallationsQuery = () => { - const { data: allPackages, isLoading: isLoadingPackages } = useGetPackagesQuery({ - prerelease: true, - }); - - const { data: agentPolicyData, isLoading: isLoadingPolicies } = useGetAgentPoliciesQuery({ - full: true, - }); - - const allInstalledPackages = useMemo( - () => (allPackages?.items || []).filter((pkg) => pkg.status === installationStatuses.Installed), - [allPackages?.items] - ); - - const updatablePackages = useMemo( - () => - allInstalledPackages.filter( - (item) => - 'installationInfo' in item && - item.installationInfo?.version && - semverLt(item.installationInfo.version, item.version) - ), - [allInstalledPackages] - ); - - const updatableIntegrations = useMemo>( - () => - (agentPolicyData?.items || []).reduce((result, policy) => { - policy.package_policies?.forEach((pkgPolicy: PackagePolicy) => { - if (!pkgPolicy.package) return false; - const { name, version } = pkgPolicy.package; - const installedPackage = allInstalledPackages.find( - (installedPkg) => - 'installationInfo' in installedPkg && installedPkg?.installationInfo?.name === name - ); - if ( - installedPackage && - 'installationInfo' in installedPackage && - installedPackage?.installationInfo?.version && - semverLt(version, installedPackage.installationInfo.version) - ) { - const packageData = result.get(name) ?? { - currentVersion: installedPackage.installationInfo.version, - policiesToUpgrade: [], - }; - packageData.policiesToUpgrade.push({ - id: policy.id, - name: policy.name, - agentsCount: policy.agents ?? 0, - pkgPolicyId: pkgPolicy.id, - pkgPolicyName: pkgPolicy.name, - pkgPolicyIntegrationVersion: version, - }); - result.set(name, packageData); - } - }); - return result; - }, new Map()), - [allInstalledPackages, agentPolicyData] - ); - - return { - allPackages, - allInstalledPackages, - updatablePackages, - updatableIntegrations, - isLoadingPackages, - isLoadingPolicies, - }; -}; diff --git a/x-pack/plugins/fleet/public/hooks/use_request/agent_policy.ts b/x-pack/plugins/fleet/public/hooks/use_request/agent_policy.ts index 837222dae103f..b1a76f5a334f2 100644 --- a/x-pack/plugins/fleet/public/hooks/use_request/agent_policy.ts +++ b/x-pack/plugins/fleet/public/hooks/use_request/agent_policy.ts @@ -32,7 +32,8 @@ export const useGetAgentPolicies = (query?: GetAgentPoliciesRequest['query']) => return useRequest({ path: agentPolicyRouteService.getListPath(), method: 'get', - query, + // Make noAgentCount the default as it have a significant performance impact + query: { ...(query ?? {}), noAgentCount: query?.noAgentCount === false ? false : true }, version: API_VERSIONS.public.v1, }); }; @@ -47,14 +48,18 @@ export const useGetAgentPoliciesQuery = ( sendRequestForRq({ path: agentPolicyRouteService.getListPath(), method: 'get', - query, + // Make noAgentCount the default as it have a significant performance impact + query: { ...(query ?? {}), noAgentCount: query?.noAgentCount === false ? false : true }, version: API_VERSIONS.public.v1, }), enabled: options?.enabled, }); }; -export const useBulkGetAgentPoliciesQuery = (ids: string[], options?: { full?: boolean }) => { +export const useBulkGetAgentPoliciesQuery = ( + ids: string[], + options?: { full?: boolean; ignoreMissing?: boolean } +) => { return useQuery(['agentPolicies', ids], () => sendRequestForRq({ path: agentPolicyRouteService.getBulkGetPath(), @@ -65,11 +70,14 @@ export const useBulkGetAgentPoliciesQuery = (ids: string[], options?: { full?: b ); }; -export const sendBulkGetAgentPolicies = (ids: string[], options?: { full?: boolean }) => { +export const sendBulkGetAgentPolicies = ( + ids: string[], + options?: { full?: boolean; ignoreMissing?: boolean } +) => { return sendRequest({ path: agentPolicyRouteService.getBulkGetPath(), method: 'post', - body: JSON.stringify({ ids, full: options?.full }), + body: JSON.stringify({ ids, full: options?.full, ignoreMissing: options?.ignoreMissing }), version: API_VERSIONS.public.v1, }); }; diff --git a/x-pack/plugins/fleet/public/hooks/use_request/package_policy.ts b/x-pack/plugins/fleet/public/hooks/use_request/package_policy.ts index 6ceda885e48d4..8cacf2de03e23 100644 --- a/x-pack/plugins/fleet/public/hooks/use_request/package_policy.ts +++ b/x-pack/plugins/fleet/public/hooks/use_request/package_policy.ts @@ -59,14 +59,20 @@ export const sendDeletePackagePolicy = (body: DeletePackagePoliciesRequest['body }); }; -export function useGetPackagePoliciesQuery(query: GetPackagePoliciesRequest['query']) { - return useQuery(['packagePolicies'], () => - sendRequestForRq({ - method: 'get', - version: API_VERSIONS.public.v1, - path: packagePolicyRouteService.getListPath(), - query, - }) +export function useGetPackagePoliciesQuery( + query: GetPackagePoliciesRequest['query'], + options: Partial<{ enabled: boolean }> = {} +) { + return useQuery( + ['packagePolicies'], + () => + sendRequestForRq({ + method: 'get', + version: API_VERSIONS.public.v1, + path: packagePolicyRouteService.getListPath(), + query, + }), + options ); } diff --git a/x-pack/plugins/fleet/scripts/create_agent_policies/create_agent_policies.ts b/x-pack/plugins/fleet/scripts/create_agent_policies/create_agent_policies.ts new file mode 100644 index 0000000000000..83838b3443e90 --- /dev/null +++ b/x-pack/plugins/fleet/scripts/create_agent_policies/create_agent_policies.ts @@ -0,0 +1,134 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ToolingLog } from '@kbn/tooling-log'; +import yargs from 'yargs'; + +import { LEGACY_AGENT_POLICY_SAVED_OBJECT_TYPE } from '../../common'; + +const logger = new ToolingLog({ + level: 'info', + writeTo: process.stdout, +}); + +const ES_URL = 'http://localhost:9200'; +const ES_SUPERUSER = 'system_indices_superuser'; +const ES_PASSWORD = 'changeme'; + +const printUsage = () => + logger.info(` + Create mocked agent policies to test Fleet UI at scale +`); + +const INDEX_BULK_OP = '{ "index":{ "_id": "{{id}}" } }\n'; + +async function createAgentPoliciesDocsBulk(size: number) { + const auth = 'Basic ' + Buffer.from(ES_SUPERUSER + ':' + ES_PASSWORD).toString('base64'); + const body = Array.from({ length: size }, (_, index) => index + 1) + .flatMap((idx) => [ + INDEX_BULK_OP.replace( + /{{id}}/, + `${LEGACY_AGENT_POLICY_SAVED_OBJECT_TYPE}:test-policy-${idx}` + ), + JSON.stringify({ + [LEGACY_AGENT_POLICY_SAVED_OBJECT_TYPE]: { + namespace: 'default', + monitoring_enabled: ['logs', 'metrics', 'traces'], + name: `Test Policy ${idx}`, + description: 'test policy', + is_default: false, + is_default_fleet_server: false, + inactivity_timeout: 1209600, + is_preconfigured: false, + status: 'active', + is_managed: false, + revision: 2, + updated_at: new Date().toISOString(), + updated_by: 'system', + schema_version: '1.1.1', + is_protected: false, + }, + type: LEGACY_AGENT_POLICY_SAVED_OBJECT_TYPE, + references: [], + managed: false, + coreMigrationVersion: '8.8.0', + typeMigrationVersion: '10.3.0', + created_at: new Date().toISOString(), + updated_at: new Date().toISOString(), + }) + '\n', + ]) + .join(''); + const res = await fetch(`${ES_URL}/.kibana_ingest/_bulk`, { + method: 'post', + body, + headers: { + Authorization: auth, + 'Content-Type': 'application/x-ndjson', + }, + }); + const data = await res.json(); + + if (!data.items) { + logger.error('Error creating agent policies docs: ' + JSON.stringify(data)); + process.exit(1); + } + return data; +} + +async function createEnrollmentToken(size: number) { + const auth = 'Basic ' + Buffer.from(ES_SUPERUSER + ':' + ES_PASSWORD).toString('base64'); + const body = Array.from({ length: size }, (_, index) => index + 1) + .flatMap((idx) => [ + INDEX_BULK_OP.replace(/{{id}}/, `test-enrollment-token-${idx}`), + JSON.stringify({ + active: true, + api_key_id: 'faketest123', + api_key: 'test==', + name: `Test Policy ${idx}`, + policy_id: `${LEGACY_AGENT_POLICY_SAVED_OBJECT_TYPE}:test-policy-${idx}`, + namespaces: [], + created_at: new Date().toISOString(), + }) + '\n', + ]) + .join(''); + + const res = await fetch(`${ES_URL}/.fleet-enrollment-api-keys/_bulk`, { + method: 'post', + body, + headers: { + Authorization: auth, + 'Content-Type': 'application/x-ndjson', + }, + }); + const data = await res.json(); + + if (!data.items) { + logger.error('Error creating agent policies docs: ' + JSON.stringify(data)); + process.exit(1); + } + return data; +} + +export async function run() { + const { + size: sizeArg = 500, + // ignore yargs positional args, we only care about named args + _, + $0, + ...otherArgs + } = yargs(process.argv.slice(2)).argv; + if (Object.keys(otherArgs).length) { + logger.error(`Unknown arguments: ${Object.keys(otherArgs).join(', ')}`); + printUsage(); + process.exit(0); + } + + const size = Number(sizeArg).valueOf(); + logger.info(`Creating ${size} policies`); + await Promise.all([createAgentPoliciesDocsBulk(size), createEnrollmentToken(size)]); + logger.info(`Succesfuly created ${size} policies`); +} diff --git a/x-pack/plugins/triggers_actions_ui/config.ts b/x-pack/plugins/fleet/scripts/create_agent_policies/index.js similarity index 50% rename from x-pack/plugins/triggers_actions_ui/config.ts rename to x-pack/plugins/fleet/scripts/create_agent_policies/index.js index 3f288f7e4ddb7..a51859ee684c6 100644 --- a/x-pack/plugins/triggers_actions_ui/config.ts +++ b/x-pack/plugins/fleet/scripts/create_agent_policies/index.js @@ -5,10 +5,13 @@ * 2.0. */ -import { schema, TypeOf } from '@kbn/config-schema'; +require('../../../../../src/setup_node_env'); +require('./create_agent_policies').run(); -export const configSchema = schema.object({ - enableGeoTrackingThresholdAlert: schema.maybe(schema.boolean({ defaultValue: false })), -}); +/* +Usage: + +cd x-pack/plugins/fleet +node scripts/create_agents/index.js -export type ConfigSchema = TypeOf; +*/ diff --git a/x-pack/plugins/fleet/server/plugin.ts b/x-pack/plugins/fleet/server/plugin.ts index 043b02ca93d7f..8b472b8b4dfbb 100644 --- a/x-pack/plugins/fleet/server/plugin.ts +++ b/x-pack/plugins/fleet/server/plugin.ts @@ -130,6 +130,7 @@ import { getPackageSpecTagId } from './services/epm/kibana/assets/tag_assets'; import { FleetMetricsTask } from './services/metrics/fleet_metrics_task'; import { fetchAgentMetrics } from './services/metrics/fetch_agent_metrics'; import { registerIntegrationFieldsExtractor } from './services/register_integration_fields_extractor'; +import { registerUpgradeManagedPackagePoliciesTask } from './services/setup/managed_package_policies'; export interface FleetSetupDeps { security: SecurityPluginSetup; @@ -180,6 +181,7 @@ export interface FleetAppContext { auditLogger?: AuditLogger; uninstallTokenService: UninstallTokenServiceInterface; unenrollInactiveAgentsTask: UnenrollInactiveAgentsTask; + taskManagerStart?: TaskManagerStartContract; } export type FleetSetupContract = void; @@ -596,6 +598,8 @@ export class FleetPlugin registerRoutes(fleetAuthzRouter, config); this.telemetryEventsSender.setup(deps.telemetry); + // Register task + registerUpgradeManagedPackagePoliciesTask(deps.taskManager); this.bulkActionsResolver = new BulkActionsResolver(deps.taskManager, core); this.checkDeletedFilesTask = new CheckDeletedFilesTask({ core, @@ -653,6 +657,7 @@ export class FleetPlugin messageSigningService, uninstallTokenService, unenrollInactiveAgentsTask: this.unenrollInactiveAgentsTask!, + taskManagerStart: plugins.taskManager, }); licenseService.start(plugins.licensing.license$); this.telemetryEventsSender.start(plugins.telemetry, core).catch(() => {}); diff --git a/x-pack/plugins/fleet/server/routes/agent/request_diagnostics_handler.ts b/x-pack/plugins/fleet/server/routes/agent/request_diagnostics_handler.ts index a87b21ab89352..b59d38d947860 100644 --- a/x-pack/plugins/fleet/server/routes/agent/request_diagnostics_handler.ts +++ b/x-pack/plugins/fleet/server/routes/agent/request_diagnostics_handler.ts @@ -40,6 +40,7 @@ export const requestDiagnosticsHandler: RequestHandler< const result = await AgentService.requestDiagnostics( esClient, + soClient, request.params.agentId, request.body?.additional_metrics ); diff --git a/x-pack/plugins/fleet/server/services/agents/actions.ts b/x-pack/plugins/fleet/server/services/agents/actions.ts index 11c7174e09312..f0dcd9a1ac62d 100644 --- a/x-pack/plugins/fleet/server/services/agents/actions.ts +++ b/x-pack/plugins/fleet/server/services/agents/actions.ts @@ -313,7 +313,7 @@ export async function cancelAgentAction( soClient: SavedObjectsClientContract, actionId: string ) { - const currentNameSpace = getCurrentNamespace(soClient); + const currentSpaceId = getCurrentNamespace(soClient); const getUpgradeActions = async () => { const query = { @@ -329,7 +329,7 @@ export async function cancelAgentAction( }; const res = await esClient.search({ index: AGENT_ACTIONS_INDEX, - query: await addNamespaceFilteringToQuery(query, currentNameSpace), + query: await addNamespaceFilteringToQuery(query, currentSpaceId), size: SO_SEARCH_LIMIT, }); @@ -358,12 +358,10 @@ export async function cancelAgentAction( const cancelledActions: Array<{ agents: string[] }> = []; const createAction = async (action: FleetServerAgentAction) => { - const namespaces = currentNameSpace ? { namespaces: [currentNameSpace] } : {}; - await createAgentAction(esClient, { id: cancelActionId, type: 'CANCEL', - ...namespaces, + namespaces: [currentSpaceId], agents: action.agents!, data: { target_id: action.action_id, diff --git a/x-pack/plugins/fleet/server/services/agents/crud.ts b/x-pack/plugins/fleet/server/services/agents/crud.ts index 847d0dd8335c6..541829f32deb2 100644 --- a/x-pack/plugins/fleet/server/services/agents/crud.ts +++ b/x-pack/plugins/fleet/server/services/agents/crud.ts @@ -433,7 +433,7 @@ async function _filterAgents( }> { const { page = 1, perPage = 20, sortField = 'enrolled_at', sortOrder = 'desc' } = options; const runtimeFields = await buildAgentStatusRuntimeField(soClient); - const currentNameSpace = getCurrentNamespace(soClient); + const currentSpaceId = getCurrentNamespace(soClient); let res; try { @@ -445,7 +445,7 @@ async function _filterAgents( runtime_mappings: runtimeFields, fields: Object.keys(runtimeFields), sort: [{ [sortField]: { order: sortOrder } }], - query: await addNamespaceFilteringToQuery({ bool: { filter: [query] } }, currentNameSpace), + query: await addNamespaceFilteringToQuery({ bool: { filter: [query] } }, currentSpaceId), index: AGENTS_INDEX, ignore_unavailable: true, }); diff --git a/x-pack/plugins/fleet/server/services/agents/reassign.ts b/x-pack/plugins/fleet/server/services/agents/reassign.ts index d5a4d2ab67525..89222f4773f90 100644 --- a/x-pack/plugins/fleet/server/services/agents/reassign.ts +++ b/x-pack/plugins/fleet/server/services/agents/reassign.ts @@ -78,8 +78,7 @@ export async function reassignAgent( policy_revision: null, }); - const currentNameSpace = getCurrentNamespace(soClient); - const namespaces = currentNameSpace ? { namespaces: [currentNameSpace] } : {}; + const currentSpaceId = getCurrentNamespace(soClient); await createAgentAction(esClient, { agents: [agentId], @@ -88,7 +87,7 @@ export async function reassignAgent( data: { policy_id: newAgentPolicyId, }, - ...namespaces, + namespaces: [currentSpaceId], }); } @@ -103,7 +102,7 @@ export async function reassignAgents( ): Promise<{ actionId: string }> { await verifyNewAgentPolicy(soClient, newAgentPolicyId); - const currentNameSpace = getCurrentNamespace(soClient); + const currentSpaceId = getCurrentNamespace(soClient); const outgoingErrors: Record = {}; let givenAgents: Agent[] = []; if ('agents' in options) { @@ -121,7 +120,7 @@ export async function reassignAgents( } } else if ('kuery' in options) { const batchSize = options.batchSize ?? SO_SEARCH_LIMIT; - const namespaceFilter = await agentsKueryNamespaceFilter(currentNameSpace); + const namespaceFilter = await agentsKueryNamespaceFilter(currentSpaceId); const kuery = namespaceFilter ? `${namespaceFilter} AND ${options.kuery}` : options.kuery; const res = await getAgentsByKuery(esClient, soClient, { kuery, @@ -138,7 +137,7 @@ export async function reassignAgents( soClient, { ...options, - spaceId: currentNameSpace, + spaceId: currentSpaceId, batchSize, total: res.total, newAgentPolicyId, @@ -150,7 +149,7 @@ export async function reassignAgents( return await reassignBatch( esClient, - { newAgentPolicyId, spaceId: currentNameSpace }, + { newAgentPolicyId, spaceId: currentSpaceId }, givenAgents, outgoingErrors ); diff --git a/x-pack/plugins/fleet/server/services/agents/reassign_action_runner.ts b/x-pack/plugins/fleet/server/services/agents/reassign_action_runner.ts index cd9183b0771bc..364a6a5433af2 100644 --- a/x-pack/plugins/fleet/server/services/agents/reassign_action_runner.ts +++ b/x-pack/plugins/fleet/server/services/agents/reassign_action_runner.ts @@ -89,7 +89,7 @@ export async function reassignBatch( const actionId = options.actionId ?? uuidv4(); const total = options.total ?? givenAgents.length; const now = new Date().toISOString(); - const namespaces = spaceId ? { namespaces: [spaceId] } : {}; + const namespaces = spaceId ? [spaceId] : []; await createAgentAction(esClient, { id: actionId, @@ -100,7 +100,7 @@ export async function reassignBatch( data: { policy_id: options.newAgentPolicyId, }, - ...namespaces, + namespaces, }); await createErrorActionResults( diff --git a/x-pack/plugins/fleet/server/services/agents/request_diagnostics.test.ts b/x-pack/plugins/fleet/server/services/agents/request_diagnostics.test.ts index 7010b1f2c3b1e..7f6af525695cd 100644 --- a/x-pack/plugins/fleet/server/services/agents/request_diagnostics.test.ts +++ b/x-pack/plugins/fleet/server/services/agents/request_diagnostics.test.ts @@ -28,8 +28,8 @@ describe('requestDiagnostics', () => { describe('requestDiagnostics (singular)', () => { it('can request diagnostics for single agent', async () => { - const { esClient, agentInRegularDoc } = createClientMock(); - await requestDiagnostics(esClient, agentInRegularDoc._id); + const { soClient, esClient, agentInRegularDoc } = createClientMock(); + await requestDiagnostics(esClient, soClient, agentInRegularDoc._id); expect(esClient.create).toHaveBeenCalledWith( expect.objectContaining({ diff --git a/x-pack/plugins/fleet/server/services/agents/request_diagnostics.ts b/x-pack/plugins/fleet/server/services/agents/request_diagnostics.ts index 323af2ad29314..c4f0e1f0591ad 100644 --- a/x-pack/plugins/fleet/server/services/agents/request_diagnostics.ts +++ b/x-pack/plugins/fleet/server/services/agents/request_diagnostics.ts @@ -11,6 +11,10 @@ import type { RequestDiagnosticsAdditionalMetrics } from '../../../common/types' import { SO_SEARCH_LIMIT, REQUEST_DIAGNOSTICS_TIMEOUT_MS } from '../../constants'; +import { getCurrentNamespace } from '../spaces/get_current_namespace'; + +import { agentsKueryNamespaceFilter } from '../spaces/agent_namespaces'; + import type { GetAgentsOptions } from '.'; import { getAgents, getAgentsByKuery } from './crud'; import { createAgentAction } from './actions'; @@ -22,9 +26,12 @@ import { export async function requestDiagnostics( esClient: ElasticsearchClient, + soClient: SavedObjectsClientContract, agentId: string, additionalMetrics?: RequestDiagnosticsAdditionalMetrics[] ): Promise<{ actionId: string }> { + const currentSpaceId = getCurrentNamespace(soClient); + const response = await createAgentAction(esClient, { agents: [agentId], created_at: new Date().toISOString(), @@ -33,6 +40,7 @@ export async function requestDiagnostics( data: { additional_metrics: additionalMetrics, }, + namespaces: [currentSpaceId], }); return { actionId: response.id }; } @@ -45,24 +53,29 @@ export async function bulkRequestDiagnostics( additionalMetrics?: RequestDiagnosticsAdditionalMetrics[]; } ): Promise<{ actionId: string }> { + const currentSpaceId = getCurrentNamespace(soClient); + if ('agentIds' in options) { const givenAgents = await getAgents(esClient, soClient, options); return await requestDiagnosticsBatch(esClient, givenAgents, { additionalMetrics: options.additionalMetrics, + spaceId: currentSpaceId, }); } const batchSize = options.batchSize ?? SO_SEARCH_LIMIT; + const namespaceFilter = await agentsKueryNamespaceFilter(currentSpaceId); + const kuery = namespaceFilter ? `${namespaceFilter} AND ${options.kuery}` : options.kuery; const res = await getAgentsByKuery(esClient, soClient, { - kuery: options.kuery, + kuery, showInactive: false, page: 1, perPage: batchSize, }); if (res.total <= batchSize) { - const givenAgents = await getAgents(esClient, soClient, options); - return await requestDiagnosticsBatch(esClient, givenAgents, { + return await requestDiagnosticsBatch(esClient, res.agents, { additionalMetrics: options.additionalMetrics, + spaceId: currentSpaceId, }); } else { return await new RequestDiagnosticsActionRunner( @@ -72,6 +85,7 @@ export async function bulkRequestDiagnostics( ...options, batchSize, total: res.total, + spaceId: currentSpaceId, }, { pitId: await openPointInTime(esClient) } ).runActionAsyncWithRetry(); diff --git a/x-pack/plugins/fleet/server/services/agents/request_diagnostics_action_runner.ts b/x-pack/plugins/fleet/server/services/agents/request_diagnostics_action_runner.ts index 073297fabe8fa..ecdcc8a59688c 100644 --- a/x-pack/plugins/fleet/server/services/agents/request_diagnostics_action_runner.ts +++ b/x-pack/plugins/fleet/server/services/agents/request_diagnostics_action_runner.ts @@ -39,6 +39,7 @@ export async function requestDiagnosticsBatch( actionId?: string; total?: number; additionalMetrics?: RequestDiagnosticsAdditionalMetrics[]; + spaceId?: string; } ): Promise<{ actionId: string }> { const errors: Record = {}; @@ -56,6 +57,8 @@ export async function requestDiagnosticsBatch( }); const agentIds = givenAgents.map((agent) => agent.id); + const spaceId = options.spaceId; + const namespaces = spaceId ? [spaceId] : []; await createAgentAction(esClient, { id: actionId, @@ -67,6 +70,7 @@ export async function requestDiagnosticsBatch( data: { additional_metrics: options.additionalMetrics, }, + namespaces, }); await createErrorActionResults( diff --git a/x-pack/plugins/fleet/server/services/agents/unenroll.ts b/x-pack/plugins/fleet/server/services/agents/unenroll.ts index e2c2a17c4d2ad..01b26d1f40fcd 100644 --- a/x-pack/plugins/fleet/server/services/agents/unenroll.ts +++ b/x-pack/plugins/fleet/server/services/agents/unenroll.ts @@ -12,6 +12,8 @@ import { v4 as uuidv4 } from 'uuid'; import type { Agent } from '../../types'; import { HostedAgentPolicyRestrictionRelatedError } from '../../errors'; import { SO_SEARCH_LIMIT } from '../../constants'; +import { getCurrentNamespace } from '../spaces/get_current_namespace'; +import { agentsKueryNamespaceFilter } from '../spaces/agent_namespaces'; import { createAgentAction } from './actions'; import type { GetAgentsOptions } from './crud'; @@ -49,6 +51,7 @@ export async function unenrollAgent( revoke?: boolean; } ) { + await getAgentById(esClient, soClient, agentId); // throw 404 if agent not in namespace if (!options?.force) { await unenrollAgentIsAllowed(soClient, esClient, agentId); } @@ -56,10 +59,12 @@ export async function unenrollAgent( return forceUnenrollAgent(esClient, soClient, agentId); } const now = new Date().toISOString(); + const currentSpaceId = getCurrentNamespace(soClient); await createAgentAction(esClient, { agents: [agentId], created_at: now, type: 'UNENROLL', + namespaces: [currentSpaceId], }); await updateAgent(esClient, agentId, { unenrollment_started_at: now, @@ -76,27 +81,37 @@ export async function unenrollAgents( showInactive?: boolean; } ): Promise<{ actionId: string }> { + const spaceId = getCurrentNamespace(soClient); + if ('agentIds' in options) { const givenAgents = await getAgents(esClient, soClient, options); - return await unenrollBatch(soClient, esClient, givenAgents, options); + return await unenrollBatch(soClient, esClient, givenAgents, { + ...options, + spaceId, + }); } const batchSize = options.batchSize ?? SO_SEARCH_LIMIT; + const namespaceFilter = await agentsKueryNamespaceFilter(spaceId); + const kuery = namespaceFilter ? `${namespaceFilter} AND ${options.kuery}` : options.kuery; const res = await getAgentsByKuery(esClient, soClient, { - kuery: options.kuery, + kuery, showInactive: options.showInactive ?? false, page: 1, perPage: batchSize, }); if (res.total <= batchSize) { - const givenAgents = await getAgents(esClient, soClient, options); - return await unenrollBatch(soClient, esClient, givenAgents, options); + return await unenrollBatch(soClient, esClient, res.agents, { + ...options, + spaceId, + }); } else { return await new UnenrollActionRunner( esClient, soClient, { ...options, + spaceId, batchSize, total: res.total, }, @@ -120,5 +135,5 @@ export async function forceUnenrollAgent( active: false, unenrolled_at: new Date().toISOString(), }); - await updateActionsForForceUnenroll(esClient, [agent.id], uuidv4(), 1); + await updateActionsForForceUnenroll(esClient, soClient, [agent.id], uuidv4(), 1); } diff --git a/x-pack/plugins/fleet/server/services/agents/unenroll_action_runner.ts b/x-pack/plugins/fleet/server/services/agents/unenroll_action_runner.ts index 8aae49b754ef7..d4e9d25942385 100644 --- a/x-pack/plugins/fleet/server/services/agents/unenroll_action_runner.ts +++ b/x-pack/plugins/fleet/server/services/agents/unenroll_action_runner.ts @@ -19,6 +19,8 @@ import { invalidateAPIKeys } from '../api_keys'; import { appContextService } from '../app_context'; +import { getCurrentNamespace } from '../spaces/get_current_namespace'; + import { ActionRunner } from './action_runner'; import { bulkUpdateAgents } from './crud'; @@ -61,6 +63,7 @@ export async function unenrollBatch( revoke?: boolean; actionId?: string; total?: number; + spaceId?: string; } ): Promise<{ actionId: string }> { const hostedPolicies = await getHostedPolicies(soClient, givenAgents); @@ -100,11 +103,14 @@ export async function unenrollBatch( const agentIds = agentsToUpdate.map((agent) => agent.id); + const spaceId = options.spaceId; + const namespaces = spaceId ? [spaceId] : []; + if (options.revoke) { // Get all API keys that need to be invalidated await invalidateAPIKeysForAgents(agentsToUpdate); - await updateActionsForForceUnenroll(esClient, agentIds, actionId, total); + await updateActionsForForceUnenroll(esClient, soClient, agentIds, actionId, total); } else { // Create unenroll action for each agent await createAgentAction(esClient, { @@ -113,6 +119,7 @@ export async function unenrollBatch( created_at: now, type: 'UNENROLL', total, + namespaces, }); } @@ -130,17 +137,20 @@ export async function unenrollBatch( export async function updateActionsForForceUnenroll( esClient: ElasticsearchClient, + soClient: SavedObjectsClientContract, agentIds: string[], actionId: string, total: number ) { // creating an action doc so that force unenroll shows up in activity + const currentSpaceId = getCurrentNamespace(soClient); await createAgentAction(esClient, { id: actionId, agents: agentIds, created_at: new Date().toISOString(), type: 'FORCE_UNENROLL', total, + namespaces: [currentSpaceId], }); await bulkCreateAgentActionResults( esClient, diff --git a/x-pack/plugins/fleet/server/services/agents/update_agent_tags.ts b/x-pack/plugins/fleet/server/services/agents/update_agent_tags.ts index 4e42ac121ccca..2293130ed5148 100644 --- a/x-pack/plugins/fleet/server/services/agents/update_agent_tags.ts +++ b/x-pack/plugins/fleet/server/services/agents/update_agent_tags.ts @@ -12,7 +12,7 @@ import { AgentReassignmentError } from '../../errors'; import { SO_SEARCH_LIMIT } from '../../constants'; -import { agentsKueryNamespaceFilter, isAgentInNamespace } from '../spaces/agent_namespaces'; +import { agentsKueryNamespaceFilter } from '../spaces/agent_namespaces'; import { getCurrentNamespace } from '../spaces/get_current_namespace'; @@ -27,7 +27,7 @@ export async function updateAgentTags( tagsToAdd: string[], tagsToRemove: string[] ): Promise<{ actionId: string }> { - const currentNameSpace = getCurrentNamespace(soClient); + const currentSpaceId = getCurrentNamespace(soClient); const outgoingErrors: Record = {}; const givenAgents: Agent[] = []; @@ -38,17 +38,13 @@ export async function updateAgentTags( outgoingErrors[maybeAgent.id] = new AgentReassignmentError( `Cannot find agent ${maybeAgent.id}` ); - } else if ((await isAgentInNamespace(maybeAgent, currentNameSpace)) !== true) { - outgoingErrors[maybeAgent.id] = new AgentReassignmentError( - `Agent ${maybeAgent.id} is not in the current space` - ); } else { givenAgents.push(maybeAgent); } } } else if ('kuery' in options) { const batchSize = options.batchSize ?? SO_SEARCH_LIMIT; - const namespaceFilter = await agentsKueryNamespaceFilter(currentNameSpace); + const namespaceFilter = await agentsKueryNamespaceFilter(currentSpaceId); const filters = namespaceFilter ? [namespaceFilter] : []; if (options.kuery !== '') { @@ -76,6 +72,7 @@ export async function updateAgentTags( soClient, { ...options, + spaceId: currentSpaceId, kuery, tagsToAdd, tagsToRemove, @@ -86,15 +83,9 @@ export async function updateAgentTags( ).runActionAsyncWithRetry(); } - return await updateTagsBatch( - soClient, - esClient, - givenAgents, - outgoingErrors, - { - tagsToAdd, - tagsToRemove, - }, - currentNameSpace - ); + return await updateTagsBatch(soClient, esClient, givenAgents, outgoingErrors, { + tagsToAdd, + tagsToRemove, + spaceId: currentSpaceId, + }); } 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 bb3b5f71cb222..309aa80f4d8c2 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 @@ -36,6 +36,7 @@ export class UpdateAgentTagsActionRunner extends ActionRunner { tagsToRemove: this.actionParams?.tagsToRemove, actionId: this.actionParams.actionId, total: this.actionParams.total, + spaceId: this.actionParams.spaceId, } ); } @@ -61,8 +62,8 @@ export async function updateTagsBatch( total?: number; kuery?: string; retryCount?: number; - }, - spaceId?: string + spaceId?: string; + } ): Promise<{ actionId: string; updated?: number; took?: number }> { const errors: Record = { ...outgoingErrors }; const hostedAgentError = `Cannot modify tags on a hosted agent`; @@ -150,7 +151,8 @@ export async function updateTagsBatch( const versionConflictCount = res.version_conflicts ?? 0; const versionConflictIds = isLastRetry ? getUuidArray(versionConflictCount) : []; - const namespaces = spaceId ? { namespaces: [spaceId] } : {}; + const spaceId = options.spaceId; + const namespaces = spaceId ? [spaceId] : []; // creating an action doc so that update tags shows up in activity // the logic only saves agent count in the action that updated, failed or in case of last retry, conflicted @@ -160,7 +162,7 @@ export async function updateTagsBatch( agents: updatedIds .concat(failures.map((failure) => failure.id)) .concat(isLastRetry ? versionConflictIds : []), - ...namespaces, + namespaces, created_at: new Date().toISOString(), type: 'UPDATE_TAGS', total: options.total ?? res.total, @@ -180,7 +182,7 @@ export async function updateTagsBatch( updatedIds.map((id) => ({ agentId: id, actionId, - ...namespaces, + namespaces, })) ); appContextService.getLogger().debug(`action updated result wrote on ${updatedCount} agents`); diff --git a/x-pack/plugins/fleet/server/services/agents/upgrade.ts b/x-pack/plugins/fleet/server/services/agents/upgrade.ts index 40d676a68e24d..c5e4fdc1134f0 100644 --- a/x-pack/plugins/fleet/server/services/agents/upgrade.ts +++ b/x-pack/plugins/fleet/server/services/agents/upgrade.ts @@ -46,8 +46,7 @@ export async function sendUpgradeAgentAction({ ); } - const currentNameSpace = getCurrentNamespace(soClient); - const namespaces = currentNameSpace ? { namespaces: [currentNameSpace] } : {}; + const currentSpaceId = getCurrentNamespace(soClient); await createAgentAction(esClient, { agents: [agentId], @@ -55,7 +54,7 @@ export async function sendUpgradeAgentAction({ data, ack_data: data, type: 'UPGRADE', - ...namespaces, + namespaces: [currentSpaceId], }); await updateAgent(esClient, agentId, { upgraded_at: null, @@ -76,7 +75,7 @@ export async function sendUpgradeAgentsActions( batchSize?: number; } ): Promise<{ actionId: string }> { - const currentNameSpace = getCurrentNamespace(soClient); + const currentSpaceId = getCurrentNamespace(soClient); // Full set of agents const outgoingErrors: Record = {}; let givenAgents: Agent[] = []; @@ -96,7 +95,7 @@ export async function sendUpgradeAgentsActions( } } else if ('kuery' in options) { const batchSize = options.batchSize ?? SO_SEARCH_LIMIT; - const namespaceFilter = await agentsKueryNamespaceFilter(currentNameSpace); + const namespaceFilter = await agentsKueryNamespaceFilter(currentSpaceId); const kuery = namespaceFilter ? `${namespaceFilter} AND ${options.kuery}` : options.kuery; const res = await getAgentsByKuery(esClient, soClient, { @@ -116,12 +115,12 @@ export async function sendUpgradeAgentsActions( ...options, batchSize, total: res.total, - spaceId: currentNameSpace, + spaceId: currentSpaceId, }, { pitId: await openPointInTime(esClient) } ).runActionAsyncWithRetry(); } } - return await upgradeBatch(esClient, givenAgents, outgoingErrors, options, currentNameSpace); + return await upgradeBatch(esClient, givenAgents, outgoingErrors, options, currentSpaceId); } diff --git a/x-pack/plugins/fleet/server/services/agents/upgrade_action_runner.ts b/x-pack/plugins/fleet/server/services/agents/upgrade_action_runner.ts index a11b43a5b3ee2..b4c2d600062df 100644 --- a/x-pack/plugins/fleet/server/services/agents/upgrade_action_runner.ts +++ b/x-pack/plugins/fleet/server/services/agents/upgrade_action_runner.ts @@ -174,7 +174,7 @@ export async function upgradeBatch( const actionId = options.actionId ?? uuidv4(); const total = options.total ?? givenAgents.length; - const namespaces = spaceId ? { namespaces: [spaceId] } : {}; + const namespaces = spaceId ? [spaceId] : []; await createAgentAction(esClient, { id: actionId, @@ -185,7 +185,7 @@ export async function upgradeBatch( total, agents: agentsToUpdate.map((agent) => agent.id), ...rollingUpgradeOptions, - ...namespaces, + namespaces, }); await createErrorActionResults( diff --git a/x-pack/plugins/fleet/server/services/app_context.ts b/x-pack/plugins/fleet/server/services/app_context.ts index f2965025d45d1..7dccb7ba1dfe0 100644 --- a/x-pack/plugins/fleet/server/services/app_context.ts +++ b/x-pack/plugins/fleet/server/services/app_context.ts @@ -25,14 +25,12 @@ import type { EncryptedSavedObjectsPluginSetup, EncryptedSavedObjectsPluginStart, } from '@kbn/encrypted-saved-objects-plugin/server'; - import type { SecurityPluginStart, SecurityPluginSetup } from '@kbn/security-plugin/server'; - import type { CloudSetup } from '@kbn/cloud-plugin/server'; import { DEFAULT_SPACE_ID } from '@kbn/spaces-plugin/common'; import type { SavedObjectTaggingStart } from '@kbn/saved-objects-tagging-plugin/server'; - import { SECURITY_EXTENSION_ID, SPACES_EXTENSION_ID } from '@kbn/core-saved-objects-server'; +import type { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; import type { FleetConfigType } from '../../common/types'; import { @@ -84,6 +82,7 @@ class AppContextService { private bulkActionsResolver: BulkActionsResolver | undefined; private messageSigningService: MessageSigningServiceInterface | undefined; private uninstallTokenService: UninstallTokenServiceInterface | undefined; + private taskManagerStart: TaskManagerStartContract | undefined; public start(appContext: FleetAppContext) { this.data = appContext.data; @@ -108,6 +107,7 @@ class AppContextService { this.bulkActionsResolver = appContext.bulkActionsResolver; this.messageSigningService = appContext.messageSigningService; this.uninstallTokenService = appContext.uninstallTokenService; + this.taskManagerStart = appContext.taskManagerStart; if (appContext.config$) { this.config$ = appContext.config$; @@ -282,6 +282,10 @@ class AppContextService { return this.kibanaInstanceId; } + public getTaskManagerStart() { + return this.taskManagerStart; + } + public addExternalCallback(type: ExternalCallback[0], callback: ExternalCallback[1]) { if (!this.externalCallbacks.has(type)) { this.externalCallbacks.set(type, new Set()); diff --git a/x-pack/plugins/fleet/server/services/epm/packages/cache.test.ts b/x-pack/plugins/fleet/server/services/epm/packages/cache.test.ts new file mode 100644 index 0000000000000..5588dbe35ef31 --- /dev/null +++ b/x-pack/plugins/fleet/server/services/epm/packages/cache.test.ts @@ -0,0 +1,72 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + getPackageAssetsMapCache, + getPackageInfoCache, + runWithCache, + setPackageAssetsMapCache, + setPackageInfoCache, +} from './cache'; + +const PKG_NAME = 'test'; +const PKG_VERSION = '1.0.0'; + +describe('EPM CacheSession', () => { + describe('outside of a cache session', () => { + it('should not cache package info', () => { + setPackageInfoCache(PKG_NAME, PKG_VERSION, { + name: 'test', + } as any); + const cache = getPackageInfoCache(PKG_NAME, PKG_VERSION); + expect(cache).toBeUndefined(); + }); + + it('should not cache assetsMap', () => { + setPackageAssetsMapCache(PKG_NAME, PKG_VERSION, new Map()); + const cache = getPackageAssetsMapCache(PKG_NAME, PKG_VERSION); + expect(cache).toBeUndefined(); + }); + }); + + describe('in of a cache session', () => { + it('should cache package info', async () => { + function setCache() { + setPackageInfoCache(PKG_NAME, PKG_VERSION, { + name: 'test', + } as any); + } + function getCache() { + const cache = getPackageInfoCache(PKG_NAME, PKG_VERSION); + expect(cache).toEqual({ name: 'test' }); + } + + await runWithCache(async () => { + setCache(); + getCache(); + }); + }); + + it('should cache assetsMap', async () => { + function setCache() { + const map = new Map(); + map.set('test.yaml', Buffer.from('name: test')); + setPackageAssetsMapCache(PKG_NAME, PKG_VERSION, map); + } + function getCache() { + const cache = getPackageAssetsMapCache(PKG_NAME, PKG_VERSION); + expect(cache).not.toBeUndefined(); + expect(cache?.get('test.yaml')?.toString()).toEqual('name: test'); + } + + await runWithCache(async () => { + setCache(); + getCache(); + }); + }); + }); +}); diff --git a/x-pack/plugins/fleet/server/services/epm/packages/cache.ts b/x-pack/plugins/fleet/server/services/epm/packages/cache.ts new file mode 100644 index 0000000000000..63eb825365fbe --- /dev/null +++ b/x-pack/plugins/fleet/server/services/epm/packages/cache.ts @@ -0,0 +1,72 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { AsyncLocalStorage } from 'async_hooks'; + +import LRUCache from 'lru-cache'; + +import type { AssetsMap } from '../../../../common/types'; + +import type { PackageInfo } from '../../../../common'; + +const cacheStore = new AsyncLocalStorage(); + +const PACKAGE_INFO_CACHE_SIZE = 20; +const PACKAGE_ASSETS_MAP_CACHE_SIZE = 1; + +class CacheSession { + private _packageInfoCache?: LRUCache; + + private _packageAssetsMap?: LRUCache; + + getPackageInfoCache() { + if (!this._packageInfoCache) { + this._packageInfoCache = new LRUCache({ + max: PACKAGE_INFO_CACHE_SIZE, + }); + } + return this._packageInfoCache; + } + + getPackageAssetsMapCache() { + if (!this._packageAssetsMap) { + this._packageAssetsMap = new LRUCache({ + max: PACKAGE_ASSETS_MAP_CACHE_SIZE, + }); + } + return this._packageAssetsMap; + } +} + +export function getPackageInfoCache(pkgName: string, pkgVersion: string) { + return cacheStore.getStore()?.getPackageInfoCache()?.get(`${pkgName}:${pkgVersion}`); +} + +export function setPackageInfoCache(pkgName: string, pkgVersion: string, packageInfo: PackageInfo) { + return cacheStore.getStore()?.getPackageInfoCache()?.set(`${pkgName}:${pkgVersion}`, packageInfo); +} + +export function getPackageAssetsMapCache(pkgName: string, pkgVersion: string) { + return cacheStore.getStore()?.getPackageAssetsMapCache()?.get(`${pkgName}:${pkgVersion}`); +} + +export function setPackageAssetsMapCache( + pkgName: string, + pkgVersion: string, + assetsMap: AssetsMap +) { + return cacheStore + .getStore() + ?.getPackageAssetsMapCache() + ?.set(`${pkgName}:${pkgVersion}`, assetsMap); +} + +export async function runWithCache(cb: () => Promise): Promise { + const cache = new CacheSession(); + + return cacheStore.run(cache, cb); +} diff --git a/x-pack/plugins/fleet/server/services/epm/packages/get.ts b/x-pack/plugins/fleet/server/services/epm/packages/get.ts index 0e5f5be89cab3..2af0f1e9f1d2b 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/get.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/get.ts @@ -60,6 +60,12 @@ import { auditLoggingService } from '../../audit_logging'; import { getFilteredSearchPackages } from '../filtered_packages'; import { createInstallableFrom } from '.'; +import { + getPackageAssetsMapCache, + setPackageAssetsMapCache, + getPackageInfoCache, + setPackageInfoCache, +} from './cache'; export { getFile } from '../registry'; @@ -415,6 +421,10 @@ export async function getPackageInfo({ ignoreUnverified?: boolean; prerelease?: boolean; }): Promise { + const cacheResult = getPackageInfoCache(pkgName, pkgVersion); + if (cacheResult) { + return cacheResult; + } const [savedObject, latestPackage] = await Promise.all([ getInstallationObject({ savedObjectsClient, pkgName }), Registry.fetchFindLatestPackageOrUndefined(pkgName, { prerelease }), @@ -468,7 +478,10 @@ export async function getPackageInfo({ }; const updated = { ...packageInfo, ...additions }; - return createInstallableFrom(updated, savedObject); + const installable = createInstallableFrom(updated, savedObject); + setPackageInfoCache(pkgName, pkgVersion, installable); + + return installable; } export const getPackageUsageStats = async ({ @@ -720,6 +733,10 @@ export async function getPackageAssetsMap({ logger: Logger; ignoreUnverified?: boolean; }) { + const cache = getPackageAssetsMapCache(packageInfo.name, packageInfo.version); + if (cache) { + return cache; + } const installedPackageWithAssets = await getInstalledPackageWithAssets({ savedObjectsClient, pkgName: packageInfo.name, @@ -736,6 +753,7 @@ export async function getPackageAssetsMap({ } else { assetsMap = installedPackageWithAssets.assetsMap; } + setPackageAssetsMapCache(packageInfo.name, packageInfo.version, assetsMap); return assetsMap; } diff --git a/x-pack/plugins/fleet/server/services/package_policies/utils.ts b/x-pack/plugins/fleet/server/services/package_policies/utils.ts index 0d76fc307c74c..5c19345a58f79 100644 --- a/x-pack/plugins/fleet/server/services/package_policies/utils.ts +++ b/x-pack/plugins/fleet/server/services/package_policies/utils.ts @@ -20,55 +20,16 @@ import { outputService } from '../output'; import { appContextService } from '../app_context'; export const mapPackagePolicySavedObjectToPackagePolicy = ({ - /* eslint-disable @typescript-eslint/naming-convention */ id, version, - attributes: { - name, - description, - namespace, - enabled, - is_managed, - policy_id, - policy_ids, - output_id, - // `package` is a reserved keyword - package: packageInfo, - inputs, - vars, - elasticsearch, - agents, - revision, - secret_references, - updated_at, - updated_by, - created_at, - created_by, - /* eslint-enable @typescript-eslint/naming-convention */ - }, + attributes, + namespaces, }: SavedObject): PackagePolicy => { return { id, - name, - description, - namespace, - enabled, - is_managed, - policy_id, - policy_ids, - output_id, - package: packageInfo, - inputs, - vars, - elasticsearch, version, - agents, - revision, - secret_references, - updated_at, - updated_by, - created_at, - created_by, + spaceIds: namespaces, + ...attributes, }; }; diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index f23ed5836afeb..c1970548e98fa 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -118,7 +118,6 @@ import { mapPackagePolicySavedObjectToPackagePolicy, preflightCheckPackagePolicy, } from './package_policies'; -import { updateDatastreamExperimentalFeatures } from './epm/packages/update'; import type { PackagePolicyClient, PackagePolicyClientFetchAllItemsOptions, @@ -1651,13 +1650,6 @@ class PackagePolicyClientImpl implements PackagePolicyClient { await this.update(soClient, esClient, id, updatePackagePolicy, updateOptions); - // Persist any experimental feature opt-ins that come through the upgrade process to the Installation SO - await updateDatastreamExperimentalFeatures( - soClient, - packagePolicy.package!.name, - experimentalDataStreamFeatures - ); - result.push({ id, name: packagePolicy.name, diff --git a/x-pack/plugins/fleet/server/services/preconfiguration.ts b/x-pack/plugins/fleet/server/services/preconfiguration.ts index 853961f2fd77a..18726cdab4452 100644 --- a/x-pack/plugins/fleet/server/services/preconfiguration.ts +++ b/x-pack/plugins/fleet/server/services/preconfiguration.ts @@ -42,7 +42,7 @@ import { agentPolicyService, addPackageToAgentPolicy } from './agent_policy'; import { type InputsOverride, packagePolicyService } from './package_policy'; import { preconfigurePackageInputs } from './package_policy'; import { appContextService } from './app_context'; -import type { UpgradeManagedPackagePoliciesResult } from './managed_package_policies'; +import type { UpgradeManagedPackagePoliciesResult } from './setup/managed_package_policies'; import { isDefaultAgentlessPolicyEnabled } from './utils/agentless'; interface PreconfigurationResult { diff --git a/x-pack/plugins/fleet/server/services/setup.test.ts b/x-pack/plugins/fleet/server/services/setup.test.ts index 5e88fac35e140..8add6942e9da7 100644 --- a/x-pack/plugins/fleet/server/services/setup.test.ts +++ b/x-pack/plugins/fleet/server/services/setup.test.ts @@ -8,13 +8,14 @@ import type { SavedObjectsClientContract } from '@kbn/core/server'; import type { ElasticsearchClientMock } from '@kbn/core/server/mocks'; +import { MessageSigningError } from '../../common/errors'; import { createAppContextStartContractMock, xpackMocks } from '../mocks'; import { ensurePreconfiguredPackagesAndPolicies } from '.'; import { appContextService } from './app_context'; import { getInstallations } from './epm/packages'; -import { upgradeManagedPackagePolicies } from './managed_package_policies'; +import { setupUpgradeManagedPackagePolicies } from './setup/managed_package_policies'; import { setupFleet } from './setup'; jest.mock('./preconfiguration'); @@ -25,7 +26,7 @@ jest.mock('./settings'); jest.mock('./output'); jest.mock('./download_source'); jest.mock('./epm/packages'); -jest.mock('./managed_package_policies'); +jest.mock('./setup/managed_package_policies'); jest.mock('./setup/upgrade_package_install_version'); jest.mock('./epm/elasticsearch/template/install', () => { return { @@ -64,7 +65,7 @@ describe('setupFleet', () => { nonFatalErrors: [], }); - (upgradeManagedPackagePolicies as jest.Mock).mockResolvedValue([]); + (setupUpgradeManagedPackagePolicies as jest.Mock).mockResolvedValue([]); soClient.get.mockResolvedValue({ attributes: {} } as any); soClient.find.mockResolvedValue({ saved_objects: [] } as any); @@ -80,7 +81,7 @@ describe('setupFleet', () => { describe('should reject with any error thrown underneath', () => { it('SO client throws plain Error', async () => { - mockedMethodThrowsError(upgradeManagedPackagePolicies as jest.Mock); + mockedMethodThrowsError(setupUpgradeManagedPackagePolicies as jest.Mock); const setupPromise = setupFleet(soClient, esClient); await expect(setupPromise).rejects.toThrow('SO method mocked to throw'); @@ -88,7 +89,7 @@ describe('setupFleet', () => { }); it('SO client throws other error', async () => { - mockedMethodThrowsCustom(upgradeManagedPackagePolicies as jest.Mock); + mockedMethodThrowsCustom(setupUpgradeManagedPackagePolicies as jest.Mock); const setupPromise = setupFleet(soClient, esClient); await expect(setupPromise).rejects.toThrow('method mocked to throw'); @@ -97,13 +98,6 @@ describe('setupFleet', () => { }); it('should not return non fatal errors when upgrade result has no errors', async () => { - (upgradeManagedPackagePolicies as jest.Mock).mockResolvedValue([ - { - errors: [], - packagePolicyId: '1', - }, - ]); - const result = await setupFleet(soClient, esClient); expect(result).toEqual({ @@ -112,13 +106,11 @@ describe('setupFleet', () => { }); }); - it('should return non fatal errors when upgrade result has errors', async () => { - (upgradeManagedPackagePolicies as jest.Mock).mockResolvedValue([ - { - errors: [{ key: 'key', message: 'message' }], - packagePolicyId: '1', - }, - ]); + it('should return non fatal errors when generateKeyPair result has errors', async () => { + const messageSigninError = new MessageSigningError('test'); + jest + .mocked(appContextService.getMessageSigningService()!.generateKeyPair) + .mockRejectedValue(messageSigninError); const result = await setupFleet(soClient, esClient); @@ -126,13 +118,7 @@ describe('setupFleet', () => { isInitialized: true, nonFatalErrors: [ { - errors: [ - { - key: 'key', - message: 'message', - }, - ], - packagePolicyId: '1', + error: messageSigninError, }, ], }); diff --git a/x-pack/plugins/fleet/server/services/setup.ts b/x-pack/plugins/fleet/server/services/setup.ts index e59eb229ad8e5..c0b86d6394769 100644 --- a/x-pack/plugins/fleet/server/services/setup.ts +++ b/x-pack/plugins/fleet/server/services/setup.ts @@ -40,8 +40,8 @@ import { ensureFleetFinalPipelineIsInstalled } from './epm/elasticsearch/ingest_ import { ensureDefaultComponentTemplates } from './epm/elasticsearch/template/install'; import { getInstallations, reinstallPackageForInstallation } from './epm/packages'; import { isPackageInstalled } from './epm/packages/install'; -import type { UpgradeManagedPackagePoliciesResult } from './managed_package_policies'; -import { upgradeManagedPackagePolicies } from './managed_package_policies'; +import type { UpgradeManagedPackagePoliciesResult } from './setup/managed_package_policies'; +import { setupUpgradeManagedPackagePolicies } from './setup/managed_package_policies'; import { upgradePackageInstallVersion } from './setup/upgrade_package_install_version'; import { upgradeAgentPolicySchemaVersion } from './setup/upgrade_agent_policy_schema_version'; import { migrateSettingsToFleetServerHost } from './fleet_server_host'; @@ -250,9 +250,7 @@ async function createSetupSideEffects( stepSpan?.end(); stepSpan = apm.startSpan('Upgrade managed package policies', 'preconfiguration'); - const packagePolicyUpgradeErrors = ( - await upgradeManagedPackagePolicies(soClient, esClient) - ).filter((result) => (result.errors ?? []).length > 0); + await setupUpgradeManagedPackagePolicies(soClient, esClient); stepSpan?.end(); logger.debug('Upgrade Fleet package install versions'); @@ -294,7 +292,6 @@ async function createSetupSideEffects( const nonFatalErrors = [ ...preconfiguredPackagesNonFatalErrors, - ...packagePolicyUpgradeErrors, ...(messageSigningServiceNonFatalError ? [messageSigningServiceNonFatalError] : []), ]; diff --git a/x-pack/plugins/fleet/server/services/managed_package_policies.test.ts b/x-pack/plugins/fleet/server/services/setup/managed_package_policies.test.ts similarity index 64% rename from x-pack/plugins/fleet/server/services/managed_package_policies.test.ts rename to x-pack/plugins/fleet/server/services/setup/managed_package_policies.test.ts index 0882fff0ec34f..166ad8c4e8fa3 100644 --- a/x-pack/plugins/fleet/server/services/managed_package_policies.test.ts +++ b/x-pack/plugins/fleet/server/services/setup/managed_package_policies.test.ts @@ -7,15 +7,16 @@ import { elasticsearchServiceMock, savedObjectsClientMock } from '@kbn/core/server/mocks'; +import { packagePolicyService } from '../package_policy'; +import { getInstallation } from '../epm/packages'; + import { upgradeManagedPackagePolicies } from './managed_package_policies'; -import { packagePolicyService } from './package_policy'; -import { getInstallations } from './epm/packages'; -jest.mock('./package_policy'); -jest.mock('./epm/packages'); -jest.mock('./app_context', () => { +jest.mock('../package_policy'); +jest.mock('../epm/packages'); +jest.mock('../app_context', () => { return { - ...jest.requireActual('./app_context'), + ...jest.requireActual('../app_context'), appContextService: { getLogger: jest.fn(() => { return { error: jest.fn(), debug: jest.fn() }; @@ -23,22 +24,21 @@ jest.mock('./app_context', () => { }, }; }); -jest.mock('./audit_logging'); +jest.mock('../audit_logging'); describe('upgradeManagedPackagePolicies', () => { afterEach(() => { jest.clearAllMocks(); + jest.mocked(packagePolicyService.fetchAllItems).mockReset(); }); - it('should not upgrade policies for non-managed package', async () => { + it('should not upgrade policies for installed package', async () => { const esClient = elasticsearchServiceMock.createClusterClient().asInternalUser; const soClient = savedObjectsClientMock.create(); - (getInstallations as jest.Mock).mockResolvedValueOnce({ - saved_objects: [], - }); + (getInstallation as jest.Mock).mockResolvedValueOnce(undefined); - await upgradeManagedPackagePolicies(soClient, esClient); + await upgradeManagedPackagePolicies(soClient, esClient, 'testpkg'); expect(packagePolicyService.upgrade).not.toBeCalled(); }); @@ -62,9 +62,11 @@ describe('upgradeManagedPackagePolicies', () => { }, }; - (packagePolicyService.list as jest.Mock).mockResolvedValueOnce({ - items: [packagePolicy], - }); + (packagePolicyService.fetchAllItems as jest.Mock).mockResolvedValueOnce( + (async function* () { + yield [packagePolicy]; + })() + ); (packagePolicyService.getUpgradeDryRunDiff as jest.Mock).mockResolvedValueOnce({ name: 'non-managed-package-policy', @@ -72,19 +74,13 @@ describe('upgradeManagedPackagePolicies', () => { hasErrors: false, }); - (getInstallations as jest.Mock).mockResolvedValueOnce({ - saved_objects: [ - { - attributes: { - id: 'test-installation', - version: '1.0.0', - keep_policies_up_to_date: true, - }, - }, - ], + (getInstallation as jest.Mock).mockResolvedValueOnce({ + id: 'test-installation', + version: '1.0.0', + keep_policies_up_to_date: true, }); - const results = await upgradeManagedPackagePolicies(soClient, esClient); + const results = await upgradeManagedPackagePolicies(soClient, esClient, 'pkgname'); expect(results).toEqual([ { packagePolicyId: 'managed-package-id', diff: [{ id: 'foo' }, { id: 'bar' }], errors: [] }, ]); @@ -103,39 +99,35 @@ describe('upgradeManagedPackagePolicies', () => { const esClient = elasticsearchServiceMock.createClusterClient().asInternalUser; const soClient = savedObjectsClientMock.create(); - (packagePolicyService.list as jest.Mock).mockResolvedValueOnce({ - items: [ - { - id: 'managed-package-id', - inputs: {}, - version: '', - revision: 1, - updated_at: '', - updated_by: '', - created_at: '', - created_by: '', - package: { - name: 'managed-package', - title: 'Managed Package', - version: '1.0.1', + (packagePolicyService.fetchAllItems as jest.Mock).mockResolvedValueOnce( + (async function* () { + yield [ + { + id: 'managed-package-id', + inputs: {}, + version: '', + revision: 1, + updated_at: '', + updated_by: '', + created_at: '', + created_by: '', + package: { + name: 'managed-package', + title: 'Managed Package', + version: '1.0.1', + }, }, - }, - ], - }); + ]; + })() + ); - (getInstallations as jest.Mock).mockResolvedValueOnce({ - saved_objects: [ - { - attributes: { - id: 'test-installation', - version: '1.0.0', - keep_policies_up_to_date: true, - }, - }, - ], + (getInstallation as jest.Mock).mockResolvedValueOnce({ + id: 'test-installation', + version: '1.0.0', + keep_policies_up_to_date: true, }); - await upgradeManagedPackagePolicies(soClient, esClient); + await upgradeManagedPackagePolicies(soClient, esClient, 'pkgname'); expect(packagePolicyService.getUpgradeDryRunDiff).not.toHaveBeenCalled(); expect(packagePolicyService.upgrade).not.toHaveBeenCalled(); @@ -146,25 +138,27 @@ describe('upgradeManagedPackagePolicies', () => { const esClient = elasticsearchServiceMock.createClusterClient().asInternalUser; const soClient = savedObjectsClientMock.create(); - (packagePolicyService.list as jest.Mock).mockResolvedValueOnce({ - items: [ - { - id: 'conflicting-package-policy', - inputs: {}, - version: '', - revision: 1, - updated_at: '', - updated_by: '', - created_at: '', - created_by: '', - package: { - name: 'conflicting-package', - title: 'Conflicting Package', - version: '0.0.1', + (packagePolicyService.fetchAllItems as jest.Mock).mockResolvedValueOnce( + (async function* () { + yield [ + { + id: 'conflicting-package-policy', + inputs: {}, + version: '', + revision: 1, + updated_at: '', + updated_by: '', + created_at: '', + created_by: '', + package: { + name: 'conflicting-package', + title: 'Conflicting Package', + version: '0.0.1', + }, }, - }, - ], - }); + ]; + })() + ); (packagePolicyService.getUpgradeDryRunDiff as jest.Mock).mockResolvedValueOnce({ name: 'conflicting-package-policy', @@ -175,19 +169,13 @@ describe('upgradeManagedPackagePolicies', () => { hasErrors: true, }); - (getInstallations as jest.Mock).mockResolvedValueOnce({ - saved_objects: [ - { - attributes: { - id: 'test-installation', - version: '1.0.0', - keep_policies_up_to_date: true, - }, - }, - ], + (getInstallation as jest.Mock).mockResolvedValueOnce({ + id: 'test-installation', + version: '1.0.0', + keep_policies_up_to_date: true, }); - const result = await upgradeManagedPackagePolicies(soClient, esClient); + const result = await upgradeManagedPackagePolicies(soClient, esClient, 'pkgname'); expect(result).toEqual([ { diff --git a/x-pack/plugins/fleet/server/services/managed_package_policies.ts b/x-pack/plugins/fleet/server/services/setup/managed_package_policies.ts similarity index 50% rename from x-pack/plugins/fleet/server/services/managed_package_policies.ts rename to x-pack/plugins/fleet/server/services/setup/managed_package_policies.ts index 053d46d1a087d..edb701971cd65 100644 --- a/x-pack/plugins/fleet/server/services/managed_package_policies.ts +++ b/x-pack/plugins/fleet/server/services/setup/managed_package_policies.ts @@ -7,16 +7,22 @@ import type { ElasticsearchClient, SavedObjectsClientContract } from '@kbn/core/server'; import semverLt from 'semver/functions/lt'; +import type { + ConcreteTaskInstance, + TaskManagerSetupContract, + TaskManagerStartContract, +} from '@kbn/task-manager-plugin/server'; -import type { UpgradePackagePolicyDryRunResponseItem } from '../../common/types'; +import type { UpgradePackagePolicyDryRunResponseItem } from '../../../common/types'; -import { PACKAGES_SAVED_OBJECT_TYPE, PACKAGE_POLICY_SAVED_OBJECT_TYPE } from '../constants'; +import { PACKAGES_SAVED_OBJECT_TYPE, PACKAGE_POLICY_SAVED_OBJECT_TYPE } from '../../constants'; -import type { Installation, PackagePolicy } from '../types'; +import type { Installation, PackagePolicy } from '../../types'; -import { appContextService } from './app_context'; -import { getInstallations } from './epm/packages'; -import { packagePolicyService } from './package_policy'; +import { appContextService } from '../app_context'; +import { getInstallation, getInstallations } from '../epm/packages'; +import { packagePolicyService } from '../package_policy'; +import { runWithCache } from '../epm/packages/cache'; export interface UpgradeManagedPackagePoliciesResult { packagePolicyId: string; @@ -24,30 +30,130 @@ export interface UpgradeManagedPackagePoliciesResult { errors: any; } +const TASK_TYPE = 'fleet:setup:upgrade_managed_package_policies'; + +export function registerUpgradeManagedPackagePoliciesTask( + taskManagerSetup: TaskManagerSetupContract +) { + taskManagerSetup.registerTaskDefinitions({ + [TASK_TYPE]: { + title: 'Fleet Setup Upgrade managed package policies', + timeout: '1h', + maxAttempts: 1, + createTaskRunner: ({ taskInstance }: { taskInstance: ConcreteTaskInstance }) => { + const pkgName = taskInstance.params.packageName; + return { + async run() { + const esClient = appContextService.getInternalUserESClient(); + const soClient = appContextService.getInternalUserSOClientWithoutSpaceExtension(); + + await runWithCache(() => upgradeManagedPackagePolicies(soClient, esClient, pkgName)); + }, + async cancel() {}, + }; + }, + }, + }); +} + +async function runUpgradeManagedPackagePoliciesTask( + taskManagerStart: TaskManagerStartContract, + pkgName: string +) { + await taskManagerStart.ensureScheduled({ + id: `${TASK_TYPE}:${pkgName}`, + scope: ['fleet'], + params: { packageName: pkgName }, + taskType: TASK_TYPE, + runAt: new Date(Date.now() + 3 * 1000), + state: {}, + }); +} + /** - * Upgrade any package policies for packages installed through setup that are denoted as `AUTO_UPGRADE` packages - * or have the `keep_policies_up_to_date` flag set to `true` + * + * @param soClient + * @param esClient + * @returns */ -export const upgradeManagedPackagePolicies = async ( +export const setupUpgradeManagedPackagePolicies = async ( soClient: SavedObjectsClientContract, esClient: ElasticsearchClient -): Promise => { +) => { appContextService .getLogger() - .debug('Running required package policies upgrades for managed policies'); - const results: UpgradeManagedPackagePoliciesResult[] = []; + .debug('Scheduling required package policies upgrades for managed policies'); const installedPackages = await getInstallations(soClient, { filter: `${PACKAGES_SAVED_OBJECT_TYPE}.attributes.install_status:installed AND ${PACKAGES_SAVED_OBJECT_TYPE}.attributes.keep_policies_up_to_date:true`, }); - for (const { attributes: installedPackage } of installedPackages.saved_objects) { - const packagePolicies = await getPackagePoliciesNotMatchingVersion( + const packagePoliciesFinder = await getPackagePoliciesNotMatchingVersion( soClient, installedPackage.name, installedPackage.version ); + let shouldRegisterTask = false; + for await (const packagePolicies of packagePoliciesFinder) { + for (const packagePolicy of packagePolicies) { + if (isPolicyVersionLtInstalledVersion(packagePolicy, installedPackage)) { + shouldRegisterTask = true; + break; + } + } + if (shouldRegisterTask) { + break; + } + } + if (shouldRegisterTask) { + appContextService + .getLogger() + .debug( + `Scheduled package policies upgrades for package: ${installedPackage.name}@${installedPackage.version}` + ); + await runUpgradeManagedPackagePoliciesTask( + appContextService.getTaskManagerStart()!, + installedPackage.name + ); + } + } +}; + +/** + * Upgrade any package policies for packages installed through setup that are denoted as `AUTO_UPGRADE` packages + * or have the `keep_policies_up_to_date` flag set to `true` + */ +export const upgradeManagedPackagePolicies = async ( + soClient: SavedObjectsClientContract, + esClient: ElasticsearchClient, + pkgName: string +): Promise => { + appContextService + .getLogger() + .debug('Running required package policies upgrades for managed policies'); + const results: UpgradeManagedPackagePoliciesResult[] = []; + + const installedPackage = await getInstallation({ + pkgName, + savedObjectsClient: soClient, + logger: appContextService.getLogger(), + }); + if (!installedPackage) { + appContextService + .getLogger() + .debug('Aborting upgrading managed package policies: package is not installed'); + + return []; + } + + const packagePoliciesFinder = await getPackagePoliciesNotMatchingVersion( + soClient, + installedPackage.name, + installedPackage.version + ); + + for await (const packagePolicies of packagePoliciesFinder) { for (const packagePolicy of packagePolicies) { if (isPolicyVersionLtInstalledVersion(packagePolicy, installedPackage)) { await upgradePackagePolicy(soClient, esClient, packagePolicy, installedPackage, results); @@ -61,14 +167,11 @@ async function getPackagePoliciesNotMatchingVersion( soClient: SavedObjectsClientContract, pkgName: string, pkgVersion: string -): Promise { - return ( - await packagePolicyService.list(soClient, { - page: 1, - perPage: 1000, - kuery: `${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.package.name:${pkgName} AND NOT ${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.package.version:${pkgVersion}`, - }) - ).items; +) { + return packagePolicyService.fetchAllItems(soClient, { + perPage: 50, + kuery: `${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.package.name:${pkgName} AND NOT ${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.package.version:${pkgVersion}`, + }); } function isPolicyVersionLtInstalledVersion( diff --git a/x-pack/plugins/fleet/server/services/spaces/get_current_namespace.ts b/x-pack/plugins/fleet/server/services/spaces/get_current_namespace.ts index 534e21ad44ae8..e6ffc40264fee 100644 --- a/x-pack/plugins/fleet/server/services/spaces/get_current_namespace.ts +++ b/x-pack/plugins/fleet/server/services/spaces/get_current_namespace.ts @@ -11,6 +11,7 @@ import type { SavedObjectsClientContract } from '@kbn/core/server'; /* * soClient.getCurrentNamespace() returns undefined in the default space. * This helper returns the name of the current space and 'default' in the default space. + * Note: this refers to the current Kibana space, not to be confused with datastream namespaces. */ export function getCurrentNamespace(soClient: SavedObjectsClientContract) { return soClient.getCurrentNamespace() ?? DEFAULT_NAMESPACE_STRING; diff --git a/x-pack/plugins/graph/public/index.ts b/x-pack/plugins/graph/public/index.ts index 63e68eae586b0..85053d703dd24 100644 --- a/x-pack/plugins/graph/public/index.ts +++ b/x-pack/plugins/graph/public/index.ts @@ -7,7 +7,7 @@ import { PluginInitializerContext } from '@kbn/core/public'; import { GraphPlugin } from './plugin'; -import { ConfigSchema } from '../config'; +import type { ConfigSchema } from '../server/config'; export const plugin = (initializerContext: PluginInitializerContext) => new GraphPlugin(initializerContext); diff --git a/x-pack/plugins/graph/public/plugin.ts b/x-pack/plugins/graph/public/plugin.ts index a0fd21dcfa979..f7179f36e204f 100644 --- a/x-pack/plugins/graph/public/plugin.ts +++ b/x-pack/plugins/graph/public/plugin.ts @@ -32,7 +32,7 @@ import type { HomePublicPluginSetup, HomePublicPluginStart } from '@kbn/home-plu import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import { SavedObjectsManagementPluginStart } from '@kbn/saved-objects-management-plugin/public'; import { checkLicense } from '../common/check_license'; -import { ConfigSchema } from '../config'; +import type { ConfigSchema } from '../server/config'; import { CONTENT_ID, LATEST_VERSION } from '../common/content_management'; export interface GraphPluginSetupDependencies { diff --git a/x-pack/plugins/graph/config.ts b/x-pack/plugins/graph/server/config.ts similarity index 100% rename from x-pack/plugins/graph/config.ts rename to x-pack/plugins/graph/server/config.ts diff --git a/x-pack/plugins/graph/common/content_management/cm_services.ts b/x-pack/plugins/graph/server/content_management/cm_services.ts similarity index 100% rename from x-pack/plugins/graph/common/content_management/cm_services.ts rename to x-pack/plugins/graph/server/content_management/cm_services.ts diff --git a/x-pack/plugins/graph/server/content_management/graph_storage.ts b/x-pack/plugins/graph/server/content_management/graph_storage.ts index 6487f942b29d4..d0f57252fdb00 100644 --- a/x-pack/plugins/graph/server/content_management/graph_storage.ts +++ b/x-pack/plugins/graph/server/content_management/graph_storage.ts @@ -7,7 +7,7 @@ import { Logger } from '@kbn/logging'; import { SOContentStorage } from '@kbn/content-management-utils'; -import { cmServicesDefinition } from '../../common/content_management/cm_services'; +import { cmServicesDefinition } from './cm_services'; import type { GraphCrudTypes } from '../../common/content_management'; const SO_TYPE = 'graph-workspace'; diff --git a/x-pack/plugins/graph/common/content_management/v1/cm_services.ts b/x-pack/plugins/graph/server/content_management/v1/cm_services.ts similarity index 100% rename from x-pack/plugins/graph/common/content_management/v1/cm_services.ts rename to x-pack/plugins/graph/server/content_management/v1/cm_services.ts diff --git a/x-pack/plugins/graph/server/index.ts b/x-pack/plugins/graph/server/index.ts index 46877645a8503..821a2a28d53d0 100644 --- a/x-pack/plugins/graph/server/index.ts +++ b/x-pack/plugins/graph/server/index.ts @@ -7,7 +7,7 @@ import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import { configSchema, ConfigSchema } from '../config'; +import { configSchema, ConfigSchema } from './config'; export const plugin = async (initializerContext: PluginInitializerContext) => { const { GraphPlugin } = await import('./plugin'); 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 b7e246614fd38..0ba8ca201d40d 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 @@ -217,7 +217,7 @@ describe('When semantic_text is enabled', () => { }, } as any); const { find } = setup({ - errorsInTrainedModelDeployment: { '.elser_model_2': 'Error' }, + errorsInTrainedModelDeployment: { elser_model_2: 'Error' }, saveMappings, forceSaveMappings, setErrorsInTrainedModelDeployment, @@ -228,7 +228,7 @@ describe('When semantic_text is enabled', () => { }); it('should display only the errored deployment', () => { - expect(find('trainedModelsDeploymentModal').text()).toContain('.elser_model_2'); + expect(find('trainedModelsDeploymentModal').text()).toContain('elser_model_2'); expect(find('trainedModelsDeploymentModal').text()).not.toContain('valid-model'); }); 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 4f8e6557e334f..23f54382f36b9 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 @@ -32,14 +32,16 @@ import { getRequiredParametersFormForType } from './required_parameters_forms'; import { useSemanticText } from './semantic_text/use_semantic_text'; const formWrapper = (props: any) =>
; + +export interface ModelIdMapEntry { + trainedModelId: string; + isDeployed: boolean; + isDeployable: boolean; + isDownloading: boolean; + modelStats?: TrainedModelStat; // third-party models don't have model stats +} export interface InferenceToModelIdMap { - [key: string]: { - trainedModelId: string; - isDeployed: boolean; - isDeployable: boolean; - isDownloading: boolean; - modelStats?: TrainedModelStat; // third-party models don't have model stats - }; + [key: string]: ModelIdMapEntry; } export interface SemanticTextInfo { 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 57871383149cf..42d220ba4724b 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 @@ -36,8 +36,7 @@ export function useSemanticText(props: UseSemanticTextProps) { const { fields, mappingViewFields } = useMappingsState(); const { fetchInferenceToModelIdMap } = useDetailsPageMappingsModelManagement(); const dispatch = useDispatch(); - const { showSuccessToasts, showErrorToasts, showSuccessfullyDeployedToast } = - useMLModelNotificationToasts(); + const { showSuccessToasts, showErrorToasts } = useMLModelNotificationToasts(); const fieldTypeValue = form.getFormData()?.type; useEffect(() => { @@ -127,28 +126,27 @@ export function useSemanticText(props: UseSemanticTextProps) { } try { // 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.inference_id, customInferenceEndpointConfig ); if (trainedModelId) { + if (inferenceData.isDeployable && !inferenceData.isDeployed) { + showSuccessToasts(trainedModelId); + } // clear error because we've succeeded here setErrorsInTrainedModelDeployment?.((prevItems) => ({ ...prevItems, - [trainedModelId]: undefined, + [data.inference_id]: undefined, })); } - showSuccessfullyDeployedToast(trainedModelId); } catch (error) { // trainedModelId is empty string when it's a third party model if (trainedModelId) { setErrorsInTrainedModelDeployment?.((prevItems) => ({ ...prevItems, - [trainedModelId]: error, + [data.inference_id]: error, })); } showErrorToasts(error); diff --git a/x-pack/plugins/index_management/public/application/hooks/use_index_errors.ts b/x-pack/plugins/index_management/public/application/hooks/use_index_errors.ts index 07cda78a1527e..58c3a359c2dce 100644 --- a/x-pack/plugins/index_management/public/application/hooks/use_index_errors.ts +++ b/x-pack/plugins/index_management/public/application/hooks/use_index_errors.ts @@ -59,7 +59,9 @@ export const useIndexErrors = ( if (isLocalModel(model)) { const modelId = model.service_settings.model_id; const modelStats = trainedModelStats?.trained_model_stats.find( - (value) => value.model_id === modelId + (value) => + value.model_id === modelId && + value.deployment_stats?.deployment_id === field.source.inference_id ); if (!modelStats || modelStats.deployment_stats?.state !== 'started') { return { @@ -68,8 +70,9 @@ export const useIndexErrors = ( 'xpack.idxMgmt.indexOverview.indexErrors.modelNotStartedError', { defaultMessage: - 'Model {modelId} for inference endpoint {inferenceId} in field {fieldName} has not been started', + 'Deployment {deploymentId} of model {modelId} for inference endpoint {inferenceId} in field {fieldName} has not been started', values: { + deploymentId: field.source.inference_id as string, inferenceId: field.source.inference_id as string, fieldName: field.path.join('.'), modelId, 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 1b1cafc9880b6..567d3f782f6f1 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 @@ -217,10 +217,11 @@ export const DetailsPageMappingsContent: FunctionComponent<{ const updateMappings = useCallback( async (forceSaveMappings?: boolean) => { const hasSemanticText = hasSemanticTextField(state.fields); + let inferenceToModelIdMap = state.inferenceToModelIdMap; setIsUpdatingMappings(true); try { if (isSemanticTextEnabled && hasMLPermissions && hasSemanticText && !forceSaveMappings) { - await fetchInferenceToModelIdMap(); + inferenceToModelIdMap = await fetchInferenceToModelIdMap(); } const fields = hasSemanticText ? getStateWithCopyToFields(state).fields : state.fields; const denormalizedFields = deNormalize(fields); @@ -231,8 +232,8 @@ export const DetailsPageMappingsContent: FunctionComponent<{ .map((field) => field.inference_id) .filter( (inferenceId: string) => - state.inferenceToModelIdMap?.[inferenceId].trainedModelId && // third-party inference models don't have trainedModelId - !state.inferenceToModelIdMap?.[inferenceId].isDeployed + inferenceToModelIdMap?.[inferenceId].trainedModelId && // third-party inference models don't have trainedModelId + !inferenceToModelIdMap?.[inferenceId].isDeployed ); setHasSavedFields(true); if (inferenceIdsInPendingList.length === 0) { 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 e91ef6c88021d..b2e9a1339c3fb 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 @@ -26,6 +26,7 @@ import React from 'react'; import { EuiLink } from '@elastic/eui'; import { useEffect, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; +import { ModelIdMapEntry } from '../../../../components/mappings_editor/components/document_fields/fields'; import { isSemanticTextField } from '../../../../components/mappings_editor/lib/utils'; import { deNormalize } from '../../../../components/mappings_editor/lib'; import { useMLModelNotificationToasts } from '../../../../../hooks/use_ml_model_status_toasts'; @@ -62,7 +63,7 @@ export function TrainedModelsDeploymentModal({ const closeModal = () => setIsModalVisible(false); const [mlManagementPageUrl, setMlManagementPageUrl] = useState(''); const [allowForceSaveMappings, setAllowForceSaveMappings] = useState(false); - const { showErrorToasts } = useMLModelNotificationToasts(); + const { showErrorToasts, showSuccessfullyDeployedToast } = useMLModelNotificationToasts(); useEffect(() => { const mlLocator = url?.locators.get(ML_APP_LOCATOR); @@ -85,13 +86,19 @@ export function TrainedModelsDeploymentModal({ const [pendingDeployments, setPendingDeployments] = useState([]); - const startModelAllocation = async (trainedModelId: string) => { + const startModelAllocation = async (entry: ModelIdMapEntry & { inferenceId: string }) => { try { - await ml?.mlApi?.trainedModels.startModelAllocation(trainedModelId); + await ml?.mlApi?.trainedModels.startModelAllocation(entry.trainedModelId, { + number_of_allocations: 1, + threads_per_allocation: 1, + priority: 'normal', + deployment_id: entry.inferenceId, + }); + showSuccessfullyDeployedToast(entry.trainedModelId); } catch (error) { setErrorsInTrainedModelDeployment((previousState) => ({ ...previousState, - [trainedModelId]: error.message, + [entry.inferenceId]: error.message, })); showErrorToasts(error); setIsModalVisible(true); @@ -99,8 +106,13 @@ export function TrainedModelsDeploymentModal({ }; useEffect(() => { - const models = inferenceIdsInPendingList.map( - (inferenceId) => inferenceToModelIdMap?.[inferenceId] + const models = inferenceIdsInPendingList.map((inferenceId) => + inferenceToModelIdMap?.[inferenceId] + ? { + inferenceId, + ...inferenceToModelIdMap?.[inferenceId], + } + : undefined ); // filter out third-party models for (const model of models) { if ( @@ -110,16 +122,17 @@ export function TrainedModelsDeploymentModal({ !model.isDeployed ) { // Sometimes the model gets stuck in a ready to deploy state, so we need to trigger deployment manually - startModelAllocation(model.trainedModelId); + // This is currently the only way to surface a specific error message to the user + startModelAllocation(model); } } - const pendingModels = models + const allPendingDeployments = models .map((model) => { - return model?.trainedModelId && !model?.isDeployed ? model?.trainedModelId : ''; + return model?.trainedModelId && !model?.isDeployed ? model?.inferenceId : ''; }) - .filter((trainedModelId) => !!trainedModelId); - const uniqueDeployments = pendingModels.filter( - (deployment, index) => pendingModels.indexOf(deployment) === index + .filter((id) => !!id); + const uniqueDeployments = allPendingDeployments.filter( + (deployment, index) => allPendingDeployments.indexOf(deployment) === index ); setPendingDeployments(uniqueDeployments); // eslint-disable-next-line react-hooks/exhaustive-deps @@ -132,6 +145,8 @@ export function TrainedModelsDeploymentModal({ useEffect(() => { if (erroredDeployments.length > 0 || pendingDeployments.length > 0) { setIsModalVisible(true); + } else { + setIsModalVisible(false); } }, [erroredDeployments.length, pendingDeployments.length]); return isModalVisible ? ( 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 9ad3e74e96a9e..7a8d9f526b9f0 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 @@ -34,9 +34,9 @@ const getCustomInferenceIdMap = ( ? { trainedModelId: model.service_settings.model_id, isDeployable: model.service === Service.elser || model.service === Service.elasticsearch, - isDeployed: modelStatsById[model.service_settings.model_id]?.state === 'started', + isDeployed: modelStatsById[model.inference_id]?.state === 'started', isDownloading: Boolean(downloadStates[model.service_settings.model_id]), - modelStats: modelStatsById[model.service_settings.model_id], + modelStats: modelStatsById[model.inference_id], } : { trainedModelId: '', @@ -104,7 +104,7 @@ export const useDetailsPageMappingsModelManagement = () => { Record >((acc, { model_id: modelId, deployment_stats: stats }) => { if (modelId && stats) { - acc[modelId] = stats; + acc[stats.deployment_id] = stats; } return acc; }, {}) || {}; diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.test.ts b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.test.ts new file mode 100644 index 0000000000000..1d25f09dce3bc --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.test.ts @@ -0,0 +1,310 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { PassThrough } from 'stream'; +import type { InferenceExecutor } from '../../utils/inference_executor'; +import { MessageRole } from '../../../../common/chat_complete'; +import { ToolChoiceType } from '../../../../common/chat_complete/tools'; +import { bedrockClaudeAdapter } from './bedrock_claude_adapter'; +import { addNoToolUsageDirective } from './prompts'; + +describe('bedrockClaudeAdapter', () => { + const executorMock = { + invoke: jest.fn(), + } as InferenceExecutor & { invoke: jest.MockedFn }; + + beforeEach(() => { + executorMock.invoke.mockReset(); + executorMock.invoke.mockImplementation(async () => { + return { + actionId: '', + status: 'ok', + data: new PassThrough(), + }; + }); + }); + + function getCallParams() { + const params = executorMock.invoke.mock.calls[0][0].subActionParams as Record; + return { + system: params.system, + messages: params.messages, + tools: params.tools, + toolChoice: params.toolChoice, + }; + } + + describe('#chatComplete()', () => { + it('calls `executor.invoke` with the right fixed parameters', () => { + bedrockClaudeAdapter.chatComplete({ + executor: executorMock, + messages: [ + { + role: MessageRole.User, + content: 'question', + }, + ], + }); + + expect(executorMock.invoke).toHaveBeenCalledTimes(1); + expect(executorMock.invoke).toHaveBeenCalledWith({ + subAction: 'invokeStream', + subActionParams: { + messages: [ + { + role: 'user', + rawContent: [{ type: 'text', text: 'question' }], + }, + ], + temperature: 0, + stopSequences: ['\n\nHuman:'], + }, + }); + }); + + it('correctly format tools', () => { + bedrockClaudeAdapter.chatComplete({ + executor: executorMock, + messages: [ + { + role: MessageRole.User, + content: 'question', + }, + ], + tools: { + myFunction: { + description: 'myFunction', + }, + myFunctionWithArgs: { + description: 'myFunctionWithArgs', + schema: { + type: 'object', + properties: { + foo: { + type: 'string', + description: 'foo', + }, + }, + required: ['foo'], + }, + }, + }, + }); + + expect(executorMock.invoke).toHaveBeenCalledTimes(1); + + const { tools } = getCallParams(); + expect(tools).toEqual([ + { + name: 'myFunction', + description: 'myFunction', + input_schema: { + properties: {}, + type: 'object', + }, + }, + { + name: 'myFunctionWithArgs', + description: 'myFunctionWithArgs', + input_schema: { + properties: { + foo: { + description: 'foo', + type: 'string', + }, + }, + required: ['foo'], + type: 'object', + }, + }, + ]); + }); + + it('correctly format messages', () => { + bedrockClaudeAdapter.chatComplete({ + executor: executorMock, + messages: [ + { + role: MessageRole.User, + content: 'question', + }, + { + role: MessageRole.Assistant, + content: 'answer', + }, + { + role: MessageRole.User, + content: 'another question', + }, + { + role: MessageRole.Assistant, + content: null, + toolCalls: [ + { + function: { + name: 'my_function', + arguments: { + foo: 'bar', + }, + }, + toolCallId: '0', + }, + ], + }, + { + role: MessageRole.Tool, + toolCallId: '0', + response: { + bar: 'foo', + }, + }, + ], + }); + + expect(executorMock.invoke).toHaveBeenCalledTimes(1); + + const { messages } = getCallParams(); + expect(messages).toEqual([ + { + rawContent: [ + { + text: 'question', + type: 'text', + }, + ], + role: 'user', + }, + { + rawContent: [ + { + text: 'answer', + type: 'text', + }, + ], + role: 'assistant', + }, + { + rawContent: [ + { + text: 'another question', + type: 'text', + }, + ], + role: 'user', + }, + { + rawContent: [ + { + id: '0', + input: { + foo: 'bar', + }, + name: 'my_function', + type: 'tool_use', + }, + ], + role: 'assistant', + }, + { + rawContent: [ + { + content: '{"bar":"foo"}', + tool_use_id: '0', + type: 'tool_result', + }, + ], + role: 'user', + }, + ]); + }); + + it('correctly format system message', () => { + bedrockClaudeAdapter.chatComplete({ + executor: executorMock, + system: 'Some system message', + messages: [ + { + role: MessageRole.User, + content: 'question', + }, + ], + }); + + expect(executorMock.invoke).toHaveBeenCalledTimes(1); + + const { system } = getCallParams(); + expect(system).toEqual('Some system message'); + }); + + it('correctly format tool choice', () => { + bedrockClaudeAdapter.chatComplete({ + executor: executorMock, + messages: [ + { + role: MessageRole.User, + content: 'question', + }, + ], + toolChoice: ToolChoiceType.required, + }); + + expect(executorMock.invoke).toHaveBeenCalledTimes(1); + + const { toolChoice } = getCallParams(); + expect(toolChoice).toEqual({ + type: 'any', + }); + }); + + it('correctly format tool choice for named function', () => { + bedrockClaudeAdapter.chatComplete({ + executor: executorMock, + messages: [ + { + role: MessageRole.User, + content: 'question', + }, + ], + toolChoice: { function: 'foobar' }, + }); + + expect(executorMock.invoke).toHaveBeenCalledTimes(1); + + const { toolChoice } = getCallParams(); + expect(toolChoice).toEqual({ + type: 'tool', + name: 'foobar', + }); + }); + + it('correctly adapt the request for ToolChoiceType.None', () => { + bedrockClaudeAdapter.chatComplete({ + executor: executorMock, + system: 'some system instruction', + messages: [ + { + role: MessageRole.User, + content: 'question', + }, + ], + tools: { + myFunction: { + description: 'myFunction', + }, + }, + toolChoice: ToolChoiceType.none, + }); + + expect(executorMock.invoke).toHaveBeenCalledTimes(1); + + const { toolChoice, tools, system } = getCallParams(); + expect(toolChoice).toBeUndefined(); + expect(tools).toEqual([]); + expect(system).toEqual(addNoToolUsageDirective('some system instruction')); + }); + }); +}); diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.ts b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.ts new file mode 100644 index 0000000000000..5a03dc04347b1 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.ts @@ -0,0 +1,140 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { filter, from, map, switchMap, tap } from 'rxjs'; +import { Readable } from 'stream'; +import type { InvokeAIActionParams } from '@kbn/stack-connectors-plugin/common/bedrock/types'; +import { parseSerdeChunkMessage } from './serde_utils'; +import { Message, MessageRole } from '../../../../common/chat_complete'; +import { createInferenceInternalError } from '../../../../common/errors'; +import { ToolChoiceType, type ToolOptions } from '../../../../common/chat_complete/tools'; +import { InferenceConnectorAdapter } from '../../types'; +import type { BedRockMessage, BedrockToolChoice } from './types'; +import { + BedrockChunkMember, + serdeEventstreamIntoObservable, +} from './serde_eventstream_into_observable'; +import { processCompletionChunks } from './process_completion_chunks'; +import { addNoToolUsageDirective } from './prompts'; + +export const bedrockClaudeAdapter: InferenceConnectorAdapter = { + chatComplete: ({ executor, system, messages, toolChoice, tools }) => { + const noToolUsage = toolChoice === ToolChoiceType.none; + + const connectorInvokeRequest: InvokeAIActionParams = { + system: noToolUsage ? addNoToolUsageDirective(system) : system, + messages: messagesToBedrock(messages), + tools: noToolUsage ? [] : toolsToBedrock(tools), + toolChoice: toolChoiceToBedrock(toolChoice), + temperature: 0, + stopSequences: ['\n\nHuman:'], + }; + + return from( + executor.invoke({ + subAction: 'invokeStream', + subActionParams: connectorInvokeRequest, + }) + ).pipe( + switchMap((response) => { + const readable = response.data as Readable; + return serdeEventstreamIntoObservable(readable); + }), + tap((eventData) => { + if ('modelStreamErrorException' in eventData) { + throw createInferenceInternalError(eventData.modelStreamErrorException.originalMessage); + } + }), + filter((value): value is BedrockChunkMember => { + return 'chunk' in value && value.chunk?.headers?.[':event-type']?.value === 'chunk'; + }), + map((message) => { + return parseSerdeChunkMessage(message.chunk); + }), + processCompletionChunks() + ); + }, +}; + +const toolChoiceToBedrock = ( + toolChoice: ToolOptions['toolChoice'] +): BedrockToolChoice | undefined => { + if (toolChoice === ToolChoiceType.required) { + return { + type: 'any', + }; + } else if (toolChoice === ToolChoiceType.auto) { + return { + type: 'auto', + }; + } else if (typeof toolChoice === 'object') { + return { + type: 'tool', + name: toolChoice.function, + }; + } + // ToolChoiceType.none is not supported by claude + // we are adding a directive to the system instructions instead in that case. + return undefined; +}; + +const toolsToBedrock = (tools: ToolOptions['tools']) => { + return tools + ? Object.entries(tools).map(([toolName, toolDef]) => { + return { + name: toolName, + description: toolDef.description, + input_schema: toolDef.schema ?? { + type: 'object' as const, + properties: {}, + }, + }; + }) + : undefined; +}; + +const messagesToBedrock = (messages: Message[]): BedRockMessage[] => { + return messages.map((message) => { + switch (message.role) { + case MessageRole.User: + return { + role: 'user' as const, + rawContent: [{ type: 'text' as const, text: message.content }], + }; + case MessageRole.Assistant: + return { + role: 'assistant' as const, + rawContent: [ + ...(message.content ? [{ type: 'text' as const, text: message.content }] : []), + ...(message.toolCalls + ? message.toolCalls.map((toolCall) => { + return { + type: 'tool_use' as const, + id: toolCall.toolCallId, + name: toolCall.function.name, + input: ('arguments' in toolCall.function + ? toolCall.function.arguments + : {}) as Record, + }; + }) + : []), + ], + }; + case MessageRole.Tool: + return { + role: 'user' as const, + rawContent: [ + { + type: 'tool_result' as const, + tool_use_id: message.toolCallId, + content: JSON.stringify(message.response), + }, + ], + }; + } + }); +}; diff --git a/x-pack/packages/kbn-cloud-security-posture-common/schema/index.ts b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/index.ts similarity index 73% rename from x-pack/packages/kbn-cloud-security-posture-common/schema/index.ts rename to x-pack/plugins/inference/server/chat_complete/adapters/bedrock/index.ts index 981633d2a3fad..01d849e1ea9af 100644 --- a/x-pack/packages/kbn-cloud-security-posture-common/schema/index.ts +++ b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export { ruleStateAttributes, cspBenchmarkRuleMetadataSchema, rulesStates } from './rules'; +export { bedrockClaudeAdapter } from './bedrock_claude_adapter'; diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/process_completion_chunks.test.ts b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/process_completion_chunks.test.ts new file mode 100644 index 0000000000000..6307aecaeefc4 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/process_completion_chunks.test.ts @@ -0,0 +1,336 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { lastValueFrom, of, toArray } from 'rxjs'; +import { processCompletionChunks } from './process_completion_chunks'; +import type { CompletionChunk } from './types'; + +describe('processCompletionChunks', () => { + it('does not emit for a message_start event', async () => { + const chunks: CompletionChunk[] = [ + { + type: 'message_start', + message: 'foo', + }, + ]; + + expect(await lastValueFrom(of(...chunks).pipe(processCompletionChunks(), toArray()))).toEqual( + [] + ); + }); + + it('emits the correct value for a content_block_start event with text content ', async () => { + const chunks: CompletionChunk[] = [ + { + type: 'content_block_start', + index: 0, + content_block: { type: 'text', text: 'foo' }, + }, + ]; + + expect(await lastValueFrom(of(...chunks).pipe(processCompletionChunks(), toArray()))).toEqual([ + { + type: 'chatCompletionChunk', + content: 'foo', + tool_calls: [], + }, + ]); + }); + + it('emits the correct value for a content_block_start event with tool_use content ', async () => { + const chunks: CompletionChunk[] = [ + { + type: 'content_block_start', + index: 0, + content_block: { type: 'tool_use', id: 'id', name: 'name', input: '{}' }, + }, + ]; + + expect(await lastValueFrom(of(...chunks).pipe(processCompletionChunks(), toArray()))).toEqual([ + { + type: 'chatCompletionChunk', + content: '', + tool_calls: [ + { + toolCallId: 'id', + index: 0, + function: { + arguments: '', + name: 'name', + }, + }, + ], + }, + ]); + }); + + it('emits the correct value for a content_block_delta event with text content ', async () => { + const chunks: CompletionChunk[] = [ + { + type: 'content_block_delta', + index: 0, + delta: { type: 'text_delta', text: 'delta' }, + }, + ]; + + expect(await lastValueFrom(of(...chunks).pipe(processCompletionChunks(), toArray()))).toEqual([ + { + type: 'chatCompletionChunk', + content: 'delta', + tool_calls: [], + }, + ]); + }); + + it('emits the correct value for a content_block_delta event with tool_use content ', async () => { + const chunks: CompletionChunk[] = [ + { + type: 'content_block_delta', + index: 0, + delta: { type: 'input_json_delta', partial_json: '{ "param' }, + }, + ]; + + expect(await lastValueFrom(of(...chunks).pipe(processCompletionChunks(), toArray()))).toEqual([ + { + type: 'chatCompletionChunk', + content: '', + tool_calls: [ + { + index: 0, + toolCallId: '', + function: { + arguments: '{ "param', + name: '', + }, + }, + ], + }, + ]); + }); + + it('does not emit for a content_block_stop event', async () => { + const chunks: CompletionChunk[] = [ + { + type: 'content_block_stop', + index: 0, + }, + ]; + + expect(await lastValueFrom(of(...chunks).pipe(processCompletionChunks(), toArray()))).toEqual( + [] + ); + }); + + it('emits the correct value for a message_delta event with tool_use content ', async () => { + const chunks: CompletionChunk[] = [ + { + type: 'message_delta', + delta: { stop_reason: 'end_turn', stop_sequence: 'stop_seq', usage: { output_tokens: 42 } }, + }, + ]; + + expect(await lastValueFrom(of(...chunks).pipe(processCompletionChunks(), toArray()))).toEqual([ + { + type: 'chatCompletionChunk', + content: 'stop_seq', + tool_calls: [], + }, + ]); + }); + + it('emits a token count for a message_stop event ', async () => { + const chunks: CompletionChunk[] = [ + { + type: 'message_stop', + 'amazon-bedrock-invocationMetrics': { + inputTokenCount: 1, + outputTokenCount: 2, + invocationLatency: 3, + firstByteLatency: 4, + }, + }, + ]; + + expect(await lastValueFrom(of(...chunks).pipe(processCompletionChunks(), toArray()))).toEqual([ + { + type: 'chatCompletionTokenCount', + tokens: { + completion: 2, + prompt: 1, + total: 3, + }, + }, + ]); + }); + + it('emits the correct values for a text response scenario', async () => { + const chunks: CompletionChunk[] = [ + { + type: 'message_start', + message: 'foo', + }, + { + type: 'content_block_start', + index: 0, + content_block: { type: 'text', text: 'foo' }, + }, + { + type: 'content_block_delta', + index: 0, + delta: { type: 'text_delta', text: 'delta1' }, + }, + { + type: 'content_block_delta', + index: 0, + delta: { type: 'text_delta', text: 'delta2' }, + }, + { + type: 'content_block_stop', + index: 0, + }, + { + type: 'message_delta', + delta: { stop_reason: 'end_turn', stop_sequence: 'stop_seq', usage: { output_tokens: 42 } }, + }, + { + type: 'message_stop', + 'amazon-bedrock-invocationMetrics': { + inputTokenCount: 1, + outputTokenCount: 2, + invocationLatency: 3, + firstByteLatency: 4, + }, + }, + ]; + + expect(await lastValueFrom(of(...chunks).pipe(processCompletionChunks(), toArray()))).toEqual([ + { + content: 'foo', + tool_calls: [], + type: 'chatCompletionChunk', + }, + { + content: 'delta1', + tool_calls: [], + type: 'chatCompletionChunk', + }, + { + content: 'delta2', + tool_calls: [], + type: 'chatCompletionChunk', + }, + { + content: 'stop_seq', + tool_calls: [], + type: 'chatCompletionChunk', + }, + { + tokens: { + completion: 2, + prompt: 1, + total: 3, + }, + type: 'chatCompletionTokenCount', + }, + ]); + }); + + it('emits the correct values for a tool_use response scenario', async () => { + const chunks: CompletionChunk[] = [ + { + type: 'message_start', + message: 'foo', + }, + { + type: 'content_block_start', + index: 0, + content_block: { type: 'tool_use', id: 'id', name: 'name', input: '{}' }, + }, + { + type: 'content_block_delta', + index: 0, + delta: { type: 'input_json_delta', partial_json: '{ "param' }, + }, + { + type: 'content_block_delta', + index: 0, + delta: { type: 'input_json_delta', partial_json: '": 12 }' }, + }, + { + type: 'content_block_stop', + index: 0, + }, + { + type: 'message_delta', + delta: { stop_reason: 'tool_use', stop_sequence: null, usage: { output_tokens: 42 } }, + }, + { + type: 'message_stop', + 'amazon-bedrock-invocationMetrics': { + inputTokenCount: 1, + outputTokenCount: 2, + invocationLatency: 3, + firstByteLatency: 4, + }, + }, + ]; + + expect(await lastValueFrom(of(...chunks).pipe(processCompletionChunks(), toArray()))).toEqual([ + { + content: '', + tool_calls: [ + { + function: { + arguments: '', + name: 'name', + }, + index: 0, + toolCallId: 'id', + }, + ], + type: 'chatCompletionChunk', + }, + { + content: '', + tool_calls: [ + { + function: { + arguments: '{ "param', + name: '', + }, + index: 0, + toolCallId: '', + }, + ], + type: 'chatCompletionChunk', + }, + { + content: '', + tool_calls: [ + { + function: { + arguments: '": 12 }', + name: '', + }, + index: 0, + toolCallId: '', + }, + ], + type: 'chatCompletionChunk', + }, + { + tokens: { + completion: 2, + prompt: 1, + total: 3, + }, + type: 'chatCompletionTokenCount', + }, + ]); + }); +}); diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/process_completion_chunks.ts b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/process_completion_chunks.ts new file mode 100644 index 0000000000000..5513cc9028ac9 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/process_completion_chunks.ts @@ -0,0 +1,113 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Observable, Subscriber } from 'rxjs'; +import { + ChatCompletionChunkEvent, + ChatCompletionTokenCountEvent, + ChatCompletionChunkToolCall, + ChatCompletionEventType, +} from '../../../../common/chat_complete'; +import type { CompletionChunk, MessageStopChunk } from './types'; + +export function processCompletionChunks() { + return (source: Observable) => + new Observable((subscriber) => { + function handleNext(chunkBody: CompletionChunk) { + if (isTokenCountCompletionChunk(chunkBody)) { + return emitTokenCountEvent(subscriber, chunkBody); + } + + let completionChunk = ''; + let toolCallChunk: ChatCompletionChunkToolCall | undefined; + + switch (chunkBody.type) { + case 'content_block_start': + if (chunkBody.content_block.type === 'text') { + completionChunk = chunkBody.content_block.text || ''; + } else if (chunkBody.content_block.type === 'tool_use') { + toolCallChunk = { + index: chunkBody.index, + toolCallId: chunkBody.content_block.id, + function: { + name: chunkBody.content_block.name, + // the API returns '{}' here, which can't be merged with the deltas... + arguments: '', + }, + }; + } + break; + + case 'content_block_delta': + if (chunkBody.delta.type === 'text_delta') { + completionChunk = chunkBody.delta.text || ''; + } else if (chunkBody.delta.type === 'input_json_delta') { + toolCallChunk = { + index: chunkBody.index, + toolCallId: '', + function: { + name: '', + arguments: chunkBody.delta.partial_json, + }, + }; + } + break; + + case 'message_delta': + completionChunk = chunkBody.delta.stop_sequence || ''; + break; + + default: + break; + } + + if (completionChunk || toolCallChunk) { + subscriber.next({ + type: ChatCompletionEventType.ChatCompletionChunk, + content: completionChunk, + tool_calls: toolCallChunk ? [toolCallChunk] : [], + }); + } + } + + source.subscribe({ + next: (value) => { + try { + handleNext(value); + } catch (error) { + subscriber.error(error); + } + }, + error: (err) => { + subscriber.error(err); + }, + complete: () => { + subscriber.complete(); + }, + }); + }); +} + +function isTokenCountCompletionChunk(value: CompletionChunk): value is MessageStopChunk { + return value.type === 'message_stop' && 'amazon-bedrock-invocationMetrics' in value; +} + +function emitTokenCountEvent( + subscriber: Subscriber, + chunk: MessageStopChunk +) { + const { inputTokenCount, outputTokenCount } = chunk['amazon-bedrock-invocationMetrics']; + + subscriber.next({ + type: ChatCompletionEventType.ChatCompletionTokenCount, + tokens: { + completion: outputTokenCount, + prompt: inputTokenCount, + total: inputTokenCount + outputTokenCount, + }, + }); +} diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/prompts.ts b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/prompts.ts new file mode 100644 index 0000000000000..ed8387bf75252 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/prompts.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +const noToolUsageDirective = ` +Please answer with text. You should NOT call or use a tool, even if tools might be available and even if +the user explicitly asks for it. DO NOT UNDER ANY CIRCUMSTANCES call a tool. Instead, ALWAYS reply with text. +`; + +export const addNoToolUsageDirective = (systemMessage: string | undefined): string => { + return systemMessage ? `${systemMessage}\n\n${noToolUsageDirective}` : noToolUsageDirective; +}; diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/serde_eventstream_into_observable.test.ts b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/serde_eventstream_into_observable.test.ts new file mode 100644 index 0000000000000..bed6458a94dc7 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/serde_eventstream_into_observable.test.ts @@ -0,0 +1,87 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Readable } from 'stream'; +import { Observable, toArray, firstValueFrom, map, filter } from 'rxjs'; +import { + BedrockChunkMember, + BedrockStreamMember, + serdeEventstreamIntoObservable, +} from './serde_eventstream_into_observable'; +import { EventStreamMarshaller } from '@smithy/eventstream-serde-node'; +import { fromUtf8, toUtf8 } from '@smithy/util-utf8'; +import type { CompletionChunk } from './types'; +import { parseSerdeChunkMessage, serializeSerdeChunkMessage } from './serde_utils'; + +describe('serdeEventstreamIntoObservable', () => { + const marshaller = new EventStreamMarshaller({ + utf8Encoder: toUtf8, + utf8Decoder: fromUtf8, + }); + + const getSerdeEventStream = (chunks: CompletionChunk[]) => { + const input = Readable.from(chunks); + return marshaller.serialize(input, serializeSerdeChunkMessage); + }; + + const getChunks = async (serde$: Observable) => { + return await firstValueFrom( + serde$.pipe( + filter((value): value is BedrockChunkMember => { + return 'chunk' in value && value.chunk?.headers?.[':event-type']?.value === 'chunk'; + }), + map((message) => { + return parseSerdeChunkMessage(message.chunk); + }), + toArray() + ) + ); + }; + + it('converts a single chunk', async () => { + const chunks: CompletionChunk[] = [ + { + type: 'content_block_delta', + index: 0, + delta: { type: 'text_delta', text: 'Hello' }, + }, + ]; + + const inputStream = getSerdeEventStream(chunks); + const serde$ = serdeEventstreamIntoObservable(inputStream); + + const result = await getChunks(serde$); + + expect(result).toEqual(chunks); + }); + + it('converts multiple chunks', async () => { + const chunks: CompletionChunk[] = [ + { + type: 'content_block_start', + index: 0, + content_block: { type: 'text', text: 'start' }, + }, + { + type: 'content_block_delta', + index: 0, + delta: { type: 'text_delta', text: 'Hello' }, + }, + { + type: 'content_block_stop', + index: 0, + }, + ]; + + const inputStream = getSerdeEventStream(chunks); + const serde$ = serdeEventstreamIntoObservable(inputStream); + + const result = await getChunks(serde$); + + expect(result).toEqual(chunks); + }); +}); diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/serde_eventstream_into_observable.ts b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/serde_eventstream_into_observable.ts new file mode 100644 index 0000000000000..24a245ab2efcc --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/serde_eventstream_into_observable.ts @@ -0,0 +1,76 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EventStreamMarshaller } from '@smithy/eventstream-serde-node'; +import { fromUtf8, toUtf8 } from '@smithy/util-utf8'; +import { identity } from 'lodash'; +import { Observable } from 'rxjs'; +import { Readable } from 'stream'; +import { Message } from '@smithy/types'; +import { createInferenceInternalError } from '../../../../common/errors'; + +interface ModelStreamErrorException { + name: 'ModelStreamErrorException'; + originalStatusCode?: number; + originalMessage?: string; +} + +export interface BedrockChunkMember { + chunk: Message; +} + +export interface ModelStreamErrorExceptionMember { + modelStreamErrorException: ModelStreamErrorException; +} + +export type BedrockStreamMember = BedrockChunkMember | ModelStreamErrorExceptionMember; + +// AWS uses SerDe to send over serialized data, so we use their +// @smithy library to parse the stream data + +export function serdeEventstreamIntoObservable( + readable: Readable +): Observable { + return new Observable((subscriber) => { + const marshaller = new EventStreamMarshaller({ + utf8Encoder: toUtf8, + utf8Decoder: fromUtf8, + }); + + async function processStream() { + for await (const chunk of marshaller.deserialize(readable, identity)) { + if (chunk) { + subscriber.next(chunk); + } + } + } + + processStream().then( + () => { + subscriber.complete(); + }, + (error) => { + if (!(error instanceof Error)) { + try { + const exceptionType = error.headers[':exception-type'].value; + const body = toUtf8(error.body); + let message = `Encountered error in Bedrock stream of type ${exceptionType}`; + try { + message += '\n' + JSON.parse(body).message; + } catch (parseError) { + // trap + } + error = createInferenceInternalError(message); + } catch (decodeError) { + error = createInferenceInternalError(decodeError.message); + } + } + subscriber.error(error); + } + ); + }); +} diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/serde_utils.test.ts b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/serde_utils.test.ts new file mode 100644 index 0000000000000..c763fd8c9daf3 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/serde_utils.test.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { CompletionChunk } from './types'; +import { serializeSerdeChunkMessage, parseSerdeChunkMessage } from './serde_utils'; + +describe('parseSerdeChunkMessage', () => { + it('parses a serde chunk message', () => { + const chunk: CompletionChunk = { + type: 'content_block_stop', + index: 0, + }; + + expect(parseSerdeChunkMessage(serializeSerdeChunkMessage(chunk))).toEqual(chunk); + }); +}); diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/serde_utils.ts b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/serde_utils.ts new file mode 100644 index 0000000000000..d7050b7744940 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/serde_utils.ts @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { toUtf8, fromUtf8 } from '@smithy/util-utf8'; +import type { Message } from '@smithy/types'; +import type { CompletionChunk } from './types'; + +/** + * Extract the completion chunk from a chunk message + */ +export function parseSerdeChunkMessage(chunk: Message): CompletionChunk { + return JSON.parse(Buffer.from(JSON.parse(toUtf8(chunk.body)).bytes, 'base64').toString('utf-8')); +} + +/** + * Reverse `parseSerdeChunkMessage` + */ +export const serializeSerdeChunkMessage = (input: CompletionChunk): Message => { + const b64 = Buffer.from(JSON.stringify(input), 'utf-8').toString('base64'); + const body = fromUtf8(JSON.stringify({ bytes: b64 })); + return { + headers: { + ':event-type': { type: 'string', value: 'chunk' }, + ':content-type': { type: 'string', value: 'application/json' }, + ':message-type': { type: 'string', value: 'event' }, + }, + body, + }; +}; diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/types.ts b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/types.ts new file mode 100644 index 0000000000000..f0937a8d8ec18 --- /dev/null +++ b/x-pack/plugins/inference/server/chat_complete/adapters/bedrock/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/** + * BedRock message as expected by the bedrock connector + */ +export interface BedRockMessage { + role: 'user' | 'assistant'; + content?: string; + rawContent?: BedRockMessagePart[]; +} + +/** + * Bedrock message parts + */ +export type BedRockMessagePart = + | { type: 'text'; text: string } + | { + type: 'tool_use'; + id: string; + name: string; + input: Record; + } + | { type: 'tool_result'; tool_use_id: string; content: string }; + +export type BedrockToolChoice = { type: 'auto' } | { type: 'any' } | { type: 'tool'; name: string }; + +interface CompletionChunkBase { + type: string; +} + +export interface MessageStartChunk extends CompletionChunkBase { + type: 'message_start'; + message: unknown; +} + +export interface ContentBlockStartChunk extends CompletionChunkBase { + type: 'content_block_start'; + index: number; + content_block: + | { + type: 'text'; + text: string; + } + | { type: 'tool_use'; id: string; name: string; input: string }; +} + +export interface ContentBlockDeltaChunk extends CompletionChunkBase { + type: 'content_block_delta'; + index: number; + delta: + | { + type: 'text_delta'; + text: string; + } + | { + type: 'input_json_delta'; + partial_json: string; + }; +} + +export interface ContentBlockStopChunk extends CompletionChunkBase { + type: 'content_block_stop'; + index: number; +} + +export interface MessageDeltaChunk extends CompletionChunkBase { + type: 'message_delta'; + delta: { + stop_reason: string; + stop_sequence: null | string; + usage: { + output_tokens: number; + }; + }; +} + +export interface MessageStopChunk extends CompletionChunkBase { + type: 'message_stop'; + 'amazon-bedrock-invocationMetrics': { + inputTokenCount: number; + outputTokenCount: number; + invocationLatency: number; + firstByteLatency: number; + }; +} + +export type CompletionChunk = + | MessageStartChunk + | ContentBlockStartChunk + | ContentBlockDeltaChunk + | ContentBlockStopChunk + | MessageDeltaChunk + | MessageStopChunk; diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.test.ts b/x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.test.ts index 9e0b0da6d5894..558e0cd06ef91 100644 --- a/x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.test.ts +++ b/x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.test.ts @@ -9,6 +9,7 @@ import { InferenceConnectorType } from '../../../common/connectors'; import { getInferenceAdapter } from './get_inference_adapter'; import { openAIAdapter } from './openai'; import { geminiAdapter } from './gemini'; +import { bedrockClaudeAdapter } from './bedrock'; describe('getInferenceAdapter', () => { it('returns the openAI adapter for OpenAI type', () => { @@ -19,7 +20,7 @@ describe('getInferenceAdapter', () => { expect(getInferenceAdapter(InferenceConnectorType.Gemini)).toBe(geminiAdapter); }); - it('returns undefined for Bedrock type', () => { - expect(getInferenceAdapter(InferenceConnectorType.Bedrock)).toBe(undefined); + it('returns the bedrock adapter for Bedrock type', () => { + expect(getInferenceAdapter(InferenceConnectorType.Bedrock)).toBe(bedrockClaudeAdapter); }); }); diff --git a/x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.ts b/x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.ts index 0538d828a473a..f34b0c27a339f 100644 --- a/x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.ts +++ b/x-pack/plugins/inference/server/chat_complete/adapters/get_inference_adapter.ts @@ -9,6 +9,7 @@ import { InferenceConnectorType } from '../../../common/connectors'; import type { InferenceConnectorAdapter } from '../types'; import { openAIAdapter } from './openai'; import { geminiAdapter } from './gemini'; +import { bedrockClaudeAdapter } from './bedrock'; export const getInferenceAdapter = ( connectorType: InferenceConnectorType @@ -21,8 +22,7 @@ export const getInferenceAdapter = ( return geminiAdapter; case InferenceConnectorType.Bedrock: - // not implemented yet - break; + return bedrockClaudeAdapter; } return undefined; diff --git a/x-pack/plugins/inference/tsconfig.json b/x-pack/plugins/inference/tsconfig.json index 16d7ca041582c..593556c8f39c8 100644 --- a/x-pack/plugins/inference/tsconfig.json +++ b/x-pack/plugins/inference/tsconfig.json @@ -22,6 +22,7 @@ "@kbn/logging", "@kbn/core-http-server", "@kbn/actions-plugin", - "@kbn/config-schema" + "@kbn/config-schema", + "@kbn/stack-connectors-plugin" ] } diff --git a/x-pack/plugins/lens/public/shared_components/icon_set.tsx b/x-pack/plugins/lens/public/shared_components/icon_set.tsx new file mode 100644 index 0000000000000..44e1a104822b1 --- /dev/null +++ b/x-pack/plugins/lens/public/shared_components/icon_set.tsx @@ -0,0 +1,70 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import type { AvailableReferenceLineIcon } from '@kbn/expression-xy-plugin/common'; +import type { AvailableMetricIcon } from '@kbn/expression-metric-vis-plugin/common'; +import { iconSortCriteria, type IconSet, sharedSetOfIcons } from '@kbn/visualization-ui-components'; + +export const referenceLineIconsSet: IconSet = sharedSetOfIcons; + +export const metricIconsSet: IconSet = [ + ...sharedSetOfIcons, + // use spread here to avoid to cast single entries + ...([ + { + value: 'sortUp', + label: i18n.translate('xpack.lens.metric.iconSelect.sortUpLabel', { + defaultMessage: 'Sort up', + }), + }, + { + value: 'sortDown', + label: i18n.translate('xpack.lens.metric.iconSelect.sortDownLabel', { + defaultMessage: 'Sort down', + }), + }, + { + value: 'compute', + label: i18n.translate('xpack.lens.metric.iconSelect.computeLabel', { + defaultMessage: 'Compute', + }), + }, + { + value: 'globe', + label: i18n.translate('xpack.lens.metric.iconSelect.globeLabel', { + defaultMessage: 'Globe', + }), + }, + { + value: 'temperature', + label: i18n.translate('xpack.lens.metric.iconSelect.temperatureLabel', { + defaultMessage: 'Temperature', + }), + }, + { + value: 'heart', + label: i18n.translate('xpack.lens.metric.iconSelect.heartLabel', { defaultMessage: 'Heart' }), + }, + { + value: 'mapMarker', + label: i18n.translate('xpack.lens.metric.iconSelect.mapMarkerLabel', { + defaultMessage: 'Map Marker', + }), + }, + { + value: 'pin', + label: i18n.translate('xpack.lens.metric.iconSelect.mapPinLabel', { + defaultMessage: 'Map Pin', + }), + }, + { + value: 'starEmpty', + label: i18n.translate('xpack.lens.metric.iconSelect.starLabel', { defaultMessage: 'Star' }), + }, + ] as const), +].sort(iconSortCriteria); diff --git a/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx b/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx index 2b6c1f4476006..78fcd67f36431 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx @@ -36,8 +36,8 @@ import type { VisualizationDimensionEditorProps } from '../../types'; import { defaultNumberPaletteParams, defaultPercentagePaletteParams } from './palette_config'; import { DEFAULT_MAX_COLUMNS, getDefaultColor, showingBar } from './visualization'; import { CollapseSetting } from '../../shared_components/collapse_setting'; -import { iconsSet } from './icon_set'; import { MetricVisualizationState } from './types'; +import { metricIconsSet } from '../../shared_components/icon_set'; export type SupportingVisType = 'none' | 'bar' | 'trendline'; @@ -350,7 +350,7 @@ function PrimaryMetricEditor(props: SubProps) { })} > { setState({ diff --git a/x-pack/plugins/lens/public/visualizations/metric/icon_set.ts b/x-pack/plugins/lens/public/visualizations/metric/icon_set.ts deleted file mode 100644 index 704c802f4826d..0000000000000 --- a/x-pack/plugins/lens/public/visualizations/metric/icon_set.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import { AvailableMetricIcon } from '@kbn/expression-metric-vis-plugin/common'; -import { type IconSet } from '@kbn/visualization-ui-components'; - -export const iconsSet: IconSet = [ - { - value: 'empty', - label: i18n.translate('xpack.lens.metric.iconSelect.noIconLabel', { - defaultMessage: 'None', - }), - }, - { - value: 'sortUp', - label: i18n.translate('xpack.lens.metric.iconSelect.sortUpLabel', { - defaultMessage: 'Sort up', - }), - }, - { - value: 'sortDown', - label: i18n.translate('xpack.lens.metric.iconSelect.sortDownLabel', { - defaultMessage: 'Sort down', - }), - }, - { - value: 'compute', - label: i18n.translate('xpack.lens.metric.iconSelect.computeLabel', { - defaultMessage: 'Compute', - }), - }, - { - value: 'globe', - label: i18n.translate('xpack.lens.metric.iconSelect.globeLabel', { - defaultMessage: 'Globe', - }), - }, - { - value: 'temperature', - label: i18n.translate('xpack.lens.metric.iconSelect.temperatureLabel', { - defaultMessage: 'Temperature', - }), - }, - { - value: 'asterisk', - label: i18n.translate('xpack.lens.metric.iconSelect.asteriskIconLabel', { - defaultMessage: 'Asterisk', - }), - }, - { - value: 'alert', - label: i18n.translate('xpack.lens.metric.iconSelect.alertIconLabel', { - defaultMessage: 'Alert', - }), - }, - { - value: 'bell', - label: i18n.translate('xpack.lens.metric.iconSelect.bellIconLabel', { - defaultMessage: 'Bell', - }), - }, - { - value: 'bolt', - label: i18n.translate('xpack.lens.metric.iconSelect.boltIconLabel', { - defaultMessage: 'Bolt', - }), - }, - { - value: 'bug', - label: i18n.translate('xpack.lens.metric.iconSelect.bugIconLabel', { - defaultMessage: 'Bug', - }), - }, - - { - value: 'editorComment', - label: i18n.translate('xpack.lens.metric.iconSelect.commentIconLabel', { - defaultMessage: 'Comment', - }), - }, - { - value: 'flag', - label: i18n.translate('xpack.lens.metric.iconSelect.flagIconLabel', { - defaultMessage: 'Flag', - }), - }, - { - value: 'heart', - label: i18n.translate('xpack.lens.metric.iconSelect.heartLabel', { defaultMessage: 'Heart' }), - }, - { - value: 'mapMarker', - label: i18n.translate('xpack.lens.metric.iconSelect.mapMarkerLabel', { - defaultMessage: 'Map Marker', - }), - }, - { - value: 'pin', - label: i18n.translate('xpack.lens.metric.iconSelect.mapPinLabel', { - defaultMessage: 'Map Pin', - }), - }, - { - value: 'starEmpty', - label: i18n.translate('xpack.lens.metric.iconSelect.starLabel', { defaultMessage: 'Star' }), - }, - { - value: 'tag', - label: i18n.translate('xpack.lens.metric.iconSelect.tagIconLabel', { - defaultMessage: 'Tag', - }), - }, -]; diff --git a/x-pack/plugins/lens/public/visualizations/metric/to_expression.ts b/x-pack/plugins/lens/public/visualizations/metric/to_expression.ts index d0ff261653e1f..02292a4ddce0a 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/to_expression.ts +++ b/x-pack/plugins/lens/public/visualizations/metric/to_expression.ts @@ -13,6 +13,7 @@ import type { import { buildExpression, buildExpressionFunction } from '@kbn/expressions-plugin/common'; import { Ast } from '@kbn/interpreter'; import { LayoutDirection } from '@elastic/charts'; +import { hasIcon } from '@kbn/visualization-ui-components'; import { CollapseArgs, CollapseFunction } from '../../../common/expressions'; import { CollapseExpressionFunction } from '../../../common/expressions/collapse/types'; import { DatasourceLayers } from '../../types'; @@ -155,7 +156,7 @@ export const toExpression = ( iconAlign: state.iconAlign ?? metricStateDefaults.iconAlign, valueFontSize: state.valueFontMode ?? metricStateDefaults.valueFontMode, color: state.color || getDefaultColor(state, isMetricNumeric), - icon: state.icon, + icon: hasIcon(state.icon) ? state.icon : undefined, palette: isMetricNumeric && state.palette?.params ? [ diff --git a/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts b/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts index ac32e125fc57d..e4011ca8431a3 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts +++ b/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts @@ -318,9 +318,6 @@ describe('metric visualization', () => { "color": Array [ "static-color", ], - "icon": Array [ - "empty", - ], "iconAlign": Array [ "left", ], @@ -394,9 +391,6 @@ describe('metric visualization', () => { "color": Array [ "static-color", ], - "icon": Array [ - "empty", - ], "iconAlign": Array [ "left", ], diff --git a/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx b/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx index 758c0c8ca9035..81eebf770485f 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx @@ -109,8 +109,6 @@ import { } from './visualization_helpers'; import { getAxesConfiguration, groupAxesByType } from './axes_configuration'; import type { XYByValueAnnotationLayerConfig, XYState } from './types'; -import { ReferenceLinePanel } from './xy_config_panel/reference_line_config_panel'; -import { AnnotationsPanel } from './xy_config_panel/annotations_config_panel'; import { defaultAnnotationLabel } from './annotations/helpers'; import { onDropForVisualization } from '../../editor_frame_service/editor_frame/config_panel/buttons/drop_targets_utils'; import { createAnnotationActions } from './annotations/actions'; @@ -130,6 +128,8 @@ import { XY_X_WRONG_DATA_TYPE, XY_Y_WRONG_DATA_TYPE, } from '../../user_messages_ids'; +import { AnnotationsPanel } from './xy_config_panel/annotations_config_panel/annotations_panel'; +import { ReferenceLinePanel } from './xy_config_panel/reference_line_config_panel/reference_line_panel'; const XY_ID = 'lnsXY'; diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/icon_set.ts b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/icon_set.ts deleted file mode 100644 index 623e474d0d10b..0000000000000 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/icon_set.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import { AvailableReferenceLineIcon } from '@kbn/expression-xy-plugin/common'; -import { type IconSet } from '@kbn/visualization-ui-components'; - -export const referenceLineIconsSet: IconSet = [ - { - value: 'empty', - label: i18n.translate('xpack.lens.xyChart.iconSelect.noIconLabel', { - defaultMessage: 'None', - }), - }, - { - value: 'asterisk', - label: i18n.translate('xpack.lens.xyChart.iconSelect.asteriskIconLabel', { - defaultMessage: 'Asterisk', - }), - }, - { - value: 'bell', - label: i18n.translate('xpack.lens.xyChart.iconSelect.bellIconLabel', { - defaultMessage: 'Bell', - }), - }, - { - value: 'bolt', - label: i18n.translate('xpack.lens.xyChart.iconSelect.boltIconLabel', { - defaultMessage: 'Bolt', - }), - }, - { - value: 'bug', - label: i18n.translate('xpack.lens.xyChart.iconSelect.bugIconLabel', { - defaultMessage: 'Bug', - }), - }, - { - value: 'editorComment', - label: i18n.translate('xpack.lens.xyChart.iconSelect.commentIconLabel', { - defaultMessage: 'Comment', - }), - }, - { - value: 'alert', - label: i18n.translate('xpack.lens.xyChart.iconSelect.alertIconLabel', { - defaultMessage: 'Alert', - }), - }, - { - value: 'flag', - label: i18n.translate('xpack.lens.xyChart.iconSelect.flagIconLabel', { - defaultMessage: 'Flag', - }), - }, - { - value: 'tag', - label: i18n.translate('xpack.lens.xyChart.iconSelect.tagIconLabel', { - defaultMessage: 'Tag', - }), - }, -]; diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/reference_line_panel.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/reference_line_panel.tsx index fa75cc530864c..cd9bb66443998 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/reference_line_panel.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/reference_line_panel.tsx @@ -17,6 +17,7 @@ import { TextDecorationSetting, } from '@kbn/visualization-ui-components'; import { useDebouncedValue } from '@kbn/visualization-utils'; +import { referenceLineIconsSet } from '../../../../shared_components/icon_set'; import type { VisualizationDimensionEditorProps } from '../../../../types'; import { State, XYState, XYReferenceLineLayerConfig, YConfig } from '../../types'; import { FormatFactory } from '../../../../../common/types'; @@ -25,7 +26,6 @@ import { updateLayer } from '..'; import { idPrefix } from '../dimension_editor'; import { isHorizontalChart } from '../../state_helpers'; import { MarkerDecorationPosition } from '../shared/marker_decoration_settings'; -import { referenceLineIconsSet } from './icon_set'; import { defaultReferenceLineColor } from '../../color_assignment'; export const ReferenceLinePanel = ( diff --git a/x-pack/plugins/lens/common/content_management/cm_services.ts b/x-pack/plugins/lens/server/content_management/cm_services.ts similarity index 100% rename from x-pack/plugins/lens/common/content_management/cm_services.ts rename to x-pack/plugins/lens/server/content_management/cm_services.ts diff --git a/x-pack/plugins/lens/server/content_management/lens_storage.ts b/x-pack/plugins/lens/server/content_management/lens_storage.ts index 3894ef20af30c..e17ea543b8bd7 100644 --- a/x-pack/plugins/lens/server/content_management/lens_storage.ts +++ b/x-pack/plugins/lens/server/content_management/lens_storage.ts @@ -18,7 +18,7 @@ import { type LensSavedObjectAttributes, type PartialLensSavedObject, } from '../../common/content_management'; -import { cmServicesDefinition } from '../../common/content_management/cm_services'; +import { cmServicesDefinition } from './cm_services'; const searchArgsToSOFindOptions = (args: LensCrudTypes['SearchIn']): SavedObjectsFindOptions => { const { query, contentTypeId, options } = args; diff --git a/x-pack/plugins/lens/common/content_management/v1/cm_services.ts b/x-pack/plugins/lens/server/content_management/v1/cm_services.ts similarity index 100% rename from x-pack/plugins/lens/common/content_management/v1/cm_services.ts rename to x-pack/plugins/lens/server/content_management/v1/cm_services.ts diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx index 7ac354ed12ce3..e7bedcc7cf308 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx @@ -220,7 +220,7 @@ export const BuilderEntryItem: React.FC = ({ exceptionItemIndex, entry.entryIndex )} - isClearable={false} + isClearable={true} isLoading={false} isDisabled={isDisabled || indexPattern == null} onChange={handleFieldChange} diff --git a/x-pack/plugins/ml/common/license/ml_license.ts b/x-pack/plugins/ml/common/license/ml_license.ts index 403786ffa37dc..b561834cae74a 100644 --- a/x-pack/plugins/ml/common/license/ml_license.ts +++ b/x-pack/plugins/ml/common/license/ml_license.ts @@ -135,7 +135,7 @@ export function isTrialLicense(license: ILicense) { } export function isMinimumLicense(license: ILicense) { - return license.check(PLUGIN_ID, MINIMUM_LICENSE).state === 'valid'; + return license.check(PLUGIN_ID, MINIMUM_LICENSE).state === 'valid' || license.isAvailable; } export function isMlEnabled(license: ILicense) { diff --git a/x-pack/plugins/ml/public/application/app.tsx b/x-pack/plugins/ml/public/application/app.tsx index cfc9826e4280b..c83c965629fb1 100644 --- a/x-pack/plugins/ml/public/application/app.tsx +++ b/x-pack/plugins/ml/public/application/app.tsx @@ -22,7 +22,6 @@ import useObservable from 'react-use/lib/useObservable'; import type { ExperimentalFeatures, MlFeatures } from '../../common/constants/app'; import { ML_STORAGE_KEYS } from '../../common/types/storage'; import type { MlSetupDependencies, MlStartDependencies } from '../plugin'; -import { clearCache, setDependencyCache } from './util/dependency_cache'; import { setLicenseCache } from './license'; import { MlRouter } from './routing'; import type { PageDependencies } from './routing/router'; @@ -97,7 +96,7 @@ const App: FC = ({ uiActions: deps.uiActions, unifiedSearch: deps.unifiedSearch, usageCollection: deps.usageCollection, - mlServices: getMlGlobalServices(coreStart.http, deps.data.dataViews, deps.usageCollection), + mlServices: getMlGlobalServices(coreStart, deps.data.dataViews, deps.usageCollection), }; }, [deps, coreStart]); @@ -160,18 +159,6 @@ export const renderApp = ( mlFeatures: MlFeatures, experimentalFeatures: ExperimentalFeatures ) => { - setDependencyCache({ - timefilter: deps.data.query.timefilter, - fieldFormats: deps.fieldFormats, - config: coreStart.uiSettings!, - docLinks: coreStart.docLinks!, - toastNotifications: coreStart.notifications.toasts, - recentlyAccessed: coreStart.chrome!.recentlyAccessed, - application: coreStart.application, - http: coreStart.http, - maps: deps.maps, - }); - appMountParams.onAppLeave((actions) => actions.default()); ReactDOM.render( @@ -187,7 +174,6 @@ export const renderApp = ( ); return () => { - clearCache(); ReactDOM.unmountComponentAtNode(appMountParams.element); deps.data.search.session.clear(); }; diff --git a/x-pack/plugins/ml/public/application/capabilities/check_capabilities.ts b/x-pack/plugins/ml/public/application/capabilities/check_capabilities.ts index e7102560e0e02..ee7868adb41fa 100644 --- a/x-pack/plugins/ml/public/application/capabilities/check_capabilities.ts +++ b/x-pack/plugins/ml/public/application/capabilities/check_capabilities.ts @@ -197,10 +197,11 @@ export function checkGetManagementMlJobsResolver({ mlCapabilities }: MlGlobalSer } export function checkCreateJobsCapabilitiesResolver( + mlApiServices: MlApiServices, redirectToJobsManagementPage: () => Promise ): Promise { return new Promise((resolve, reject) => { - getCapabilities() + getCapabilities(mlApiServices) .then(async ({ capabilities, isPlatinumOrTrialLicense }) => { _capabilities = capabilities; // if the license is basic (isPlatinumOrTrialLicense === false) then do not redirect, diff --git a/x-pack/plugins/ml/public/application/capabilities/get_capabilities.ts b/x-pack/plugins/ml/public/application/capabilities/get_capabilities.ts index ed4725b9ffde3..2f7ad039b2700 100644 --- a/x-pack/plugins/ml/public/application/capabilities/get_capabilities.ts +++ b/x-pack/plugins/ml/public/application/capabilities/get_capabilities.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { ml } from '../services/ml_api_service'; +import type { MlApiServices } from '../services/ml_api_service'; import type { MlCapabilitiesResponse } from '../../../common/types/capabilities'; -export function getCapabilities(): Promise { +export function getCapabilities(ml: MlApiServices): Promise { return ml.checkMlCapabilities(); } diff --git a/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.test.tsx b/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.test.tsx index ad78c4e5f0270..81cafabbae827 100644 --- a/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.test.tsx +++ b/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.test.tsx @@ -9,7 +9,9 @@ import useObservable from 'react-use/lib/useObservable'; import mockAnnotations from '../annotations_table/__mocks__/mock_annotations.json'; import React from 'react'; import { fireEvent, render, screen, waitFor } from '@testing-library/react'; +import type { CoreStart } from '@kbn/core/public'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; +import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; import type { Annotation } from '../../../../../common/types/annotations'; import { AnnotationUpdatesService } from '../../../services/annotations_service'; @@ -17,9 +19,17 @@ import { AnnotationUpdatesService } from '../../../services/annotations_service' import { AnnotationFlyout } from '.'; import { MlAnnotationUpdatesContext } from '../../../contexts/ml/ml_annotation_updates_context'; -jest.mock('../../../util/dependency_cache', () => ({ - getToastNotifications: () => ({ addSuccess: jest.fn(), addDanger: jest.fn() }), -})); +const kibanaReactContextMock = createKibanaReactContext({ + mlServices: { + mlApiServices: { + annotations: { + indexAnnotation: jest.fn().mockResolvedValue({}), + deleteAnnotation: jest.fn().mockResolvedValue({}), + }, + }, + }, + notifications: { toasts: { addDanger: jest.fn(), addSuccess: jest.fn() } }, +} as unknown as Partial); const MlAnnotationUpdatesContextProvider = ({ annotationUpdatesService, @@ -30,7 +40,9 @@ const MlAnnotationUpdatesContextProvider = ({ }) => { return ( - {children} + + {children} + ); }; diff --git a/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.tsx b/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.tsx index 5b14f6d350873..3bea429042299 100644 --- a/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.tsx +++ b/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.tsx @@ -30,6 +30,7 @@ import { import type { CommonProps } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import { context } from '@kbn/kibana-react-plugin/public'; import { type MlPartitionFieldsType, ML_PARTITION_FIELDS } from '@kbn/ml-anomaly-utils'; import { ANNOTATION_MAX_LENGTH_CHARS, @@ -42,13 +43,12 @@ import type { import { annotationsRefreshed } from '../../../services/annotations_service'; import { AnnotationDescriptionList } from '../annotation_description_list'; import { DeleteAnnotationModal } from '../delete_annotation_modal'; -import { ml } from '../../../services/ml_api_service'; -import { getToastNotifications } from '../../../util/dependency_cache'; import { getAnnotationFieldName, getAnnotationFieldValue, } from '../../../../../common/types/annotations'; import { MlAnnotationUpdatesContext } from '../../../contexts/ml/ml_annotation_updates_context'; +import type { MlKibanaReactContextValue } from '../../../contexts/kibana'; interface ViewableDetector { index: number; @@ -78,6 +78,9 @@ interface State { } export class AnnotationFlyoutUI extends Component { + static contextType = context; + declare context: MlKibanaReactContextValue; + private deletionInProgress = false; public state: State = { @@ -126,7 +129,6 @@ export class AnnotationFlyoutUI extends Component { if (this.deletionInProgress) return; const { annotationState } = this.state; - const toastNotifications = getToastNotifications(); if (annotationState === null || annotationState._id === undefined) { return; @@ -134,6 +136,8 @@ export class AnnotationFlyoutUI extends Component { this.deletionInProgress = true; + const ml = this.context.services.mlServices.mlApiServices; + const toastNotifications = this.context.services.notifications.toasts; try { await ml.annotations.deleteAnnotation(annotationState._id); toastNotifications.addSuccess( @@ -237,11 +241,12 @@ export class AnnotationFlyoutUI extends Component { annotation.event = annotation.event ?? ANNOTATION_EVENT_USER; annotationUpdatesService.setValue(null); + const ml = this.context.services.mlServices.mlApiServices; + const toastNotifications = this.context.services.notifications.toasts; ml.annotations .indexAnnotation(annotation) .then(() => { annotationsRefreshed(); - const toastNotifications = getToastNotifications(); if (typeof annotation._id === 'undefined') { toastNotifications.addSuccess( i18n.translate( @@ -265,7 +270,6 @@ export class AnnotationFlyoutUI extends Component { } }) .catch((resp) => { - const toastNotifications = getToastNotifications(); if (typeof annotation._id === 'undefined') { toastNotifications.addDanger( i18n.translate( diff --git a/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js b/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js index 9436209c5f3bb..d9d98029c3eee 100644 --- a/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js +++ b/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js @@ -29,10 +29,11 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import { withKibana } from '@kbn/kibana-react-plugin/public'; import { addItemToRecentlyAccessed } from '../../../util/recently_accessed'; -import { ml } from '../../../services/ml_api_service'; -import { mlJobService } from '../../../services/job_service'; +import { mlJobServiceFactory } from '../../../services/job_service'; +import { toastNotificationServiceProvider } from '../../../services/toast_notification_service'; import { mlTableService } from '../../../services/table_service'; import { ANNOTATIONS_TABLE_DEFAULT_QUERY_SIZE } from '../../../../../common/constants/search'; import { @@ -45,7 +46,6 @@ import { ANNOTATION_EVENT_USER, ANNOTATION_EVENT_DELAYED_DATA, } from '../../../../../common/constants/annotations'; -import { withKibana } from '@kbn/kibana-react-plugin/public'; import { ML_APP_LOCATOR, ML_PAGES } from '../../../../../common/constants/locator'; import { timeFormatter } from '@kbn/ml-date-utils'; import { MlAnnotationUpdatesContext } from '../../../contexts/ml/ml_annotation_updates_context'; @@ -90,10 +90,8 @@ class AnnotationsTableUI extends Component { queryText: `event:(${ANNOTATION_EVENT_USER} or ${ANNOTATION_EVENT_DELAYED_DATA})`, searchError: undefined, jobId: - Array.isArray(this.props.jobs) && - this.props.jobs.length > 0 && - this.props.jobs[0] !== undefined - ? this.props.jobs[0].job_id + Array.isArray(props.jobs) && props.jobs.length > 0 && props.jobs[0] !== undefined + ? props.jobs[0].job_id : undefined, datafeedFlyoutVisible: false, modelSnapshot: null, @@ -103,6 +101,10 @@ class AnnotationsTableUI extends Component { this.sorting = { sort: { field: 'timestamp', direction: 'asc' }, }; + this.mlJobService = mlJobServiceFactory( + toastNotificationServiceProvider(props.kibana.services.notifications.toasts), + props.kibana.services.mlServices.mlApiServices + ); } getAnnotations() { @@ -113,6 +115,8 @@ class AnnotationsTableUI extends Component { isLoading: true, }); + const ml = this.props.kibana.services.mlServices.mlApiServices; + if (dataCounts.processed_record_count > 0) { // Load annotations for the selected job. ml.annotations @@ -177,7 +181,7 @@ class AnnotationsTableUI extends Component { } } - return mlJobService.getJob(jobId); + return this.mlJobService.getJob(jobId); } annotationsRefreshSubscription = null; diff --git a/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table.js b/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table.js index 220497ba13b10..80ee0f7a64820 100644 --- a/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table.js +++ b/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table.js @@ -26,7 +26,6 @@ import { AnomalyDetails } from './anomaly_details'; import { mlTableService } from '../../services/table_service'; import { RuleEditorFlyout } from '../rule_editor'; -import { ml } from '../../services/ml_api_service'; import { INFLUENCERS_LIMIT, ANOMALIES_TABLE_TABS, MAX_CHARS } from './anomalies_table_constants'; export class AnomaliesTableInternal extends Component { @@ -69,6 +68,7 @@ export class AnomaliesTableInternal extends Component { } toggleRow = async (item, tab = ANOMALIES_TABLE_TABS.DETAILS) => { + const ml = this.context.services.mlServices.mlApiServices; const itemIdToExpandedRowMap = { ...this.state.itemIdToExpandedRowMap }; if (itemIdToExpandedRowMap[item.rowId]) { delete itemIdToExpandedRowMap[item.rowId]; diff --git a/x-pack/plugins/ml/public/application/components/anomalies_table/links_menu.tsx b/x-pack/plugins/ml/public/application/components/anomalies_table/links_menu.tsx index ca3ffc38f816b..5b7d4b3be128c 100644 --- a/x-pack/plugins/ml/public/application/components/anomalies_table/links_menu.tsx +++ b/x-pack/plugins/ml/public/application/components/anomalies_table/links_menu.tsx @@ -52,14 +52,13 @@ import { parseInterval } from '../../../../common/util/parse_interval'; import { ML_APP_LOCATOR, ML_PAGES } from '../../../../common/constants/locator'; import { getFiltersForDSLQuery } from '../../../../common/util/job_utils'; -import { mlJobService } from '../../services/job_service'; -import { ml } from '../../services/ml_api_service'; +import { useMlJobService } from '../../services/job_service'; import { escapeKueryForFieldValuePair, replaceStringTokens } from '../../util/string_utils'; import { getUrlForRecord, openCustomUrlWindow } from '../../util/custom_url_utils'; import type { SourceIndicesWithGeoFields } from '../../explorer/explorer_utils'; import { escapeDoubleQuotes, getDateFormatTz } from '../../explorer/explorer_utils'; import { usePermissionCheck } from '../../capabilities/check_capabilities'; -import { useMlKibana } from '../../contexts/kibana'; +import { useMlApiContext, useMlKibana } from '../../contexts/kibana'; import { useMlIndexUtils } from '../../util/index_service'; import { getQueryStringForInfluencers } from './get_query_string_for_influencers'; @@ -101,13 +100,24 @@ export const LinksMenuUI = (props: LinksMenuProps) => { const kibana = useMlKibana(); const { - services: { data, share, application, uiActions }, + services: { + data, + share, + application, + uiActions, + uiSettings, + notifications: { toasts }, + }, } = kibana; const { getDataViewById, getDataViewIdFromName } = useMlIndexUtils(); + const ml = useMlApiContext(); + const mlJobService = useMlJobService(); const job = useMemo(() => { if (props.selectedJob !== undefined) return props.selectedJob; return mlJobService.getJob(props.anomaly.jobId); + // skip mlJobService from deps + // eslint-disable-next-line react-hooks/exhaustive-deps }, [props.anomaly.jobId, props.selectedJob]); const categorizationFieldName = job.analysis_config.categorization_field_name; @@ -145,7 +155,9 @@ export const LinksMenuUI = (props: LinksMenuProps) => { const getAnomaliesMapsLink = async (anomaly: MlAnomaliesTableRecord) => { const initialLayers = getInitialAnomaliesLayers(anomaly.jobId); - const anomalyBucketStartMoment = moment(anomaly.source.timestamp).tz(getDateFormatTz()); + const anomalyBucketStartMoment = moment(anomaly.source.timestamp).tz( + getDateFormatTz(uiSettings) + ); const anomalyBucketStart = anomalyBucketStartMoment.toISOString(); const anomalyBucketEnd = anomalyBucketStartMoment .add(anomaly.source.bucket_span, 'seconds') @@ -186,7 +198,9 @@ export const LinksMenuUI = (props: LinksMenuProps) => { sourceIndicesWithGeoFields[anomaly.jobId] ); // Widen the timerange by one bucket span on start/end to increase chances of always having data on the map - const anomalyBucketStartMoment = moment(anomaly.source.timestamp).tz(getDateFormatTz()); + const anomalyBucketStartMoment = moment(anomaly.source.timestamp).tz( + getDateFormatTz(uiSettings) + ); const anomalyBucketStart = anomalyBucketStartMoment .subtract(anomaly.source.bucket_span, 'seconds') .toISOString(); @@ -513,7 +527,6 @@ export const LinksMenuUI = (props: LinksMenuProps) => { .catch((resp) => { // eslint-disable-next-line no-console console.log('openCustomUrl(): error loading categoryDefinition:', resp); - const { toasts } = kibana.services.notifications; toasts.addDanger( i18n.translate('xpack.ml.anomaliesTable.linksMenu.unableToOpenLinkErrorMessage', { defaultMessage: @@ -615,7 +628,6 @@ export const LinksMenuUI = (props: LinksMenuProps) => { if (job === undefined) { // eslint-disable-next-line no-console console.log(`viewExamples(): no job found with ID: ${props.anomaly.jobId}`); - const { toasts } = kibana.services.notifications; toasts.addDanger( i18n.translate('xpack.ml.anomaliesTable.linksMenu.unableToViewExamplesErrorMessage', { defaultMessage: 'Unable to view examples as no details could be found for job ID {jobId}', @@ -702,7 +714,6 @@ export const LinksMenuUI = (props: LinksMenuProps) => { .catch((resp) => { // eslint-disable-next-line no-console console.log('viewExamples(): error loading categoryDefinition:', resp); - const { toasts } = kibana.services.notifications; toasts.addDanger( i18n.translate('xpack.ml.anomaliesTable.linksMenu.loadingDetailsErrorMessage', { defaultMessage: @@ -736,7 +747,6 @@ export const LinksMenuUI = (props: LinksMenuProps) => { `viewExamples(): error finding type of field ${categorizationFieldName} in indices:`, datafeedIndices ); - const { toasts } = kibana.services.notifications; toasts.addDanger( i18n.translate('xpack.ml.anomaliesTable.linksMenu.noMappingCouldBeFoundErrorMessage', { defaultMessage: diff --git a/x-pack/plugins/ml/public/application/components/custom_hooks/use_create_ad_links.ts b/x-pack/plugins/ml/public/application/components/custom_hooks/use_create_ad_links.ts index 51a096512ee7d..50a4c7f1efda9 100644 --- a/x-pack/plugins/ml/public/application/components/custom_hooks/use_create_ad_links.ts +++ b/x-pack/plugins/ml/public/application/components/custom_hooks/use_create_ad_links.ts @@ -11,7 +11,7 @@ import { ANOMALY_DETECTION_DEFAULT_TIME_RANGE, ANOMALY_DETECTION_ENABLE_TIME_RANGE, } from '../../../../common/constants/settings'; -import { mlJobService } from '../../services/job_service'; +import { useMlJobService } from '../../services/job_service'; export const useCreateADLinks = () => { const { @@ -19,6 +19,7 @@ export const useCreateADLinks = () => { http: { basePath }, }, } = useMlKibana(); + const mlJobService = useMlJobService(); const useUserTimeSettings = useUiSettings().get(ANOMALY_DETECTION_ENABLE_TIME_RANGE); const userTimeSettings = useUiSettings().get(ANOMALY_DETECTION_DEFAULT_TIME_RANGE); diff --git a/x-pack/plugins/ml/public/application/components/custom_urls/custom_url_editor/list.tsx b/x-pack/plugins/ml/public/application/components/custom_urls/custom_url_editor/list.tsx index f10e644ffffee..16dba857ed6cc 100644 --- a/x-pack/plugins/ml/public/application/components/custom_urls/custom_url_editor/list.tsx +++ b/x-pack/plugins/ml/public/application/components/custom_urls/custom_url_editor/list.tsx @@ -29,7 +29,7 @@ import { } from '@kbn/ml-data-frame-analytics-utils'; import { parseUrlState } from '@kbn/ml-url-state'; -import { useMlKibana } from '../../../contexts/kibana'; +import { useMlApiContext, useMlKibana } from '../../../contexts/kibana'; import { useToastNotificationService } from '../../../services/toast_notification_service'; import { isValidLabel, openCustomUrlWindow } from '../../../util/custom_url_utils'; import { getTestUrl } from './utils'; @@ -73,6 +73,7 @@ export const CustomUrlList: FC = ({ data: { dataViews }, }, } = useMlKibana(); + const ml = useMlApiContext(); const { displayErrorToast } = useToastNotificationService(); const [expandedUrlIndex, setExpandedUrlIndex] = useState(null); @@ -160,7 +161,14 @@ export const CustomUrlList: FC = ({ if (index < customUrls.length) { try { - const testUrl = await getTestUrl(job, customUrl, timefieldName, undefined, isPartialDFAJob); + const testUrl = await getTestUrl( + ml, + job, + customUrl, + timefieldName, + undefined, + isPartialDFAJob + ); openCustomUrlWindow(testUrl, customUrl, http.basePath.get()); } catch (error) { displayErrorToast( diff --git a/x-pack/plugins/ml/public/application/components/custom_urls/custom_url_editor/utils.ts b/x-pack/plugins/ml/public/application/components/custom_urls/custom_url_editor/utils.ts index b151ddcb808fd..cd0a52e170453 100644 --- a/x-pack/plugins/ml/public/application/components/custom_urls/custom_url_editor/utils.ts +++ b/x-pack/plugins/ml/public/application/components/custom_urls/custom_url_editor/utils.ts @@ -42,12 +42,12 @@ import { replaceTokensInDFAUrlValue, isValidLabel, } from '../../../util/custom_url_utils'; -import { ml } from '../../../services/ml_api_service'; import { escapeForElasticsearchQuery } from '../../../util/string_utils'; import type { CombinedJob, Job } from '../../../../../common/types/anomaly_detection_jobs'; import { isAnomalyDetectionJob } from '../../../../../common/types/anomaly_detection_jobs'; import type { TimeRangeType } from './constants'; +import type { MlApiServices } from '../../../services/ml_api_service'; export interface TimeRange { type: TimeRangeType; @@ -426,7 +426,11 @@ function buildAppStateQueryParam(queryFieldNames: string[]) { // Builds the full URL for testing out a custom URL configuration, which // may contain dollar delimited partition / influencer entity tokens and // drilldown time range settings. -async function getAnomalyDetectionJobTestUrl(job: Job, customUrl: MlUrlConfig): Promise { +async function getAnomalyDetectionJobTestUrl( + ml: MlApiServices, + job: Job, + customUrl: MlUrlConfig +): Promise { const interval = parseInterval(job.analysis_config.bucket_span!); const bucketSpanSecs = interval !== null ? interval.asSeconds() : 0; @@ -516,6 +520,7 @@ async function getAnomalyDetectionJobTestUrl(job: Job, customUrl: MlUrlConfig): } async function getDataFrameAnalyticsTestUrl( + ml: MlApiServices, job: DataFrameAnalyticsConfig, customUrl: MlKibanaUrlConfig, timeFieldName: string | null, @@ -589,6 +594,7 @@ async function getDataFrameAnalyticsTestUrl( } export function getTestUrl( + ml: MlApiServices, job: Job | DataFrameAnalyticsConfig, customUrl: MlUrlConfig, timeFieldName: string | null, @@ -597,6 +603,7 @@ export function getTestUrl( ) { if (isDataFrameAnalyticsConfigs(job) || isPartialDFAJob) { return getDataFrameAnalyticsTestUrl( + ml, job as DataFrameAnalyticsConfig, customUrl, timeFieldName, @@ -605,5 +612,5 @@ export function getTestUrl( ); } - return getAnomalyDetectionJobTestUrl(job, customUrl); + return getAnomalyDetectionJobTestUrl(ml, job, customUrl); } diff --git a/x-pack/plugins/ml/public/application/components/custom_urls/custom_urls.tsx b/x-pack/plugins/ml/public/application/components/custom_urls/custom_urls.tsx index 56b0064e69ddd..8c92a4c4515a5 100644 --- a/x-pack/plugins/ml/public/application/components/custom_urls/custom_urls.tsx +++ b/x-pack/plugins/ml/public/application/components/custom_urls/custom_urls.tsx @@ -42,7 +42,7 @@ import { } from './custom_url_editor/utils'; import { openCustomUrlWindow } from '../../util/custom_url_utils'; import type { CustomUrlsWrapperProps } from './custom_urls_wrapper'; -import { indexServiceFactory } from '../../util/index_service'; +import { indexServiceFactory, type MlIndexUtils } from '../../util/index_service'; interface CustomUrlsState { customUrls: MlUrlConfig[]; @@ -62,9 +62,10 @@ export class CustomUrls extends Component { static contextType = context; declare context: MlKibanaReactContextValue; - private toastNotificationService: ToastNotificationService | undefined; + private toastNotificationService: ToastNotificationService; + private mlIndexUtils: MlIndexUtils; - constructor(props: CustomUrlsProps) { + constructor(props: CustomUrlsProps, constructorContext: MlKibanaReactContextValue) { super(props); this.state = { @@ -74,6 +75,11 @@ export class CustomUrls extends Component { editorOpen: false, supportedFilterFields: [], }; + + this.toastNotificationService = toastNotificationServiceProvider( + constructorContext.services.notifications.toasts + ); + this.mlIndexUtils = indexServiceFactory(constructorContext.services.data.dataViews); } static getDerivedStateFromProps(props: CustomUrlsProps) { @@ -84,10 +90,7 @@ export class CustomUrls extends Component { } componentDidMount() { - const { toasts } = this.context.services.notifications; - this.toastNotificationService = toastNotificationServiceProvider(toasts); const { dashboardService } = this.props; - const mlIndexUtils = indexServiceFactory(this.context.services.data.dataViews); dashboardService .fetchDashboards() @@ -106,7 +109,7 @@ export class CustomUrls extends Component { ); }); - mlIndexUtils + this.mlIndexUtils .loadDataViewListItems() .then((dataViewListItems) => { this.setState({ dataViewListItems }); @@ -175,6 +178,7 @@ export class CustomUrls extends Component { http: { basePath }, data: { dataViews }, dashboard, + mlServices: { mlApiServices: ml }, } = this.context.services; const dataViewId = this.state?.editorSettings?.kibanaSettings?.discoverIndexPatternId; const job = this.props.job; @@ -190,6 +194,7 @@ export class CustomUrls extends Component { buildCustomUrlFromSettings(dashboard, this.state.editorSettings as CustomUrlSettings).then( (customUrl) => { getTestUrl( + ml, job, customUrl, timefieldName, diff --git a/x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.js b/x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.js index 64cbf60dee385..409002011926d 100644 --- a/x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.js +++ b/x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.js @@ -6,13 +6,15 @@ */ import PropTypes from 'prop-types'; - import React, { Component } from 'react'; -import { RecognizedResult } from './recognized_result'; -import { ml } from '../../services/ml_api_service'; +import { context } from '@kbn/kibana-react-plugin/public'; + +import { RecognizedResult } from './recognized_result'; export class DataRecognizer extends Component { + static contextType = context; + constructor(props) { super(props); @@ -27,6 +29,7 @@ export class DataRecognizer extends Component { } componentDidMount() { + const ml = this.context.services.mlServices.mlApiServices; // once the mount is complete, call the recognize endpoint to see if the index format is known to us, ml.recognizeIndex({ indexPatternTitle: this.indexPattern.title }) .then((resp) => { diff --git a/x-pack/plugins/ml/public/application/components/items_grid/items_grid_pagination.js b/x-pack/plugins/ml/public/application/components/items_grid/items_grid_pagination.js index 95079800fc358..c95b1db622ff8 100644 --- a/x-pack/plugins/ml/public/application/components/items_grid/items_grid_pagination.js +++ b/x-pack/plugins/ml/public/application/components/items_grid/items_grid_pagination.js @@ -101,13 +101,18 @@ export class ItemsGridPagination extends Component { - + diff --git a/x-pack/plugins/ml/public/application/components/ml_inference/components/reindex_with_pipeline.tsx b/x-pack/plugins/ml/public/application/components/ml_inference/components/reindex_with_pipeline.tsx index 513ad5849d258..17128208e7aec 100644 --- a/x-pack/plugins/ml/public/application/components/ml_inference/components/reindex_with_pipeline.tsx +++ b/x-pack/plugins/ml/public/application/components/ml_inference/components/reindex_with_pipeline.tsx @@ -29,7 +29,7 @@ import { extractErrorMessage } from '@kbn/ml-error-utils'; import { i18n } from '@kbn/i18n'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { debounce } from 'lodash'; -import { useMlKibana } from '../../../contexts/kibana'; +import { useMlApiContext, useMlKibana } from '../../../contexts/kibana'; import { isValidIndexName } from '../../../../../common/util/es_utils'; import { createKibanaDataView, checkIndexExists } from '../retry_create_data_view'; import { useToastNotificationService } from '../../../services/toast_notification_service'; @@ -82,12 +82,11 @@ export const ReindexWithPipeline: FC = ({ pipelineName, sourceIndex }) => application: { capabilities }, share, data, - mlServices: { - mlApiServices: { getIndices, reindexWithPipeline, hasPrivileges }, - }, docLinks: { links }, }, } = useMlKibana(); + const ml = useMlApiContext(); + const { getIndices, reindexWithPipeline, hasPrivileges } = ml; const { displayErrorToast } = useToastNotificationService(); @@ -124,7 +123,7 @@ export const ReindexWithPipeline: FC = ({ pipelineName, sourceIndex }) => ); const debouncedIndexCheck = debounce(async () => { - const checkResp = await checkIndexExists(destinationIndex); + const checkResp = await checkIndexExists(destinationIndex, ml); if (checkResp.errorMessage !== undefined) { displayErrorToast( checkResp.errorMessage, @@ -237,7 +236,11 @@ export const ReindexWithPipeline: FC = ({ pipelineName, sourceIndex }) => useEffect( function createDiscoverLink() { async function createDataView() { - const dataViewCreationResult = await createKibanaDataView(destinationIndex, data.dataViews); + const dataViewCreationResult = await createKibanaDataView( + destinationIndex, + data.dataViews, + ml + ); if ( dataViewCreationResult?.success === true && dataViewCreationResult?.dataViewId && @@ -251,6 +254,8 @@ export const ReindexWithPipeline: FC = ({ pipelineName, sourceIndex }) => createDataView(); } }, + // Skip ml API services from deps check + // eslint-disable-next-line react-hooks/exhaustive-deps [ reindexingTaskId, destinationIndex, diff --git a/x-pack/plugins/ml/public/application/components/ml_inference/components/test_pipeline.tsx b/x-pack/plugins/ml/public/application/components/ml_inference/components/test_pipeline.tsx index a9745e6e16aa5..48ae32d615d93 100644 --- a/x-pack/plugins/ml/public/application/components/ml_inference/components/test_pipeline.tsx +++ b/x-pack/plugins/ml/public/application/components/ml_inference/components/test_pipeline.tsx @@ -67,10 +67,7 @@ export const TestPipeline: FC = memo(({ state, sourceIndex, mode }) => { const [lastFetchedSampleDocsString, setLastFetchedSampleDocsString] = useState(''); const [isValid, setIsValid] = useState(true); const [showCallOut, setShowCallOut] = useState(true); - const { - esSearch, - trainedModels: { trainedModelPipelineSimulate }, - } = useMlApiContext(); + const ml = useMlApiContext(); const { notifications: { toasts }, services: { @@ -91,7 +88,7 @@ export const TestPipeline: FC = memo(({ state, sourceIndex, mode }) => { const simulatePipeline = async () => { try { - const result = await trainedModelPipelineSimulate( + const result = await ml.trainedModels.trainedModelPipelineSimulate( pipelineConfig, JSON.parse(sampleDocsString) as IngestSimulateDocument[] ); @@ -130,7 +127,7 @@ export const TestPipeline: FC = memo(({ state, sourceIndex, mode }) => { let records: IngestSimulateDocument[] = []; let resp; try { - resp = await esSearch(body); + resp = await ml.esSearch(body); if (resp && resp.hits.total.value > 0) { records = resp.hits.hits; @@ -144,7 +141,9 @@ export const TestPipeline: FC = memo(({ state, sourceIndex, mode }) => { setLastFetchedSampleDocsString(JSON.stringify(records, null, 2)); setIsValid(true); }, - [esSearch] + // skip ml API service from deps + // eslint-disable-next-line react-hooks/exhaustive-deps + [] ); const { getSampleDoc, getRandomSampleDoc } = useMemo( @@ -178,7 +177,7 @@ export const TestPipeline: FC = memo(({ state, sourceIndex, mode }) => { useEffect( function checkSourceIndexExists() { async function ensureSourceIndexExists() { - const resp = await checkIndexExists(sourceIndex!); + const resp = await checkIndexExists(sourceIndex!, ml); const indexExists = resp.resp && resp.resp[sourceIndex!] && resp.resp[sourceIndex!].exists; if (indexExists === false) { setSourceIndexMissingError(sourceIndexMissingMessage); @@ -188,6 +187,8 @@ export const TestPipeline: FC = memo(({ state, sourceIndex, mode }) => { ensureSourceIndexExists(); } }, + // skip ml API service from deps + // eslint-disable-next-line react-hooks/exhaustive-deps [sourceIndex, sourceIndexMissingError] ); diff --git a/x-pack/plugins/ml/public/application/components/ml_inference/retry_create_data_view.ts b/x-pack/plugins/ml/public/application/components/ml_inference/retry_create_data_view.ts index 4f6e493d1aa34..fd270ae70dfd7 100644 --- a/x-pack/plugins/ml/public/application/components/ml_inference/retry_create_data_view.ts +++ b/x-pack/plugins/ml/public/application/components/ml_inference/retry_create_data_view.ts @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import { extractErrorMessage } from '@kbn/ml-error-utils'; import type { DataViewsContract } from '@kbn/data-views-plugin/public'; import { DuplicateDataViewError } from '@kbn/data-plugin/public'; -import { ml } from '../../services/ml_api_service'; +import type { MlApiServices } from '../../services/ml_api_service'; import type { FormMessage } from '../../data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/state'; interface CreateKibanaDataViewResponse { @@ -25,7 +25,7 @@ function delay(ms = 1000) { }); } -export async function checkIndexExists(destIndex: string) { +export async function checkIndexExists(destIndex: string, ml: MlApiServices) { let resp; let errorMessage; try { @@ -36,20 +36,23 @@ export async function checkIndexExists(destIndex: string) { return { resp, errorMessage }; } -export async function retryIndexExistsCheck(destIndex: string): Promise<{ +export async function retryIndexExistsCheck( + destIndex: string, + ml: MlApiServices +): Promise<{ success: boolean; indexExists: boolean; errorMessage?: string; }> { let retryCount = 15; - let resp = await checkIndexExists(destIndex); + let resp = await checkIndexExists(destIndex, ml); let indexExists = resp.resp && resp.resp[destIndex] && resp.resp[destIndex].exists; while (retryCount > 1 && !indexExists) { retryCount--; await delay(1000); - resp = await checkIndexExists(destIndex); + resp = await checkIndexExists(destIndex, ml); indexExists = resp.resp && resp.resp[destIndex] && resp.resp[destIndex].exists; } @@ -67,12 +70,13 @@ export async function retryIndexExistsCheck(destIndex: string): Promise<{ export const createKibanaDataView = async ( destinationIndex: string, dataViewsService: DataViewsContract, + ml: MlApiServices, timeFieldName?: string, callback?: (response: FormMessage) => void ) => { const response: CreateKibanaDataViewResponse = { success: false, message: '' }; const dataViewName = destinationIndex; - const exists = await retryIndexExistsCheck(destinationIndex); + const exists = await retryIndexExistsCheck(destinationIndex, ml); if (exists?.success === true) { // index exists - create data view if (exists?.indexExists === true) { diff --git a/x-pack/plugins/ml/public/application/components/model_snapshots/edit_model_snapshot_flyout/edit_model_snapshot_flyout.tsx b/x-pack/plugins/ml/public/application/components/model_snapshots/edit_model_snapshot_flyout/edit_model_snapshot_flyout.tsx index 0e34435d93ac4..1be4c7f479ea2 100644 --- a/x-pack/plugins/ml/public/application/components/model_snapshots/edit_model_snapshot_flyout/edit_model_snapshot_flyout.tsx +++ b/x-pack/plugins/ml/public/application/components/model_snapshots/edit_model_snapshot_flyout/edit_model_snapshot_flyout.tsx @@ -30,8 +30,7 @@ import type { ModelSnapshot, CombinedJobWithStats, } from '../../../../../common/types/anomaly_detection_jobs'; -import { ml } from '../../../services/ml_api_service'; -import { useNotifications } from '../../../contexts/kibana'; +import { useMlApiContext, useNotifications } from '../../../contexts/kibana'; interface Props { snapshot: ModelSnapshot; @@ -40,6 +39,7 @@ interface Props { } export const EditModelSnapshotFlyout: FC = ({ snapshot, job, closeFlyout }) => { + const ml = useMlApiContext(); const { toasts } = useNotifications(); const [description, setDescription] = useState(snapshot.description); const [retain, setRetain] = useState(snapshot.retain); diff --git a/x-pack/plugins/ml/public/application/components/model_snapshots/model_snapshots_table.tsx b/x-pack/plugins/ml/public/application/components/model_snapshots/model_snapshots_table.tsx index f36668cd1a8f9..2c74bb9f67969 100644 --- a/x-pack/plugins/ml/public/application/components/model_snapshots/model_snapshots_table.tsx +++ b/x-pack/plugins/ml/public/application/components/model_snapshots/model_snapshots_table.tsx @@ -12,10 +12,10 @@ import { i18n } from '@kbn/i18n'; import type { EuiBasicTableColumn } from '@elastic/eui'; import { EuiFlexGroup, EuiFlexItem, EuiInMemoryTable, EuiLoadingSpinner } from '@elastic/eui'; import { timeFormatter } from '@kbn/ml-date-utils'; +import { useMlApiContext } from '../../contexts/kibana'; import { usePermissionCheck } from '../../capabilities/check_capabilities'; import { EditModelSnapshotFlyout } from './edit_model_snapshot_flyout'; import { RevertModelSnapshotFlyout } from './revert_model_snapshot_flyout'; -import { ml } from '../../services/ml_api_service'; import { DATAFEED_STATE, JOB_STATE } from '../../../../common/constants/states'; import { CloseJobConfirm } from './close_job_confirm'; import type { @@ -36,6 +36,8 @@ export enum COMBINED_JOB_STATE { } export const ModelSnapshotTable: FC = ({ job, refreshJobList }) => { + const ml = useMlApiContext(); + const [canCreateJob, canStartStopDatafeed] = usePermissionCheck([ 'canCreateJob', 'canStartStopDatafeed', @@ -71,7 +73,8 @@ export const ModelSnapshotTable: FC = ({ job, refreshJobList }) => { const checkJobIsClosed = useCallback( async (snapshot: ModelSnapshot) => { - const state = await getCombinedJobState(job.job_id); + const jobs = await ml.jobs.jobs([job.job_id]); + const state = getCombinedJobState(jobs); if (state === COMBINED_JOB_STATE.UNKNOWN) { // this will only happen if the job has been deleted by another user // between the time the row has been expended and now @@ -90,6 +93,8 @@ export const ModelSnapshotTable: FC = ({ job, refreshJobList }) => { setCloseJobModalVisible(snapshot); } }, + // skip mlApiServices from deps + // eslint-disable-next-line react-hooks/exhaustive-deps [job] ); @@ -101,12 +106,15 @@ export const ModelSnapshotTable: FC = ({ job, refreshJobList }) => { const forceCloseJob = useCallback(async () => { await ml.jobs.forceStopAndCloseJob(job.job_id); if (closeJobModalVisible !== null) { - const state = await getCombinedJobState(job.job_id); + const jobs = await ml.jobs.jobs([job.job_id]); + const state = getCombinedJobState(jobs); if (state === COMBINED_JOB_STATE.CLOSED) { setRevertSnapshot(closeJobModalVisible); } } hideCloseJobModalVisible(); + // skip mlApiServices from deps + // eslint-disable-next-line react-hooks/exhaustive-deps }, [job, closeJobModalVisible]); const closeEditFlyout = useCallback((reload: boolean) => { @@ -260,9 +268,7 @@ export const ModelSnapshotTable: FC = ({ job, refreshJobList }) => { ); }; -async function getCombinedJobState(jobId: string) { - const jobs = await ml.jobs.jobs([jobId]); - +function getCombinedJobState(jobs: CombinedJobWithStats[]) { if (jobs.length !== 1) { return COMBINED_JOB_STATE.UNKNOWN; } diff --git a/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/revert_model_snapshot_flyout.tsx b/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/revert_model_snapshot_flyout.tsx index ac1e31ced032c..c25bcee687e04 100644 --- a/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/revert_model_snapshot_flyout.tsx +++ b/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/revert_model_snapshot_flyout.tsx @@ -36,10 +36,9 @@ import type { ModelSnapshot, CombinedJobWithStats, } from '../../../../../common/types/anomaly_detection_jobs'; -import { ml } from '../../../services/ml_api_service'; -import { useNotifications } from '../../../contexts/kibana'; +import { useMlApiContext, useNotifications } from '../../../contexts/kibana'; import { chartLoaderProvider } from './chart_loader'; -import { mlResultsService } from '../../../services/results_service'; +import { mlResultsServiceProvider } from '../../../services/results_service'; import type { LineChartPoint } from '../../../jobs/new_job/common/chart_loader'; import { EventRateChart } from '../../../jobs/new_job/pages/components/charts/event_rate_chart/event_rate_chart'; import type { Anomaly } from '../../../jobs/new_job/common/results_loader/results_loader'; @@ -64,9 +63,11 @@ export const RevertModelSnapshotFlyout: FC = ({ closeFlyout, refresh, }) => { + const ml = useMlApiContext(); const { toasts } = useNotifications(); const { loadAnomalyDataForJob, loadEventRateForJob } = useMemo( - () => chartLoaderProvider(mlResultsService), + () => chartLoaderProvider(mlResultsServiceProvider(ml)), + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); const [currentSnapshot, setCurrentSnapshot] = useState(snapshot); diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.js b/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.js index abed4bf9819d8..36c7d6cc00a88 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.js @@ -53,7 +53,7 @@ import { } from './utils'; import { getPartitioningFieldNames } from '../../../../common/util/job_utils'; -import { mlJobService } from '../../services/job_service'; +import { mlJobServiceFactory } from '../../services/job_service'; import { toastNotificationServiceProvider } from '../../services/toast_notification_service'; class RuleEditorFlyoutUI extends Component { @@ -80,6 +80,11 @@ class RuleEditorFlyoutUI extends Component { this.partitioningFieldNames = []; this.canGetFilters = checkPermission('canGetFilters'); + + this.mlJobService = mlJobServiceFactory( + toastNotificationServiceProvider(props.kibana.services.notifications.toasts), + props.kibana.services.mlServices.mlApiServices + ); } componentDidMount() { @@ -101,7 +106,7 @@ class RuleEditorFlyoutUI extends Component { showFlyout = (anomaly) => { let ruleIndex = -1; - const job = this.props.selectedJob ?? mlJobService.getJob(anomaly.jobId); + const job = this.props.selectedJob ?? this.mlJobService.getJob(anomaly.jobId); if (job === undefined) { // No details found for this job, display an error and // don't open the Flyout as no edits can be made without the job. @@ -337,6 +342,7 @@ class RuleEditorFlyoutUI extends Component { }; updateRuleAtIndex = (ruleIndex, editedRule) => { + const mlJobService = this.mlJobService; const { toasts } = this.props.kibana.services.notifications; const { mlApiServices } = this.props.kibana.services.mlServices; const { job, anomaly } = this.state; @@ -344,7 +350,7 @@ class RuleEditorFlyoutUI extends Component { const jobId = job.job_id; const detectorIndex = anomaly.detectorIndex; - saveJobRule(job, detectorIndex, ruleIndex, editedRule, mlApiServices) + saveJobRule(mlJobService, job, detectorIndex, ruleIndex, editedRule, mlApiServices) .then((resp) => { if (resp.success) { toasts.add({ @@ -392,13 +398,14 @@ class RuleEditorFlyoutUI extends Component { }; deleteRuleAtIndex = (index) => { + const mlJobService = this.mlJobService; const { toasts } = this.props.kibana.services.notifications; const { mlApiServices } = this.props.kibana.services.mlServices; const { job, anomaly } = this.state; const jobId = job.job_id; const detectorIndex = anomaly.detectorIndex; - deleteJobRule(job, detectorIndex, index, mlApiServices) + deleteJobRule(mlJobService, job, detectorIndex, index, mlApiServices) .then((resp) => { if (resp.success) { toasts.addSuccess( diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.test.js b/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.test.js index 67ace1427eb13..8dce7f8f45f78 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.test.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.test.js @@ -7,7 +7,7 @@ // Mock the services required for reading and writing job data. jest.mock('../../services/job_service', () => ({ - mlJobService: { + mlJobServiceFactory: () => ({ getJob: () => { return { job_id: 'farequote_no_by', @@ -43,9 +43,8 @@ jest.mock('../../services/job_service', () => ({ }, }; }, - }, + }), })); -jest.mock('../../services/ml_api_service', () => 'ml'); jest.mock('../../capabilities/check_capabilities', () => ({ checkPermission: () => true, })); @@ -93,6 +92,7 @@ function prepareTest() { }, }, }, + mlServices: { mlApiServices: {} }, notifications: { toasts: { addDanger: () => {}, diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/__snapshots__/rule_action_panel.test.js.snap b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/__snapshots__/rule_action_panel.test.js.snap deleted file mode 100644 index 5cd4ef44c07a2..0000000000000 --- a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/__snapshots__/rule_action_panel.test.js.snap +++ /dev/null @@ -1,182 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`RuleActionPanel renders panel for rule with a condition 1`] = ` - - , - }, - Object { - "description": , - "title": , - }, - Object { - "description": - - , - "title": "", - }, - Object { - "description": , - "title": "", - }, - ] - } - type="column" - /> - -`; - -exports[`RuleActionPanel renders panel for rule with a condition and scope, value not in filter list 1`] = ` - - , - }, - Object { - "description": , - "title": , - }, - Object { - "description": - - , - "title": "", - }, - Object { - "description": , - "title": "", - }, - ] - } - type="column" - /> - -`; - -exports[`RuleActionPanel renders panel for rule with scope, value in filter list 1`] = ` - - , - }, - Object { - "description": - - , - "title": , - }, - Object { - "description": , - "title": "", - }, - ] - } - type="column" - /> - -`; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.js b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.js index 9ee71aff3d54a..aeca2d6425fd7 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.js @@ -11,19 +11,21 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; +import { cloneDeep } from 'lodash'; import { EuiDescriptionList, EuiLink, EuiPanel } from '@elastic/eui'; -import { cloneDeep } from 'lodash'; +import { context } from '@kbn/kibana-react-plugin/public'; import { AddToFilterListLink } from './add_to_filter_list_link'; import { DeleteRuleModal } from './delete_rule_modal'; import { EditConditionLink } from './edit_condition_link'; import { buildRuleDescription } from '../utils'; -import { ml } from '../../../services/ml_api_service'; import { FormattedMessage } from '@kbn/i18n-react'; export class RuleActionPanel extends Component { + static contextType = context; + constructor(props) { super(props); @@ -41,6 +43,7 @@ export class RuleActionPanel extends Component { } componentDidMount() { + const ml = this.context.services.mlServices.mlApiServices; // If the rule has a scope section with a single partitioning field key, // load the filter list to check whether to add a link to add the // anomaly partitioning field value to the filter list. diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.test.js b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.test.js index 6d5b2e38346d3..79414b02a5e48 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.test.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.test.js @@ -5,6 +5,15 @@ * 2.0. */ +import React from 'react'; +import { render, screen, waitFor } from '@testing-library/react'; + +import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; +import { ML_DETECTOR_RULE_ACTION } from '@kbn/ml-anomaly-utils'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; + +import { RuleActionPanel } from './rule_action_panel'; + jest.mock('../../../services/job_service', () => 'mlJobService'); // Mock the call for loading a filter. @@ -19,22 +28,18 @@ const mockTestFilter = { jobs: ['farequote'], }, }; -jest.mock('../../../services/ml_api_service', () => ({ - ml: { - filters: { - filters: () => { - return Promise.resolve(mockTestFilter); + +const kibanaReactContextMock = createKibanaReactContext({ + mlServices: { + mlApiServices: { + filters: { + filters: () => { + return Promise.resolve(mockTestFilter); + }, }, }, }, -})); - -import React from 'react'; - -import { shallowWithIntl } from '@kbn/test-jest-helpers'; -import { ML_DETECTOR_RULE_ACTION } from '@kbn/ml-anomaly-utils'; - -import { RuleActionPanel } from './rule_action_panel'; +}); describe('RuleActionPanel', () => { const job = { @@ -117,9 +122,21 @@ describe('RuleActionPanel', () => { ruleIndex: 0, }; - const component = shallowWithIntl(); - - expect(component).toMatchSnapshot(); + render( + + + + + + ); + + expect(screen.getByText('Rule')).toBeInTheDocument(); + expect(screen.getByText('skip result when actual is less than 1')).toBeInTheDocument(); + expect(screen.getByText('Actions')).toBeInTheDocument(); + expect(screen.getByText('Update rule condition from 1 to')).toBeInTheDocument(); + expect(screen.getByText('Update')).toBeInTheDocument(); + expect(screen.getByText('Edit rule')).toBeInTheDocument(); + expect(screen.getByText('Delete rule')).toBeInTheDocument(); }); test('renders panel for rule with scope, value in filter list', () => { @@ -128,19 +145,46 @@ describe('RuleActionPanel', () => { ruleIndex: 1, }; - const component = shallowWithIntl(); - - expect(component).toMatchSnapshot(); + render( + + + + + + ); + + expect(screen.getByText('Rule')).toBeInTheDocument(); + expect( + screen.getByText('skip model update when airline is not in eu-airlines') + ).toBeInTheDocument(); + expect(screen.getByText('Actions')).toBeInTheDocument(); + expect(screen.getByText('Edit rule')).toBeInTheDocument(); + expect(screen.getByText('Delete rule')).toBeInTheDocument(); }); - test('renders panel for rule with a condition and scope, value not in filter list', () => { + test('renders panel for rule with a condition and scope, value not in filter list', async () => { const props = { ...requiredProps, ruleIndex: 1, }; - const wrapper = shallowWithIntl(); - wrapper.setState({ showAddToFilterListLink: true }); - expect(wrapper).toMatchSnapshot(); + await waitFor(() => { + render( + + + + + + ); + }); + + expect(screen.getByText('Rule')).toBeInTheDocument(); + expect( + screen.getByText('skip model update when airline is not in eu-airlines') + ).toBeInTheDocument(); + expect(screen.getByText('Actions')).toBeInTheDocument(); + expect(screen.getByText('Add AAL to eu-airlines')).toBeInTheDocument(); + expect(screen.getByText('Edit rule')).toBeInTheDocument(); + expect(screen.getByText('Delete rule')).toBeInTheDocument(); }); }); diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/utils.js b/x-pack/plugins/ml/public/application/components/rule_editor/utils.js index 275f32b28bb51..a2c8c6d11f8e5 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/utils.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/utils.js @@ -15,7 +15,6 @@ import { ML_DETECTOR_RULE_OPERATOR, } from '@kbn/ml-anomaly-utils'; -import { mlJobService } from '../../services/job_service'; import { processCreatedBy } from '../../../../common/util/job_utils'; export function getNewConditionDefaults() { @@ -69,7 +68,14 @@ export function isValidRule(rule) { return isValid; } -export function saveJobRule(job, detectorIndex, ruleIndex, editedRule, mlApiServices) { +export function saveJobRule( + mlJobService, + job, + detectorIndex, + ruleIndex, + editedRule, + mlApiServices +) { const detector = job.analysis_config.detectors[detectorIndex]; // Filter out any scope expression where the UI=specific 'enabled' @@ -102,16 +108,16 @@ export function saveJobRule(job, detectorIndex, ruleIndex, editedRule, mlApiServ } } - return updateJobRules(job, detectorIndex, rules, mlApiServices); + return updateJobRules(mlJobService, job, detectorIndex, rules, mlApiServices); } -export function deleteJobRule(job, detectorIndex, ruleIndex, mlApiServices) { +export function deleteJobRule(mlJobService, job, detectorIndex, ruleIndex, mlApiServices) { const detector = job.analysis_config.detectors[detectorIndex]; let customRules = []; if (detector.custom_rules !== undefined && ruleIndex < detector.custom_rules.length) { customRules = cloneDeep(detector.custom_rules); customRules.splice(ruleIndex, 1); - return updateJobRules(job, detectorIndex, customRules, mlApiServices); + return updateJobRules(mlJobService, job, detectorIndex, customRules, mlApiServices); } else { return Promise.reject( new Error( @@ -127,7 +133,7 @@ export function deleteJobRule(job, detectorIndex, ruleIndex, mlApiServices) { } } -export function updateJobRules(job, detectorIndex, rules, mlApiServices) { +export function updateJobRules(mlJobService, job, detectorIndex, rules, mlApiServices) { // Pass just the detector with the edited rule to the updateJob endpoint. const jobId = job.job_id; const jobData = { @@ -149,17 +155,14 @@ export function updateJobRules(job, detectorIndex, rules, mlApiServices) { mlApiServices .updateJob({ jobId: jobId, job: jobData }) .then(() => { - // If using mlJobService, refresh the job data in the job service before resolving. - if (mlJobService) { - mlJobService - .refreshJob(jobId) - .then(() => { - resolve({ success: true }); - }) - .catch((refreshResp) => { - reject(refreshResp); - }); - } + mlJobService + .refreshJob(jobId) + .then(() => { + resolve({ success: true }); + }) + .catch((refreshResp) => { + reject(refreshResp); + }); }) .catch((resp) => { reject(resp); diff --git a/x-pack/plugins/ml/public/application/components/validate_job/__snapshots__/validate_job_view.test.js.snap b/x-pack/plugins/ml/public/application/components/validate_job/__snapshots__/validate_job_view.test.js.snap deleted file mode 100644 index 6a4418074f626..0000000000000 --- a/x-pack/plugins/ml/public/application/components/validate_job/__snapshots__/validate_job_view.test.js.snap +++ /dev/null @@ -1,64 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`ValidateJob renders button and modal with a message 1`] = ` - -
- - - -
-
-`; - -exports[`ValidateJob renders the button 1`] = ` - -
- - - -
-
-`; - -exports[`ValidateJob renders the button and modal with a success message 1`] = ` - -
- - - -
-
-`; diff --git a/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.d.ts b/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.d.ts index d903533bfb73e..c6517cecd6924 100644 --- a/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.d.ts +++ b/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.d.ts @@ -9,7 +9,6 @@ import type { FC } from 'react'; declare const ValidateJob: FC<{ getJobConfig: any; getDuration: any; - ml: any; embedded?: boolean; setIsValid?: (valid: boolean) => void; idFilterList?: string[]; diff --git a/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.js b/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.js index 64910f5abfd21..acc17d6b8c0da 100644 --- a/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.js +++ b/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.js @@ -26,8 +26,6 @@ import { import { FormattedMessage } from '@kbn/i18n-react'; -import { getDocLinks } from '../../util/dependency_cache'; - import { parseMessages } from '../../../../common/constants/messages'; import { VALIDATION_STATUS } from '../../../../common/constants/validation'; import { Callout, statusToEuiIconType } from '../callout'; @@ -76,7 +74,7 @@ MessageList.propTypes = { const LoadingSpinner = () => ( - + ); @@ -120,6 +118,7 @@ export class ValidateJobUI extends Component { }; validate = () => { + const docLinks = this.props.kibana.services.docLinks; const job = this.props.getJobConfig(); const getDuration = this.props.getDuration; const duration = typeof getDuration === 'function' ? getDuration() : undefined; @@ -131,10 +130,10 @@ export class ValidateJobUI extends Component { if (typeof duration === 'object' && duration.start !== null && duration.end !== null) { let shouldShowLoadingIndicator = true; - this.props.ml + this.props.kibana.services.mlServices.mlApiServices .validateJob({ duration, fields, job }) .then((validationMessages) => { - const messages = parseMessages(validationMessages, getDocLinks()); + const messages = parseMessages(validationMessages, docLinks); shouldShowLoadingIndicator = false; const messagesContainError = messages.some((m) => m.status === VALIDATION_STATUS.ERROR); @@ -229,7 +228,7 @@ export class ValidateJobUI extends Component { }; render() { - const jobTipsUrl = getDocLinks().links.ml.anomalyDetectionJobTips; + const jobTipsUrl = this.props.kibana.services.docLinks.links.ml.anomalyDetectionJobTips; // only set to false if really false and not another falsy value, so it defaults to true. const fill = this.props.fill === false ? false : true; // default to false if not explicitly set to true @@ -244,7 +243,8 @@ export class ValidateJobUI extends Component { {embedded === false ? (
this.validate(e)} size="s" fill={fill} iconType={isCurrentJobConfig ? this.state.ui.iconType : defaultIconType} @@ -260,6 +260,7 @@ export class ValidateJobUI extends Component { {!isDisabled && this.state.ui.isModalVisible && ( ({ - getDocLinks: () => ({ - links: { - ml: { - anomalyDetectionJobTips: 'jest-metadata-mock-url', +const mockValidateJob = jest.fn().mockImplementation(({ job }) => { + console.log('job', job); + if (job.job_id === 'job1') { + return Promise.resolve([]); + } else if (job.job_id === 'job2') { + return Promise.resolve([ + { + fieldName: 'airline', + id: 'over_field_low_cardinality', + status: 'warning', + text: 'Cardinality of over_field "airline" is low and therefore less suitable for population analysis.', + url: 'https://www.elastic.co/blog/sizing-machine-learning-with-elasticsearch', }, - }, - }), -})); + ]); + } else { + return Promise.reject(new Error('Unknown job')); + } +}); + +const mockKibanaContext = { + services: { + docLinks: { links: { ml: { anomalyDetectionJobTips: 'https://anomalyDetectionJobTips' } } }, + notifications: { toasts: { addDanger: jest.fn(), addError: jest.fn() } }, + mlServices: { mlApiServices: { validateJob: mockValidateJob } }, + }, +}; +const mockReact = React; jest.mock('@kbn/kibana-react-plugin/public', () => ({ - withKibana: (comp) => { - return comp; + withKibana: (type) => { + const EnhancedType = (props) => { + return mockReact.createElement(type, { + ...props, + kibana: mockKibanaContext, + }); + }; + return EnhancedType; }, })); const job = { - job_id: 'test-id', + job_id: 'job2', }; const getJobConfig = () => job; const getDuration = () => ({ start: 0, end: 1 }); -function prepareTest(messages) { - const p = Promise.resolve(messages); - - const ml = { - validateJob: () => Promise.resolve(messages), - }; - const kibana = { - services: { - notifications: { toasts: { addDanger: jest.fn(), addError: jest.fn() } }, - }, - }; - - const component = ( - - ); - - const wrapper = shallowWithIntl(component); - - return { wrapper, p }; -} - describe('ValidateJob', () => { - const test1 = prepareTest({ - success: true, - messages: [], - }); - - test('renders the button', () => { - expect(test1.wrapper).toMatchSnapshot(); - }); - - test('renders the button and modal with a success message', () => { - test1.wrapper.instance().validate(); - test1.p.then(() => { - test1.wrapper.update(); - expect(test1.wrapper).toMatchSnapshot(); - }); - }); - - const test2 = prepareTest({ - success: true, - messages: [ - { - fieldName: 'airline', - id: 'over_field_low_cardinality', - status: 'warning', - text: 'Cardinality of over_field "airline" is low and therefore less suitable for population analysis.', - url: 'https://www.elastic.co/blog/sizing-machine-learning-with-elasticsearch', - }, - ], + test('renders the button when not in embedded mode', () => { + const { getByTestId, queryByTestId } = render( + + + + ); + + const button = getByTestId('mlValidateJobButton'); + expect(button).toBeInTheDocument(); + + const loadingSpinner = queryByTestId('mlValidateJobLoadingSpinner'); + expect(loadingSpinner).not.toBeInTheDocument(); + const modal = queryByTestId('mlValidateJobModal'); + expect(modal).not.toBeInTheDocument(); }); - test('renders button and modal with a message', () => { - test2.wrapper.instance().validate(); - test2.p.then(() => { - test2.wrapper.update(); - expect(test2.wrapper).toMatchSnapshot(); + test('renders no button when in embedded mode', async () => { + const { queryByTestId, getByTestId } = render( + + + + ); + + expect(queryByTestId('mlValidateJobButton')).not.toBeInTheDocument(); + expect(getByTestId('mlValidateJobLoadingSpinner')).toBeInTheDocument(); + expect(queryByTestId('mlValidateJobModal')).not.toBeInTheDocument(); + + await waitFor(() => expect(mockValidateJob).toHaveBeenCalledTimes(1)); + + // wait for the loading spinner to disappear and show a callout instead + await waitFor(() => { + expect(queryByTestId('mlValidateJobLoadingSpinner')).not.toBeInTheDocument(); + expect(queryByTestId('mlValidationCallout warning')).toBeInTheDocument(); }); }); }); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts index e025b808e2fcc..a636974e68b94 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts @@ -19,8 +19,8 @@ import { ANALYSIS_CONFIG_TYPE, } from '@kbn/ml-data-frame-analytics-utils'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { ml } from '../../services/ml_api_service'; import type { Dictionary } from '../../../../common/types/common'; +import type { MlApiServices } from '../../services/ml_api_service'; export type IndexPattern = string; @@ -289,6 +289,7 @@ export enum REGRESSION_STATS { } interface LoadEvalDataConfig { + mlApiServices: MlApiServices; isTraining?: boolean; index: string; dependentVariable: string; @@ -303,6 +304,7 @@ interface LoadEvalDataConfig { } export const loadEvalData = async ({ + mlApiServices, isTraining, index, dependentVariable, @@ -360,7 +362,7 @@ export const loadEvalData = async ({ }; try { - const evalResult = await ml.dataFrameAnalytics.evaluateDataFrameAnalytics(config); + const evalResult = await mlApiServices.dataFrameAnalytics.evaluateDataFrameAnalytics(config); results.success = true; results.eval = evalResult; return results; @@ -371,6 +373,7 @@ export const loadEvalData = async ({ }; interface LoadDocsCountConfig { + mlApiServices: MlApiServices; ignoreDefaultQuery?: boolean; isTraining?: boolean; searchQuery: estypes.QueryDslQueryContainer; @@ -384,6 +387,7 @@ interface LoadDocsCountResponse { } export const loadDocsCount = async ({ + mlApiServices, ignoreDefaultQuery = true, isTraining, searchQuery, @@ -398,7 +402,7 @@ export const loadDocsCount = async ({ query, }; - const resp: TrackTotalHitsSearchResponse = await ml.esSearch({ + const resp: TrackTotalHitsSearchResponse = await mlApiServices.esSearch({ index: destIndex, size: 0, body, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/common/get_index_data.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/common/get_index_data.ts index 68ed524ec5c12..bd289f3a1cdd7 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/common/get_index_data.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/common/get_index_data.ts @@ -11,16 +11,19 @@ import { type DataFrameAnalyticsConfig } from '@kbn/ml-data-frame-analytics-util import type { EsSorting, UseDataGridReturnType } from '@kbn/ml-data-grid'; import { getProcessedFields, INDEX_STATUS } from '@kbn/ml-data-grid'; -import { ml } from '../../services/ml_api_service'; -import { newJobCapsServiceAnalytics } from '../../services/new_job_capabilities/new_job_capabilities_service_analytics'; +import { mlJobCapsServiceAnalyticsFactory } from '../../services/new_job_capabilities/new_job_capabilities_service_analytics'; +import type { MlApiServices } from '../../services/ml_api_service'; export const getIndexData = async ( + mlApiServices: MlApiServices, jobConfig: DataFrameAnalyticsConfig | undefined, dataGrid: UseDataGridReturnType, searchQuery: estypes.QueryDslQueryContainer, options: { didCancel: boolean } ) => { if (jobConfig !== undefined) { + const newJobCapsServiceAnalytics = mlJobCapsServiceAnalyticsFactory(mlApiServices); + const { pagination, setErrorMessage, @@ -47,7 +50,7 @@ export const getIndexData = async ( const { pageIndex, pageSize } = pagination; // TODO: remove results_field from `fields` when possible - const resp: estypes.SearchResponse = await ml.esSearch({ + const resp: estypes.SearchResponse = await mlApiServices.esSearch({ index: jobConfig.dest.index, body: { fields: ['*'], diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/common/get_index_fields.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/common/get_index_fields.ts index 54f76fdc1b52f..0cc1bb0b587c0 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/common/get_index_fields.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/common/get_index_fields.ts @@ -8,19 +8,22 @@ import type { ES_FIELD_TYPES } from '@kbn/field-types'; import type { DataFrameAnalyticsConfig } from '@kbn/ml-data-frame-analytics-utils'; -import { newJobCapsServiceAnalytics } from '../../services/new_job_capabilities/new_job_capabilities_service_analytics'; +import { mlJobCapsServiceAnalyticsFactory } from '../../services/new_job_capabilities/new_job_capabilities_service_analytics'; +import type { MlApiServices } from '../../services/ml_api_service'; export interface FieldTypes { [key: string]: ES_FIELD_TYPES; } export const getIndexFields = ( + mlApiServices: MlApiServices, jobConfig: DataFrameAnalyticsConfig | undefined, needsDestIndexFields: boolean ) => { if (jobConfig !== undefined) { - const { selectedFields: defaultSelected, docFields } = - newJobCapsServiceAnalytics.getDefaultFields(jobConfig, needsDestIndexFields); + const { selectedFields: defaultSelected, docFields } = mlJobCapsServiceAnalyticsFactory( + mlApiServices + ).getDefaultFields(jobConfig, needsDestIndexFields); const types: FieldTypes = {}; const allFields: string[] = []; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/common/use_results_view_config.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/common/use_results_view_config.ts index 22acd894d63ef..fba862558b766 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/common/use_results_view_config.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/common/use_results_view_config.ts @@ -19,14 +19,13 @@ import { type TotalFeatureImportance, } from '@kbn/ml-data-frame-analytics-utils'; -import { useMlKibana } from '../../contexts/kibana'; -import { ml } from '../../services/ml_api_service'; -import { newJobCapsServiceAnalytics } from '../../services/new_job_capabilities/new_job_capabilities_service_analytics'; +import { useMlApiContext, useMlKibana } from '../../contexts/kibana'; +import { useNewJobCapsServiceAnalytics } from '../../services/new_job_capabilities/new_job_capabilities_service_analytics'; import { useMlIndexUtils } from '../../util/index_service'; import { isGetDataFrameAnalyticsStatsResponseOk } from '../pages/analytics_management/services/analytics_service/get_analytics'; import { useTrainedModelsApiService } from '../../services/ml_api_service/trained_models'; -import { getToastNotificationService } from '../../services/toast_notification_service'; +import { useToastNotificationService } from '../../services/toast_notification_service'; import { getDestinationIndex } from './get_destination_index'; export const useResultsViewConfig = (jobId: string) => { @@ -35,8 +34,11 @@ export const useResultsViewConfig = (jobId: string) => { data: { dataViews }, }, } = useMlKibana(); + const toastNotificationService = useToastNotificationService(); + const ml = useMlApiContext(); const { getDataViewIdFromName } = useMlIndexUtils(); const trainedModelsApiService = useTrainedModelsApiService(); + const newJobCapsServiceAnalytics = useNewJobCapsServiceAnalytics(); const [dataView, setDataView] = useState(undefined); const [dataViewErrorMessage, setDataViewErrorMessage] = useState(undefined); @@ -92,7 +94,7 @@ export const useResultsViewConfig = (jobId: string) => { setTotalFeatureImportance(inferenceModel?.metadata?.total_feature_importance); } } catch (e) { - getToastNotificationService().displayErrorToast(e); + toastNotificationService.displayErrorToast(e); } } diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/advanced_step/advanced_step_form.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/advanced_step/advanced_step_form.tsx index 24577dd0dcc04..9b8dec570a5e9 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/advanced_step/advanced_step_form.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/advanced_step/advanced_step_form.tsx @@ -32,7 +32,7 @@ import { import { HyperParameters } from './hyper_parameters'; import type { CreateAnalyticsStepProps } from '../../../analytics_management/hooks/use_create_analytics_form'; import { getModelMemoryLimitErrors } from '../../../analytics_management/hooks/use_create_analytics_form/reducer'; -import { useMlKibana } from '../../../../../contexts/kibana'; +import { useMlKibana, useMlApiContext } from '../../../../../contexts/kibana'; import { DEFAULT_MODEL_MEMORY_LIMIT } from '../../../analytics_management/hooks/use_create_analytics_form/state'; import { ANALYTICS_STEPS } from '../../page'; import { fetchExplainData } from '../shared'; @@ -134,6 +134,7 @@ export const AdvancedStepForm: FC = ({ const { services: { docLinks }, } = useMlKibana(); + const mlApiServices = useMlApiContext(); const classAucRocDocLink = docLinks.links.ml.classificationAucRoc; const { setEstimatedModelMemoryLimit, setFormState } = actions; @@ -205,7 +206,10 @@ export const AdvancedStepForm: FC = ({ useEffect(() => { setFetchingAdvancedParamErrors(true); (async function () { - const { success, errorMessage, errorReason, expectedMemory } = await fetchExplainData(form); + const { success, errorMessage, errorReason, expectedMemory } = await fetchExplainData( + mlApiServices, + form + ); const paramErrors: AdvancedParamErrors = {}; if (success) { diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx index a06e3575cfce9..4f737c1137663 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx @@ -29,13 +29,13 @@ import { } from '@kbn/ml-data-frame-analytics-utils'; import { DataGrid } from '@kbn/ml-data-grid'; import { SEARCH_QUERY_LANGUAGE } from '@kbn/ml-query-utils'; -import { useMlKibana } from '../../../../../contexts/kibana'; +import { useMlApiContext, useMlKibana } from '../../../../../contexts/kibana'; import { EuiComboBoxWithFieldStats, FieldStatsFlyoutProvider, } from '../../../../../components/field_stats_flyout'; import type { FieldForStats } from '../../../../../components/field_stats_flyout/field_stats_info_button'; -import { newJobCapsServiceAnalytics } from '../../../../../services/new_job_capabilities/new_job_capabilities_service_analytics'; +import { useNewJobCapsServiceAnalytics } from '../../../../../services/new_job_capabilities/new_job_capabilities_service_analytics'; import { useDataSource } from '../../../../../contexts/ml'; import { getScatterplotMatrixLegendType } from '../../../../common/get_scatterplot_matrix_legend_type'; @@ -44,7 +44,6 @@ import { Messages } from '../shared'; import type { State } from '../../../analytics_management/hooks/use_create_analytics_form/state'; import { DEFAULT_MODEL_MEMORY_LIMIT } from '../../../analytics_management/hooks/use_create_analytics_form/state'; import { handleExplainErrorMessage, shouldAddAsDepVarOption } from './form_options_validation'; -import { getToastNotifications } from '../../../../../util/dependency_cache'; import { ANALYTICS_STEPS } from '../../page'; import { ContinueButton } from '../continue_button'; @@ -115,6 +114,10 @@ export const ConfigurationStepForm: FC = ({ setCurrentStep, sourceDataViewTitle, }) => { + const { services } = useMlKibana(); + const toastNotifications = services.notifications.toasts; + const mlApiServices = useMlApiContext(); + const newJobCapsServiceAnalytics = useNewJobCapsServiceAnalytics(); const { selectedDataView, selectedSavedSearch } = useDataSource(); const { savedSearchQuery, savedSearchQueryStr } = useSavedSearch(); @@ -167,8 +170,6 @@ export const ConfigurationStepForm: FC = ({ language: jobConfigQueryLanguage ?? SEARCH_QUERY_LANGUAGE.KUERY, }); - const toastNotifications = getToastNotifications(); - const setJobConfigQuery: ExplorationQueryBarProps['setSearchQuery'] = (update) => { if (update.query) { setFormState({ @@ -287,7 +288,7 @@ export const ConfigurationStepForm: FC = ({ fieldSelection, errorMessage, noDocsContainMappedFields: noDocsWithFields, - } = await fetchExplainData(formToUse); + } = await fetchExplainData(mlApiServices, formToUse); if (success) { if (shouldUpdateEstimatedMml) { @@ -443,7 +444,7 @@ export const ConfigurationStepForm: FC = ({ fieldSelection, errorMessage, noDocsContainMappedFields: noDocsWithFields, - } = await fetchExplainData(formCopy); + } = await fetchExplainData(mlApiServices, formCopy); if (success) { // update the field selection table const hasRequiredFields = fieldSelection.some( @@ -547,7 +548,6 @@ export const ConfigurationStepForm: FC = ({ // eslint-disable-next-line react-hooks/exhaustive-deps [dependentVariableEmpty, jobType, scatterplotMatrixProps.fields.length] ); - const { services } = useMlKibana(); const fieldStatsServices: FieldStatsServices = useMemo(() => { const { uiSettings, data, fieldFormats, charts } = services; return { diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/supported_fields_message.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/supported_fields_message.tsx index f7c8f30bff1a2..d8f3404cf2887 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/supported_fields_message.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/supported_fields_message.tsx @@ -19,7 +19,7 @@ import { } from '@kbn/ml-data-frame-analytics-utils'; import type { AnalyticsJobType } from '../../../analytics_management/hooks/use_create_analytics_form/state'; import { CATEGORICAL_TYPES } from './form_options_validation'; -import { newJobCapsServiceAnalytics } from '../../../../../services/new_job_capabilities/new_job_capabilities_service_analytics'; +import { useNewJobCapsServiceAnalytics } from '../../../../../services/new_job_capabilities/new_job_capabilities_service_analytics'; const containsClassificationFieldsCb = ({ name, type }: Field) => !OMIT_FIELDS.includes(name) && @@ -73,7 +73,7 @@ export const SupportedFieldsMessage: FC = ({ jobType }) => { const [sourceIndexContainsSupportedFields, setSourceIndexContainsSupportedFields] = useState(true); const [sourceIndexFieldsCheckFailed, setSourceIndexFieldsCheckFailed] = useState(false); - const { fields } = newJobCapsServiceAnalytics; + const { fields } = useNewJobCapsServiceAnalytics(); // Find out if data view contains supported fields for job type. Provides a hint in the form // that job may not run correctly if no supported fields are found. diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_analytics_advanced_editor/create_analytics_advanced_editor.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_analytics_advanced_editor/create_analytics_advanced_editor.tsx index cdc93fbeb4feb..a2a6e965c3e70 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_analytics_advanced_editor/create_analytics_advanced_editor.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_analytics_advanced_editor/create_analytics_advanced_editor.tsx @@ -14,8 +14,7 @@ import { i18n } from '@kbn/i18n'; import { extractErrorMessage } from '@kbn/ml-error-utils'; import { dynamic } from '@kbn/shared-ux-utility'; -import { useNotifications } from '../../../../../contexts/kibana'; -import { ml } from '../../../../../services/ml_api_service'; +import { useMlApiContext, useNotifications } from '../../../../../contexts/kibana'; import type { CreateAnalyticsFormProps } from '../../../analytics_management/hooks/use_create_analytics_form'; import { CreateStep } from '../create_step'; import { ANALYTICS_STEPS } from '../../page'; @@ -25,6 +24,7 @@ const EditorComponent = dynamic(async () => ({ })); export const CreateAnalyticsAdvancedEditor: FC = (props) => { + const ml = useMlApiContext(); const { actions, state } = props; const { setAdvancedEditorRawString, setFormState } = actions; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step_footer/create_step_footer.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step_footer/create_step_footer.tsx index 307308ddb65b9..b7dac69e1226e 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step_footer/create_step_footer.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_step_footer/create_step_footer.tsx @@ -16,8 +16,7 @@ import { } from '@kbn/ml-data-frame-analytics-utils'; import { getDataFrameAnalyticsProgressPhase } from '../../../analytics_management/components/analytics_list/common'; import { isGetDataFrameAnalyticsStatsResponseOk } from '../../../analytics_management/services/analytics_service/get_analytics'; -import { useMlKibana } from '../../../../../contexts/kibana'; -import { ml } from '../../../../../services/ml_api_service'; +import { useMlApiContext, useMlKibana } from '../../../../../contexts/kibana'; import { BackToListPanel } from '../back_to_list_panel'; import { ViewResultsPanel } from '../view_results_panel'; import { ProgressStats } from './progress_stats'; @@ -49,6 +48,7 @@ export const CreateStepFooter: FC = ({ jobId, jobType, showProgress }) => const { services: { notifications }, } = useMlKibana(); + const ml = useMlApiContext(); useEffect(() => { setInitialized(true); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/details_step/details_step_form.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/details_step/details_step_form.tsx index 3cc53d3c95ad0..d80c23732dcbd 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/details_step/details_step_form.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/details_step/details_step_form.tsx @@ -14,12 +14,11 @@ import { extractErrorMessage } from '@kbn/ml-error-utils'; import { CreateDataViewForm } from '@kbn/ml-data-view-utils/components/create_data_view_form_row'; import { DestinationIndexForm } from '@kbn/ml-creation-wizard-utils/components/destination_index_form'; -import { useMlKibana } from '../../../../../contexts/kibana'; +import { useMlApiContext, useMlKibana } from '../../../../../contexts/kibana'; import type { CreateAnalyticsStepProps } from '../../../analytics_management/hooks/use_create_analytics_form'; import { JOB_ID_MAX_LENGTH } from '../../../../../../../common/constants/validation'; import { ContinueButton } from '../continue_button'; import { ANALYTICS_STEPS } from '../../page'; -import { ml } from '../../../../../services/ml_api_service'; import { useCanCreateDataView } from '../../hooks/use_can_create_data_view'; import { useDataViewTimeFields } from '../../hooks/use_data_view_time_fields'; import { AdditionalSection } from './additional_section'; @@ -43,6 +42,7 @@ export const DetailsStepForm: FC = ({ const { services: { docLinks, notifications }, } = useMlKibana(); + const ml = useMlApiContext(); const canCreateDataView = useCanCreateDataView(); const { dataViewAvailableTimeFields, onTimeFieldChanged } = useDataViewTimeFields({ diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/shared/fetch_explain_data.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/shared/fetch_explain_data.ts index 95a6381ac3fc4..680415e189354 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/shared/fetch_explain_data.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/shared/fetch_explain_data.ts @@ -11,11 +11,11 @@ import type { DfAnalyticsExplainResponse, FieldSelectionItem, } from '@kbn/ml-data-frame-analytics-utils'; -import { ml } from '../../../../../services/ml_api_service'; import type { State } from '../../../analytics_management/hooks/use_create_analytics_form/state'; import { getJobConfigFromFormState } from '../../../analytics_management/hooks/use_create_analytics_form/state'; +import type { MlApiServices } from '../../../../../services/ml_api_service'; -export const fetchExplainData = async (formState: State['form']) => { +export const fetchExplainData = async (mlApiServices: MlApiServices, formState: State['form']) => { const jobConfig = getJobConfigFromFormState(formState); let errorMessage = ''; let errorReason = ''; @@ -28,9 +28,8 @@ export const fetchExplainData = async (formState: State['form']) => { delete jobConfig.dest; delete jobConfig.model_memory_limit; delete jobConfig.analyzed_fields; - const resp: DfAnalyticsExplainResponse = await ml.dataFrameAnalytics.explainDataFrameAnalytics( - jobConfig - ); + const resp: DfAnalyticsExplainResponse = + await mlApiServices.dataFrameAnalytics.explainDataFrameAnalytics(jobConfig); expectedMemory = resp.memory_estimation?.expected_memory_without_disk; fieldSelection = resp.field_selection || []; } catch (error) { diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts index 110307fdb4024..80abafecd83ed 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts @@ -34,10 +34,9 @@ import { INDEX_STATUS, } from '@kbn/ml-data-grid'; +import { useMlApiContext } from '../../../../contexts/kibana'; import { DataLoader } from '../../../../datavisualizer/index_based/data_loader'; -import { ml } from '../../../../services/ml_api_service'; - type IndexSearchResponse = estypes.SearchResponse; interface MLEuiDataGridColumn extends EuiDataGridColumn { @@ -82,6 +81,7 @@ export const useIndexData = ( toastNotifications: CoreSetup['notifications']['toasts'], runtimeMappings?: RuntimeMappings ): UseIndexDataReturnType => { + const ml = useMlApiContext(); // Fetch 500 random documents to determine populated fields. // This is a workaround to avoid passing potentially thousands of unpopulated fields // (for example, as part of filebeat/metricbeat/ECS based indices) @@ -258,7 +258,7 @@ export const useIndexData = ( ]); const dataLoader = useMemo( - () => new DataLoader(dataView, toastNotifications), + () => new DataLoader(dataView, ml), // eslint-disable-next-line react-hooks/exhaustive-deps [dataView] ); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx index c9b345c460030..4890ac59ffbe6 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx @@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import type { DataFrameAnalyticsId } from '@kbn/ml-data-frame-analytics-utils'; import { useDataSource } from '../../../contexts/ml/data_source_context'; -import { ml } from '../../../services/ml_api_service'; +import { useMlApiContext } from '../../../contexts/kibana'; import { useCreateAnalyticsForm } from '../analytics_management/hooks/use_create_analytics_form'; import { CreateAnalyticsAdvancedEditor } from './components/create_analytics_advanced_editor'; import { @@ -46,6 +46,7 @@ interface Props { } export const Page: FC = ({ jobId }) => { + const ml = useMlApiContext(); const [currentStep, setCurrentStep] = useState(ANALYTICS_STEPS.CONFIGURATION); const [activatedSteps, setActivatedSteps] = useState([ true, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/use_confusion_matrix.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/use_confusion_matrix.ts index 8c638c0617f89..74ca62a874081 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/use_confusion_matrix.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/use_confusion_matrix.ts @@ -16,11 +16,11 @@ import { type DataFrameAnalyticsConfig, } from '@kbn/ml-data-frame-analytics-utils'; -import { newJobCapsServiceAnalytics } from '../../../../../services/new_job_capabilities/new_job_capabilities_service_analytics'; +import { useNewJobCapsServiceAnalytics } from '../../../../../services/new_job_capabilities/new_job_capabilities_service_analytics'; +import { useMlApiContext } from '../../../../../contexts/kibana'; import type { ResultsSearchQuery, ClassificationMetricItem } from '../../../../common/analytics'; import { isClassificationEvaluateResponse } from '../../../../common/analytics'; - import { loadEvalData, loadDocsCount } from '../../../../common'; import { isTrainingFilter } from './is_training_filter'; @@ -60,6 +60,8 @@ export const useConfusionMatrix = ( jobConfig: DataFrameAnalyticsConfig, searchQuery: ResultsSearchQuery ) => { + const mlApiServices = useMlApiContext(); + const newJobCapsServiceAnalytics = useNewJobCapsServiceAnalytics(); const [confusionMatrixData, setConfusionMatrixData] = useState([]); const [overallAccuracy, setOverallAccuracy] = useState(null); const [avgRecall, setAvgRecall] = useState(null); @@ -87,6 +89,7 @@ export const useConfusionMatrix = ( } const evalData = await loadEvalData({ + mlApiServices, isTraining, index: jobConfig.dest.index, dependentVariable, @@ -98,6 +101,7 @@ export const useConfusionMatrix = ( }); const docsCountResp = await loadDocsCount({ + mlApiServices, isTraining, searchQuery, resultsField, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/use_roc_curve.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/use_roc_curve.ts index c411a624bd434..88dd6f20cd75d 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/use_roc_curve.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/use_roc_curve.ts @@ -15,7 +15,8 @@ import { type RocCurveItem, } from '@kbn/ml-data-frame-analytics-utils'; -import { newJobCapsServiceAnalytics } from '../../../../../services/new_job_capabilities/new_job_capabilities_service_analytics'; +import { useNewJobCapsServiceAnalytics } from '../../../../../services/new_job_capabilities/new_job_capabilities_service_analytics'; +import { useMlApiContext } from '../../../../../contexts/kibana'; import type { ResultsSearchQuery } from '../../../../common/analytics'; import { isClassificationEvaluateResponse } from '../../../../common/analytics'; @@ -39,6 +40,8 @@ export const useRocCurve = ( searchQuery: ResultsSearchQuery, columns: string[] ) => { + const mlApiServices = useMlApiContext(); + const newJobCapsServiceAnalytics = useNewJobCapsServiceAnalytics(); const classificationClasses = columns.filter( (d) => d !== ACTUAL_CLASS_ID && d !== OTHER_CLASS_ID ); @@ -74,6 +77,7 @@ export const useRocCurve = ( for (let i = 0; i < classificationClasses.length; i++) { const rocCurveClassName = classificationClasses[i]; const evalData = await loadEvalData({ + mlApiServices, isTraining: isTrainingFilter(searchQuery, resultsField), index: jobConfig.dest.index, dependentVariable, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_analytics.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_analytics.tsx index 84ce34eb8d8b7..10e302fad2249 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_analytics.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_analytics.tsx @@ -17,13 +17,11 @@ import { type DataFrameAnalysisConfigType, } from '@kbn/ml-data-frame-analytics-utils'; -import { ml } from '../../../../../services/ml_api_service'; - import { isGetDataFrameAnalyticsStatsResponseOk } from '../../../analytics_management/services/analytics_service/get_analytics'; import type { DataFrameAnalyticsListRow } from '../../../analytics_management/components/analytics_list/common'; import { DATA_FRAME_MODE } from '../../../analytics_management/components/analytics_list/common'; import { ExpandedRow } from '../../../analytics_management/components/analytics_list/expanded_row'; - +import { useMlApiContext } from '../../../../../contexts/kibana'; import type { ExpandableSectionProps } from './expandable_section'; import { ExpandableSection, HEADER_ITEMS_LOADING } from './expandable_section'; @@ -77,6 +75,8 @@ interface ExpandableSectionAnalyticsProps { } export const ExpandableSectionAnalytics: FC = ({ jobId }) => { + const ml = useMlApiContext(); + const [expandedRowItem, setExpandedRowItem] = useState(); const fetchStats = async () => { diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx index 9bbd3996fa3b6..212c0fa6d2cf7 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx @@ -40,7 +40,6 @@ import { import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { SEARCH_QUERY_LANGUAGE } from '@kbn/ml-query-utils'; -import { getToastNotifications } from '../../../../../util/dependency_cache'; import type { useColorRange } from '../../../../../components/color_range_legend'; import { ColorRangeLegend } from '../../../../../components/color_range_legend'; import { useMlKibana } from '../../../../../contexts/kibana'; @@ -140,6 +139,7 @@ export const ExpandableSectionResults: FC = ({ share, data, http: { basePath }, + notifications: { toasts }, }, } = useMlKibana(); @@ -394,7 +394,7 @@ export const ExpandableSectionResults: FC = ({ } dataTestSubj="mlExplorationDataGrid" renderCellPopover={renderCellPopover} - toastNotifications={getToastNotifications()} + toastNotifications={toasts} /> )} diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/exploration_results_table.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/exploration_results_table.tsx index e92e8f665bc37..c3d41cb4c4307 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/exploration_results_table.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/exploration_results_table.tsx @@ -14,9 +14,6 @@ import type { DataFrameTaskStateType, } from '@kbn/ml-data-frame-analytics-utils'; -import { getToastNotifications } from '../../../../../util/dependency_cache'; -import { useMlKibana } from '../../../../../contexts/kibana'; - import type { ResultsSearchQuery } from '../../../../common/analytics'; import { ExpandableSectionResults } from '../expandable_section'; @@ -33,19 +30,7 @@ interface Props { export const ExplorationResultsTable: FC = React.memo( ({ dataView, jobConfig, needsDestDataView, searchQuery }) => { - const { - services: { - mlServices: { mlApiServices }, - }, - } = useMlKibana(); - - const classificationData = useExplorationResults( - dataView, - jobConfig, - searchQuery, - getToastNotifications(), - mlApiServices - ); + const classificationData = useExplorationResults(dataView, jobConfig, searchQuery); if (jobConfig === undefined || classificationData === undefined) { return null; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts index f34d597bf4265..34ad61d02cd3b 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts @@ -9,7 +9,6 @@ import { useCallback, useEffect, useMemo, useState } from 'react'; import type { EuiDataGridColumn } from '@elastic/eui'; -import type { CoreSetup } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; import type { DataView } from '@kbn/data-views-plugin/public'; import { extractErrorMessage } from '@kbn/ml-error-utils'; @@ -35,7 +34,7 @@ import { } from '@kbn/ml-data-grid'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { MlApiServices } from '../../../../../services/ml_api_service'; +import { useMlApiContext, useMlKibana } from '../../../../../contexts/kibana'; import { DataLoader } from '../../../../../datavisualizer/index_based/data_loader'; import { getIndexData, getIndexFields } from '../../../../common'; @@ -45,10 +44,14 @@ import { useExplorationDataGrid } from './use_exploration_data_grid'; export const useExplorationResults = ( dataView: DataView | undefined, jobConfig: DataFrameAnalyticsConfig | undefined, - searchQuery: estypes.QueryDslQueryContainer, - toastNotifications: CoreSetup['notifications']['toasts'], - mlApiServices: MlApiServices + searchQuery: estypes.QueryDslQueryContainer ): UseIndexDataReturnType => { + const { + services: { + notifications: { toasts }, + }, + } = useMlKibana(); + const ml = useMlApiContext(); const [baseline, setBaseLine] = useState(); const trainedModelsApiService = useTrainedModelsApiService(); @@ -60,7 +63,7 @@ export const useExplorationResults = ( if (jobConfig !== undefined) { const resultsField = jobConfig.dest.results_field!; - const { fieldTypes } = getIndexFields(jobConfig, needsDestIndexFields); + const { fieldTypes } = getIndexFields(ml, jobConfig, needsDestIndexFields); columns.push( ...getDataGridSchemasFromFieldTypes(fieldTypes, resultsField).sort((a: any, b: any) => sortExplorationResultsFields(a.id, b.id, jobConfig) @@ -81,7 +84,7 @@ export const useExplorationResults = ( // passed on to `getIndexData`. useEffect(() => { const options = { didCancel: false }; - getIndexData(jobConfig, dataGrid, searchQuery, options); + getIndexData(ml, jobConfig, dataGrid, searchQuery, options); return () => { options.didCancel = true; }; @@ -90,7 +93,7 @@ export const useExplorationResults = ( }, [jobConfig && jobConfig.id, dataGrid.pagination, searchQuery, dataGrid.sortingColumns]); const dataLoader = useMemo( - () => (dataView !== undefined ? new DataLoader(dataView, toastNotifications) : undefined), + () => (dataView !== undefined ? new DataLoader(dataView, ml) : undefined), // eslint-disable-next-line react-hooks/exhaustive-deps [dataView] ); @@ -110,7 +113,7 @@ export const useExplorationResults = ( dataGrid.setColumnCharts(columnChartsData); } } catch (e) { - showDataGridColumnChartErrorMessageToast(e, toastNotifications); + showDataGridColumnChartErrorMessageToast(e, toasts); } }; @@ -158,7 +161,7 @@ export const useExplorationResults = ( } catch (e) { const error = extractErrorMessage(e); - toastNotifications.addDanger({ + toasts.addDanger({ title: i18n.translate( 'xpack.ml.dataframe.analytics.explorationResults.baselineErrorMessageToast', { @@ -169,7 +172,7 @@ export const useExplorationResults = ( }); } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [mlApiServices, jobConfig]); + }, [jobConfig]); useEffect(() => { getAnalyticsBaseline(); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts index 38d439067897a..5b9ce4646b9e7 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts @@ -33,7 +33,7 @@ import { COLOR_RANGE, COLOR_RANGE_SCALE, } from '../../../../../components/color_range_legend'; -import { getToastNotifications } from '../../../../../util/dependency_cache'; +import { useMlApiContext, useMlKibana } from '../../../../../contexts/kibana'; import { getIndexData, getIndexFields } from '../../../../common'; @@ -45,6 +45,12 @@ export const useOutlierData = ( jobConfig: DataFrameAnalyticsConfig | undefined, searchQuery: estypes.QueryDslQueryContainer ): UseIndexDataReturnType => { + const { + services: { + notifications: { toasts }, + }, + } = useMlKibana(); + const ml = useMlApiContext(); const needsDestIndexFields = dataView !== undefined && dataView.title === jobConfig?.source.index[0]; @@ -53,7 +59,7 @@ export const useOutlierData = ( if (jobConfig !== undefined && dataView !== undefined) { const resultsField = jobConfig.dest.results_field; - const { fieldTypes } = getIndexFields(jobConfig, needsDestIndexFields); + const { fieldTypes } = getIndexFields(ml, jobConfig, needsDestIndexFields); newColumns.push( ...getDataGridSchemasFromFieldTypes(fieldTypes, resultsField!).sort((a: any, b: any) => sortExplorationResultsFields(a.id, b.id, jobConfig) @@ -86,7 +92,7 @@ export const useOutlierData = ( // passed on to `getIndexData`. useEffect(() => { const options = { didCancel: false }; - getIndexData(jobConfig, dataGrid, searchQuery, options); + getIndexData(ml, jobConfig, dataGrid, searchQuery, options); return () => { options.didCancel = true; }; @@ -95,7 +101,9 @@ export const useOutlierData = ( }, [jobConfig && jobConfig.id, dataGrid.pagination, searchQuery, dataGrid.sortingColumns]); const dataLoader = useMemo( - () => (dataView !== undefined ? new DataLoader(dataView, getToastNotifications()) : undefined), + () => (dataView !== undefined ? new DataLoader(dataView, ml) : undefined), + // skip ml API services from deps check + // eslint-disable-next-line react-hooks/exhaustive-deps [dataView] ); @@ -114,7 +122,7 @@ export const useOutlierData = ( dataGrid.setColumnCharts(columnChartsData); } } catch (e) { - showDataGridColumnChartErrorMessageToast(e, getToastNotifications()); + showDataGridColumnChartErrorMessageToast(e, toasts); } }; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx index 958714e9b98bd..398e0ecb61505 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx @@ -28,7 +28,7 @@ import { } from '@kbn/ml-data-frame-analytics-utils'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { useMlKibana } from '../../../../../contexts/kibana'; +import { useMlApiContext, useMlKibana } from '../../../../../contexts/kibana'; import type { Eval } from '../../../../common'; import { getValuesFromResponse, loadEvalData, loadDocsCount } from '../../../../common'; @@ -65,6 +65,7 @@ export const EvaluatePanel: FC = ({ jobConfig, jobStatus, searchQuery }) const { services: { docLinks }, } = useMlKibana(); + const mlApiServices = useMlApiContext(); const docLink = docLinks.links.ml.regressionEvaluation; const [trainingEval, setTrainingEval] = useState(defaultEval); const [generalizationEval, setGeneralizationEval] = useState(defaultEval); @@ -84,6 +85,7 @@ export const EvaluatePanel: FC = ({ jobConfig, jobStatus, searchQuery }) setIsLoadingGeneralization(true); const genErrorEval = await loadEvalData({ + mlApiServices, isTraining: false, index, dependentVariable, @@ -122,6 +124,7 @@ export const EvaluatePanel: FC = ({ jobConfig, jobStatus, searchQuery }) setIsLoadingTraining(true); const trainingErrorEval = await loadEvalData({ + mlApiServices, isTraining: true, index, dependentVariable, @@ -159,6 +162,7 @@ export const EvaluatePanel: FC = ({ jobConfig, jobStatus, searchQuery }) const loadData = async () => { loadGeneralizationData(false); const genDocsCountResp = await loadDocsCount({ + mlApiServices, ignoreDefaultQuery: false, isTraining: false, searchQuery, @@ -173,6 +177,7 @@ export const EvaluatePanel: FC = ({ jobConfig, jobStatus, searchQuery }) loadTrainingData(false); const trainDocsCountResp = await loadDocsCount({ + mlApiServices, ignoreDefaultQuery: false, isTraining: true, searchQuery, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/delete_action_name.test.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/delete_action_name.test.tsx index 03364165095d2..2ae6a2ae1b265 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/delete_action_name.test.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/delete_action_name.test.tsx @@ -21,11 +21,8 @@ jest.mock('../../../../../capabilities/check_capabilities', () => ({ createPermissionFailureMessage: jest.fn(), })); -jest.mock('../../../../../util/dependency_cache', () => ({ - getToastNotifications: () => ({ addSuccess: jest.fn(), addDanger: jest.fn() }), -})); - jest.mock('../../../../../contexts/kibana', () => ({ + useMlApiContext: jest.fn(), useMlKibana: () => ({ services: { ...mockCoreServices.createStart(), data: { data_view: { find: jest.fn() } } }, }), diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx index 3357febd9398f..01a89135c9c34 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx @@ -14,9 +14,9 @@ import { useMlKibana } from '../../../../../contexts/kibana'; import { useToastNotificationService } from '../../../../../services/toast_notification_service'; import { - deleteAnalytics, - deleteAnalyticsAndDestIndex, - canDeleteIndex, + useDeleteAnalytics, + useDeleteAnalyticsAndDestIndex, + useCanDeleteIndex, } from '../../services/analytics_service'; import type { @@ -56,6 +56,9 @@ export const useDeleteAction = (canDeleteDataFrameAnalytics: boolean) => { const indexName = getDestinationIndex(item?.config); const toastNotificationService = useToastNotificationService(); + const deleteAnalytics = useDeleteAnalytics(); + const deleteAnalyticsAndDestIndex = useDeleteAnalyticsAndDestIndex(); + const canDeleteIndex = useCanDeleteIndex(); const checkDataViewExists = async () => { try { @@ -83,7 +86,7 @@ export const useDeleteAction = (canDeleteDataFrameAnalytics: boolean) => { }; const checkUserIndexPermission = async () => { try { - const userCanDelete = await canDeleteIndex(indexName, toastNotificationService); + const userCanDelete = await canDeleteIndex(indexName); if (userCanDelete) { setUserCanDeleteIndex(true); } @@ -133,11 +136,10 @@ export const useDeleteAction = (canDeleteDataFrameAnalytics: boolean) => { deleteAnalyticsAndDestIndex( item.config, deleteTargetIndex, - dataViewExists && deleteDataView, - toastNotificationService + dataViewExists && deleteDataView ); } else { - deleteAnalytics(item.config, toastNotificationService); + deleteAnalytics(item.config); } } }; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_edit/edit_action_flyout.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_edit/edit_action_flyout.tsx index 90850dd3a9666..cc66cf0c34dbf 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_edit/edit_action_flyout.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_edit/edit_action_flyout.tsx @@ -37,7 +37,6 @@ import { } from '@kbn/ml-data-frame-analytics-utils'; import { useMlKibana, useMlApiContext } from '../../../../../contexts/kibana'; -import { ml } from '../../../../../services/ml_api_service'; import { useToastNotificationService } from '../../../../../services/toast_notification_service'; import type { MemoryInputValidatorResult } from '../../../../../../../common/util/validators'; import { memoryInputValidator } from '../../../../../../../common/util/validators'; @@ -70,10 +69,10 @@ export const EditActionFlyout: FC> = ({ closeFlyout, item } } = useMlKibana(); const { refresh } = useRefreshAnalyticsList(); - const mlApiServices = useMlApiContext(); + const ml = useMlApiContext(); const { dataFrameAnalytics: { getDataFrameAnalytics }, - } = mlApiServices; + } = ml; const toastNotificationService = useToastNotificationService(); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_start/use_start_action.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_start/use_start_action.tsx index 78bed8273de5d..dbe12f0e2c287 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_start/use_start_action.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_start/use_start_action.tsx @@ -16,8 +16,7 @@ import { isDataFrameAnalyticsFailed, isDataFrameAnalyticsRunning, } from '../analytics_list/common'; -import { startAnalytics } from '../../services/analytics_service'; -import { useToastNotificationService } from '../../../../../services/toast_notification_service'; +import { useStartAnalytics } from '../../services/analytics_service'; import { startActionNameText, StartActionName } from './start_action_name'; @@ -27,13 +26,13 @@ export const useStartAction = (canStartStopDataFrameAnalytics: boolean) => { const [item, setItem] = useState(); - const toastNotificationService = useToastNotificationService(); + const startAnalytics = useStartAnalytics(); const closeModal = () => setModalVisible(false); const startAndCloseModal = () => { if (item !== undefined) { setModalVisible(false); - startAnalytics(item, toastNotificationService); + startAnalytics(item); } }; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_stop/use_stop_action.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_stop/use_stop_action.tsx index e972c85e19f2e..8cc223e8aebe6 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_stop/use_stop_action.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_stop/use_stop_action.tsx @@ -12,14 +12,15 @@ import type { DataFrameAnalyticsListRow, } from '../analytics_list/common'; import { isDataFrameAnalyticsFailed, isDataFrameAnalyticsRunning } from '../analytics_list/common'; -import { stopAnalytics } from '../../services/analytics_service'; +import { useStopAnalytics } from '../../services/analytics_service'; import { stopActionNameText, StopActionName } from './stop_action_name'; export type StopAction = ReturnType; export const useStopAction = (canStartStopDataFrameAnalytics: boolean) => { - const [isModalVisible, setModalVisible] = useState(false); + const stopAnalytics = useStopAnalytics(); + const [isModalVisible, setModalVisible] = useState(false); const [item, setItem] = useState(); const closeModal = () => setModalVisible(false); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx index 9cf3636604450..8f192f3919e16 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx @@ -30,7 +30,7 @@ import { ML_PAGES } from '../../../../../../../common/constants/locator'; import type { DataFrameAnalyticsListRow, ItemIdToExpandedRowMap } from './common'; import { DataFrameAnalyticsListColumn } from './common'; -import { getAnalyticsFactory } from '../../services/analytics_service'; +import { useGetAnalytics } from '../../services/analytics_service'; import { getJobTypeBadge, getTaskStateBadge, useColumns } from './use_columns'; import { ExpandedRow } from './expanded_row'; import type { AnalyticStatsBarStats } from '../../../../../components/stats_bar'; @@ -127,7 +127,7 @@ export const DataFrameAnalyticsList: FC = ({ const disabled = !canCreateDataFrameAnalytics || !canStartStopDataFrameAnalytics; - const getAnalytics = getAnalyticsFactory( + const getAnalytics = useGetAnalytics( setAnalytics, setAnalyticsStats, setErrorMessage, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row_messages_pane.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row_messages_pane.tsx index 9336959a8f0cc..cdfd3f00ff3dc 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row_messages_pane.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row_messages_pane.tsx @@ -10,7 +10,7 @@ import './expanded_row_messages_pane.scss'; import type { FC } from 'react'; import React, { useState, useEffect, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { ml } from '../../../../../services/ml_api_service'; +import { useMlApiContext } from '../../../../../contexts/kibana'; import { useRefreshAnalyticsList } from '../../../../common'; import { JobMessages } from '../../../../../components/job_messages'; import type { JobMessage } from '../../../../../../../common/types/audit_message'; @@ -22,6 +22,7 @@ interface Props { } export const ExpandedRowMessagesPane: FC = ({ analyticsId, dataTestSubj }) => { + const ml = useMlApiContext(); const [messages, setMessages] = useState([]); const [isLoading, setIsLoading] = useState(false); const [errorMessage, setErrorMessage] = useState(''); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/use_create_analytics_form.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/use_create_analytics_form.ts index c6239a139ee7d..f458c11551698 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/use_create_analytics_form.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/use_create_analytics_form.ts @@ -13,9 +13,8 @@ import { extractErrorMessage } from '@kbn/ml-error-utils'; import { extractErrorProperties } from '@kbn/ml-error-utils'; import type { DataFrameAnalyticsConfig } from '@kbn/ml-data-frame-analytics-utils'; -import { useMlKibana } from '../../../../../contexts/kibana'; +import { useMlApiContext, useMlKibana } from '../../../../../contexts/kibana'; import type { DeepReadonly } from '../../../../../../../common/types/common'; -import { ml } from '../../../../../services/ml_api_service'; import { useRefreshAnalyticsList } from '../../../../common'; import { extractCloningConfig, isAdvancedConfig } from '../../components/action_clone'; @@ -50,6 +49,7 @@ export const useCreateAnalyticsForm = (): CreateAnalyticsFormProps => { data: { dataViews }, }, } = useMlKibana(); + const ml = useMlApiContext(); const [state, dispatch] = useReducer(reducer, getInitialState()); const { refresh } = useRefreshAnalyticsList(); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/delete_analytics.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/delete_analytics.ts index b7eeacb1b8c66..281ebeccabac9 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/delete_analytics.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/delete_analytics.ts @@ -8,143 +8,159 @@ import { i18n } from '@kbn/i18n'; import { extractErrorMessage } from '@kbn/ml-error-utils'; -import { ml } from '../../../../../services/ml_api_service'; -import type { ToastNotificationService } from '../../../../../services/toast_notification_service'; +import { useMlApiContext } from '../../../../../contexts/kibana'; +import { useToastNotificationService } from '../../../../../services/toast_notification_service'; import { refreshAnalyticsList$, REFRESH_ANALYTICS_LIST_STATE } from '../../../../common'; import type { DataFrameAnalyticsListRow } from '../../components/analytics_list/common'; -export const deleteAnalytics = async ( - analyticsConfig: DataFrameAnalyticsListRow['config'], - toastNotificationService: ToastNotificationService -) => { - try { - await ml.dataFrameAnalytics.deleteDataFrameAnalytics(analyticsConfig.id); - toastNotificationService.displaySuccessToast( - i18n.translate('xpack.ml.dataframe.analyticsList.deleteAnalyticsSuccessMessage', { - defaultMessage: 'Request to delete data frame analytics job {analyticsId} acknowledged.', - values: { analyticsId: analyticsConfig.id }, - }) - ); - } catch (e) { - toastNotificationService.displayErrorToast( - e, - i18n.translate('xpack.ml.dataframe.analyticsList.deleteAnalyticsErrorMessage', { - defaultMessage: 'An error occurred deleting the data frame analytics job {analyticsId}', - values: { analyticsId: analyticsConfig.id }, - }) - ); - } - refreshAnalyticsList$.next(REFRESH_ANALYTICS_LIST_STATE.REFRESH); -}; +export const useDeleteAnalytics = () => { + const toastNotificationService = useToastNotificationService(); + const ml = useMlApiContext(); -export const deleteAnalyticsAndDestIndex = async ( - analyticsConfig: DataFrameAnalyticsListRow['config'], - deleteDestIndex: boolean, - deleteDestDataView: boolean, - toastNotificationService: ToastNotificationService -) => { - const destinationIndex = analyticsConfig.dest.index; - try { - const status = await ml.dataFrameAnalytics.deleteDataFrameAnalyticsAndDestIndex( - analyticsConfig.id, - deleteDestIndex, - deleteDestDataView - ); - if (status.analyticsJobDeleted?.success) { + return async (analyticsConfig: DataFrameAnalyticsListRow['config']) => { + try { + await ml.dataFrameAnalytics.deleteDataFrameAnalytics(analyticsConfig.id); toastNotificationService.displaySuccessToast( i18n.translate('xpack.ml.dataframe.analyticsList.deleteAnalyticsSuccessMessage', { defaultMessage: 'Request to delete data frame analytics job {analyticsId} acknowledged.', values: { analyticsId: analyticsConfig.id }, }) ); - } - if (status.analyticsJobDeleted?.error) { + } catch (e) { toastNotificationService.displayErrorToast( - status.analyticsJobDeleted.error, + e, i18n.translate('xpack.ml.dataframe.analyticsList.deleteAnalyticsErrorMessage', { defaultMessage: 'An error occurred deleting the data frame analytics job {analyticsId}', values: { analyticsId: analyticsConfig.id }, }) ); } + refreshAnalyticsList$.next(REFRESH_ANALYTICS_LIST_STATE.REFRESH); + }; +}; - if (status.destIndexDeleted?.success) { - toastNotificationService.displaySuccessToast( - i18n.translate('xpack.ml.dataframe.analyticsList.deleteAnalyticsWithIndexSuccessMessage', { - defaultMessage: 'Request to delete destination index {destinationIndex} acknowledged.', - values: { destinationIndex }, - }) +export const useDeleteAnalyticsAndDestIndex = () => { + const toastNotificationService = useToastNotificationService(); + const ml = useMlApiContext(); + + return async ( + analyticsConfig: DataFrameAnalyticsListRow['config'], + deleteDestIndex: boolean, + deleteDestDataView: boolean + ) => { + const destinationIndex = analyticsConfig.dest.index; + try { + const status = await ml.dataFrameAnalytics.deleteDataFrameAnalyticsAndDestIndex( + analyticsConfig.id, + deleteDestIndex, + deleteDestDataView ); - } - if (status.destIndexDeleted?.error) { + if (status.analyticsJobDeleted?.success) { + toastNotificationService.displaySuccessToast( + i18n.translate('xpack.ml.dataframe.analyticsList.deleteAnalyticsSuccessMessage', { + defaultMessage: + 'Request to delete data frame analytics job {analyticsId} acknowledged.', + values: { analyticsId: analyticsConfig.id }, + }) + ); + } + if (status.analyticsJobDeleted?.error) { + toastNotificationService.displayErrorToast( + status.analyticsJobDeleted.error, + i18n.translate('xpack.ml.dataframe.analyticsList.deleteAnalyticsErrorMessage', { + defaultMessage: 'An error occurred deleting the data frame analytics job {analyticsId}', + values: { analyticsId: analyticsConfig.id }, + }) + ); + } + + if (status.destIndexDeleted?.success) { + toastNotificationService.displaySuccessToast( + i18n.translate( + 'xpack.ml.dataframe.analyticsList.deleteAnalyticsWithIndexSuccessMessage', + { + defaultMessage: + 'Request to delete destination index {destinationIndex} acknowledged.', + values: { destinationIndex }, + } + ) + ); + } + if (status.destIndexDeleted?.error) { + toastNotificationService.displayErrorToast( + status.destIndexDeleted.error, + i18n.translate('xpack.ml.dataframe.analyticsList.deleteAnalyticsWithIndexErrorMessage', { + defaultMessage: 'An error occurred deleting destination index {destinationIndex}', + values: { destinationIndex }, + }) + ); + } + + if (status.destDataViewDeleted?.success) { + toastNotificationService.displaySuccessToast( + i18n.translate( + 'xpack.ml.dataframe.analyticsList.deleteAnalyticsWithDataViewSuccessMessage', + { + defaultMessage: 'Request to delete data view {destinationIndex} acknowledged.', + values: { destinationIndex }, + } + ) + ); + } + if (status.destDataViewDeleted?.error) { + const error = extractErrorMessage(status.destDataViewDeleted.error); + toastNotificationService.displayDangerToast( + i18n.translate( + 'xpack.ml.dataframe.analyticsList.deleteAnalyticsWithDataViewErrorMessage', + { + defaultMessage: 'An error occurred deleting data view {destinationIndex}: {error}', + values: { destinationIndex, error }, + } + ) + ); + } + } catch (e) { toastNotificationService.displayErrorToast( - status.destIndexDeleted.error, - i18n.translate('xpack.ml.dataframe.analyticsList.deleteAnalyticsWithIndexErrorMessage', { - defaultMessage: 'An error occurred deleting destination index {destinationIndex}', - values: { destinationIndex }, + e, + i18n.translate('xpack.ml.dataframe.analyticsList.deleteAnalyticsErrorMessage', { + defaultMessage: 'An error occurred deleting the data frame analytics job {analyticsId}', + values: { analyticsId: analyticsConfig.id }, }) ); } + refreshAnalyticsList$.next(REFRESH_ANALYTICS_LIST_STATE.REFRESH); + }; +}; - if (status.destDataViewDeleted?.success) { - toastNotificationService.displaySuccessToast( - i18n.translate( - 'xpack.ml.dataframe.analyticsList.deleteAnalyticsWithDataViewSuccessMessage', +export const useCanDeleteIndex = () => { + const toastNotificationService = useToastNotificationService(); + const ml = useMlApiContext(); + + return async (indexName: string) => { + try { + const privilege = await ml.hasPrivileges({ + index: [ { - defaultMessage: 'Request to delete data view {destinationIndex} acknowledged.', - values: { destinationIndex }, - } - ) + names: [indexName], // uses wildcard + privileges: ['delete_index'], + }, + ], + }); + if (!privilege) { + return false; + } + + return ( + privilege.hasPrivileges === undefined || privilege.hasPrivileges.has_all_requested === true ); - } - if (status.destDataViewDeleted?.error) { - const error = extractErrorMessage(status.destDataViewDeleted.error); + } catch (e) { + const error = extractErrorMessage(e); toastNotificationService.displayDangerToast( - i18n.translate('xpack.ml.dataframe.analyticsList.deleteAnalyticsWithDataViewErrorMessage', { - defaultMessage: 'An error occurred deleting data view {destinationIndex}: {error}', - values: { destinationIndex, error }, + i18n.translate('xpack.ml.dataframe.analyticsList.deleteAnalyticsPrivilegeErrorMessage', { + defaultMessage: 'User does not have permission to delete index {indexName}: {error}', + values: { indexName, error }, }) ); } - } catch (e) { - toastNotificationService.displayErrorToast( - e, - i18n.translate('xpack.ml.dataframe.analyticsList.deleteAnalyticsErrorMessage', { - defaultMessage: 'An error occurred deleting the data frame analytics job {analyticsId}', - values: { analyticsId: analyticsConfig.id }, - }) - ); - } - refreshAnalyticsList$.next(REFRESH_ANALYTICS_LIST_STATE.REFRESH); -}; - -export const canDeleteIndex = async ( - indexName: string, - toastNotificationService: ToastNotificationService -) => { - try { - const privilege = await ml.hasPrivileges({ - index: [ - { - names: [indexName], // uses wildcard - privileges: ['delete_index'], - }, - ], - }); - if (!privilege) { - return false; - } - - return ( - privilege.hasPrivileges === undefined || privilege.hasPrivileges.has_all_requested === true - ); - } catch (e) { - const error = extractErrorMessage(e); - toastNotificationService.displayDangerToast( - i18n.translate('xpack.ml.dataframe.analyticsList.deleteAnalyticsPrivilegeErrorMessage', { - defaultMessage: 'User does not have permission to delete index {indexName}: {error}', - values: { indexName, error }, - }) - ); - } + }; }; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/get_analytics.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/get_analytics.ts index 6f40a026e1355..9a7cccc77aa3f 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/get_analytics.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/get_analytics.ts @@ -11,7 +11,7 @@ import { type DataFrameAnalysisConfigType, DATA_FRAME_TASK_STATE, } from '@kbn/ml-data-frame-analytics-utils'; -import { ml } from '../../../../../services/ml_api_service'; +import { useMlApiContext } from '../../../../../contexts/kibana'; import type { GetDataFrameAnalyticsStatsResponseError, GetDataFrameAnalyticsStatsResponseOk, @@ -106,7 +106,7 @@ export function getAnalyticsJobsStats( return resultStats; } -export const getAnalyticsFactory = ( +export const useGetAnalytics = ( setAnalytics: React.Dispatch>, setAnalyticsStats: (update: AnalyticStatsBarStats | undefined) => void, setErrorMessage: React.Dispatch< @@ -116,6 +116,8 @@ export const getAnalyticsFactory = ( setJobsAwaitingNodeCount: React.Dispatch>, blockRefresh: boolean ): GetAnalytics => { + const ml = useMlApiContext(); + let concurrentLoads = 0; const getAnalytics = async (forceRefresh = false) => { diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/index.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/index.ts index 028378c294840..47b0ab3d576c4 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/index.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/index.ts @@ -5,7 +5,11 @@ * 2.0. */ -export { getAnalyticsFactory } from './get_analytics'; -export { deleteAnalytics, deleteAnalyticsAndDestIndex, canDeleteIndex } from './delete_analytics'; -export { startAnalytics } from './start_analytics'; -export { stopAnalytics } from './stop_analytics'; +export { useGetAnalytics } from './get_analytics'; +export { + useDeleteAnalytics, + useDeleteAnalyticsAndDestIndex, + useCanDeleteIndex, +} from './delete_analytics'; +export { useStartAnalytics } from './start_analytics'; +export { useStopAnalytics } from './stop_analytics'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/start_analytics.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/start_analytics.ts index 3d7f46a00c0a2..a5b0dfd32ffa5 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/start_analytics.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/start_analytics.ts @@ -6,32 +6,35 @@ */ import { i18n } from '@kbn/i18n'; -import { ml } from '../../../../../services/ml_api_service'; -import type { ToastNotificationService } from '../../../../../services/toast_notification_service'; + +import { useMlApiContext } from '../../../../../contexts/kibana'; +import { useToastNotificationService } from '../../../../../services/toast_notification_service'; import { refreshAnalyticsList$, REFRESH_ANALYTICS_LIST_STATE } from '../../../../common'; import type { DataFrameAnalyticsListRow } from '../../components/analytics_list/common'; -export const startAnalytics = async ( - d: DataFrameAnalyticsListRow, - toastNotificationService: ToastNotificationService -) => { - try { - await ml.dataFrameAnalytics.startDataFrameAnalytics(d.config.id); - toastNotificationService.displaySuccessToast( - i18n.translate('xpack.ml.dataframe.analyticsList.startAnalyticsSuccessMessage', { - defaultMessage: 'Request to start data frame analytics {analyticsId} acknowledged.', - values: { analyticsId: d.config.id }, - }) - ); - } catch (e) { - toastNotificationService.displayErrorToast( - e, - i18n.translate('xpack.ml.dataframe.analyticsList.startAnalyticsErrorTitle', { - defaultMessage: 'Error starting job', - }) - ); - } - refreshAnalyticsList$.next(REFRESH_ANALYTICS_LIST_STATE.REFRESH); +export const useStartAnalytics = () => { + const toastNotificationService = useToastNotificationService(); + const ml = useMlApiContext(); + + return async (d: DataFrameAnalyticsListRow) => { + try { + await ml.dataFrameAnalytics.startDataFrameAnalytics(d.config.id); + toastNotificationService.displaySuccessToast( + i18n.translate('xpack.ml.dataframe.analyticsList.startAnalyticsSuccessMessage', { + defaultMessage: 'Request to start data frame analytics {analyticsId} acknowledged.', + values: { analyticsId: d.config.id }, + }) + ); + } catch (e) { + toastNotificationService.displayErrorToast( + e, + i18n.translate('xpack.ml.dataframe.analyticsList.startAnalyticsErrorTitle', { + defaultMessage: 'Error starting job', + }) + ); + } + refreshAnalyticsList$.next(REFRESH_ANALYTICS_LIST_STATE.REFRESH); + }; }; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/stop_analytics.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/stop_analytics.ts index 4058f0dfb7568..af0b746a17332 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/stop_analytics.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/services/analytics_service/stop_analytics.ts @@ -6,35 +6,41 @@ */ import { i18n } from '@kbn/i18n'; -import { getToastNotifications } from '../../../../../util/dependency_cache'; -import { ml } from '../../../../../services/ml_api_service'; + +import { useMlApiContext } from '../../../../../contexts/kibana'; +import { useToastNotificationService } from '../../../../../services/toast_notification_service'; import { refreshAnalyticsList$, REFRESH_ANALYTICS_LIST_STATE } from '../../../../common'; import type { DataFrameAnalyticsListRow } from '../../components/analytics_list/common'; import { isDataFrameAnalyticsFailed } from '../../components/analytics_list/common'; -export const stopAnalytics = async (d: DataFrameAnalyticsListRow) => { - const toastNotifications = getToastNotifications(); - try { - await ml.dataFrameAnalytics.stopDataFrameAnalytics( - d.config.id, - isDataFrameAnalyticsFailed(d.stats.state) - ); - toastNotifications.addSuccess( - i18n.translate('xpack.ml.dataframe.analyticsList.stopAnalyticsSuccessMessage', { - defaultMessage: 'Request to stop data frame analytics {analyticsId} acknowledged.', - values: { analyticsId: d.config.id }, - }) - ); - } catch (e) { - toastNotifications.addDanger( - i18n.translate('xpack.ml.dataframe.analyticsList.stopAnalyticsErrorMessage', { - defaultMessage: - 'An error occurred stopping the data frame analytics {analyticsId}: {error}', - values: { analyticsId: d.config.id, error: JSON.stringify(e) }, - }) - ); - } - refreshAnalyticsList$.next(REFRESH_ANALYTICS_LIST_STATE.REFRESH); +export const useStopAnalytics = () => { + const toastNotificationService = useToastNotificationService(); + const ml = useMlApiContext(); + + return async (d: DataFrameAnalyticsListRow) => { + try { + await ml.dataFrameAnalytics.stopDataFrameAnalytics( + d.config.id, + isDataFrameAnalyticsFailed(d.stats.state) + ); + toastNotificationService.displaySuccessToast( + i18n.translate('xpack.ml.dataframe.analyticsList.stopAnalyticsSuccessMessage', { + defaultMessage: 'Request to stop data frame analytics {analyticsId} acknowledged.', + values: { analyticsId: d.config.id }, + }) + ); + } catch (e) { + toastNotificationService.displayErrorToast( + e, + i18n.translate('xpack.ml.dataframe.analyticsList.stopAnalyticsErrorMessage', { + defaultMessage: + 'An error occurred stopping the data frame analytics {analyticsId}: {error}', + values: { analyticsId: d.config.id, error: JSON.stringify(e) }, + }) + ); + } + refreshAnalyticsList$.next(REFRESH_ANALYTICS_LIST_STATE.REFRESH); + }; }; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/use_fetch_analytics_map_data.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/use_fetch_analytics_map_data.ts index 701900bd32285..d56cd4b7c638d 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/use_fetch_analytics_map_data.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/use_fetch_analytics_map_data.ts @@ -14,8 +14,7 @@ import { JOB_MAP_NODE_TYPES, type AnalyticsMapReturnType, } from '@kbn/ml-data-frame-analytics-utils'; -import { ml } from '../../../services/ml_api_service'; - +import { useMlApiContext } from '../../../contexts/kibana'; interface GetDataObjectParameter { analyticsId?: string; id?: string; @@ -24,6 +23,7 @@ interface GetDataObjectParameter { } export const useFetchAnalyticsMapData = () => { + const ml = useMlApiContext(); const [isLoading, setIsLoading] = useState(false); const [elements, setElements] = useState([]); const [error, setError] = useState(); diff --git a/x-pack/plugins/ml/public/application/datavisualizer/file_based/file_datavisualizer.tsx b/x-pack/plugins/ml/public/application/datavisualizer/file_based/file_datavisualizer.tsx index 168ae4a44656d..bc4d204fda223 100644 --- a/x-pack/plugins/ml/public/application/datavisualizer/file_based/file_datavisualizer.tsx +++ b/x-pack/plugins/ml/public/application/datavisualizer/file_based/file_datavisualizer.tsx @@ -17,7 +17,7 @@ import type { import { useTimefilter } from '@kbn/ml-date-picker'; import type { ResultLinks } from '@kbn/data-visualizer-plugin/common/app'; import { HelpMenu } from '../../components/help_menu'; -import { useMlKibana, useMlLocator } from '../../contexts/kibana'; +import { useMlApiContext, useMlKibana, useMlLocator } from '../../contexts/kibana'; import { ML_PAGES } from '../../../../common/constants/locator'; import { isFullLicense } from '../../license'; @@ -36,8 +36,9 @@ export const FileDataVisualizerPage: FC = () => { }, }, } = useMlKibana(); + const mlApiServices = useMlApiContext(); const mlLocator = useMlLocator()!; - getMlNodeCount(); + getMlNodeCount(mlApiServices); const [FileDataVisualizer, setFileDataVisualizer] = useState(null); const [resultLinks, setResultLinks] = useState(null); @@ -104,7 +105,7 @@ export const FileDataVisualizerPage: FC = () => { useEffect(() => { // ML uses this function if (dataVisualizer !== undefined) { - getMlNodeCount(); + getMlNodeCount(mlApiServices); const { getFileDataVisualizerComponent } = dataVisualizer; getFileDataVisualizerComponent().then((resp) => { const items = resp(); diff --git a/x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts b/x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts index da50b4538fa89..3ca5acb5a41bc 100644 --- a/x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts +++ b/x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts @@ -5,8 +5,6 @@ * 2.0. */ -import type { CoreSetup } from '@kbn/core/public'; - import type { DataView } from '@kbn/data-views-plugin/public'; import { DEFAULT_SAMPLER_SHARD_SIZE } from '@kbn/ml-agg-utils'; import { OMIT_FIELDS } from '@kbn/ml-anomaly-utils'; @@ -14,23 +12,21 @@ import { type RuntimeMappings } from '@kbn/ml-runtime-field-utils'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { IndexPatternTitle } from '../../../../../common/types/kibana'; +import type { MlApiServices } from '../../../services/ml_api_service'; -import { ml } from '../../../services/ml_api_service'; import type { FieldHistogramRequestConfig } from '../common/request'; // Maximum number of examples to obtain for text type fields. const MAX_EXAMPLES_DEFAULT: number = 10; export class DataLoader { - private _indexPattern: DataView; private _runtimeMappings: RuntimeMappings; private _indexPatternTitle: IndexPatternTitle = ''; private _maxExamples: number = MAX_EXAMPLES_DEFAULT; - constructor(indexPattern: DataView, toastNotifications?: CoreSetup['notifications']['toasts']) { - this._indexPattern = indexPattern; + constructor(private _indexPattern: DataView, private _mlApiServices: MlApiServices) { this._runtimeMappings = this._indexPattern.getComputedFields().runtimeFields as RuntimeMappings; - this._indexPatternTitle = indexPattern.title; + this._indexPatternTitle = _indexPattern.title; } async loadFieldHistograms( @@ -39,7 +35,7 @@ export class DataLoader { samplerShardSize = DEFAULT_SAMPLER_SHARD_SIZE, editorRuntimeMappings?: RuntimeMappings ): Promise { - const stats = await ml.getVisualizerFieldHistograms({ + const stats = await this._mlApiServices.getVisualizerFieldHistograms({ indexPattern: this._indexPatternTitle, query, fields, diff --git a/x-pack/plugins/ml/public/application/datavisualizer/index_based/index_data_visualizer.tsx b/x-pack/plugins/ml/public/application/datavisualizer/index_based/index_data_visualizer.tsx index 157aa89522d75..ac980bf21c32c 100644 --- a/x-pack/plugins/ml/public/application/datavisualizer/index_based/index_data_visualizer.tsx +++ b/x-pack/plugins/ml/public/application/datavisualizer/index_based/index_data_visualizer.tsx @@ -18,7 +18,7 @@ import type { import { useTimefilter } from '@kbn/ml-date-picker'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import useMountedState from 'react-use/lib/useMountedState'; -import { useMlKibana, useMlLocator } from '../../contexts/kibana'; +import { useMlApiContext, useMlKibana, useMlLocator } from '../../contexts/kibana'; import { HelpMenu } from '../../components/help_menu'; import { ML_PAGES } from '../../../../common/constants/locator'; import { isFullLicense } from '../../license'; @@ -40,10 +40,11 @@ export const IndexDataVisualizerPage: FC<{ esql: boolean }> = ({ esql = false }) }, }, } = useMlKibana(); + const mlApiServices = useMlApiContext(); const { showNodeInfo } = useEnabledFeatures(); const mlLocator = useMlLocator()!; const mlFeaturesDisabled = !isFullLicense(); - getMlNodeCount(); + getMlNodeCount(mlApiServices); const [IndexDataVisualizer, setIndexDataVisualizer] = useState( null diff --git a/x-pack/plugins/ml/public/application/explorer/actions/job_selection.ts b/x-pack/plugins/ml/public/application/explorer/actions/job_selection.ts index 60149ef7d4017..2523db6fa8165 100644 --- a/x-pack/plugins/ml/public/application/explorer/actions/job_selection.ts +++ b/x-pack/plugins/ml/public/application/explorer/actions/job_selection.ts @@ -9,12 +9,13 @@ import { from } from 'rxjs'; import { map } from 'rxjs'; import type { MlFieldFormatService } from '../../services/field_format_service'; -import { mlJobService } from '../../services/job_service'; +import type { MlJobService } from '../../services/job_service'; import { EXPLORER_ACTION } from '../explorer_constants'; import { createJobs } from '../explorer_utils'; export function jobSelectionActionCreator( + mlJobService: MlJobService, mlFieldFormatService: MlFieldFormatService, selectedJobIds: string[] ) { diff --git a/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts b/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts index faa2b009c131d..80f32a3df82fc 100644 --- a/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts +++ b/x-pack/plugins/ml/public/application/explorer/actions/load_explorer_data.ts @@ -18,6 +18,7 @@ import type { TimefilterContract } from '@kbn/data-plugin/public'; import { useTimefilter } from '@kbn/ml-date-picker'; import type { InfluencersFilterQuery } from '@kbn/ml-anomaly-utils'; import type { TimeBucketsInterval, TimeRangeBounds } from '@kbn/ml-time-buckets'; +import type { IUiSettingsClient } from '@kbn/core/public'; import type { AppStateSelectedCells, ExplorerJob } from '../explorer_utils'; import { getDateFormatTz, @@ -31,11 +32,13 @@ import { loadOverallAnnotations, } from '../explorer_utils'; import type { ExplorerState } from '../reducers'; -import { useMlKibana } from '../../contexts/kibana'; +import { useMlApiContext, useUiSettings } from '../../contexts/kibana'; import type { MlResultsService } from '../../services/results_service'; import { mlResultsServiceProvider } from '../../services/results_service'; import type { AnomalyExplorerChartsService } from '../../services/anomaly_explorer_charts_service'; import { useAnomalyExplorerContext } from '../anomaly_explorer_context'; +import type { MlApiServices } from '../../services/ml_api_service'; +import { useMlJobService, type MlJobService } from '../../services/job_service'; // Memoize the data fetching methods. // wrapWithLastRefreshArg() wraps any given function and preprends a `lastRefresh` argument @@ -93,6 +96,9 @@ export const isLoadExplorerDataConfig = (arg: any): arg is LoadExplorerDataConfi * Fetches the data necessary for the Anomaly Explorer using observables. */ const loadExplorerDataProvider = ( + uiSettings: IUiSettingsClient, + mlApiServices: MlApiServices, + mlJobService: MlJobService, mlResultsService: MlResultsService, anomalyExplorerChartsService: AnomalyExplorerChartsService, timefilter: TimefilterContract @@ -120,14 +126,20 @@ const loadExplorerDataProvider = ( const timerange = getSelectionTimeRange(selectedCells, bounds); - const dateFormatTz = getDateFormatTz(); + const dateFormatTz = getDateFormatTz(uiSettings); // First get the data where we have all necessary args at hand using forkJoin: // annotationsData, anomalyChartRecords, influencers, overallState, tableData return forkJoin({ - overallAnnotations: memoizedLoadOverallAnnotations(lastRefresh, selectedJobs, bounds), + overallAnnotations: memoizedLoadOverallAnnotations( + lastRefresh, + mlApiServices, + selectedJobs, + bounds + ), annotationsData: memoizedLoadAnnotationsTableData( lastRefresh, + mlApiServices, selectedCells, selectedJobs, bounds @@ -155,6 +167,8 @@ const loadExplorerDataProvider = ( : Promise.resolve({}), tableData: memoizedLoadAnomaliesTableData( lastRefresh, + mlApiServices, + mlJobService, selectedCells, selectedJobs, dateFormatTz, @@ -202,20 +216,23 @@ const loadExplorerDataProvider = ( }; export const useExplorerData = (): [Partial | undefined, (d: any) => void] => { + const uiSettings = useUiSettings(); const timefilter = useTimefilter(); - - const { - services: { - mlServices: { mlApiServices }, - }, - } = useMlKibana(); - + const mlApiServices = useMlApiContext(); + const mlJobService = useMlJobService(); const { anomalyExplorerChartsService } = useAnomalyExplorerContext(); const loadExplorerData = useMemo(() => { const mlResultsService = mlResultsServiceProvider(mlApiServices); - return loadExplorerDataProvider(mlResultsService, anomalyExplorerChartsService, timefilter); + return loadExplorerDataProvider( + uiSettings, + mlApiServices, + mlJobService, + mlResultsService, + anomalyExplorerChartsService, + timefilter + ); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); diff --git a/x-pack/plugins/ml/public/application/explorer/anomaly_explorer_context.tsx b/x-pack/plugins/ml/public/application/explorer/anomaly_explorer_context.tsx index dec8d5df57ceb..35b552a95cac8 100644 --- a/x-pack/plugins/ml/public/application/explorer/anomaly_explorer_context.tsx +++ b/x-pack/plugins/ml/public/application/explorer/anomaly_explorer_context.tsx @@ -19,6 +19,7 @@ import { AnomalyExplorerChartsService } from '../services/anomaly_explorer_chart import { useTableSeverity } from '../components/controls/select_severity'; import { AnomalyDetectionAlertsStateService } from './alerts'; import { explorerServiceFactory, type ExplorerService } from './explorer_dashboard_service'; +import { useMlJobService } from '../services/job_service'; export interface AnomalyExplorerContextValue { anomalyExplorerChartsService: AnomalyExplorerChartsService; @@ -65,6 +66,7 @@ export const AnomalyExplorerContextProvider: FC> = ({ data, }, } = useMlKibana(); + const mlJobService = useMlJobService(); const [, , tableSeverityState] = useTableSeverity(); @@ -80,7 +82,7 @@ export const AnomalyExplorerContextProvider: FC> = ({ // updates so using `useEffect` is the right thing to do here to not get errors // related to React lifecycle methods. useEffect(() => { - const explorerService = explorerServiceFactory(mlFieldFormatService); + const explorerService = explorerServiceFactory(mlJobService, mlFieldFormatService); const anomalyTimelineService = new AnomalyTimelineService( timefilter, @@ -93,6 +95,7 @@ export const AnomalyExplorerContextProvider: FC> = ({ ); const anomalyTimelineStateService = new AnomalyTimelineStateService( + mlJobService, anomalyExplorerUrlStateService, anomalyExplorerCommonStateService, anomalyTimelineService, diff --git a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline_state_service.ts b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline_state_service.ts index 799e4d4ab9b05..371284d0ac047 100644 --- a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline_state_service.ts +++ b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline_state_service.ts @@ -38,8 +38,7 @@ import { SWIMLANE_TYPE, VIEW_BY_JOB_LABEL, } from './explorer_constants'; -// FIXME get rid of the static import -import { mlJobService } from '../services/job_service'; +import type { MlJobService } from '../services/job_service'; import { getSelectionInfluencers, getSelectionTimeRange } from './explorer_utils'; import type { Refresh } from '../routing/use_refresh'; import { StateService } from '../services/state_service'; @@ -107,6 +106,7 @@ export class AnomalyTimelineStateService extends StateService { ); constructor( + private mlJobService: MlJobService, private anomalyExplorerUrlStateService: AnomalyExplorerUrlStateService, private anomalyExplorerCommonStateService: AnomalyExplorerCommonStateService, private anomalyTimelineService: AnomalyTimelineService, @@ -482,6 +482,7 @@ export class AnomalyTimelineStateService extends StateService { selectedCells: AppStateSelectedCells | undefined | null, selectedJobs: ExplorerJob[] | undefined ) { + const mlJobService = this.mlJobService; const selectedJobIds = selectedJobs?.map((d) => d.id) ?? []; // Unique influencers for the selected job(s). diff --git a/x-pack/plugins/ml/public/application/explorer/explorer.tsx b/x-pack/plugins/ml/public/application/explorer/explorer.tsx index 65b862bc548e6..2b6971077a086 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer.tsx +++ b/x-pack/plugins/ml/public/application/explorer/explorer.tsx @@ -380,6 +380,7 @@ export const Explorer: FC = ({ services: { charts: chartsService, data: { dataViews: dataViewsService }, + uiSettings, }, } = useMlKibana(); const { euiTheme } = useEuiTheme(); @@ -442,7 +443,7 @@ export const Explorer: FC = ({ ); const jobSelectorProps = { - dateFormatTz: getDateFormatTz(), + dateFormatTz: getDateFormatTz(uiSettings), } as JobSelectorProps; const noJobsSelected = !selectedJobs || selectedJobs.length === 0; diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/__snapshots__/explorer_chart_config_builder.test.js.snap b/x-pack/plugins/ml/public/application/explorer/explorer_charts/__snapshots__/explorer_chart_config_builder.test.js.snap deleted file mode 100644 index e2e1140f5c5b4..0000000000000 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/__snapshots__/explorer_chart_config_builder.test.js.snap +++ /dev/null @@ -1,53 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`buildConfig get dataConfig for anomaly record 1`] = ` -Object { - "bucketSpanSeconds": 900, - "datafeedConfig": Object { - "chunking_config": Object { - "mode": "auto", - }, - "datafeed_id": "datafeed-mock-job-id", - "indices": Array [ - "farequote-2017", - ], - "job_id": "mock-job-id", - "query": Object { - "match_all": Object { - "boost": 1, - }, - }, - "query_delay": "86658ms", - "scroll_size": 1000, - "state": "stopped", - }, - "detectorIndex": 0, - "detectorLabel": "mean(responsetime)", - "entityFields": Array [ - Object { - "fieldName": "airline", - "fieldType": "partition", - "fieldValue": "JAL", - }, - ], - "fieldName": "responsetime", - "functionDescription": "mean", - "infoTooltip": Object { - "aggregationInterval": "15m", - "chartFunction": "avg responsetime", - "entityFields": Array [ - Object { - "fieldName": "airline", - "fieldValue": "JAL", - }, - ], - "jobId": "mock-job-id", - }, - "interval": "15m", - "jobId": "mock-job-id", - "metricFieldName": "responsetime", - "metricFunction": "avg", - "summaryCountFieldName": undefined, - "timeField": "@timestamp", -} -`; diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_config_builder.js b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_config_builder.js deleted file mode 100644 index 5fdfd95040937..0000000000000 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_config_builder.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -/* - * Builds the configuration object used to plot a chart showing where the anomalies occur in - * the raw data in the Explorer dashboard. - */ - -import { parseInterval } from '../../../../common/util/parse_interval'; -import { getEntityFieldList, ML_JOB_AGGREGATION } from '@kbn/ml-anomaly-utils'; -import { buildConfigFromDetector } from '../../util/chart_config_builder'; -import { mlJobService } from '../../services/job_service'; -import { mlFunctionToESAggregation } from '../../../../common/util/job_utils'; - -// Builds the chart configuration for the provided anomaly record, returning -// an object with properties used for the display (series function and field, aggregation interval etc), -// and properties for the datafeed used for the job (indices, time field etc). -export function buildConfig(record) { - const job = mlJobService.getJob(record.job_id); - const detectorIndex = record.detector_index; - const config = buildConfigFromDetector(job, detectorIndex); - - // Add extra properties used by the explorer dashboard charts. - config.functionDescription = record.function_description; - config.bucketSpanSeconds = parseInterval(job.analysis_config.bucket_span).asSeconds(); - - config.detectorLabel = record.function; - if ( - mlJobService.detectorsByJob[record.job_id] !== undefined && - detectorIndex < mlJobService.detectorsByJob[record.job_id].length - ) { - config.detectorLabel = - mlJobService.detectorsByJob[record.job_id][detectorIndex].detector_description; - } else { - if (record.field_name !== undefined) { - config.detectorLabel += ` ${config.fieldName}`; - } - } - - if (record.field_name !== undefined) { - config.fieldName = record.field_name; - config.metricFieldName = record.field_name; - } - - // Add the 'entity_fields' i.e. the partition, by, over fields which - // define the metric series to be plotted. - config.entityFields = getEntityFieldList(record); - - if (record.function === ML_JOB_AGGREGATION.METRIC) { - config.metricFunction = mlFunctionToESAggregation(record.function_description); - } - - // Build the tooltip data for the chart info icon, showing further details on what is being plotted. - let functionLabel = config.metricFunction; - if (config.metricFieldName !== undefined) { - functionLabel += ` ${config.metricFieldName}`; - } - - config.infoTooltip = { - jobId: record.job_id, - aggregationInterval: config.interval, - chartFunction: functionLabel, - entityFields: config.entityFields.map((f) => ({ - fieldName: f.fieldName, - fieldValue: f.fieldValue, - })), - }; - - return config; -} diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_config_builder.test.js b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_config_builder.test.js deleted file mode 100644 index 9fe35f137d66f..0000000000000 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_chart_config_builder.test.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import mockAnomalyRecord from './__mocks__/mock_anomaly_record.json'; -import mockDetectorsByJob from './__mocks__/mock_detectors_by_job.json'; -import mockJobConfig from './__mocks__/mock_job_config.json'; - -jest.mock('../../services/job_service', () => ({ - mlJobService: { - getJob() { - return mockJobConfig; - }, - detectorsByJob: mockDetectorsByJob, - }, -})); - -import { buildConfig } from './explorer_chart_config_builder'; - -describe('buildConfig', () => { - test('get dataConfig for anomaly record', () => { - const dataConfig = buildConfig(mockAnomalyRecord); - expect(dataConfig).toMatchSnapshot(); - }); -}); diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.js b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.js index 702aeed891ebc..c2ce5450bd7ba 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.js +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.js @@ -95,7 +95,6 @@ function ExplorerChartContainer({ timefilter, timeRange, onSelectEntity, - recentlyAccessed, tooManyBucketsCalloutMsg, showSelectedInterval, chartsService, @@ -105,6 +104,7 @@ function ExplorerChartContainer({ const { services: { + chrome: { recentlyAccessed }, share, application: { navigateToApp }, }, @@ -389,11 +389,7 @@ export const ExplorerChartsContainerUI = ({ chartsService, }) => { const { - services: { - chrome: { recentlyAccessed }, - embeddable: embeddablePlugin, - maps: mapsPlugin, - }, + services: { embeddable: embeddablePlugin, maps: mapsPlugin }, } = kibana; let seriesToPlotFiltered; @@ -452,7 +448,6 @@ export const ExplorerChartsContainerUI = ({ timefilter={timefilter} timeRange={timeRange} onSelectEntity={onSelectEntity} - recentlyAccessed={recentlyAccessed} tooManyBucketsCalloutMsg={tooManyBucketsCalloutMsg} showSelectedInterval={showSelectedInterval} chartsService={chartsService} diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.test.js b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.test.js index 38f8eca99ae68..dbbb00ac85fb7 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.test.js +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.test.js @@ -21,16 +21,11 @@ import { kibanaContextMock } from '../../contexts/kibana/__mocks__/kibana_contex import { timeBucketsMock } from '../../util/__mocks__/time_buckets'; import { timefilterMock } from '../../contexts/kibana/__mocks__/use_timefilter'; -jest.mock('../../services/job_service', () => ({ - mlJobService: { - getJob: jest.fn(), - }, -})); - jest.mock('../../contexts/kibana', () => ({ useMlKibana: () => { return { services: { + chrome: { recentlyAccessed: { add: jest.fn() } }, share: { url: { locators: { diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_dashboard_service.ts b/x-pack/plugins/ml/public/application/explorer/explorer_dashboard_service.ts index 1bcef70b54c25..1cf723f5145d6 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_dashboard_service.ts +++ b/x-pack/plugins/ml/public/application/explorer/explorer_dashboard_service.ts @@ -20,6 +20,7 @@ import { EXPLORER_ACTION } from './explorer_constants'; import type { ExplorerState } from './reducers'; import { explorerReducer, getExplorerDefaultState } from './reducers'; import type { MlFieldFormatService } from '../services/field_format_service'; +import type { MlJobService } from '../services/job_service'; type ExplorerAction = Action | Observable; export const explorerAction$ = new Subject(); @@ -52,7 +53,10 @@ const setExplorerDataActionCreator = (payload: DeepPartial) => ({ }); // Export observable state and action dispatchers as service -export const explorerServiceFactory = (mlFieldFormatService: MlFieldFormatService) => ({ +export const explorerServiceFactory = ( + mlJobService: MlJobService, + mlFieldFormatService: MlFieldFormatService +) => ({ state$: explorerState$, clearExplorerData: () => { explorerAction$.next({ type: EXPLORER_ACTION.CLEAR_EXPLORER_DATA }); @@ -64,7 +68,9 @@ export const explorerServiceFactory = (mlFieldFormatService: MlFieldFormatServic explorerAction$.next({ type: EXPLORER_ACTION.CLEAR_JOBS }); }, updateJobSelection: (selectedJobIds: string[]) => { - explorerAction$.next(jobSelectionActionCreator(mlFieldFormatService, selectedJobIds)); + explorerAction$.next( + jobSelectionActionCreator(mlJobService, mlFieldFormatService, selectedJobIds) + ); }, setExplorerData: (payload: DeepPartial) => { explorerAction$.next(setExplorerDataActionCreator(payload)); diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_utils.ts b/x-pack/plugins/ml/public/application/explorer/explorer_utils.ts index 4f8ee3556c872..fbfad277ff45f 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_utils.ts +++ b/x-pack/plugins/ml/public/application/explorer/explorer_utils.ts @@ -24,9 +24,10 @@ import { type MlRecordForInfluencer, ML_JOB_AGGREGATION, } from '@kbn/ml-anomaly-utils'; - import type { InfluencersFilterQuery } from '@kbn/ml-anomaly-utils'; import type { TimeRangeBounds } from '@kbn/ml-time-buckets'; +import type { IUiSettingsClient } from '@kbn/core/public'; + import { ANNOTATIONS_TABLE_DEFAULT_QUERY_SIZE, ANOMALIES_TABLE_DEFAULT_QUERY_SIZE, @@ -39,9 +40,7 @@ import { isTimeSeriesViewJob, } from '../../../common/util/job_utils'; import { parseInterval } from '../../../common/util/parse_interval'; -import { ml } from '../services/ml_api_service'; -import { mlJobService } from '../services/job_service'; -import { getUiSettings } from '../util/dependency_cache'; +import type { MlJobService } from '../services/job_service'; import type { SwimlaneType } from './explorer_constants'; import { @@ -53,6 +52,7 @@ import { import type { CombinedJob } from '../../../common/types/anomaly_detection_jobs'; import type { MlResultsService } from '../services/results_service'; import type { Annotations, AnnotationsTable } from '../../../common/types/annotations'; +import type { MlApiServices } from '../services/ml_api_service'; export interface ExplorerJob { id: string; @@ -239,7 +239,7 @@ export async function loadFilteredTopInfluencers( )) as any[]; } -export function getInfluencers(selectedJobs: any[]): string[] { +export function getInfluencers(mlJobService: MlJobService, selectedJobs: any[]): string[] { const influencers: string[] = []; selectedJobs.forEach((selectedJob) => { const job = mlJobService.getJob(selectedJob.id); @@ -250,15 +250,14 @@ export function getInfluencers(selectedJobs: any[]): string[] { return influencers; } -export function getDateFormatTz(): string { - const uiSettings = getUiSettings(); +export function getDateFormatTz(uiSettings: IUiSettingsClient): string { // Pass the timezone to the server for use when aggregating anomalies (by day / hour) for the table. const tzConfig = uiSettings.get('dateFormat:tz'); const dateFormatTz = tzConfig !== 'Browser' ? tzConfig : moment.tz.guess(); return dateFormatTz; } -export function getFieldsByJob() { +export function getFieldsByJob(mlJobService: MlJobService) { return mlJobService.jobs.reduce( (reducedFieldsByJob, job) => { // Add the list of distinct by, over, partition and influencer fields for each job. @@ -353,6 +352,7 @@ export function getSelectionJobIds( } export function loadOverallAnnotations( + mlApiServices: MlApiServices, selectedJobs: ExplorerJob[], bounds: TimeRangeBounds ): Promise { @@ -361,7 +361,7 @@ export function loadOverallAnnotations( return new Promise((resolve) => { lastValueFrom( - ml.annotations.getAnnotations$({ + mlApiServices.annotations.getAnnotations$({ jobIds, earliestMs: timeRange.earliestMs, latestMs: timeRange.latestMs, @@ -407,6 +407,7 @@ export function loadOverallAnnotations( } export function loadAnnotationsTableData( + mlApiServices: MlApiServices, selectedCells: AppStateSelectedCells | undefined | null, selectedJobs: ExplorerJob[], bounds: Required @@ -416,7 +417,7 @@ export function loadAnnotationsTableData( return new Promise((resolve) => { lastValueFrom( - ml.annotations.getAnnotations$({ + mlApiServices.annotations.getAnnotations$({ jobIds, earliestMs: timeRange.earliestMs, latestMs: timeRange.latestMs, @@ -465,6 +466,8 @@ export function loadAnnotationsTableData( } export async function loadAnomaliesTableData( + mlApiServices: MlApiServices, + mlJobService: MlJobService, selectedCells: AppStateSelectedCells | undefined | null, selectedJobs: ExplorerJob[], dateFormatTz: string, @@ -479,7 +482,7 @@ export async function loadAnomaliesTableData( const timeRange = getSelectionTimeRange(selectedCells, bounds); return new Promise((resolve, reject) => { - ml.results + mlApiServices.results .getAnomaliesTableData( jobIds, [], diff --git a/x-pack/plugins/ml/public/application/explorer/reducers/explorer_reducer/get_index_pattern.ts b/x-pack/plugins/ml/public/application/explorer/reducers/explorer_reducer/get_index_pattern.ts index 7bc74698db2cd..ca360a9c4cb69 100644 --- a/x-pack/plugins/ml/public/application/explorer/reducers/explorer_reducer/get_index_pattern.ts +++ b/x-pack/plugins/ml/public/application/explorer/reducers/explorer_reducer/get_index_pattern.ts @@ -7,15 +7,12 @@ import { ML_RESULTS_INDEX_PATTERN } from '../../../../../common/constants/index_patterns'; -import type { ExplorerJob } from '../../explorer_utils'; -import { getInfluencers } from '../../explorer_utils'; - // Creates index pattern in the format expected by the kuery bar/kuery autocomplete provider // Field objects required fields: name, type, aggregatable, searchable -export function getIndexPattern(selectedJobs: ExplorerJob[]) { +export function getIndexPattern(influencers: string[]) { return { title: ML_RESULTS_INDEX_PATTERN, - fields: getInfluencers(selectedJobs).map((influencer) => ({ + fields: influencers.map((influencer) => ({ name: influencer, type: 'string', aggregatable: true, diff --git a/x-pack/plugins/ml/public/application/explorer/reducers/explorer_reducer/job_selection_change.ts b/x-pack/plugins/ml/public/application/explorer/reducers/explorer_reducer/job_selection_change.ts index dbf5dc2c8a8be..da657c3f18bc7 100644 --- a/x-pack/plugins/ml/public/application/explorer/reducers/explorer_reducer/job_selection_change.ts +++ b/x-pack/plugins/ml/public/application/explorer/reducers/explorer_reducer/job_selection_change.ts @@ -6,16 +6,15 @@ */ import type { ActionPayload } from '../../explorer_dashboard_service'; -import { getInfluencers } from '../../explorer_utils'; import { getIndexPattern } from './get_index_pattern'; import type { ExplorerState } from './state'; export const jobSelectionChange = (state: ExplorerState, payload: ActionPayload): ExplorerState => { - const { selectedJobs } = payload; + const { selectedJobs, noInfluencersConfigured } = payload; const stateUpdate: ExplorerState = { ...state, - noInfluencersConfigured: getInfluencers(selectedJobs).length === 0, + noInfluencersConfigured, selectedJobs, }; diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/confirm_modals/close_jobs_confirm_modal.tsx b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/confirm_modals/close_jobs_confirm_modal.tsx index 499ef14ecca36..605ebc0a412ea 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/confirm_modals/close_jobs_confirm_modal.tsx +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/confirm_modals/close_jobs_confirm_modal.tsx @@ -19,8 +19,10 @@ import { EuiButton, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { useMlKibana } from '../../../../contexts/kibana'; import type { MlSummaryJob } from '../../../../../../common/types/anomaly_detection_jobs'; import { isManagedJob } from '../../../jobs_utils'; +import { useMlJobService } from '../../../../services/job_service'; import { closeJobs } from '../utils'; import { ManagedJobsWarningCallout } from './managed_jobs_warning_callout'; @@ -37,6 +39,12 @@ export const CloseJobsConfirmModal: FC = ({ unsetShowFunction, refreshJobs, }) => { + const { + services: { + notifications: { toasts }, + }, + } = useMlKibana(); + const mlJobService = useMlJobService(); const [modalVisible, setModalVisible] = useState(false); const [hasManagedJob, setHasManaged] = useState(true); const [jobsToReset, setJobsToReset] = useState([]); @@ -113,7 +121,7 @@ export const CloseJobsConfirmModal: FC = ({ { - closeJobs(jobsToReset, refreshJobs); + closeJobs(toasts, mlJobService, jobsToReset, refreshJobs); closeModal(); }} fill diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/confirm_modals/stop_datafeeds_confirm_modal.tsx b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/confirm_modals/stop_datafeeds_confirm_modal.tsx index 355e186291508..265e0c58986aa 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/confirm_modals/stop_datafeeds_confirm_modal.tsx +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/confirm_modals/stop_datafeeds_confirm_modal.tsx @@ -19,8 +19,10 @@ import { EuiButton, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { useMlKibana } from '../../../../contexts/kibana'; import type { MlSummaryJob } from '../../../../../../common/types/anomaly_detection_jobs'; import { isManagedJob } from '../../../jobs_utils'; +import { useMlJobService } from '../../../../services/job_service'; import { stopDatafeeds } from '../utils'; import { ManagedJobsWarningCallout } from './managed_jobs_warning_callout'; @@ -38,6 +40,12 @@ export const StopDatafeedsConfirmModal: FC = ({ unsetShowFunction, refreshJobs, }) => { + const { + services: { + notifications: { toasts }, + }, + } = useMlKibana(); + const mlJobService = useMlJobService(); const [modalVisible, setModalVisible] = useState(false); const [hasManagedJob, setHasManaged] = useState(true); const [jobsToStop, setJobsToStop] = useState([]); @@ -114,7 +122,7 @@ export const StopDatafeedsConfirmModal: FC = ({ { - stopDatafeeds(jobsToStop, refreshJobs); + stopDatafeeds(toasts, mlJobService, jobsToStop, refreshJobs); closeModal(); }} fill diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/datafeed_chart_flyout.tsx b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/datafeed_chart_flyout.tsx index 93ad352c6b2d9..510149ada47e6 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/datafeed_chart_flyout.tsx +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/datafeed_chart_flyout.tsx @@ -110,6 +110,7 @@ export const DatafeedChartFlyout: FC = ({ onClose, onModelSnapshotAnnotationClick, }) => { + const mlApiServices = useMlApiContext(); const [data, setData] = useState<{ datafeedConfig: CombinedJobWithStats['datafeed_config'] | undefined; bucketSpan: string | undefined; @@ -212,7 +213,7 @@ export const DatafeedChartFlyout: FC = ({ const getJobAndSnapshotData = useCallback(async () => { try { - const job: CombinedJobWithStats = await loadFullJob(jobId); + const job: CombinedJobWithStats = await loadFullJob(mlApiServices, jobId); const modelSnapshotResultsLine: LineAnnotationDatumWithModelSnapshot[] = []; const modelSnapshotsResp = await getModelSnapshots(jobId); const modelSnapshots = modelSnapshotsResp.model_snapshots ?? []; @@ -659,6 +660,7 @@ export const JobListDatafeedChartFlyout: FC = ( unsetShowFunction, refreshJobs, }) => { + const mlApiServices = useMlApiContext(); const [isVisible, setIsVisible] = useState(false); const [job, setJob] = useState(); const [jobWithStats, setJobWithStats] = useState(); @@ -675,9 +677,11 @@ export const JobListDatafeedChartFlyout: FC = ( const showRevertModelSnapshot = useCallback(async () => { // Need to load the full job with stats, as the model snapshot // flyout needs the timestamp of the last result. - const fullJob: CombinedJobWithStats = await loadFullJob(job!.id); + const fullJob: CombinedJobWithStats = await loadFullJob(mlApiServices, job!.id); setJobWithStats(fullJob); setIsRevertModelSnapshotFlyoutVisible(true); + // exclude mlApiServices from deps + // eslint-disable-next-line react-hooks/exhaustive-deps }, [job]); useEffect(() => { diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/delete_job_modal/delete_job_modal.tsx b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/delete_job_modal/delete_job_modal.tsx index 1626a8d3ec661..75d3fb270d226 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/delete_job_modal/delete_job_modal.tsx +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/delete_job_modal/delete_job_modal.tsx @@ -23,9 +23,11 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { useMlKibana } from '../../../../contexts/kibana'; import { deleteJobs } from '../utils'; import { BLOCKED_JOBS_REFRESH_INTERVAL_MS } from '../../../../../../common/constants/jobs_list'; import { DeleteSpaceAwareItemCheckModal } from '../../../../components/delete_space_aware_item_check_modal'; +import { useMlJobService } from '../../../../services/job_service'; import type { MlSummaryJob } from '../../../../../../common/types/anomaly_detection_jobs'; import { isManagedJob } from '../../../jobs_utils'; import { ManagedJobsWarningCallout } from '../confirm_modals/managed_jobs_warning_callout'; @@ -39,6 +41,12 @@ interface Props { } export const DeleteJobModal: FC = ({ setShowFunction, unsetShowFunction, refreshJobs }) => { + const { + services: { + notifications: { toasts }, + }, + } = useMlKibana(); + const mlJobService = useMlJobService(); const [deleting, setDeleting] = useState(false); const [modalVisible, setModalVisible] = useState(false); const [adJobs, setAdJobs] = useState([]); @@ -83,6 +91,8 @@ export const DeleteJobModal: FC = ({ setShowFunction, unsetShowFunction, const deleteJob = useCallback(() => { setDeleting(true); deleteJobs( + toasts, + mlJobService, jobIds.map((id) => ({ id })), deleteUserAnnotations, deleteAlertingRules @@ -92,6 +102,8 @@ export const DeleteJobModal: FC = ({ setShowFunction, unsetShowFunction, closeModal(); refreshJobs(); }, BLOCKED_JOBS_REFRESH_INTERVAL_MS); + // exclude mlJobservice from deps + // eslint-disable-next-line react-hooks/exhaustive-deps }, [jobIds, deleteUserAnnotations, deleteAlertingRules, closeModal, refreshJobs]); if (modalVisible === false || jobIds.length === 0) { diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_job_flyout.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_job_flyout.js index 8c739877b7037..03d8745b20ee1 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_job_flyout.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_job_flyout.js @@ -10,6 +10,7 @@ import React, { Component } from 'react'; import { cloneDeep, isEqual, pick } from 'lodash'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import { withKibana } from '@kbn/kibana-react-plugin/public'; import { EuiButton, EuiButtonEmpty, @@ -30,8 +31,6 @@ import { saveJob } from './edit_utils'; import { loadFullJob } from '../utils'; import { validateModelMemoryLimit, validateGroupNames } from '../validate_job'; import { toastNotificationServiceProvider } from '../../../../services/toast_notification_service'; -import { ml } from '../../../../services/ml_api_service'; -import { withKibana } from '@kbn/kibana-react-plugin/public'; import { XJson } from '@kbn/es-ui-shared-plugin/public'; import { DATAFEED_STATE, JOB_STATE } from '../../../../../../common/constants/states'; import { CustomUrlsWrapper, isValidCustomUrls } from '../../../../components/custom_urls'; @@ -43,8 +42,8 @@ const { collapseLiteralStrings } = XJson; export class EditJobFlyoutUI extends Component { _initialJobFormState = null; - constructor(props) { - super(props); + constructor(props, constructorContext) { + super(props, constructorContext); this.state = { job: {}, @@ -121,7 +120,7 @@ export class EditJobFlyoutUI extends Component { showFlyout = (jobLite) => { const hasDatafeed = jobLite.hasDatafeed; - loadFullJob(jobLite.id) + loadFullJob(this.props.kibana.services.mlServices.mlApiServices, jobLite.id) .then((job) => { this.extractJob(job, hasDatafeed); this.setState({ @@ -204,6 +203,8 @@ export class EditJobFlyoutUI extends Component { ).message; } + const ml = this.props.kibana.services.mlServices.mlApiServices; + if (jobDetails.jobGroups !== undefined) { jobGroupsValidationError = validateGroupNames(jobDetails.jobGroups).message; if (jobGroupsValidationError === '') { @@ -272,10 +273,11 @@ export class EditJobFlyoutUI extends Component { customUrls: this.state.jobCustomUrls, }; + const mlApiServices = this.props.kibana.services.mlServices.mlApiServices; const { toasts } = this.props.kibana.services.notifications; const toastNotificationService = toastNotificationServiceProvider(toasts); - saveJob(this.state.job, newJobData) + saveJob(mlApiServices, this.state.job, newJobData) .then(() => { toasts.addSuccess( i18n.translate('xpack.ml.jobsList.editJobFlyout.changesSavedNotificationMessage', { diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.js index 8870f04f498d0..b3c36304ed381 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.js @@ -8,9 +8,8 @@ import { difference } from 'lodash'; import { getNewJobLimits } from '../../../../services/ml_server_info'; import { processCreatedBy } from '../../../../../../common/util/job_utils'; -import { ml } from '../../../../services/ml_api_service'; -export function saveJob(job, newJobData, finish) { +export function saveJob(mlApiServices, job, newJobData, finish) { return new Promise((resolve, reject) => { const jobData = { ...extractDescription(job, newJobData), @@ -30,7 +29,7 @@ export function saveJob(job, newJobData, finish) { } const saveDatafeedWrapper = () => { - saveDatafeed(datafeedData, job, finish) + saveDatafeed(mlApiServices, datafeedData, job, finish) .then(() => { resolve(); }) @@ -41,7 +40,8 @@ export function saveJob(job, newJobData, finish) { // if anything has changed, post the changes if (Object.keys(jobData).length) { - ml.updateJob({ jobId: job.job_id, job: jobData }) + mlApiServices + .updateJob({ jobId: job.job_id, job: jobData }) .then(() => { saveDatafeedWrapper(); }) @@ -54,11 +54,12 @@ export function saveJob(job, newJobData, finish) { }); } -function saveDatafeed(datafeedConfig, job) { +function saveDatafeed(mlApiServices, datafeedConfig, job) { return new Promise((resolve, reject) => { if (Object.keys(datafeedConfig).length) { const datafeedId = job.datafeed_config.datafeed_id; - ml.updateDatafeed({ datafeedId, datafeedConfig }) + mlApiServices + .updateDatafeed({ datafeedId, datafeedConfig }) .then(() => { resolve(); }) diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/detectors.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/detectors.js index 14df6ccb8d8f4..01fe676a4133b 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/detectors.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/detectors.js @@ -7,16 +7,26 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFieldText, EuiForm, EuiFormRow, EuiSpacer, EuiTitle } from '@elastic/eui'; -import { mlJobService } from '../../../../../services/job_service'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { context } from '@kbn/kibana-react-plugin/public'; + +import { mlJobServiceFactory } from '../../../../../services/job_service'; +import { toastNotificationServiceProvider } from '../../../../../services/toast_notification_service'; import { detectorToString } from '../../../../../util/string_utils'; export class Detectors extends Component { - constructor(props) { - super(props); + static contextType = context; + + constructor(props, constructorContext) { + super(props, constructorContext); + + const mlJobService = mlJobServiceFactory( + toastNotificationServiceProvider(constructorContext.services.notifications.toasts), + constructorContext.services.mlServices.mlApiServices + ); this.detectors = mlJobService.getJobGroups().map((g) => ({ label: g.id })); diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/job_details.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/job_details.js index 9bfa9caa0c875..5cb7b9edd607e 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/job_details.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/job_details.js @@ -17,12 +17,13 @@ import { EuiFieldNumber, } from '@elastic/eui'; -import { ml } from '../../../../../services/ml_api_service'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import { withKibana } from '@kbn/kibana-react-plugin/public'; + import { tabColor } from '../../../../../../../common/util/group_color_utils'; -export class JobDetails extends Component { +export class JobDetailsUI extends Component { constructor(props) { super(props); @@ -41,6 +42,7 @@ export class JobDetails extends Component { } componentDidMount() { + const ml = this.props.kibana.services.mlServices.mlApiServices; // load groups to populate the select options ml.jobs .groups() @@ -259,10 +261,12 @@ export class JobDetails extends Component { ); } } -JobDetails.propTypes = { +JobDetailsUI.propTypes = { datafeedRunning: PropTypes.bool.isRequired, jobDescription: PropTypes.string.isRequired, jobGroups: PropTypes.array.isRequired, jobModelMemoryLimit: PropTypes.string.isRequired, setJobDetails: PropTypes.func.isRequired, }; + +export const JobDetails = withKibana(JobDetailsUI); diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_actions/management.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_actions/management.js index 29045ad826bdf..1734182ff3ebc 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_actions/management.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_actions/management.js @@ -22,6 +22,10 @@ import { i18n } from '@kbn/i18n'; import { isManagedJob } from '../../../jobs_utils'; export function actionsMenuContent( + toastNotifications, + application, + mlApiServices, + mlJobService, showEditJobFlyout, showDatafeedChartFlyout, showDeleteJobModal, @@ -73,7 +77,7 @@ export function actionsMenuContent( if (isManagedJob(item)) { showStopDatafeedsConfirmModal([item]); } else { - stopDatafeeds([item], refreshJobs); + stopDatafeeds(toastNotifications, mlJobService, [item], refreshJobs); } closeMenu(true); @@ -110,7 +114,7 @@ export function actionsMenuContent( if (isManagedJob(item)) { showCloseJobsConfirmModal([item]); } else { - closeJobs([item], refreshJobs); + closeJobs(toastNotifications, mlJobService, [item], refreshJobs); } closeMenu(true); @@ -149,7 +153,7 @@ export function actionsMenuContent( return isJobBlocked(item) === false && canCreateJob; }, onClick: (item) => { - cloneJob(item.id); + cloneJob(toastNotifications, application, mlApiServices, mlJobService, item.id); closeMenu(true); }, 'data-test-subj': 'mlActionButtonCloneJob', diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/forecasts_table/forecasts_table.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/forecasts_table/forecasts_table.js index db36d97e0a9bd..6ab1aae6be895 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/forecasts_table/forecasts_table.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/forecasts_table/forecasts_table.js @@ -39,13 +39,15 @@ const MAX_FORECASTS = 500; * Table component for rendering the lists of forecasts run on an ML job. */ export class ForecastsTable extends Component { - constructor(props) { - super(props); + constructor(props, constructorContext) { + super(props, constructorContext); this.state = { isLoading: props.job.data_counts.processed_record_count !== 0, forecasts: [], }; - this.mlForecastService; + this.mlForecastService = forecastServiceFactory( + constructorContext.services.mlServices.mlApiServices + ); } /** @@ -54,7 +56,6 @@ export class ForecastsTable extends Component { static contextType = context; componentDidMount() { - this.mlForecastService = forecastServiceFactory(this.context.services.mlServices.mlApiServices); const dataCounts = this.props.job.data_counts; if (dataCounts.processed_record_count > 0) { // Get the list of all the forecasts with results at or later than the specified 'from' time. diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/job_messages_pane.tsx b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/job_messages_pane.tsx index 684cccb0afdba..eb0ce2d6be817 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/job_messages_pane.tsx +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/job_messages_pane.tsx @@ -11,7 +11,6 @@ import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiToolTip } from '@el import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { extractErrorMessage } from '@kbn/ml-error-utils'; -import { ml } from '../../../../services/ml_api_service'; import { JobMessages } from '../../../../components/job_messages'; import type { JobMessage } from '../../../../../../common/types/audit_message'; import { useToastNotificationService } from '../../../../services/toast_notification_service'; @@ -38,9 +37,7 @@ export const JobMessagesPane: FC = React.memo( const [isClearing, setIsClearing] = useState(false); const toastNotificationService = useToastNotificationService(); - const { - jobs: { clearJobAuditMessages }, - } = useMlApiContext(); + const ml = useMlApiContext(); const fetchMessages = async () => { setIsLoading(true); @@ -70,7 +67,7 @@ export const JobMessagesPane: FC = React.memo( const clearMessages = useCallback(async () => { setIsClearing(true); try { - await clearJobAuditMessages(jobId, notificationIndices); + await ml.jobs.clearJobAuditMessages(jobId, notificationIndices); setIsClearing(false); if (typeof refreshJobList === 'function') { refreshJobList(); diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list/jobs_list.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list/jobs_list.js index b72bbf41269cc..e6fd50d96a65d 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list/jobs_list.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list/jobs_list.js @@ -11,6 +11,7 @@ import { sortBy } from 'lodash'; import moment from 'moment'; import { TIME_FORMAT } from '@kbn/ml-date-utils'; +import { withKibana } from '@kbn/kibana-react-plugin/public'; import { toLocaleString } from '../../../../util/string_utils'; import { JobIcon } from '../../../../components/job_message_icon'; @@ -31,10 +32,12 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { AnomalyDetectionJobIdLink } from './job_id_link'; import { isManagedJob } from '../../../jobs_utils'; +import { mlJobServiceFactory } from '../../../../services/job_service'; +import { toastNotificationServiceProvider } from '../../../../services/toast_notification_service'; const PAGE_SIZE_OPTIONS = [10, 25, 50]; -export class JobsList extends Component { +export class JobsListUI extends Component { constructor(props) { super(props); @@ -42,6 +45,12 @@ export class JobsList extends Component { jobsSummaryList: props.jobsSummaryList, itemIdToExpandedRowMap: {}, }; + + this.mlApiServices = props.kibana.services.mlServices.mlApiServices; + this.mlJobService = mlJobServiceFactory( + toastNotificationServiceProvider(props.kibana.services.notifications.toasts), + this.mlApiServices + ); } static getDerivedStateFromProps(props) { @@ -329,6 +338,10 @@ export class JobsList extends Component { defaultMessage: 'Actions', }), actions: actionsMenuContent( + this.props.kibana.services.notifications.toasts, + this.props.kibana.services.application, + this.mlApiServices, + this.mlJobService, this.props.showEditJobFlyout, this.props.showDatafeedChartFlyout, this.props.showDeleteJobModal, @@ -399,7 +412,7 @@ export class JobsList extends Component { ); } } -JobsList.propTypes = { +JobsListUI.propTypes = { jobsSummaryList: PropTypes.array.isRequired, fullJobsList: PropTypes.object.isRequired, isMlEnabledInSpace: PropTypes.bool, @@ -419,7 +432,9 @@ JobsList.propTypes = { jobsViewState: PropTypes.object, onJobsViewStateUpdate: PropTypes.func, }; -JobsList.defaultProps = { +JobsListUI.defaultProps = { isMlEnabledInSpace: true, loading: false, }; + +export const JobsList = withKibana(JobsListUI); diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list_view/jobs_list_view.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list_view/jobs_list_view.js index 40df5bd90915b..efb9211e99c0e 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list_view/jobs_list_view.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list_view/jobs_list_view.js @@ -8,7 +8,8 @@ import React, { Component } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import { ml } from '../../../../services/ml_api_service'; +import { withKibana } from '@kbn/kibana-react-plugin/public'; + import { checkForAutoStartDatafeed, filterJobs, loadFullJob } from '../utils'; import { JobsList } from '../jobs_list'; import { JobDetails } from '../job_details'; @@ -36,10 +37,12 @@ import { StopDatafeedsConfirmModal } from '../confirm_modals/stop_datafeeds_conf import { CloseJobsConfirmModal } from '../confirm_modals/close_jobs_confirm_modal'; import { AnomalyDetectionEmptyState } from '../anomaly_detection_empty_state'; import { removeNodeInfo } from '../../../../../../common/util/job_utils'; +import { mlJobServiceFactory } from '../../../../services/job_service'; +import { toastNotificationServiceProvider } from '../../../../services/toast_notification_service'; let blockingJobsRefreshTimeout = null; -export class JobsListView extends Component { +export class JobsListViewUI extends Component { constructor(props) { super(props); @@ -77,6 +80,11 @@ export class JobsListView extends Component { * @private */ this._isFiltersSet = false; + + this.mlJobService = mlJobServiceFactory( + toastNotificationServiceProvider(props.kibana.services.notifications.toasts), + props.kibana.services.mlServices.mlApiServices + ); } componentDidMount() { @@ -98,7 +106,7 @@ export class JobsListView extends Component { } openAutoStartDatafeedModal() { - const job = checkForAutoStartDatafeed(); + const job = checkForAutoStartDatafeed(this.mlJobService); if (job !== undefined) { this.showStartDatafeedModal([job]); } @@ -139,7 +147,7 @@ export class JobsListView extends Component { } this.setState({ itemIdToExpandedRowMap }, () => { - loadFullJob(jobId) + loadFullJob(this.props.kibana.services.mlServices.mlApiServices, jobId) .then((job) => { const fullJobsList = { ...this.state.fullJobsList }; if (this.props.showNodeInfo === false) { @@ -316,6 +324,7 @@ export class JobsListView extends Component { this.setState({ loading: true }); } + const ml = this.props.kibana.services.mlServices.mlApiServices; const expandedJobsIds = Object.keys(this.state.itemIdToExpandedRowMap); try { let jobsAwaitingNodeCount = 0; @@ -378,6 +387,7 @@ export class JobsListView extends Component { return; } + const ml = this.props.kibana.services.mlServices.mlApiServices; const { jobs } = await ml.jobs.blockingJobTasks(); const blockingJobIds = jobs.map((j) => Object.keys(j)[0]).sort(); const taskListHasChanged = blockingJobIds.join() !== this.state.blockingJobIds.join(); @@ -552,3 +562,5 @@ export class JobsListView extends Component { return
{this.renderJobsListComponents()}
; } } + +export const JobsListView = withKibana(JobsListViewUI); diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/actions_menu.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/actions_menu.js index 73757a0091d5e..e12b770039b8d 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/actions_menu.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/actions_menu.js @@ -5,13 +5,22 @@ * 2.0. */ -import { checkPermission } from '../../../../capabilities/check_capabilities'; -import { mlNodesAvailable } from '../../../../ml_nodes_check/check_ml_nodes'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { EuiButtonIcon, EuiContextMenuPanel, EuiContextMenuItem, EuiPopover } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { context } from '@kbn/kibana-react-plugin/public'; + +import { checkPermission } from '../../../../capabilities/check_capabilities'; +import { mlNodesAvailable } from '../../../../ml_nodes_check/check_ml_nodes'; +import { mlJobServiceFactory } from '../../../../services/job_service'; +import { toastNotificationServiceProvider } from '../../../../services/toast_notification_service'; + +import { isManagedJob } from '../../../jobs_utils'; + import { closeJobs, stopDatafeeds, @@ -20,13 +29,12 @@ import { isClosable, isResettable, } from '../utils'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { isManagedJob } from '../../../jobs_utils'; class MultiJobActionsMenuUI extends Component { - constructor(props) { - super(props); + static contextType = context; + + constructor(props, constructorContext) { + super(props, constructorContext); this.state = { isOpen: false, @@ -37,6 +45,13 @@ class MultiJobActionsMenuUI extends Component { this.canCloseJob = checkPermission('canCloseJob') && mlNodesAvailable(); this.canResetJob = checkPermission('canResetJob') && mlNodesAvailable(); this.canCreateMlAlerts = checkPermission('canCreateMlAlerts'); + + this.toastNoticiations = constructorContext.services.notifications.toasts; + const mlApiServices = constructorContext.services.mlServices.mlApiServices; + const toastNotificationService = toastNotificationServiceProvider( + constructorContext.services.notifications.toasts + ); + this.mlJobService = mlJobServiceFactory(toastNotificationService, mlApiServices); } onButtonClick = () => { @@ -101,7 +116,7 @@ class MultiJobActionsMenuUI extends Component { if (this.props.jobs.some((j) => isManagedJob(j))) { this.props.showCloseJobsConfirmModal(this.props.jobs); } else { - closeJobs(this.props.jobs); + closeJobs(this.toastNotifications, this.mlJobService, this.props.jobs); } this.closePopover(); diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/group_selector/group_selector.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/group_selector/group_selector.js index 056bd58d045a5..9fe8bbf230322 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/group_selector/group_selector.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/group_selector/group_selector.js @@ -9,6 +9,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import { withKibana } from '@kbn/kibana-react-plugin/public'; import { EuiButton, @@ -24,11 +25,10 @@ import { import { cloneDeep } from 'lodash'; -import { ml } from '../../../../../services/ml_api_service'; import { checkPermission } from '../../../../../capabilities/check_capabilities'; import { GroupList } from './group_list'; import { NewGroupInput } from './new_group_input'; -import { getToastNotificationService } from '../../../../../services/toast_notification_service'; +import { toastNotificationServiceProvider } from '../../../../../services/toast_notification_service'; function createSelectedGroups(jobs, groups) { const jobIds = jobs.map((j) => j.id); @@ -54,15 +54,15 @@ function createSelectedGroups(jobs, groups) { return selectedGroups; } -export class GroupSelector extends Component { +export class GroupSelectorUI extends Component { static propTypes = { jobs: PropTypes.array.isRequired, allJobIds: PropTypes.array.isRequired, refreshJobs: PropTypes.func.isRequired, }; - constructor(props) { - super(props); + constructor(props, constructorContext) { + super(props, constructorContext); this.state = { isPopoverOpen: false, @@ -73,6 +73,9 @@ export class GroupSelector extends Component { this.refreshJobs = this.props.refreshJobs; this.canUpdateJob = checkPermission('canUpdateJob'); + this.toastNotificationsService = toastNotificationServiceProvider( + props.kibana.services.notifications.toasts + ); } static getDerivedStateFromProps(props, state) { @@ -88,6 +91,7 @@ export class GroupSelector extends Component { if (this.state.isPopoverOpen) { this.closePopover(); } else { + const ml = this.props.kibana.services.mlServices.mlApiServices; ml.jobs .groups() .then((groups) => { @@ -133,6 +137,7 @@ export class GroupSelector extends Component { }; applyChanges = () => { + const toastNotificationsService = this.toastNotificationsService; const { selectedGroups } = this.state; const { jobs } = this.props; const newJobs = jobs.map((j) => ({ @@ -153,6 +158,7 @@ export class GroupSelector extends Component { } const tempJobs = newJobs.map((j) => ({ jobId: j.id, groups: j.newGroups })); + const ml = this.props.kibana.services.mlServices.mlApiServices; ml.jobs .updateGroups(tempJobs) .then((resp) => { @@ -161,7 +167,7 @@ export class GroupSelector extends Component { // check success of each job update if (Object.hasOwn(resp, jobId)) { if (resp[jobId].success === false) { - getToastNotificationService().displayErrorToast(resp[jobId].error); + toastNotificationsService.displayErrorToast(resp[jobId].error); success = false; } } @@ -176,7 +182,7 @@ export class GroupSelector extends Component { } }) .catch((error) => { - getToastNotificationService().displayErrorToast(error); + toastNotificationsService.displayErrorToast(error); console.error(error); }); }; @@ -271,3 +277,5 @@ export class GroupSelector extends Component { ); } } + +export const GroupSelector = withKibana(GroupSelectorUI); diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/reset_job_modal/reset_job_modal.tsx b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/reset_job_modal/reset_job_modal.tsx index 5049610c325b4..1658c428d9b00 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/reset_job_modal/reset_job_modal.tsx +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/reset_job_modal/reset_job_modal.tsx @@ -25,6 +25,8 @@ import { i18n } from '@kbn/i18n'; import { resetJobs } from '../utils'; import type { MlSummaryJob } from '../../../../../../common/types/anomaly_detection_jobs'; import { RESETTING_JOBS_REFRESH_INTERVAL_MS } from '../../../../../../common/constants/jobs_list'; +import { useMlKibana } from '../../../../contexts/kibana'; +import { useMlJobService } from '../../../../services/job_service'; import { OpenJobsWarningCallout } from './open_jobs_warning_callout'; import { isManagedJob } from '../../../jobs_utils'; import { ManagedJobsWarningCallout } from '../confirm_modals/managed_jobs_warning_callout'; @@ -38,6 +40,12 @@ interface Props { } export const ResetJobModal: FC = ({ setShowFunction, unsetShowFunction, refreshJobs }) => { + const { + services: { + notifications: { toasts }, + }, + } = useMlKibana(); + const mlJobService = useMlJobService(); const [resetting, setResetting] = useState(false); const [modalVisible, setModalVisible] = useState(false); const [jobIds, setJobIds] = useState([]); @@ -73,11 +81,13 @@ export const ResetJobModal: FC = ({ setShowFunction, unsetShowFunction, r const resetJob = useCallback(async () => { setResetting(true); - await resetJobs(jobIds, deleteUserAnnotations); + await resetJobs(toasts, mlJobService, jobIds, deleteUserAnnotations); closeModal(); setTimeout(() => { refreshJobs(); }, RESETTING_JOBS_REFRESH_INTERVAL_MS); + // exclude mlJobservice from deps + // eslint-disable-next-line react-hooks/exhaustive-deps }, [closeModal, deleteUserAnnotations, jobIds, refreshJobs]); if (modalVisible === false || jobIds.length === 0) { diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/start_datafeed_modal/start_datafeed_modal.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/start_datafeed_modal/start_datafeed_modal.js index c4c53b00591f4..d56fc973a0249 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/start_datafeed_modal/start_datafeed_modal.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/start_datafeed_modal/start_datafeed_modal.js @@ -7,6 +7,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; +import moment from 'moment'; import { EuiButton, @@ -20,18 +21,23 @@ import { EuiCheckbox, } from '@elastic/eui'; -import moment from 'moment'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { context } from '@kbn/kibana-react-plugin/public'; + +import { mlJobServiceFactory } from '../../../../services/job_service'; +import { toastNotificationServiceProvider } from '../../../../services/toast_notification_service'; + +import { isManagedJob } from '../../../jobs_utils'; import { forceStartDatafeeds } from '../utils'; import { TimeRangeSelector } from './time_range_selector'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { isManagedJob } from '../../../jobs_utils'; - export class StartDatafeedModal extends Component { - constructor(props) { - super(props); + static contextType = context; + + constructor(props, constructorContext) { + super(props, constructorContext); const now = moment(); this.state = { @@ -50,6 +56,11 @@ export class StartDatafeedModal extends Component { this.initialSpecifiedStartTime = now; this.refreshJobs = this.props.refreshJobs; this.getShowCreateAlertFlyoutFunction = this.props.getShowCreateAlertFlyoutFunction; + this.toastNotifications = constructorContext.services.notifications.toasts; + this.mlJobService = mlJobServiceFactory( + toastNotificationServiceProvider(this.toastNotifications), + constructorContext.services.mlServices.mlApiServices + ); } componentDidMount() { @@ -114,7 +125,7 @@ export class StartDatafeedModal extends Component { ? this.state.endTime.valueOf() : this.state.endTime; - forceStartDatafeeds(jobs, start, end, () => { + forceStartDatafeeds(this.toastNotifications, this.mlJobService, jobs, start, end, () => { if (this.state.createAlert && jobs.length > 0) { this.getShowCreateAlertFlyoutFunction()(jobs.map((job) => job.id)); } diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.d.ts b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.d.ts index 7dd542dc3107f..a4c20309129f3 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.d.ts +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.d.ts @@ -5,19 +5,79 @@ * 2.0. */ -import type { CombinedJobWithStats } from '../../../../../common/types/anomaly_detection_jobs'; +import type { ApplicationStart, ToastsStart } from '@kbn/core/public'; -export function stopDatafeeds(jobs: Array<{ id: string }>, callback?: () => void): Promise; -export function closeJobs(jobs: Array<{ id: string }>, callback?: () => void): Promise; +import type { DATAFEED_STATE } from '../../../../../common/constants/states'; +import type { + CombinedJobWithStats, + MlSummaryJob, +} from '../../../../../common/types/anomaly_detection_jobs'; +import type { MlJobService } from '../../../services/job_service'; +import type { MlApiServices } from '../../../services/ml_api_service'; + +export function loadFullJob( + mlApiServices: MlApiServices, + jobId: string +): Promise; +export function loadJobForCloning(mlApiServices: MlApiServices, jobId: string): Promise; +export function isStartable(jobs: CombinedJobWithStats[]): boolean; +export function isClosable(jobs: CombinedJobWithStats[]): boolean; +export function isResettable(jobs: CombinedJobWithStats[]): boolean; +export function forceStartDatafeeds( + toastNotifications: ToastsStart, + mlJobService: MlJobService, + jobs: CombinedJobWithStats[], + start: number | undefined, + end: number | undefined, + finish?: () => void +): Promise; +export function stopDatafeeds( + toastNotifications: ToastsStart, + mlJobService: MlJobService, + jobs: CombinedJobWithStats[] | MlSummaryJob[], + finish?: () => void +): Promise; +export function showResults( + toastNotifications: ToastsStart, + resp: any, + action: DATAFEED_STATE +): void; +export function cloneJob( + toastNotifications: ToastsStart, + application: ApplicationStart, + mlApiServices: MlApiServices, + mlJobService: MlJobService, + jobId: string +): Promise; +export function closeJobs( + toastNotifications: ToastsStart, + mlJobService: MlJobService, + jobs: CombinedJobWithStats[] | MlSummaryJob[], + finish?: () => void +): Promise; export function deleteJobs( + toastNotifications: ToastsStart, + mlJobService: MlJobService, jobs: Array<{ id: string }>, deleteUserAnnotations?: boolean, deleteAlertingRules?: boolean, - callback?: () => void + finish?: () => void ): Promise; export function resetJobs( + toastNotifications: ToastsStart, + mlJobService: MlJobService, jobIds: string[], deleteUserAnnotations?: boolean, - callback?: () => void + finish?: () => void ): Promise; -export function loadFullJob(jobId: string): Promise; +export function filterJobs( + jobs: CombinedJobWithStats[], + clauses: Array<{ field: string; match: string; type: string; value: any }> +): CombinedJobWithStats[]; +export function jobProperty(job: CombinedJobWithStats, prop: string): any; +export function jobTagFilter(jobs: CombinedJobWithStats[], value: string): CombinedJobWithStats[]; +export function checkForAutoStartDatafeed( + mlJobService: MlJobService +): + | { id: string; hasDatafeed: boolean; latestTimestampSortValue: number; datafeedId: string } + | undefined; diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js index 86ed4a125aead..471e56be7a840 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/utils.js @@ -8,13 +8,7 @@ import { each } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { mlJobService } from '../../../services/job_service'; -import { - getToastNotificationService, - toastNotificationServiceProvider, -} from '../../../services/toast_notification_service'; -import { getApplication, getToastNotifications } from '../../../util/dependency_cache'; -import { ml } from '../../../services/ml_api_service'; +import { toastNotificationServiceProvider } from '../../../services/toast_notification_service'; import { stringMatch } from '../../../util/string_utils'; import { JOB_STATE, DATAFEED_STATE } from '../../../../../common/constants/states'; import { JOB_ACTION } from '../../../../../common/constants/job_actions'; @@ -25,9 +19,9 @@ import { ML_PAGES } from '../../../../../common/constants/locator'; import { PLUGIN_ID } from '../../../../../common/constants/app'; import { CREATED_BY_LABEL } from '../../../../../common/constants/new_job'; -export function loadFullJob(jobId) { +export function loadFullJob(mlApiServices, jobId) { return new Promise((resolve, reject) => { - ml.jobs + mlApiServices.jobs .jobs([jobId]) .then((jobs) => { if (jobs.length) { @@ -42,9 +36,9 @@ export function loadFullJob(jobId) { }); } -export function loadJobForCloning(jobId) { +export function loadJobForCloning(mlApiServices, jobId) { return new Promise((resolve, reject) => { - ml.jobs + mlApiServices.jobs .jobForCloning(jobId) .then((resp) => { if (resp) { @@ -86,16 +80,22 @@ export function isResettable(jobs) { ); } -export function forceStartDatafeeds(jobs, start, end, finish = () => {}) { +export function forceStartDatafeeds( + toastNotifications, + mlJobService, + jobs, + start, + end, + finish = () => {} +) { const datafeedIds = jobs.filter((j) => j.hasDatafeed).map((j) => j.datafeedId); mlJobService .forceStartDatafeeds(datafeedIds, start, end) .then((resp) => { - showResults(resp, DATAFEED_STATE.STARTED); + showResults(toastNotifications, resp, DATAFEED_STATE.STARTED); finish(); }) .catch((error) => { - const toastNotifications = getToastNotifications(); toastNotifications.addDanger( i18n.translate('xpack.ml.jobsList.startJobErrorMessage', { defaultMessage: 'Jobs failed to start', @@ -106,16 +106,15 @@ export function forceStartDatafeeds(jobs, start, end, finish = () => {}) { }); } -export function stopDatafeeds(jobs, finish = () => {}) { +export function stopDatafeeds(toastNotifications, mlJobService, jobs, finish = () => {}) { const datafeedIds = jobs.filter((j) => j.hasDatafeed).map((j) => j.datafeedId); mlJobService .stopDatafeeds(datafeedIds) .then((resp) => { - showResults(resp, DATAFEED_STATE.STOPPED); + showResults(toastNotifications, resp, DATAFEED_STATE.STOPPED); finish(); }) .catch((error) => { - const toastNotifications = getToastNotifications(); toastNotifications.addDanger( i18n.translate('xpack.ml.jobsList.stopJobErrorMessage', { defaultMessage: 'Jobs failed to stop', @@ -126,7 +125,7 @@ export function stopDatafeeds(jobs, finish = () => {}) { }); } -function showResults(resp, action) { +function showResults(toastNotifications, resp, action) { const successes = []; const failures = []; for (const d in resp) { @@ -184,7 +183,6 @@ function showResults(resp, action) { }); } - const toastNotifications = getToastNotifications(); if (successes.length > 0) { toastNotifications.addSuccess( i18n.translate('xpack.ml.jobsList.actionExecuteSuccessfullyNotificationMessage', { @@ -216,11 +214,17 @@ function showResults(resp, action) { } } -export async function cloneJob(jobId) { +export async function cloneJob( + toastNotifications, + application, + mlApiServices, + mlJobService, + jobId +) { try { const [{ job: cloneableJob, datafeed }, originalJob] = await Promise.all([ - loadJobForCloning(jobId), - loadFullJob(jobId, false), + loadJobForCloning(mlApiServices, jobId), + loadFullJob(mlApiServices, jobId), ]); const createdBy = originalJob?.custom_settings?.created_by; @@ -273,13 +277,14 @@ export async function cloneJob(jobId) { if (originalJob.calendars) { mlJobService.tempJobCloningObjects.calendars = await mlCalendarService.fetchCalendarsByIds( + mlApiServices, originalJob.calendars ); } - getApplication().navigateToApp(PLUGIN_ID, { path: ML_PAGES.ANOMALY_DETECTION_CREATE_JOB }); + application.navigateToApp(PLUGIN_ID, { path: ML_PAGES.ANOMALY_DETECTION_CREATE_JOB }); } catch (error) { - getToastNotificationService().displayErrorToast( + toastNotificationServiceProvider(toastNotifications).displayErrorToast( error, i18n.translate('xpack.ml.jobsList.cloneJobErrorMessage', { defaultMessage: 'Could not clone {jobId}. Job could not be found', @@ -289,16 +294,16 @@ export async function cloneJob(jobId) { } } -export function closeJobs(jobs, finish = () => {}) { +export function closeJobs(toastNotifications, mlJobService, jobs, finish = () => {}) { const jobIds = jobs.map((j) => j.id); mlJobService .closeJobs(jobIds) .then((resp) => { - showResults(resp, JOB_STATE.CLOSED); + showResults(toastNotifications, resp, JOB_STATE.CLOSED); finish(); }) .catch((error) => { - getToastNotificationService().displayErrorToast( + toastNotificationServiceProvider(toastNotifications).displayErrorToast( error, i18n.translate('xpack.ml.jobsList.closeJobErrorMessage', { defaultMessage: 'Jobs failed to close', @@ -308,15 +313,21 @@ export function closeJobs(jobs, finish = () => {}) { }); } -export function resetJobs(jobIds, deleteUserAnnotations, finish = () => {}) { +export function resetJobs( + toastNotifications, + mlJobService, + jobIds, + deleteUserAnnotations, + finish = () => {} +) { mlJobService .resetJobs(jobIds, deleteUserAnnotations) .then((resp) => { - showResults(resp, JOB_ACTION.RESET); + showResults(toastNotifications, resp, JOB_ACTION.RESET); finish(); }) .catch((error) => { - getToastNotificationService().displayErrorToast( + toastNotificationServiceProvider(toastNotifications).displayErrorToast( error, i18n.translate('xpack.ml.jobsList.resetJobErrorMessage', { defaultMessage: 'Jobs failed to reset', @@ -326,16 +337,23 @@ export function resetJobs(jobIds, deleteUserAnnotations, finish = () => {}) { }); } -export function deleteJobs(jobs, deleteUserAnnotations, deleteAlertingRules, finish = () => {}) { +export function deleteJobs( + toastNotifications, + mlJobService, + jobs, + deleteUserAnnotations, + deleteAlertingRules, + finish = () => {} +) { const jobIds = jobs.map((j) => j.id); mlJobService .deleteJobs(jobIds, deleteUserAnnotations, deleteAlertingRules) .then((resp) => { - showResults(resp, JOB_STATE.DELETED); + showResults(toastNotifications, resp, JOB_STATE.DELETED); finish(); }) .catch((error) => { - getToastNotificationService().displayErrorToast( + toastNotificationServiceProvider(toastNotifications).displayErrorToast( error, i18n.translate('xpack.ml.jobsList.deleteJobErrorMessage', { defaultMessage: 'Jobs failed to delete', @@ -440,7 +458,7 @@ function jobTagFilter(jobs, value) { // check to see if a job has been stored in mlJobService.tempJobCloningObjects // if it has, return an object with the minimum properties needed for the // start datafeed modal. -export function checkForAutoStartDatafeed() { +export function checkForAutoStartDatafeed(mlJobService) { const job = mlJobService.tempJobCloningObjects.job; const datafeed = mlJobService.tempJobCloningObjects.datafeed; if (job !== undefined) { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts index 893b60046a85a..68ddfe1b83b44 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts @@ -11,10 +11,10 @@ import type { DataView } from '@kbn/data-views-plugin/common'; import type { Field, SplitField, AggFieldPair } from '@kbn/ml-anomaly-utils'; import type { RuntimeMappings } from '@kbn/ml-runtime-field-utils'; import type { IndicesOptions } from '../../../../../../common/types/anomaly_detection_jobs'; -import { ml } from '../../../../services/ml_api_service'; -import { mlResultsService } from '../../../../services/results_service'; +import { mlResultsServiceProvider } from '../../../../services/results_service'; import { getCategoryFields as getCategoryFieldsOrig } from './searches'; import { aggFieldPairsCanBeCharted } from '../job_creator/util/general'; +import type { MlApiServices } from '../../../../services/ml_api_service'; type DetectorIndex = number; export interface LineChartPoint { @@ -28,18 +28,29 @@ const eq = (newArgs: any[], lastArgs: any[]) => isEqual(newArgs, lastArgs); export class ChartLoader { protected _dataView: DataView; + protected _mlApiServices: MlApiServices; + private _timeFieldName: string = ''; private _query: object = {}; - private _newJobLineChart = memoizeOne(ml.jobs.newJobLineChart, eq); - private _newJobPopulationsChart = memoizeOne(ml.jobs.newJobPopulationsChart, eq); - private _getEventRateData = memoizeOne(mlResultsService.getEventRateData, eq); - private _getCategoryFields = memoizeOne(getCategoryFieldsOrig, eq); + private _newJobLineChart; + private _newJobPopulationsChart; + private _getEventRateData; + private _getCategoryFields; - constructor(indexPattern: DataView, query: object) { + constructor(mlApiServices: MlApiServices, indexPattern: DataView, query: object) { + this._mlApiServices = mlApiServices; this._dataView = indexPattern; this._query = query; + this._newJobLineChart = memoizeOne(mlApiServices.jobs.newJobLineChart, eq); + this._newJobPopulationsChart = memoizeOne(mlApiServices.jobs.newJobPopulationsChart, eq); + this._getEventRateData = memoizeOne( + mlResultsServiceProvider(mlApiServices).getEventRateData, + eq + ); + this._getCategoryFields = memoizeOne(getCategoryFieldsOrig, eq); + if (typeof indexPattern.timeFieldName === 'string') { this._timeFieldName = indexPattern.timeFieldName; } @@ -155,6 +166,7 @@ export class ChartLoader { indicesOptions?: IndicesOptions ): Promise { const { results } = await this._getCategoryFields( + this._mlApiServices, this._dataView.getIndexPattern(), field.name, 10, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/searches.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/searches.ts index 971cf9b5ca315..3c4ca1c5f54d7 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/searches.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/searches.ts @@ -8,7 +8,7 @@ import { get } from 'lodash'; import type { RuntimeMappings } from '@kbn/ml-runtime-field-utils'; -import { ml } from '../../../../services/ml_api_service'; +import type { MlApiServices } from '../../../../services/ml_api_service'; import type { IndicesOptions } from '../../../../../../common/types/anomaly_detection_jobs'; interface CategoryResults { @@ -17,6 +17,7 @@ interface CategoryResults { } export function getCategoryFields( + mlApiServices: MlApiServices, indexPatternName: string, fieldName: string, size: number, @@ -25,23 +26,24 @@ export function getCategoryFields( indicesOptions?: IndicesOptions ): Promise { return new Promise((resolve, reject) => { - ml.esSearch({ - index: indexPatternName, - size: 0, - body: { - query, - aggs: { - catFields: { - terms: { - field: fieldName, - size, + mlApiServices + .esSearch({ + index: indexPatternName, + size: 0, + body: { + query, + aggs: { + catFields: { + terms: { + field: fieldName, + size, + }, }, }, + ...(runtimeMappings !== undefined ? { runtime_mappings: runtimeMappings } : {}), }, - ...(runtimeMappings !== undefined ? { runtime_mappings: runtimeMappings } : {}), - }, - ...(indicesOptions ?? {}), - }) + ...(indicesOptions ?? {}), + }) .then((resp: any) => { const catFields = get(resp, ['aggregations', 'catFields', 'buckets'], []); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/advanced_job_creator.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/advanced_job_creator.ts index 150b57402ee5e..30a472348d587 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/advanced_job_creator.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/advanced_job_creator.ts @@ -10,6 +10,8 @@ import type { DataView } from '@kbn/data-views-plugin/public'; import type { Field, Aggregation, SplitField } from '@kbn/ml-anomaly-utils'; import type { SavedSearch } from '@kbn/saved-search-plugin/public'; +import type { MlJobService } from '../../../../services/job_service'; +import type { MlApiServices } from '../../../../services/ml_api_service'; import { JobCreator } from './job_creator'; import type { Job, @@ -21,6 +23,7 @@ import { createBasicDetector } from './util/default_configs'; import { CREATED_BY_LABEL, JOB_TYPE } from '../../../../../../common/constants/new_job'; import { getRichDetectors } from './util/general'; import { isValidJson } from '../../../../../../common/util/validation_utils'; +import type { NewJobCapsService } from '../../../../services/new_job_capabilities/new_job_capabilities_service'; export interface RichDetector { agg: Aggregation | null; @@ -39,8 +42,15 @@ export class AdvancedJobCreator extends JobCreator { private _richDetectors: RichDetector[] = []; private _queryString: string; - constructor(indexPattern: DataView, savedSearch: SavedSearch | null, query: object) { - super(indexPattern, savedSearch, query); + constructor( + mlApiServices: MlApiServices, + mlJobService: MlJobService, + newJobCapsService: NewJobCapsService, + indexPattern: DataView, + savedSearch: SavedSearch | null, + query: object + ) { + super(mlApiServices, mlJobService, newJobCapsService, indexPattern, savedSearch, query); this.createdBy = CREATED_BY_LABEL.ADVANCED; this._queryString = JSON.stringify(this._datafeed_config.query); @@ -184,7 +194,13 @@ export class AdvancedJobCreator extends JobCreator { public cloneFromExistingJob(job: Job, datafeed: Datafeed) { this._overrideConfigs(job, datafeed); this.createdBy = CREATED_BY_LABEL.ADVANCED; - const detectors = getRichDetectors(job, datafeed, this.additionalFields, true); + const detectors = getRichDetectors( + this.newJobCapsService, + job, + datafeed, + this.additionalFields, + true + ); // keep track of the custom rules for each detector const customRules = this._detectors.map((d) => d.custom_rules); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/categorization_job_creator.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/categorization_job_creator.ts index 7d074ca0576cb..a12266e556e73 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/categorization_job_creator.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/categorization_job_creator.ts @@ -34,6 +34,9 @@ import { DEFAULT_BUCKET_SPAN, DEFAULT_RARE_BUCKET_SPAN, } from '../../../../../../common/constants/new_job'; +import type { MlJobService } from '../../../../services/job_service'; +import type { MlApiServices } from '../../../../services/ml_api_service'; +import type { NewJobCapsService } from '../../../../services/new_job_capabilities/new_job_capabilities_service'; import { getRichDetectors } from './util/general'; import { CategorizationExamplesLoader } from '../results_loader'; @@ -61,8 +64,15 @@ export class CategorizationJobCreator extends JobCreator { private _partitionFieldName: string | null = null; private _ccsVersionFailure: boolean = false; - constructor(indexPattern: DataView, savedSearch: SavedSearch | null, query: object) { - super(indexPattern, savedSearch, query); + constructor( + mlApiServices: MlApiServices, + mlJobService: MlJobService, + newJobCapsService: NewJobCapsService, + indexPattern: DataView, + savedSearch: SavedSearch | null, + query: object + ) { + super(mlApiServices, mlJobService, newJobCapsService, indexPattern, savedSearch, query); this.createdBy = CREATED_BY_LABEL.CATEGORIZATION; this._examplesLoader = new CategorizationExamplesLoader(this, indexPattern, query); @@ -254,7 +264,13 @@ export class CategorizationJobCreator extends JobCreator { public cloneFromExistingJob(job: Job, datafeed: Datafeed) { this._overrideConfigs(job, datafeed); this.createdBy = CREATED_BY_LABEL.CATEGORIZATION; - const detectors = getRichDetectors(job, datafeed, this.additionalFields, false); + const detectors = getRichDetectors( + this.newJobCapsService, + job, + datafeed, + this.additionalFields, + false + ); const dtr = detectors[0]; if (dtr !== undefined && dtr.agg !== null && dtr.field !== null) { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/geo_job_creator.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/geo_job_creator.ts index 59e89070b38dd..76fda339afa44 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/geo_job_creator.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/geo_job_creator.ts @@ -8,6 +8,9 @@ import type { DataView } from '@kbn/data-views-plugin/public'; import type { Field, Aggregation, SplitField, AggFieldPair } from '@kbn/ml-anomaly-utils'; import type { SavedSearch } from '@kbn/saved-search-plugin/public'; +import type { MlJobService } from '../../../../services/job_service'; +import type { MlApiServices } from '../../../../services/ml_api_service'; +import type { NewJobCapsService } from '../../../../services/new_job_capabilities/new_job_capabilities_service'; import { JobCreator } from './job_creator'; import type { Job, @@ -27,8 +30,15 @@ export class GeoJobCreator extends JobCreator { protected _type: JOB_TYPE = JOB_TYPE.GEO; - constructor(indexPattern: DataView, savedSearch: SavedSearch | null, query: object) { - super(indexPattern, savedSearch, query); + constructor( + mlApiServices: MlApiServices, + mlJobService: MlJobService, + newJobCapsService: NewJobCapsService, + indexPattern: DataView, + savedSearch: SavedSearch | null, + query: object + ) { + super(mlApiServices, mlJobService, newJobCapsService, indexPattern, savedSearch, query); this.createdBy = CREATED_BY_LABEL.GEO; this._wizardInitialized$.next(true); } @@ -110,7 +120,13 @@ export class GeoJobCreator extends JobCreator { this._overrideConfigs(job, datafeed); this.createdBy = CREATED_BY_LABEL.GEO; this._sparseData = isSparseDataJob(job, datafeed); - const detectors = getRichDetectors(job, datafeed, this.additionalFields, false); + const detectors = getRichDetectors( + this.newJobCapsService, + job, + datafeed, + this.additionalFields, + false + ); this.removeSplitField(); this.removeAllDetectors(); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts index c7eda482aafad..82e5fe1209a13 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts @@ -22,6 +22,7 @@ import { import type { RuntimeMappings } from '@kbn/ml-runtime-field-utils'; import type { SavedSearch } from '@kbn/saved-search-plugin/public'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; +import type { MlApiServices } from '../../../../services/ml_api_service'; import type { IndexPatternTitle } from '../../../../../../common/types/kibana'; import { getQueryFromSavedSearchObject } from '../../../../util/index_utils'; import type { @@ -35,7 +36,7 @@ import type { } from '../../../../../../common/types/anomaly_detection_jobs'; import { combineFieldsAndAggs } from '../../../../../../common/util/fields_utils'; import { createEmptyJob, createEmptyDatafeed } from './util/default_configs'; -import { mlJobService } from '../../../../services/job_service'; +import type { MlJobService } from '../../../../services/job_service'; import { JobRunner, type ProgressSubscriber } from '../job_runner'; import type { CREATED_BY_LABEL } from '../../../../../../common/constants/new_job'; import { JOB_TYPE, SHARED_RESULTS_INDEX_NAME } from '../../../../../../common/constants/new_job'; @@ -46,7 +47,7 @@ import type { Calendar } from '../../../../../../common/types/calendars'; import { mlCalendarService } from '../../../../services/calendar_service'; import { getDatafeedAggregations } from '../../../../../../common/util/datafeed_utils'; import { getFirstKeyInObject } from '../../../../../../common/util/object_utils'; -import { ml } from '../../../../services/ml_api_service'; +import type { NewJobCapsService } from '../../../../services/new_job_capabilities/new_job_capabilities_service'; export class JobCreator { protected _type: JOB_TYPE = JOB_TYPE.SINGLE_METRIC; @@ -78,8 +79,21 @@ export class JobCreator { protected _wizardInitialized$ = new BehaviorSubject(false); public wizardInitialized$ = this._wizardInitialized$.asObservable(); - - constructor(indexPattern: DataView, savedSearch: SavedSearch | null, query: object) { + public mlApiServices: MlApiServices; + public mlJobService: MlJobService; + public newJobCapsService: NewJobCapsService; + + constructor( + mlApiServices: MlApiServices, + mlJobService: MlJobService, + newJobCapsService: NewJobCapsService, + indexPattern: DataView, + savedSearch: SavedSearch | null, + query: object + ) { + this.mlApiServices = mlApiServices; + this.mlJobService = mlJobService; + this.newJobCapsService = newJobCapsService; this._indexPattern = indexPattern; this._savedSearch = savedSearch; @@ -478,7 +492,7 @@ export class JobCreator { } for (const calendar of this._calendars) { - await mlCalendarService.assignNewJobId(calendar, this.jobId); + await mlCalendarService.assignNewJobId(this.mlApiServices, calendar, this.jobId); } } @@ -608,7 +622,7 @@ export class JobCreator { public async createJob(): Promise { try { - const { success, resp } = await mlJobService.saveNewJob(this._job_config); + const { success, resp } = await this.mlJobService.saveNewJob(this._job_config); await this._updateCalendars(); if (success === true) { @@ -624,7 +638,7 @@ export class JobCreator { public async createDatafeed(): Promise { try { const tempDatafeed = this._getDatafeedWithFilteredRuntimeMappings(); - return await mlJobService.saveNewDatafeed(tempDatafeed, this._job_config.job_id); + return await this.mlJobService.saveNewDatafeed(tempDatafeed, this._job_config.job_id); } catch (error) { throw error; } @@ -831,7 +845,7 @@ export class JobCreator { // load the start and end times for the selected index // and apply them to the job creator public async autoSetTimeRange(excludeFrozenData = true) { - const { start, end } = await ml.getTimeFieldRange({ + const { start, end } = await this.mlApiServices.getTimeFieldRange({ index: this._indexPatternTitle, timeFieldName: this.timeFieldName, query: excludeFrozenData ? addExcludeFrozenToQuery(this.query) : this.query, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator_factory.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator_factory.ts index 1c599bc99a117..9e5f9988b292f 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator_factory.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator_factory.ts @@ -7,6 +7,9 @@ import type { DataView } from '@kbn/data-views-plugin/public'; import type { SavedSearch } from '@kbn/saved-search-plugin/public'; +import type { MlJobService } from '../../../../services/job_service'; +import type { MlApiServices } from '../../../../services/ml_api_service'; +import type { NewJobCapsService } from '../../../../services/new_job_capabilities/new_job_capabilities_service'; import { SingleMetricJobCreator } from './single_metric_job_creator'; import { MultiMetricJobCreator } from './multi_metric_job_creator'; import { PopulationJobCreator } from './population_job_creator'; @@ -19,7 +22,14 @@ import { JOB_TYPE } from '../../../../../../common/constants/new_job'; export const jobCreatorFactory = (jobType: JOB_TYPE) => - (indexPattern: DataView, savedSearch: SavedSearch | null, query: object) => { + ( + mlApiServices: MlApiServices, + mlJobService: MlJobService, + newJobCapsService: NewJobCapsService, + indexPattern: DataView, + savedSearch: SavedSearch | null, + query: object + ) => { let jc; switch (jobType) { case JOB_TYPE.SINGLE_METRIC: @@ -47,5 +57,5 @@ export const jobCreatorFactory = jc = SingleMetricJobCreator; break; } - return new jc(indexPattern, savedSearch, query); + return new jc(mlApiServices, mlJobService, newJobCapsService, indexPattern, savedSearch, query); }; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/multi_metric_job_creator.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/multi_metric_job_creator.ts index 39ad966b595e7..69ca14a40c4e4 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/multi_metric_job_creator.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/multi_metric_job_creator.ts @@ -8,6 +8,9 @@ import type { DataView } from '@kbn/data-views-plugin/public'; import type { Field, Aggregation, SplitField, AggFieldPair } from '@kbn/ml-anomaly-utils'; import type { SavedSearch } from '@kbn/saved-search-plugin/public'; +import type { MlJobService } from '../../../../services/job_service'; +import type { MlApiServices } from '../../../../services/ml_api_service'; +import type { NewJobCapsService } from '../../../../services/new_job_capabilities/new_job_capabilities_service'; import { JobCreator } from './job_creator'; import type { Job, @@ -26,8 +29,15 @@ export class MultiMetricJobCreator extends JobCreator { protected _type: JOB_TYPE = JOB_TYPE.MULTI_METRIC; - constructor(indexPattern: DataView, savedSearch: SavedSearch | null, query: object) { - super(indexPattern, savedSearch, query); + constructor( + mlApiServices: MlApiServices, + mlJobService: MlJobService, + newJobCapsService: NewJobCapsService, + indexPattern: DataView, + savedSearch: SavedSearch | null, + query: object + ) { + super(mlApiServices, mlJobService, newJobCapsService, indexPattern, savedSearch, query); this.createdBy = CREATED_BY_LABEL.MULTI_METRIC; this._wizardInitialized$.next(true); } @@ -90,7 +100,13 @@ export class MultiMetricJobCreator extends JobCreator { this._overrideConfigs(job, datafeed); this.createdBy = CREATED_BY_LABEL.MULTI_METRIC; this._sparseData = isSparseDataJob(job, datafeed); - const detectors = getRichDetectors(job, datafeed, this.additionalFields, false); + const detectors = getRichDetectors( + this.newJobCapsService, + job, + datafeed, + this.additionalFields, + false + ); if (datafeed.aggregations !== undefined) { // if we've converting from a single metric job, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/population_job_creator.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/population_job_creator.ts index 08de5d30d11eb..342583636d37f 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/population_job_creator.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/population_job_creator.ts @@ -8,6 +8,9 @@ import type { DataView } from '@kbn/data-views-plugin/public'; import type { Field, Aggregation, SplitField, AggFieldPair } from '@kbn/ml-anomaly-utils'; import type { SavedSearch } from '@kbn/saved-search-plugin/public'; +import type { MlJobService } from '../../../../services/job_service'; +import type { MlApiServices } from '../../../../services/ml_api_service'; +import type { NewJobCapsService } from '../../../../services/new_job_capabilities/new_job_capabilities_service'; import { JobCreator } from './job_creator'; import type { Job, @@ -25,8 +28,15 @@ export class PopulationJobCreator extends JobCreator { private _byFields: SplitField[] = []; protected _type: JOB_TYPE = JOB_TYPE.POPULATION; - constructor(indexPattern: DataView, savedSearch: SavedSearch | null, query: object) { - super(indexPattern, savedSearch, query); + constructor( + mlApiServices: MlApiServices, + mlJobService: MlJobService, + newJobCapsService: NewJobCapsService, + indexPattern: DataView, + savedSearch: SavedSearch | null, + query: object + ) { + super(mlApiServices, mlJobService, newJobCapsService, indexPattern, savedSearch, query); this.createdBy = CREATED_BY_LABEL.POPULATION; this._wizardInitialized$.next(true); } @@ -132,7 +142,13 @@ export class PopulationJobCreator extends JobCreator { public cloneFromExistingJob(job: Job, datafeed: Datafeed) { this._overrideConfigs(job, datafeed); this.createdBy = CREATED_BY_LABEL.POPULATION; - const detectors = getRichDetectors(job, datafeed, this.additionalFields, false); + const detectors = getRichDetectors( + this.newJobCapsService, + job, + datafeed, + this.additionalFields, + false + ); this.removeAllDetectors(); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/rare_job_creator.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/rare_job_creator.ts index cc9601fc85634..aaaa7d101c09a 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/rare_job_creator.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/rare_job_creator.ts @@ -13,6 +13,9 @@ import { ML_JOB_AGGREGATION, } from '@kbn/ml-anomaly-utils'; import type { SavedSearch } from '@kbn/saved-search-plugin/public'; +import type { MlJobService } from '../../../../services/job_service'; +import type { MlApiServices } from '../../../../services/ml_api_service'; +import type { NewJobCapsService } from '../../../../services/new_job_capabilities/new_job_capabilities_service'; import { JobCreator } from './job_creator'; import type { Job, @@ -33,8 +36,15 @@ export class RareJobCreator extends JobCreator { private _rareAgg: Aggregation; private _freqRareAgg: Aggregation; - constructor(indexPattern: DataView, savedSearch: SavedSearch | null, query: object) { - super(indexPattern, savedSearch, query); + constructor( + mlApiServices: MlApiServices, + mlJobService: MlJobService, + newJobCapsService: NewJobCapsService, + indexPattern: DataView, + savedSearch: SavedSearch | null, + query: object + ) { + super(mlApiServices, mlJobService, newJobCapsService, indexPattern, savedSearch, query); this.createdBy = CREATED_BY_LABEL.RARE; this._wizardInitialized$.next(true); this._rareAgg = {} as Aggregation; @@ -154,7 +164,13 @@ export class RareJobCreator extends JobCreator { this._overrideConfigs(job, datafeed); this.createdBy = CREATED_BY_LABEL.RARE; this._sparseData = isSparseDataJob(job, datafeed); - const detectors = getRichDetectors(job, datafeed, this.additionalFields, false); + const detectors = getRichDetectors( + this.newJobCapsService, + job, + datafeed, + this.additionalFields, + false + ); this.removeSplitField(); this.removePopulationField(); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/single_metric_job_creator.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/single_metric_job_creator.ts index 07a949b6a34a3..2b7a1133c1d1f 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/single_metric_job_creator.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/single_metric_job_creator.ts @@ -15,6 +15,8 @@ import { ES_AGGREGATION, } from '@kbn/ml-anomaly-utils'; import type { SavedSearch } from '@kbn/saved-search-plugin/public'; +import type { MlJobService } from '../../../../services/job_service'; +import type { MlApiServices } from '../../../../services/ml_api_service'; import { parseInterval } from '../../../../../../common/util/parse_interval'; import { JobCreator } from './job_creator'; import type { @@ -27,12 +29,20 @@ import { createBasicDetector } from './util/default_configs'; import { JOB_TYPE, CREATED_BY_LABEL } from '../../../../../../common/constants/new_job'; import { getRichDetectors } from './util/general'; import { isSparseDataJob } from './util/general'; +import type { NewJobCapsService } from '../../../../services/new_job_capabilities/new_job_capabilities_service'; export class SingleMetricJobCreator extends JobCreator { protected _type: JOB_TYPE = JOB_TYPE.SINGLE_METRIC; - constructor(indexPattern: DataView, savedSearch: SavedSearch | null, query: object) { - super(indexPattern, savedSearch, query); + constructor( + mlApiServices: MlApiServices, + mlJobService: MlJobService, + newJobCapsService: NewJobCapsService, + indexPattern: DataView, + savedSearch: SavedSearch | null, + query: object + ) { + super(mlApiServices, mlJobService, newJobCapsService, indexPattern, savedSearch, query); this.createdBy = CREATED_BY_LABEL.SINGLE_METRIC; this._wizardInitialized$.next(true); } @@ -203,7 +213,13 @@ export class SingleMetricJobCreator extends JobCreator { this._overrideConfigs(job, datafeed); this.createdBy = CREATED_BY_LABEL.SINGLE_METRIC; this._sparseData = isSparseDataJob(job, datafeed); - const detectors = getRichDetectors(job, datafeed, this.additionalFields, false); + const detectors = getRichDetectors( + this.newJobCapsService, + job, + datafeed, + this.additionalFields, + false + ); this.removeAllDetectors(); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/general.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/general.ts index ca9a7f89b3cb9..f1cbd2dc87135 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/general.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/general.ts @@ -25,28 +25,30 @@ import type { Datafeed, Detector, } from '../../../../../../../common/types/anomaly_detection_jobs'; -import { newJobCapsService } from '../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import type { NewJobCapsService } from '../../../../../services/new_job_capabilities/new_job_capabilities_service'; import type { NavigateToPath } from '../../../../../contexts/kibana'; import { ML_PAGES } from '../../../../../../../common/constants/locator'; -import { mlJobService } from '../../../../../services/job_service'; +import type { MlJobService } from '../../../../../services/job_service'; import type { JobCreatorType } from '..'; import { CREATED_BY_LABEL, JOB_TYPE } from '../../../../../../../common/constants/new_job'; -const getFieldByIdFactory = (additionalFields: Field[]) => (id: string) => { - let field = newJobCapsService.getFieldById(id); - // if no field could be found it may be a pretend field, like mlcategory or a script field - if (field === null) { - if (id === MLCATEGORY) { - field = mlCategory; - } else if (additionalFields.length) { - field = additionalFields.find((f) => f.id === id) || null; +const getFieldByIdFactory = + (newJobCapsService: NewJobCapsService, additionalFields: Field[]) => (id: string) => { + let field = newJobCapsService.getFieldById(id); + // if no field could be found it may be a pretend field, like mlcategory or a script field + if (field === null) { + if (id === MLCATEGORY) { + field = mlCategory; + } else if (additionalFields.length) { + field = additionalFields.find((f) => f.id === id) || null; + } } - } - return field; -}; + return field; + }; // populate the detectors with Field and Agg objects loaded from the job capabilities service export function getRichDetectors( + newJobCapsService: NewJobCapsService, job: Job, datafeed: Datafeed, additionalFields: Field[], @@ -54,7 +56,7 @@ export function getRichDetectors( ) { const detectors = advanced ? getDetectorsAdvanced(job, datafeed) : getDetectors(job, datafeed); - const getFieldById = getFieldByIdFactory(additionalFields); + const getFieldById = getFieldByIdFactory(newJobCapsService, additionalFields); return detectors.map((d) => { let field = null; @@ -234,64 +236,54 @@ export function isSparseDataJob(job: Job, datafeed: Datafeed): boolean { return false; } -export function stashJobForCloning( - jobCreator: JobCreatorType, - skipTimeRangeStep: boolean = false, - includeTimeRange: boolean = false, - autoSetTimeRange: boolean = false -) { - mlJobService.tempJobCloningObjects.job = jobCreator.jobConfig; - mlJobService.tempJobCloningObjects.datafeed = jobCreator.datafeedConfig; - mlJobService.tempJobCloningObjects.createdBy = jobCreator.createdBy ?? undefined; - - // skip over the time picker step of the wizard - mlJobService.tempJobCloningObjects.skipTimeRangeStep = skipTimeRangeStep; - - if (includeTimeRange === true && autoSetTimeRange === false) { - // auto select the start and end dates of the time picker - mlJobService.tempJobCloningObjects.start = jobCreator.start; - mlJobService.tempJobCloningObjects.end = jobCreator.end; - } else if (autoSetTimeRange === true) { - mlJobService.tempJobCloningObjects.autoSetTimeRange = true; - } - - mlJobService.tempJobCloningObjects.calendars = jobCreator.calendars; -} - export function convertToMultiMetricJob( + mlJobService: MlJobService, jobCreator: JobCreatorType, navigateToPath: NavigateToPath ) { jobCreator.createdBy = CREATED_BY_LABEL.MULTI_METRIC; jobCreator.modelPlot = false; - stashJobForCloning(jobCreator, true, true); + mlJobService.stashJobForCloning(jobCreator, true, true); navigateToPath(ML_PAGES.ANOMALY_DETECTION_CREATE_JOB_CONVERT_TO_MULTI_METRIC, true); } -export function convertToAdvancedJob(jobCreator: JobCreatorType, navigateToPath: NavigateToPath) { +export function convertToAdvancedJob( + mlJobService: MlJobService, + jobCreator: JobCreatorType, + navigateToPath: NavigateToPath +) { jobCreator.createdBy = null; - stashJobForCloning(jobCreator, true, true); + mlJobService.stashJobForCloning(jobCreator, true, true); navigateToPath(ML_PAGES.ANOMALY_DETECTION_CREATE_JOB_CONVERT_TO_ADVANCED, true); } -export function resetAdvancedJob(jobCreator: JobCreatorType, navigateToPath: NavigateToPath) { +export function resetAdvancedJob( + mlJobService: MlJobService, + jobCreator: JobCreatorType, + navigateToPath: NavigateToPath +) { jobCreator.createdBy = null; - stashJobForCloning(jobCreator, true, false); + mlJobService.stashJobForCloning(jobCreator, true, false); navigateToPath(ML_PAGES.ANOMALY_DETECTION_CREATE_JOB); } -export function resetJob(jobCreator: JobCreatorType, navigateToPath: NavigateToPath) { +export function resetJob( + mlJobService: MlJobService, + jobCreator: JobCreatorType, + navigateToPath: NavigateToPath +) { jobCreator.jobId = ''; - stashJobForCloning(jobCreator, true, true); + mlJobService.stashJobForCloning(jobCreator, true, true); navigateToPath(ML_PAGES.ANOMALY_DETECTION_CREATE_JOB); } export function advancedStartDatafeed( + mlJobService: MlJobService, jobCreator: JobCreatorType | null, navigateToPath: NavigateToPath ) { if (jobCreator !== null) { - stashJobForCloning(jobCreator, false, false); + mlJobService.stashJobForCloning(jobCreator, false, false); } navigateToPath('/jobs'); } diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/model_memory_estimator.test.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/model_memory_estimator.test.ts index 44e2d3de6a0c8..f73c54653f93b 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/model_memory_estimator.test.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/model_memory_estimator.test.ts @@ -10,28 +10,17 @@ import { useFakeTimers } from 'sinon'; import type { CalculatePayload } from './model_memory_estimator'; import { modelMemoryEstimatorProvider } from './model_memory_estimator'; import type { JobValidator } from '../../job_validator'; -import { ml } from '../../../../../services/ml_api_service'; +import type { MlApiServices } from '../../../../../services/ml_api_service'; import type { JobCreator } from '../job_creator'; import { BehaviorSubject } from 'rxjs'; -jest.mock('../../../../../services/ml_api_service', () => { - return { - ml: { - calculateModelMemoryLimit$: jest.fn(() => { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const { of } = require('rxjs'); - return of({ modelMemoryLimit: '15MB' }); - }), - }, - }; -}); - describe('delay', () => { let clock: SinonFakeTimers; let modelMemoryEstimator: ReturnType; let mockJobCreator: JobCreator; let wizardInitialized$: BehaviorSubject; let mockJobValidator: JobValidator; + let mockMlApiServices: MlApiServices; beforeEach(() => { clock = useFakeTimers(); @@ -42,7 +31,19 @@ describe('delay', () => { mockJobCreator = { wizardInitialized$, } as unknown as JobCreator; - modelMemoryEstimator = modelMemoryEstimatorProvider(mockJobCreator, mockJobValidator); + mockMlApiServices = { + calculateModelMemoryLimit$: jest.fn(() => { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const { of } = require('rxjs'); + return of({ modelMemoryLimit: '15MB' }); + }), + } as unknown as MlApiServices; + + modelMemoryEstimator = modelMemoryEstimatorProvider( + mockJobCreator, + mockJobValidator, + mockMlApiServices + ); }); afterEach(() => { clock.restore(); @@ -56,7 +57,7 @@ describe('delay', () => { modelMemoryEstimator.update({ analysisConfig: { detectors: [{}] } } as CalculatePayload); clock.tick(601); - expect(ml.calculateModelMemoryLimit$).not.toHaveBeenCalled(); + expect(mockMlApiServices.calculateModelMemoryLimit$).not.toHaveBeenCalled(); expect(spy).not.toHaveBeenCalled(); }); @@ -97,7 +98,7 @@ describe('delay', () => { } as CalculatePayload); clock.tick(601); - expect(ml.calculateModelMemoryLimit$).toHaveBeenCalledTimes(1); + expect(mockMlApiServices.calculateModelMemoryLimit$).toHaveBeenCalledTimes(1); expect(spy).toHaveBeenCalledTimes(1); }); @@ -115,6 +116,6 @@ describe('delay', () => { mockJobValidator.isModelMemoryEstimationPayloadValid = false; clock.tick(601); - expect(ml.calculateModelMemoryLimit$).not.toHaveBeenCalled(); + expect(mockMlApiServices.calculateModelMemoryLimit$).not.toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/model_memory_estimator.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/model_memory_estimator.ts index 6bcd6adb53c81..b3550b039a862 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/model_memory_estimator.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/util/model_memory_estimator.ts @@ -26,19 +26,20 @@ import { i18n } from '@kbn/i18n'; import { type MLHttpFetchError, extractErrorMessage } from '@kbn/ml-error-utils'; import { DEFAULT_MODEL_MEMORY_LIMIT } from '../../../../../../../common/constants/new_job'; -import { ml } from '../../../../../services/ml_api_service'; import type { JobValidator } from '../../job_validator/job_validator'; import { VALIDATION_DELAY_MS } from '../../job_validator/job_validator'; import { useMlKibana } from '../../../../../contexts/kibana'; import type { JobCreator } from '../job_creator'; +import type { MlApiServices } from '../../../../../services/ml_api_service'; -export type CalculatePayload = Parameters[0]; +export type CalculatePayload = Parameters[0]; type ModelMemoryEstimator = ReturnType; export const modelMemoryEstimatorProvider = ( jobCreator: JobCreator, - jobValidator: JobValidator + jobValidator: JobValidator, + mlApiServices: MlApiServices ) => { const modelMemoryCheck$ = new Subject(); const error$ = new Subject(); @@ -64,7 +65,7 @@ export const modelMemoryEstimatorProvider = ( // don't call the endpoint with invalid payload filter(() => jobValidator.isModelMemoryEstimationPayloadValid), switchMap((payload) => { - return ml.calculateModelMemoryLimit$(payload).pipe( + return mlApiServices.calculateModelMemoryLimit$(payload).pipe( pluck('modelMemoryLimit'), catchError((error) => { // eslint-disable-next-line no-console @@ -90,13 +91,16 @@ export const useModelMemoryEstimator = ( jobCreatorUpdated: number ) => { const { - services: { notifications }, + services: { + notifications, + mlServices: { mlApiServices }, + }, } = useMlKibana(); // Initialize model memory estimator only once const modelMemoryEstimator = useMemo( - () => modelMemoryEstimatorProvider(jobCreator, jobValidator), - [jobCreator, jobValidator] + () => modelMemoryEstimatorProvider(jobCreator, jobValidator, mlApiServices), + [jobCreator, jobValidator, mlApiServices] ); // Listen for estimation results and errors diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_runner/job_runner.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_runner/job_runner.ts index 13d85419c2c6e..bd3d68afdc6d0 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_runner/job_runner.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_runner/job_runner.ts @@ -6,8 +6,8 @@ */ import { BehaviorSubject } from 'rxjs'; -import { ml } from '../../../../services/ml_api_service'; -import { mlJobService } from '../../../../services/job_service'; +import type { MlApiServices } from '../../../../services/ml_api_service'; +import type { MlJobService } from '../../../../services/job_service'; import type { JobCreator } from '../job_creator'; import type { DatafeedId, JobId } from '../../../../../../common/types/anomaly_detection_jobs'; import { DATAFEED_STATE } from '../../../../../../common/constants/states'; @@ -22,6 +22,8 @@ export type ProgressSubscriber = (progress: number) => void; export type JobAssignmentSubscriber = (assigned: boolean) => void; export class JobRunner { + private _mlApiServices: MlApiServices; + private _mlJobService: MlJobService; private _jobId: JobId; private _datafeedId: DatafeedId; private _start: number = 0; @@ -42,6 +44,8 @@ export class JobRunner { private _jobAssignedToNode$: BehaviorSubject; constructor(jobCreator: JobCreator) { + this._mlApiServices = jobCreator.mlApiServices; + this._mlJobService = jobCreator.mlJobService; this._jobId = jobCreator.jobId; this._datafeedId = jobCreator.datafeedId; this._start = jobCreator.start; @@ -68,7 +72,7 @@ export class JobRunner { private async openJob(): Promise { try { - const { node }: { node?: string } = await mlJobService.openJob(this._jobId); + const { node }: { node?: string } = await this._mlJobService.openJob(this._jobId); this._jobAssignedToNode = node !== undefined && node.length > 0; this._jobAssignedToNode$.next(this._jobAssignedToNode); } catch (error) { @@ -92,7 +96,7 @@ export class JobRunner { pollProgress === true ? this._subscribers.map((s) => this._progress$.subscribe(s)) : []; await this.openJob(); - const { started } = await mlJobService.startDatafeed( + const { started } = await this._mlJobService.startDatafeed( this._datafeedId, this._jobId, start, @@ -189,7 +193,7 @@ export class JobRunner { } private async _isJobAssigned(): Promise { - const { jobs } = await ml.getJobStats({ jobId: this._jobId }); + const { jobs } = await this._mlApiServices.getJobStats({ jobId: this._jobId }); return jobs.length > 0 && jobs[0].node !== undefined; } @@ -208,7 +212,7 @@ export class JobRunner { isRunning: boolean; isJobClosed: boolean; }> { - return await ml.jobs.getLookBackProgress(this._jobId, this._start, this._end); + return await this._mlApiServices.jobs.getLookBackProgress(this._jobId, this._start, this._end); } public subscribeToProgress(func: ProgressSubscriber) { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_validator/validators.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_validator/validators.ts index 61bf8487b09e6..0ec37e612a3fa 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/job_validator/validators.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/job_validator/validators.ts @@ -13,7 +13,6 @@ import type { CardinalityModelPlotHigh, CardinalityValidationResult, } from '../../../../services/ml_api_service'; -import { ml } from '../../../../services/ml_api_service'; import type { JobCreator } from '../job_creator'; import type { CombinedJob } from '../../../../../../common/types/anomaly_detection_jobs'; import type { BasicValidations } from './job_validator'; @@ -82,7 +81,7 @@ export function cardinalityValidator( }), switchMap(({ jobCreator }) => { // Perform a cardinality check only with enabled model plot. - return ml + return jobCreator.mlApiServices .validateCardinality$({ ...jobCreator.jobConfig, datafeed_config: jobCreator.datafeedConfig, @@ -114,12 +113,11 @@ export function cardinalityValidator( export function jobIdValidator(jobCreator$: Subject): Observable { return jobCreator$.pipe( - map((jobCreator) => { - return jobCreator.jobId; - }), // No need to perform an API call if the analysis configuration hasn't been changed - distinctUntilChanged((prevJobId, currJobId) => prevJobId === currJobId), - switchMap((jobId) => ml.jobs.jobsExist$([jobId], true)), + distinctUntilChanged( + (prevJobCreator, currJobCreator) => prevJobCreator.jobId === currJobCreator.jobId + ), + switchMap((jobCreator) => jobCreator.mlApiServices.jobs.jobsExist$([jobCreator.jobId], true)), map((jobExistsResults) => { const jobs = Object.values(jobExistsResults); const valid = jobs?.[0].exists === false; @@ -135,13 +133,13 @@ export function jobIdValidator(jobCreator$: Subject): Observable): Observable { return jobCreator$.pipe( - map((jobCreator) => jobCreator.groups), // No need to perform an API call if the analysis configuration hasn't been changed distinctUntilChanged( - (prevGroups, currGroups) => JSON.stringify(prevGroups) === JSON.stringify(currGroups) + (prevJobCreator, currJobCreator) => + JSON.stringify(prevJobCreator.groups) === JSON.stringify(currJobCreator.groups) ), - switchMap((groups) => { - return ml.jobs.jobsExist$(groups, true); + switchMap((jobCreator) => { + return jobCreator.mlApiServices.jobs.jobsExist$(jobCreator.groups, true); }), map((jobExistsResults) => { const groups = Object.values(jobExistsResults); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/map_loader/map_loader.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/map_loader/map_loader.ts index 242ce9d472495..a75152e93bd88 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/map_loader/map_loader.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/map_loader/map_loader.ts @@ -13,13 +13,20 @@ import type { CreateLayerDescriptorParams, MapsStartApi } from '@kbn/maps-plugin import type { Query } from '@kbn/es-query'; import type { Field, SplitField } from '@kbn/ml-anomaly-utils'; import { ChartLoader } from '../chart_loader'; +import type { MlApiServices } from '../../../../services/ml_api_service'; + const eq = (newArgs: any[], lastArgs: any[]) => isEqual(newArgs, lastArgs); export class MapLoader extends ChartLoader { private _getMapData; - constructor(indexPattern: DataView, query: object, mapsPlugin: MapsStartApi | undefined) { - super(indexPattern, query); + constructor( + mlApiServices: MlApiServices, + indexPattern: DataView, + query: object, + mapsPlugin: MapsStartApi | undefined + ) { + super(mlApiServices, indexPattern, query); this._getMapData = mapsPlugin ? memoizeOne(mapsPlugin.createLayerDescriptors.createESSearchSourceLayerDescriptor, eq) diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts index b95eb08a3725f..de24a7cff2995 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts @@ -10,7 +10,6 @@ import { CATEGORY_EXAMPLES_VALIDATION_STATUS } from '@kbn/ml-category-validator' import { NUMBER_OF_CATEGORY_EXAMPLES } from '../../../../../../common/constants/new_job'; import type { IndexPatternTitle } from '../../../../../../common/types/kibana'; import type { CategorizationJobCreator } from '../job_creator'; -import { ml } from '../../../../services/ml_api_service'; export class CategorizationExamplesLoader { private _jobCreator: CategorizationJobCreator; @@ -40,7 +39,7 @@ export class CategorizationExamplesLoader { }; } - const resp = await ml.jobs.categorizationFieldExamples( + const resp = await this._jobCreator.mlApiServices.jobs.categorizationFieldExamples( this._indexPatternTitle, this._query, NUMBER_OF_CATEGORY_EXAMPLES, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/results_loader.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/results_loader.ts index 23b16bbd32499..742d0b476ebac 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/results_loader.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/results_loader.ts @@ -15,7 +15,10 @@ import { parseInterval } from '../../../../../../common/util/parse_interval'; import { JOB_TYPE } from '../../../../../../common/constants/new_job'; import type { ModelPlotOutputResults } from '../../../../services/results_service'; -import { mlResultsService } from '../../../../services/results_service'; +import { + mlResultsServiceProvider, + type MlResultsService, +} from '../../../../services/results_service'; import type { JobCreatorType } from '../job_creator'; import { isMultiMetricJobCreator } from '../job_creator'; @@ -66,6 +69,7 @@ export class ResultsLoader { private _lastModelTimeStamp: number = 0; private _lastResultsTimeout: any = null; private _chartLoader: ChartLoader; + private _mlResultsService: MlResultsService; private _results: Results = { progress: 0, @@ -81,6 +85,7 @@ export class ResultsLoader { this._chartInterval = chartInterval; this._results$ = new BehaviorSubject(this._results); this._chartLoader = chartLoader; + this._mlResultsService = mlResultsServiceProvider(jobCreator.mlApiServices); jobCreator.subscribeToProgress(this.progressSubscriber); } @@ -162,7 +167,7 @@ export class ResultsLoader { return { [dtrIndex]: [emptyModelItem] }; } const resp = await lastValueFrom( - mlResultsService.getModelPlotOutput( + this._mlResultsService.getModelPlotOutput( this._jobCreator.jobId, dtrIndex, [], @@ -214,7 +219,7 @@ export class ResultsLoader { } private async _loadJobAnomalyData(dtrIndex: number): Promise> { - const resp = await mlResultsService.getScoresByBucket( + const resp = await this._mlResultsService.getScoresByBucket( [this._jobCreator.jobId], this._jobCreator.start, this._jobCreator.end, @@ -237,6 +242,7 @@ export class ResultsLoader { private async _loadDetectorsAnomalyData(): Promise> { const resp = await getScoresByRecord( + this._jobCreator.mlApiServices, this._jobCreator.jobId, this._jobCreator.start, this._jobCreator.end, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/searches.ts b/x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/searches.ts index fa72c2c3e10f4..738bb880bd700 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/searches.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/searches.ts @@ -8,7 +8,7 @@ import { get } from 'lodash'; import { escapeForElasticsearchQuery } from '../../../../util/string_utils'; -import { ml } from '../../../../services/ml_api_service'; +import type { MlApiServices } from '../../../../services/ml_api_service'; interface SplitFieldWithValue { name: string; @@ -30,6 +30,7 @@ interface ProcessedResults { // detector swimlane search export function getScoresByRecord( + mlApiServices: MlApiServices, jobId: string, earliestMs: number, latestMs: number, @@ -53,7 +54,7 @@ export function getScoresByRecord( jobIdFilterStr += `"${String(firstSplitField.value).replace(/\\/g, '\\\\')}"`; } - ml.results + mlApiServices.results .anomalySearch( { body: { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/job_from_dashboard/quick_create_job_base.ts b/x-pack/plugins/ml/public/application/jobs/new_job/job_from_dashboard/quick_create_job_base.ts index d6bfc450a4cfa..b685bb181f7c6 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/job_from_dashboard/quick_create_job_base.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/job_from_dashboard/quick_create_job_base.ts @@ -22,6 +22,7 @@ import { FilterStateStore } from '@kbn/es-query'; import type { ErrorType } from '@kbn/ml-error-utils'; import type { DataViewsContract } from '@kbn/data-views-plugin/public'; import type { MlApiServices } from '../../../services/ml_api_service'; +import type { MlJobService } from '../../../services/job_service'; import type { Job, Datafeed } from '../../../../../common/types/anomaly_detection_jobs'; import { getFiltersForDSLQuery } from '../../../../../common/util/job_utils'; import type { CREATED_BY_LABEL } from '../../../../../common/constants/new_job'; @@ -56,7 +57,8 @@ export class QuickJobCreatorBase { protected readonly kibanaConfig: IUiSettingsClient, protected readonly timeFilter: TimefilterContract, protected readonly dashboardService: DashboardStart, - protected readonly mlApiServices: MlApiServices + protected readonly mlApiServices: MlApiServices, + protected readonly mlJobService: MlJobService ) {} protected async putJobAndDataFeed({ diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/job_from_lens/quick_create_job.ts b/x-pack/plugins/ml/public/application/jobs/new_job/job_from_lens/quick_create_job.ts index 88ad820c059f2..3ce3289a424b8 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/job_from_lens/quick_create_job.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/job_from_lens/quick_create_job.ts @@ -19,8 +19,8 @@ import type { DashboardStart } from '@kbn/dashboard-plugin/public'; import type { LensApi } from '@kbn/lens-plugin/public'; import type { JobCreatorType } from '../common/job_creator'; import { createEmptyJob, createEmptyDatafeed } from '../common/job_creator/util/default_configs'; -import { stashJobForCloning } from '../common/job_creator/util/general'; import type { MlApiServices } from '../../../services/ml_api_service'; +import type { MlJobService } from '../../../services/job_service'; import { CREATED_BY_LABEL, DEFAULT_BUCKET_SPAN, @@ -42,9 +42,10 @@ export class QuickLensJobCreator extends QuickJobCreatorBase { kibanaConfig: IUiSettingsClient, timeFilter: TimefilterContract, dashboardService: DashboardStart, - mlApiServices: MlApiServices + mlApiServices: MlApiServices, + mlJobService: MlJobService ) { - super(dataViews, kibanaConfig, timeFilter, dashboardService, mlApiServices); + super(dataViews, kibanaConfig, timeFilter, dashboardService, mlApiServices, mlJobService); } public async createAndSaveJob( @@ -115,7 +116,7 @@ export class QuickLensJobCreator extends QuickJobCreatorBase { // add job config and start and end dates to the // job cloning stash, so they can be used // by the new job wizards - stashJobForCloning( + this.mlJobService.stashJobForCloning( { jobConfig, datafeedConfig, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/job_from_lens/route_resolver.ts b/x-pack/plugins/ml/public/application/jobs/new_job/job_from_lens/route_resolver.ts index d6a815777fa9d..dd6fb765e158b 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/job_from_lens/route_resolver.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/job_from_lens/route_resolver.ts @@ -15,6 +15,7 @@ import type { DashboardStart } from '@kbn/dashboard-plugin/public'; import type { DataViewsContract } from '@kbn/data-views-plugin/public'; import { QuickLensJobCreator } from './quick_create_job'; import type { MlApiServices } from '../../../services/ml_api_service'; +import type { MlJobService } from '../../../services/job_service'; import { getDefaultQuery, getRisonValue } from '../utils/new_job_utils'; @@ -25,6 +26,7 @@ interface Dependencies { timeFilter: TimefilterContract; dashboardService: DashboardStart; mlApiServices: MlApiServices; + mlJobService: MlJobService; } export async function resolver( deps: Dependencies, @@ -35,7 +37,15 @@ export async function resolver( filtersRisonString: string, layerIndexRisonString: string ) { - const { dataViews, lens, mlApiServices, timeFilter, kibanaConfig, dashboardService } = deps; + const { + dataViews, + lens, + mlApiServices, + mlJobService, + timeFilter, + kibanaConfig, + dashboardService, + } = deps; if (lensSavedObjectRisonString === undefined) { throw new Error('Cannot create visualization'); } @@ -57,7 +67,8 @@ export async function resolver( kibanaConfig, timeFilter, dashboardService, - mlApiServices + mlApiServices, + mlJobService ); await jobCreator.createAndStashADJob(vis, from, to, query, filters, layerIndex); } diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/job_from_map/quick_create_job.ts b/x-pack/plugins/ml/public/application/jobs/new_job/job_from_map/quick_create_job.ts index 82a22a854af02..0f14eaaf515fe 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/job_from_map/quick_create_job.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/job_from_map/quick_create_job.ts @@ -13,6 +13,7 @@ import type { DataView, DataViewsContract } from '@kbn/data-views-plugin/public' import type { DashboardStart } from '@kbn/dashboard-plugin/public'; import type { MapApi } from '@kbn/maps-plugin/public'; import type { MlApiServices } from '../../../services/ml_api_service'; +import type { MlJobService } from '../../../services/job_service'; import { CREATED_BY_LABEL, JOB_TYPE, @@ -20,7 +21,6 @@ import { } from '../../../../../common/constants/new_job'; import { createEmptyJob, createEmptyDatafeed } from '../common/job_creator/util/default_configs'; import type { JobCreatorType } from '../common/job_creator'; -import { stashJobForCloning } from '../common/job_creator/util/general'; import { getJobsItemsFromEmbeddable } from './utils'; import type { CreateState } from '../job_from_dashboard'; import { QuickJobCreatorBase } from '../job_from_dashboard'; @@ -43,9 +43,10 @@ export class QuickGeoJobCreator extends QuickJobCreatorBase { kibanaConfig: IUiSettingsClient, timeFilter: TimefilterContract, dashboardService: DashboardStart, - mlApiServices: MlApiServices + mlApiServices: MlApiServices, + mlJobService: MlJobService ) { - super(dataViews, kibanaConfig, timeFilter, dashboardService, mlApiServices); + super(dataViews, kibanaConfig, timeFilter, dashboardService, mlApiServices, mlJobService); } public async createAndSaveGeoJob({ @@ -144,7 +145,7 @@ export class QuickGeoJobCreator extends QuickJobCreatorBase { // add job config and start and end dates to the // job cloning stash, so they can be used // by the new job wizards - stashJobForCloning( + this.mlJobService.stashJobForCloning( { jobConfig, datafeedConfig, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/job_from_map/route_resolver.ts b/x-pack/plugins/ml/public/application/jobs/new_job/job_from_map/route_resolver.ts index c102f0ee6ddd9..455802fcc3f4a 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/job_from_map/route_resolver.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/job_from_map/route_resolver.ts @@ -10,6 +10,7 @@ import type { TimefilterContract } from '@kbn/data-plugin/public'; import type { DashboardStart } from '@kbn/dashboard-plugin/public'; import type { DataViewsContract } from '@kbn/data-views-plugin/public'; import type { MlApiServices } from '../../../services/ml_api_service'; +import type { MlJobService } from '../../../services/job_service'; import { QuickGeoJobCreator } from './quick_create_job'; import { getDefaultQuery, getRisonValue } from '../utils/new_job_utils'; @@ -20,6 +21,7 @@ interface Dependencies { timeFilter: TimefilterContract; dashboardService: DashboardStart; mlApiServices: MlApiServices; + mlJobService: MlJobService; } export async function resolver( deps: Dependencies, @@ -32,7 +34,8 @@ export async function resolver( toRisonString: string, layerRisonString?: string ) { - const { dataViews, kibanaConfig, timeFilter, dashboardService, mlApiServices } = deps; + const { dataViews, kibanaConfig, timeFilter, dashboardService, mlApiServices, mlJobService } = + deps; const defaultLayer = { query: getDefaultQuery(), filters: [] }; const dashboard = getRisonValue(dashboardRisonString, defaultLayer); @@ -55,7 +58,8 @@ export async function resolver( kibanaConfig, timeFilter, dashboardService, - mlApiServices + mlApiServices, + mlJobService ); await jobCreator.createAndStashGeoJob( diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/job_from_pattern_analysis/quick_create_job.ts b/x-pack/plugins/ml/public/application/jobs/new_job/job_from_pattern_analysis/quick_create_job.ts index 169ff6fdf5c89..0b81525f4013d 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/job_from_pattern_analysis/quick_create_job.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/job_from_pattern_analysis/quick_create_job.ts @@ -17,8 +17,8 @@ import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/type import { CREATED_BY_LABEL, DEFAULT_BUCKET_SPAN } from '../../../../../common/constants/new_job'; import { type CreateState, QuickJobCreatorBase } from '../job_from_dashboard/quick_create_job_base'; import type { MlApiServices } from '../../../services/ml_api_service'; +import type { MlJobService } from '../../../services/job_service'; import { createEmptyDatafeed, createEmptyJob } from '../common/job_creator/util/default_configs'; -import { stashJobForCloning } from '../common/job_creator/util/general'; import type { JobCreatorType } from '../common/job_creator'; export const CATEGORIZATION_TYPE = { @@ -36,9 +36,10 @@ export class QuickCategorizationJobCreator extends QuickJobCreatorBase { timeFilter: TimefilterContract, dashboardService: DashboardStart, private data: DataPublicPluginStart, - mlApiServices: MlApiServices + mlApiServices: MlApiServices, + mlJobService: MlJobService ) { - super(dataViews, kibanaConfig, timeFilter, dashboardService, mlApiServices); + super(dataViews, kibanaConfig, timeFilter, dashboardService, mlApiServices, mlJobService); } public async createAndSaveJob( @@ -118,7 +119,7 @@ export class QuickCategorizationJobCreator extends QuickJobCreatorBase { // add job config and start and end dates to the // job cloning stash, so they can be used // by the new job wizards - stashJobForCloning( + this.mlJobService.stashJobForCloning( { jobConfig, datafeedConfig, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/job_from_pattern_analysis/route_resolver.ts b/x-pack/plugins/ml/public/application/jobs/new_job/job_from_pattern_analysis/route_resolver.ts index 69ca29f9a5ab4..a2277babcc195 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/job_from_pattern_analysis/route_resolver.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/job_from_pattern_analysis/route_resolver.ts @@ -15,6 +15,7 @@ import { CATEGORIZATION_TYPE, } from './quick_create_job'; import type { MlApiServices } from '../../../services/ml_api_service'; +import type { MlJobService } from '../../../services/job_service'; import { getDefaultDatafeedQuery, getRisonValue } from '../utils/new_job_utils'; @@ -24,6 +25,7 @@ interface Dependencies { dashboardService: DashboardStart; data: DataPublicPluginStart; mlApiServices: MlApiServices; + mlJobService: MlJobService; } export async function resolver( deps: Dependencies, @@ -36,7 +38,7 @@ export async function resolver( toRisonString: string, queryRisonString: string ) { - const { mlApiServices, timeFilter, kibanaConfig, dashboardService, data } = deps; + const { mlApiServices, mlJobService, timeFilter, kibanaConfig, dashboardService, data } = deps; const query = getRisonValue(queryRisonString, getDefaultDatafeedQuery()); const from = getRisonValue(fromRisonString, ''); @@ -57,7 +59,8 @@ export async function resolver( timeFilter, dashboardService, data, - mlApiServices + mlApiServices, + mlJobService ); await jobCreator.createAndStashADJob( categorizationType, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/charts/common/settings.ts b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/charts/common/settings.ts index bea93b891466a..d521573f646ce 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/charts/common/settings.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/charts/common/settings.ts @@ -5,6 +5,7 @@ * 2.0. */ +import type { IUiSettingsClient } from '@kbn/core/public'; import type { TimeBuckets } from '@kbn/ml-time-buckets'; import { useCurrentThemeVars } from '../../../../../../contexts/kibana'; import type { JobCreatorType } from '../../../../common/job_creator'; @@ -57,7 +58,11 @@ export const seriesStyle = { }, }; -export function getChartSettings(jobCreator: JobCreatorType, chartInterval: TimeBuckets) { +export function getChartSettings( + uiSettings: IUiSettingsClient, + jobCreator: JobCreatorType, + chartInterval: TimeBuckets +) { const cs = { ...defaultChartSettings, intervalMs: chartInterval.getInterval().asMilliseconds(), @@ -68,7 +73,7 @@ export function getChartSettings(jobCreator: JobCreatorType, chartInterval: Time // the calculation from TimeBuckets, but without the // bar target and max bars which have been set for the // general chartInterval - const interval = getTimeBucketsFromCache(); + const interval = getTimeBucketsFromCache(uiSettings); interval.setInterval('auto'); interval.setBounds(chartInterval.getBounds()); cs.intervalMs = interval.getInterval().asMilliseconds(); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx index 9fe90643c2f84..cb6a636a8c296 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx @@ -27,6 +27,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { SavedObjectFinder } from '@kbn/saved-objects-finder-plugin/public'; import { extractErrorMessage } from '@kbn/ml-error-utils'; +import { useMlJobService } from '../../../../../../../services/job_service'; import { JobCreatorContext } from '../../../job_creator_context'; import type { AdvancedJobCreator } from '../../../../../common/job_creator'; import { resetAdvancedJob } from '../../../../../common/job_creator/util/general'; @@ -66,6 +67,7 @@ export const ChangeDataViewModal: FC = ({ onClose }) => { const { jobCreator: jc } = useContext(JobCreatorContext); const jobCreator = jc as AdvancedJobCreator; + const mlJobService = useMlJobService(); const [validating, setValidating] = useState(false); const [step, setStep] = useState(STEP.PICK_DATA_VIEW); @@ -123,7 +125,9 @@ export const ChangeDataViewModal: FC = ({ onClose }) => { const applyDataView = useCallback(() => { const newIndices = newDataViewTitle.split(','); jobCreator.indices = newIndices; - resetAdvancedJob(jobCreator, navigateToPath); + resetAdvancedJob(mlJobService, jobCreator, navigateToPath); + // exclude mlJobService from deps + // eslint-disable-next-line react-hooks/exhaustive-deps }, [jobCreator, newDataViewTitle, navigateToPath]); return ( diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/time_field/time_field.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/time_field/time_field.tsx index fec9b164c3e9d..bfbcbe76499de 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/time_field/time_field.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/time_field/time_field.tsx @@ -10,14 +10,14 @@ import React, { useContext, useEffect, useState } from 'react'; import { TimeFieldSelect } from './time_field_select'; import { JobCreatorContext } from '../../../job_creator_context'; -import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; import type { AdvancedJobCreator } from '../../../../../common/job_creator'; import { Description } from './description'; export const TimeField: FC = () => { const { jobCreator: jc, jobCreatorUpdate, jobCreatorUpdated } = useContext(JobCreatorContext); const jobCreator = jc as AdvancedJobCreator; - const { dateFields } = newJobCapsService; + const { dateFields } = useNewJobCapsService(); const [timeFieldName, setTimeFieldName] = useState(jobCreator.timeFieldName); useEffect(() => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/calendars/calendars_selection.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/calendars/calendars_selection.tsx index 3949339570242..bd3b52f5bb003 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/calendars/calendars_selection.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/calendars/calendars_selection.tsx @@ -22,10 +22,9 @@ import { import { i18n } from '@kbn/i18n'; import { JobCreatorContext } from '../../../../../job_creator_context'; import { Description } from './description'; -import { ml } from '../../../../../../../../../services/ml_api_service'; import { PLUGIN_ID } from '../../../../../../../../../../../common/constants/app'; import type { Calendar } from '../../../../../../../../../../../common/types/calendars'; -import { useMlKibana } from '../../../../../../../../../contexts/kibana'; +import { useMlApiContext, useMlKibana } from '../../../../../../../../../contexts/kibana'; import { GLOBAL_CALENDAR } from '../../../../../../../../../../../common/constants/calendars'; import { ML_PAGES } from '../../../../../../../../../../../common/constants/locator'; @@ -35,6 +34,7 @@ export const CalendarsSelection: FC = () => { application: { getUrlForApp }, }, } = useMlKibana(); + const ml = useMlApiContext(); const { jobCreator, jobCreatorUpdate } = useContext(JobCreatorContext); const [selectedCalendars, setSelectedCalendars] = useState(jobCreator.calendars); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_view/metric_selection.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_view/metric_selection.tsx index 925de492084fb..88e360f837de8 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_view/metric_selection.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_view/metric_selection.tsx @@ -11,7 +11,7 @@ import React, { Fragment, useContext, useState, useEffect } from 'react'; import type { Aggregation, Field } from '@kbn/ml-anomaly-utils'; import { JobCreatorContext } from '../../../job_creator_context'; import type { AdvancedJobCreator } from '../../../../../common/job_creator'; -import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; import { MetricSelector } from './metric_selector'; import type { RichDetector } from '../../../../../common/job_creator/advanced_job_creator'; import { DetectorList } from './detector_list'; @@ -37,7 +37,7 @@ export const AdvancedDetectors: FC = ({ setIsValid }) => { const { jobCreator: jc, jobCreatorUpdate, jobCreatorUpdated } = useContext(JobCreatorContext); const jobCreator = jc as AdvancedJobCreator; - const { fields, aggs } = newJobCapsService; + const { fields, aggs } = useNewJobCapsService(); const [modalPayload, setModalPayload] = useState(null); useEffect(() => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/estimate_bucket_span.ts b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/estimate_bucket_span.ts index 9caa4c89510a2..de279236d8755 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/estimate_bucket_span.ts +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/estimate_bucket_span.ts @@ -8,6 +8,7 @@ import { useContext, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { EVENT_RATE_FIELD_ID } from '@kbn/ml-anomaly-utils'; +import { useMlApiContext } from '../../../../../../../contexts/kibana'; import { JobCreatorContext } from '../../../job_creator_context'; import type { BucketSpanEstimatorData } from '../../../../../../../../../common/types/job_service'; import { @@ -16,9 +17,8 @@ import { isAdvancedJobCreator, isRareJobCreator, } from '../../../../../common/job_creator'; -import { ml } from '../../../../../../../services/ml_api_service'; import { useDataSource } from '../../../../../../../contexts/ml'; -import { getToastNotificationService } from '../../../../../../../services/toast_notification_service'; +import { useToastNotificationService } from '../../../../../../../services/toast_notification_service'; export enum ESTIMATE_STATUS { NOT_RUNNING, @@ -26,6 +26,8 @@ export enum ESTIMATE_STATUS { } export function useEstimateBucketSpan() { + const toastNotificationService = useToastNotificationService(); + const ml = useMlApiContext(); const { jobCreator, jobCreatorUpdate } = useContext(JobCreatorContext); const dataSourceContext = useDataSource(); @@ -85,7 +87,7 @@ export function useEstimateBucketSpan() { defaultMessage: 'Bucket span could not be estimated', } ); - getToastNotificationService().displayWarningToast({ title, text }); + toastNotificationService.displayWarningToast({ title, text }); } else { jobCreator.bucketSpan = name; jobCreatorUpdate(); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/by_field/by_field.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/by_field/by_field.tsx index 038a7433a54ee..f52bf8a5dbe3f 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/by_field/by_field.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/by_field/by_field.tsx @@ -13,7 +13,7 @@ import type { Field } from '@kbn/ml-anomaly-utils'; import { SplitFieldSelect } from '../split_field_select'; import { JobCreatorContext } from '../../../job_creator_context'; import { filterCategoryFields } from '../../../../../../../../../common/util/fields_utils'; -import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; import type { PopulationJobCreator } from '../../../../../common/job_creator'; interface Props { @@ -23,6 +23,7 @@ interface Props { export const ByFieldSelector: FC = ({ detectorIndex }) => { const { jobCreator: jc, jobCreatorUpdate, jobCreatorUpdated } = useContext(JobCreatorContext); const jobCreator = jc as PopulationJobCreator; + const newJobCapsService = useNewJobCapsService(); // eslint-disable-next-line react-hooks/exhaustive-deps const runtimeCategoryFields = useMemo(() => filterCategoryFields(jobCreator.runtimeFields), []); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_field/categorization_field.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_field/categorization_field.tsx index f6331d7e55e66..706249cb88b37 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_field/categorization_field.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_field/categorization_field.tsx @@ -10,7 +10,7 @@ import React, { useContext, useEffect, useState } from 'react'; import { CategorizationFieldSelect } from './categorization_field_select'; import { JobCreatorContext } from '../../../job_creator_context'; -import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; import type { AdvancedJobCreator, CategorizationJobCreator, @@ -21,7 +21,7 @@ import { Description } from './description'; export const CategorizationField: FC = () => { const { jobCreator: jc, jobCreatorUpdate, jobCreatorUpdated } = useContext(JobCreatorContext); const jobCreator = jc as AdvancedJobCreator | CategorizationJobCreator; - const { catFields } = newJobCapsService; + const { catFields } = useNewJobCapsService(); const [categorizationFieldName, setCategorizationFieldName] = useState( jobCreator.categorizationFieldName ); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition_dropdown.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition_dropdown.tsx index 3435472ef8548..96e3249ede655 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition_dropdown.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition_dropdown.tsx @@ -11,7 +11,7 @@ import { EuiFormRow } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { JobCreatorContext } from '../../../job_creator_context'; import type { CategorizationJobCreator } from '../../../../../common/job_creator'; -import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; import { CategorizationPerPartitionFieldSelect } from './categorization_per_partition_input'; export const CategorizationPerPartitionFieldDropdown = ({ @@ -25,7 +25,7 @@ export const CategorizationPerPartitionFieldDropdown = ({ const [categorizationPartitionFieldName, setCategorizationPartitionFieldName] = useState< string | null >(jobCreator.categorizationPerPartitionField); - const { categoryFields } = newJobCapsService; + const { categoryFields } = useNewJobCapsService(); const filteredCategories = useMemo( () => categoryFields.filter((c) => c.id !== jobCreator.categorizationFieldName), diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/category_stopped_partitions.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/category_stopped_partitions.tsx index 30c93bae2f440..912bc1af40e12 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/category_stopped_partitions.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/category_stopped_partitions.tsx @@ -13,12 +13,13 @@ import { i18n } from '@kbn/i18n'; import { from } from 'rxjs'; import { switchMap, takeWhile, tap } from 'rxjs'; import { extractErrorProperties } from '@kbn/ml-error-utils'; +import { useMlApiContext } from '../../../../../../../contexts/kibana'; import { JobCreatorContext } from '../../../job_creator_context'; import type { CategorizationJobCreator } from '../../../../../common/job_creator'; -import { ml } from '../../../../../../../services/ml_api_service'; const NUMBER_OF_PREVIEW = 5; export const CategoryStoppedPartitions: FC = () => { + const ml = useMlApiContext(); const { jobCreator: jc, resultsLoader } = useContext(JobCreatorContext); const jobCreator = jc as CategorizationJobCreator; const [tableRow, setTableRow] = useState>([]); @@ -62,6 +63,8 @@ export const CategoryStoppedPartitions: FC = () => { setStoppedPartitionsError(error.message); } } + // skipping the ml service from deps + // eslint-disable-next-line react-hooks/exhaustive-deps }, [jobCreator.jobId]); useEffect(() => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/metric_selection.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/metric_selection.tsx index 5d5532069005e..5f25c8c718303 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/metric_selection.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/metric_selection.tsx @@ -13,7 +13,7 @@ import { type CategoryFieldExample, type FieldExampleCheck, } from '@kbn/ml-category-validator'; -import { getToastNotificationService } from '../../../../../../../services/toast_notification_service'; +import { useToastNotificationService } from '../../../../../../../services/toast_notification_service'; import { JobCreatorContext } from '../../../job_creator_context'; import type { CategorizationJobCreator } from '../../../../../common/job_creator'; @@ -33,6 +33,7 @@ interface Props { export const CategorizationDetectors: FC = ({ setIsValid }) => { const { jobCreator: jc, jobCreatorUpdate, jobCreatorUpdated } = useContext(JobCreatorContext); const jobCreator = jc as CategorizationJobCreator; + const toastNotificationService = useToastNotificationService(); const [loadingData, setLoadingData] = useState(false); const [ccsVersionFailure, setCcsVersionFailure] = useState(false); @@ -102,7 +103,7 @@ export const CategorizationDetectors: FC = ({ setIsValid }) => { setFieldExamples(null); setValidationChecks([]); setOverallValidStatus(CATEGORY_EXAMPLES_VALIDATION_STATUS.INVALID); - getToastNotificationService().displayErrorToast(error); + toastNotificationService.displayErrorToast(error); setCcsVersionFailure(false); } } else { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/top_categories.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/top_categories.tsx index 2b86c166ef36a..1a9db2f5c67fb 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/top_categories.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/top_categories.tsx @@ -10,14 +10,16 @@ import React, { useContext, useEffect, useState } from 'react'; import { EuiBasicTable, EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { extractErrorProperties } from '@kbn/ml-error-utils'; +import { useMlApiContext } from '../../../../../../../contexts/kibana'; import { NUMBER_OF_CATEGORY_EXAMPLES } from '../../../../../../../../../common/constants/new_job'; import { JobCreatorContext } from '../../../job_creator_context'; import type { CategorizationJobCreator } from '../../../../../common/job_creator'; import type { Results } from '../../../../../common/results_loader'; -import { ml } from '../../../../../../../services/ml_api_service'; import { useToastNotificationService } from '../../../../../../../services/toast_notification_service'; export const TopCategories: FC = () => { + const ml = useMlApiContext(); + const { displayErrorToast } = useToastNotificationService(); const { jobCreator: jc, resultsLoader } = useContext(JobCreatorContext); const jobCreator = jc as CategorizationJobCreator; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/geo_field/geo_field.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/geo_field/geo_field.tsx index 307493585ae3a..be8767d010f4c 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/geo_field/geo_field.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/geo_field/geo_field.tsx @@ -10,14 +10,14 @@ import React, { useContext, useEffect, useState } from 'react'; import { GeoFieldSelect } from './geo_field_select'; import { JobCreatorContext } from '../../../job_creator_context'; -import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; import type { GeoJobCreator } from '../../../../../common/job_creator'; import { Description } from './description'; export const GeoField: FC = () => { const { jobCreator: jc, jobCreatorUpdate, jobCreatorUpdated } = useContext(JobCreatorContext); const jobCreator = jc as GeoJobCreator; - const { geoFields } = newJobCapsService; + const { geoFields } = useNewJobCapsService(); const [geoField, setGeoField] = useState(jobCreator.geoField); useEffect(() => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/influencers/influencers.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/influencers/influencers.tsx index 482870434a522..3026cd7484675 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/influencers/influencers.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/influencers/influencers.tsx @@ -10,7 +10,7 @@ import React, { useContext, useEffect, useState } from 'react'; import { InfluencersSelect } from './influencers_select'; import { JobCreatorContext } from '../../../job_creator_context'; -import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; import type { MultiMetricJobCreator, PopulationJobCreator, @@ -21,7 +21,7 @@ import { Description } from './description'; export const Influencers: FC = () => { const { jobCreator: jc, jobCreatorUpdate, jobCreatorUpdated } = useContext(JobCreatorContext); const jobCreator = jc as MultiMetricJobCreator | PopulationJobCreator | AdvancedJobCreator; - const { fields } = newJobCapsService; + const { fields } = useNewJobCapsService(); const [influencers, setInfluencers] = useState([...jobCreator.influencers]); useEffect(() => { diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/index.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/metric_selector/index.ts similarity index 80% rename from x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/index.tsx rename to x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/metric_selector/index.ts index 4297f7d35cd6c..a046f9c4ade2b 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/index.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/metric_selector/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export { ReferenceLinePanel } from './reference_line_panel'; +export { MetricSelector } from './metric_selector'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selector.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/metric_selector/metric_selector.tsx similarity index 97% rename from x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selector.tsx rename to x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/metric_selector/metric_selector.tsx index 450e6ea99ea9d..601d94065282a 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selector.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/metric_selector/metric_selector.tsx @@ -34,7 +34,7 @@ export const MetricSelector: FC = ({ diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/multi_metric_view/metric_selection.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/multi_metric_view/metric_selection.tsx index cc8801181db7e..b187447f8b81c 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/multi_metric_view/metric_selection.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/multi_metric_view/metric_selection.tsx @@ -8,22 +8,25 @@ import type { FC } from 'react'; import React, { Fragment, useContext, useEffect, useState, useMemo } from 'react'; import type { AggFieldPair } from '@kbn/ml-anomaly-utils'; + +import { useUiSettings } from '../../../../../../../contexts/kibana'; import { JobCreatorContext } from '../../../job_creator_context'; import type { MultiMetricJobCreator } from '../../../../../common/job_creator'; import type { LineChartData } from '../../../../../common/chart_loader'; import type { DropDownLabel, DropDownProps } from '../agg_select'; -import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; import { sortFields } from '../../../../../../../../../common/util/fields_utils'; import { getChartSettings, defaultChartSettings } from '../../../charts/common/settings'; -import { MetricSelector } from './metric_selector'; +import { MetricSelector } from '../metric_selector'; import { ChartGrid } from './chart_grid'; -import { getToastNotificationService } from '../../../../../../../services/toast_notification_service'; +import { useToastNotificationService } from '../../../../../../../services/toast_notification_service'; interface Props { setIsValid: (na: boolean) => void; } export const MultiMetricDetectors: FC = ({ setIsValid }) => { + const uiSettings = useUiSettings(); const { jobCreator: jc, jobCreatorUpdate, @@ -31,8 +34,9 @@ export const MultiMetricDetectors: FC = ({ setIsValid }) => { chartLoader, chartInterval, } = useContext(JobCreatorContext); - const jobCreator = jc as MultiMetricJobCreator; + const toastNotificationService = useToastNotificationService(); + const newJobCapsService = useNewJobCapsService(); const fields = useMemo( () => sortFields([...newJobCapsService.fields, ...jobCreator.runtimeFields]), @@ -121,7 +125,7 @@ export const MultiMetricDetectors: FC = ({ setIsValid }) => { ) .then(setFieldValues) .catch((error) => { - getToastNotificationService().displayErrorToast(error); + toastNotificationService.displayErrorToast(error); }); } else { setFieldValues([]); @@ -140,7 +144,7 @@ export const MultiMetricDetectors: FC = ({ setIsValid }) => { if (allDataReady()) { setLoadingData(true); try { - const cs = getChartSettings(jobCreator, chartInterval); + const cs = getChartSettings(uiSettings, jobCreator, chartInterval); setChartSettings(cs); const resp: LineChartData = await chartLoader.loadLineCharts( jobCreator.start, @@ -154,7 +158,7 @@ export const MultiMetricDetectors: FC = ({ setIsValid }) => { ); setLineChartsData(resp); } catch (error) { - getToastNotificationService().displayErrorToast(error); + toastNotificationService.displayErrorToast(error); setLineChartsData([]); } setLoadingData(false); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/multi_metric_view/metric_selection_summary.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/multi_metric_view/metric_selection_summary.tsx index 4c3e624757f90..281163ef0fa24 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/multi_metric_view/metric_selection_summary.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/multi_metric_view/metric_selection_summary.tsx @@ -8,23 +8,25 @@ import type { FC } from 'react'; import React, { Fragment, useContext, useEffect, useState } from 'react'; +import { useUiSettings } from '../../../../../../../contexts/kibana'; import { JobCreatorContext } from '../../../job_creator_context'; import type { MultiMetricJobCreator } from '../../../../../common/job_creator'; import type { Results, ModelItem, Anomaly } from '../../../../../common/results_loader'; import type { LineChartData } from '../../../../../common/chart_loader'; import { getChartSettings, defaultChartSettings } from '../../../charts/common/settings'; import { ChartGrid } from './chart_grid'; -import { getToastNotificationService } from '../../../../../../../services/toast_notification_service'; +import { useToastNotificationService } from '../../../../../../../services/toast_notification_service'; export const MultiMetricDetectorsSummary: FC = () => { + const uiSettings = useUiSettings(); const { jobCreator: jc, chartLoader, resultsLoader, chartInterval, } = useContext(JobCreatorContext); - const jobCreator = jc as MultiMetricJobCreator; + const toastNotificationService = useToastNotificationService(); const [lineChartsData, setLineChartsData] = useState({}); const [loadingData, setLoadingData] = useState(false); @@ -52,7 +54,7 @@ export const MultiMetricDetectorsSummary: FC = () => { ); setFieldValues(tempFieldValues); } catch (error) { - getToastNotificationService().displayErrorToast(error); + toastNotificationService.displayErrorToast(error); } } })(); @@ -60,6 +62,8 @@ export const MultiMetricDetectorsSummary: FC = () => { return () => { subscription.unsubscribe(); }; + // skip toastNotificationService from deps + // eslint-disable-next-line react-hooks/exhaustive-deps }, [chartLoader, resultsLoader, jobCreator]); useEffect(() => { @@ -73,7 +77,7 @@ export const MultiMetricDetectorsSummary: FC = () => { if (allDataReady()) { setLoadingData(true); try { - const cs = getChartSettings(jobCreator, chartInterval); + const cs = getChartSettings(uiSettings, jobCreator, chartInterval); setChartSettings(cs); const resp: LineChartData = await chartLoader.loadLineCharts( jobCreator.start, @@ -87,7 +91,7 @@ export const MultiMetricDetectorsSummary: FC = () => { ); setLineChartsData(resp); } catch (error) { - getToastNotificationService().displayErrorToast(error); + toastNotificationService.displayErrorToast(error); setLineChartsData({}); } setLoadingData(false); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/multi_metric_view/metric_selector.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/multi_metric_view/metric_selector.tsx deleted file mode 100644 index 8d193c38bdf11..0000000000000 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/multi_metric_view/metric_selector.tsx +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { FC } from 'react'; -import React from 'react'; -import { i18n } from '@kbn/i18n'; -import { EuiFormRow, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import type { Field, AggFieldPair } from '@kbn/ml-anomaly-utils'; -import type { DropDownLabel, DropDownProps } from '../agg_select'; -import { AggSelect } from '../agg_select'; - -interface Props { - fields: Field[]; - detectorChangeHandler: (options: DropDownLabel[]) => void; - selectedOptions: DropDownProps; - maxWidth?: number; - removeOptions: AggFieldPair[]; -} - -const MAX_WIDTH = 560; - -export const MetricSelector: FC = ({ - fields, - detectorChangeHandler, - selectedOptions, - maxWidth, - removeOptions, -}) => { - return ( - - - - - - - - ); -}; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_field/population_field.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_field/population_field.tsx index 4e19acb99914f..02b6130bb49e3 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_field/population_field.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_field/population_field.tsx @@ -12,7 +12,7 @@ import type { Field } from '@kbn/ml-anomaly-utils'; import { SplitFieldSelect } from '../split_field_select'; import { JobCreatorContext } from '../../../job_creator_context'; import { filterCategoryFields } from '../../../../../../../../../common/util/fields_utils'; -import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; import { Description } from './description'; import type { PopulationJobCreator, RareJobCreator } from '../../../../../common/job_creator'; import { isPopulationJobCreator } from '../../../../../common/job_creator'; @@ -20,6 +20,7 @@ import { isPopulationJobCreator } from '../../../../../common/job_creator'; export const PopulationFieldSelector: FC = () => { const { jobCreator: jc, jobCreatorUpdate, jobCreatorUpdated } = useContext(JobCreatorContext); const jobCreator = jc as PopulationJobCreator | RareJobCreator; + const newJobCapsService = useNewJobCapsService(); // eslint-disable-next-line react-hooks/exhaustive-deps const runtimeCategoryFields = useMemo(() => filterCategoryFields(jobCreator.runtimeFields), []); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selection.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selection.tsx index cca8f5af98342..81dd83b9e157c 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selection.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selection.tsx @@ -9,17 +9,19 @@ import type { FC } from 'react'; import React, { Fragment, useContext, useEffect, useState, useReducer, useMemo } from 'react'; import { EuiHorizontalRule } from '@elastic/eui'; import type { Field, AggFieldPair } from '@kbn/ml-anomaly-utils'; + +import { useUiSettings } from '../../../../../../../contexts/kibana'; import { JobCreatorContext } from '../../../job_creator_context'; import type { PopulationJobCreator } from '../../../../../common/job_creator'; import type { LineChartData } from '../../../../../common/chart_loader'; import type { DropDownLabel, DropDownProps } from '../agg_select'; -import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; import { sortFields } from '../../../../../../../../../common/util/fields_utils'; import { getChartSettings, defaultChartSettings } from '../../../charts/common/settings'; -import { MetricSelector } from './metric_selector'; +import { MetricSelector } from '../metric_selector'; import { PopulationFieldSelector } from '../population_field'; import { ChartGrid } from './chart_grid'; -import { getToastNotificationService } from '../../../../../../../services/toast_notification_service'; +import { useToastNotificationService } from '../../../../../../../services/toast_notification_service'; interface Props { setIsValid: (na: boolean) => void; @@ -28,6 +30,7 @@ interface Props { type DetectorFieldValues = Record; export const PopulationDetectors: FC = ({ setIsValid }) => { + const uiSettings = useUiSettings(); const { jobCreator: jc, jobCreatorUpdate, @@ -36,6 +39,8 @@ export const PopulationDetectors: FC = ({ setIsValid }) => { chartInterval, } = useContext(JobCreatorContext); const jobCreator = jc as PopulationJobCreator; + const toastNotificationService = useToastNotificationService(); + const newJobCapsService = useNewJobCapsService(); const fields = useMemo( () => sortFields([...newJobCapsService.fields, ...jobCreator.runtimeFields]), @@ -157,7 +162,7 @@ export const PopulationDetectors: FC = ({ setIsValid }) => { if (allDataReady()) { setLoadingData(true); try { - const cs = getChartSettings(jobCreator, chartInterval); + const cs = getChartSettings(uiSettings, jobCreator, chartInterval); setChartSettings(cs); const resp: LineChartData = await chartLoader.loadPopulationCharts( jobCreator.start, @@ -171,7 +176,7 @@ export const PopulationDetectors: FC = ({ setIsValid }) => { setLineChartsData(resp); } catch (error) { - getToastNotificationService().displayErrorToast(error); + toastNotificationService.displayErrorToast(error); setLineChartsData([]); } setLoadingData(false); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selection_summary.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selection_summary.tsx index 3b52b455208a0..907bbc48f2aab 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selection_summary.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selection_summary.tsx @@ -9,19 +9,21 @@ import type { FC } from 'react'; import React, { Fragment, useContext, useEffect, useState } from 'react'; import { EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; - import type { Field, AggFieldPair } from '@kbn/ml-anomaly-utils'; + +import { useUiSettings } from '../../../../../../../contexts/kibana'; import { JobCreatorContext } from '../../../job_creator_context'; import type { PopulationJobCreator } from '../../../../../common/job_creator'; import type { Results, ModelItem, Anomaly } from '../../../../../common/results_loader'; import type { LineChartData } from '../../../../../common/chart_loader'; import { getChartSettings, defaultChartSettings } from '../../../charts/common/settings'; import { ChartGrid } from './chart_grid'; -import { getToastNotificationService } from '../../../../../../../services/toast_notification_service'; +import { useToastNotificationService } from '../../../../../../../services/toast_notification_service'; type DetectorFieldValues = Record; export const PopulationDetectorsSummary: FC = () => { + const uiSettings = useUiSettings(); const { jobCreator: jc, chartLoader, @@ -29,6 +31,7 @@ export const PopulationDetectorsSummary: FC = () => { chartInterval, } = useContext(JobCreatorContext); const jobCreator = jc as PopulationJobCreator; + const toastNotificationService = useToastNotificationService(); const [aggFieldPairList, setAggFieldPairList] = useState( jobCreator.aggFieldPairs @@ -77,7 +80,7 @@ export const PopulationDetectorsSummary: FC = () => { if (allDataReady()) { setLoadingData(true); try { - const cs = getChartSettings(jobCreator, chartInterval); + const cs = getChartSettings(uiSettings, jobCreator, chartInterval); setChartSettings(cs); const resp: LineChartData = await chartLoader.loadPopulationCharts( jobCreator.start, @@ -91,7 +94,7 @@ export const PopulationDetectorsSummary: FC = () => { setLineChartsData(resp); } catch (error) { - getToastNotificationService().displayErrorToast(error); + toastNotificationService.displayErrorToast(error); setLineChartsData({}); } setLoadingData(false); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_field/rare_field.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_field/rare_field.tsx index ecb88faecfe33..31c70d0d9c22d 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_field/rare_field.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_field/rare_field.tsx @@ -12,13 +12,14 @@ import type { Field } from '@kbn/ml-anomaly-utils'; import { RareFieldSelect } from './rare_field_select'; import { JobCreatorContext } from '../../../job_creator_context'; import { filterCategoryFields } from '../../../../../../../../../common/util/fields_utils'; -import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; import { Description } from './description'; import type { RareJobCreator } from '../../../../../common/job_creator'; export const RareFieldSelector: FC = () => { const { jobCreator: jc, jobCreatorUpdate, jobCreatorUpdated } = useContext(JobCreatorContext); const jobCreator = jc as RareJobCreator; + const newJobCapsService = useNewJobCapsService(); // eslint-disable-next-line react-hooks/exhaustive-deps const runtimeCategoryFields = useMemo(() => filterCategoryFields(jobCreator.runtimeFields), []); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/metric_selection.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/metric_selection.tsx index 39cb00dd3b8c3..e37b1722e9bc2 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/metric_selection.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/metric_selection.tsx @@ -8,16 +8,18 @@ import type { FC } from 'react'; import React, { Fragment, useContext, useEffect, useState, useMemo } from 'react'; import type { AggFieldPair } from '@kbn/ml-anomaly-utils'; + +import { useUiSettings } from '../../../../../../../contexts/kibana'; import { JobCreatorContext } from '../../../job_creator_context'; import type { SingleMetricJobCreator } from '../../../../../common/job_creator'; import type { LineChartData } from '../../../../../common/chart_loader'; import type { DropDownLabel, DropDownProps } from '../agg_select'; import { AggSelect, createLabel } from '../agg_select'; -import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; import { sortFields } from '../../../../../../../../../common/util/fields_utils'; import { AnomalyChart, CHART_TYPE } from '../../../charts/anomaly_chart'; import { getChartSettings } from '../../../charts/common/settings'; -import { getToastNotificationService } from '../../../../../../../services/toast_notification_service'; +import { useToastNotificationService } from '../../../../../../../services/toast_notification_service'; interface Props { setIsValid: (na: boolean) => void; @@ -26,6 +28,7 @@ interface Props { const DTR_IDX = 0; export const SingleMetricDetectors: FC = ({ setIsValid }) => { + const uiSettings = useUiSettings(); const { jobCreator: jc, jobCreatorUpdate, @@ -34,6 +37,8 @@ export const SingleMetricDetectors: FC = ({ setIsValid }) => { chartInterval, } = useContext(JobCreatorContext); const jobCreator = jc as SingleMetricJobCreator; + const toastNotificationService = useToastNotificationService(); + const newJobCapsService = useNewJobCapsService(); const fields = useMemo( () => sortFields([...newJobCapsService.fields, ...jobCreator.runtimeFields]), @@ -90,7 +95,7 @@ export const SingleMetricDetectors: FC = ({ setIsValid }) => { if (aggFieldPair !== null) { setLoadingData(true); try { - const cs = getChartSettings(jobCreator, chartInterval); + const cs = getChartSettings(uiSettings, jobCreator, chartInterval); const resp: LineChartData = await chartLoader.loadLineCharts( jobCreator.start, jobCreator.end, @@ -105,7 +110,7 @@ export const SingleMetricDetectors: FC = ({ setIsValid }) => { setLineChartData(resp); } } catch (error) { - getToastNotificationService().displayErrorToast(error); + toastNotificationService.displayErrorToast(error); setLineChartData({}); } setLoadingData(false); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/metric_selection_summary.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/metric_selection_summary.tsx index eddc3d7f14886..bc65018cbffa8 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/metric_selection_summary.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/metric_selection_summary.tsx @@ -7,17 +7,19 @@ import type { FC } from 'react'; import React, { Fragment, useContext, useEffect, useState } from 'react'; +import { useUiSettings } from '../../../../../../../contexts/kibana'; import { JobCreatorContext } from '../../../job_creator_context'; import type { SingleMetricJobCreator } from '../../../../../common/job_creator'; import type { Results, ModelItem, Anomaly } from '../../../../../common/results_loader'; import type { LineChartData } from '../../../../../common/chart_loader'; import { AnomalyChart, CHART_TYPE } from '../../../charts/anomaly_chart'; import { getChartSettings } from '../../../charts/common/settings'; -import { getToastNotificationService } from '../../../../../../../services/toast_notification_service'; +import { useToastNotificationService } from '../../../../../../../services/toast_notification_service'; const DTR_IDX = 0; export const SingleMetricDetectorsSummary: FC = () => { + const uiSettings = useUiSettings(); const { jobCreator: jc, chartLoader, @@ -25,6 +27,7 @@ export const SingleMetricDetectorsSummary: FC = () => { chartInterval, } = useContext(JobCreatorContext); const jobCreator = jc as SingleMetricJobCreator; + const toastNotificationService = useToastNotificationService(); const [lineChartsData, setLineChartData] = useState({}); const [loadingData, setLoadingData] = useState(false); @@ -56,7 +59,7 @@ export const SingleMetricDetectorsSummary: FC = () => { if (jobCreator.aggFieldPair !== null) { setLoadingData(true); try { - const cs = getChartSettings(jobCreator, chartInterval); + const cs = getChartSettings(uiSettings, jobCreator, chartInterval); const resp: LineChartData = await chartLoader.loadLineCharts( jobCreator.start, jobCreator.end, @@ -71,7 +74,7 @@ export const SingleMetricDetectorsSummary: FC = () => { setLineChartData(resp); } } catch (error) { - getToastNotificationService().displayErrorToast(error); + toastNotificationService.displayErrorToast(error); setLineChartData({}); } setLoadingData(false); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/settings.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/settings.tsx index f8181709ad408..a68832ae3aea3 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/settings.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/settings.tsx @@ -10,6 +10,7 @@ import React, { Fragment, useContext } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty } from '@elastic/eui'; +import { useMlJobService } from '../../../../../../../services/job_service'; import { useNavigateToPath } from '../../../../../../../contexts/kibana'; import { convertToMultiMetricJob } from '../../../../../common/job_creator/util/general'; @@ -25,10 +26,11 @@ interface Props { export const SingleMetricSettings: FC = ({ setIsValid }) => { const { jobCreator } = useContext(JobCreatorContext); + const mlJobService = useMlJobService(); const navigateToPath = useNavigateToPath(); const convertToMultiMetric = () => { - convertToMultiMetricJob(jobCreator, navigateToPath); + convertToMultiMetricJob(mlJobService, jobCreator, navigateToPath); }; return ( diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/split_field/split_field.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/split_field/split_field.tsx index b096798538da2..d98ad4256844d 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/split_field/split_field.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/split_field/split_field.tsx @@ -12,7 +12,7 @@ import type { Field } from '@kbn/ml-anomaly-utils'; import { SplitFieldSelect } from '../split_field_select'; import { JobCreatorContext } from '../../../job_creator_context'; import { filterCategoryFields } from '../../../../../../../../../common/util/fields_utils'; -import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; import { Description } from './description'; import type { MultiMetricJobCreator, RareJobCreator } from '../../../../../common/job_creator'; import { isMultiMetricJobCreator } from '../../../../../common/job_creator'; @@ -20,6 +20,7 @@ import { isMultiMetricJobCreator } from '../../../../../common/job_creator'; export const SplitFieldSelector: FC = () => { const { jobCreator: jc, jobCreatorUpdate, jobCreatorUpdated } = useContext(JobCreatorContext); const jobCreator = jc as MultiMetricJobCreator | RareJobCreator; + const newJobCapsService = useNewJobCapsService(); // eslint-disable-next-line react-hooks/exhaustive-deps const runtimeCategoryFields = useMemo(() => filterCategoryFields(jobCreator.runtimeFields), []); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/summary_count_field/summary_count_field.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/summary_count_field/summary_count_field.tsx index 106a437ba9089..5f5465745a1c5 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/summary_count_field/summary_count_field.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/summary_count_field/summary_count_field.tsx @@ -10,7 +10,7 @@ import React, { useContext, useEffect, useState } from 'react'; import { SummaryCountFieldSelect } from './summary_count_field_select'; import { JobCreatorContext } from '../../../job_creator_context'; -import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; import type { MultiMetricJobCreator, PopulationJobCreator, @@ -28,7 +28,7 @@ export const SummaryCountField: FC = () => { } = useContext(JobCreatorContext); const jobCreator = jc as MultiMetricJobCreator | PopulationJobCreator | AdvancedJobCreator; - const { fields } = newJobCapsService; + const { fields } = useNewJobCapsService(); const [summaryCountFieldName, setSummaryCountFieldName] = useState( jobCreator.summaryCountFieldName ); diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/summary.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/summary.tsx index aabbb0b3aea63..446c16e50618d 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/summary.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/summary.tsx @@ -24,7 +24,7 @@ import type { StepProps } from '../step_types'; import { WIZARD_STEPS } from '../step_types'; import { JobCreatorContext } from '../job_creator_context'; import type { JobRunner } from '../../../common/job_runner'; -import { mlJobService } from '../../../../../services/job_service'; +import { useMlJobService } from '../../../../../services/job_service'; import { JsonEditorFlyout, EDITOR_MODE } from '../common/json_editor_flyout'; import { isSingleMetricJobCreator, isAdvancedJobCreator } from '../../../common/job_creator'; import { JobDetails } from './components/job_details'; @@ -49,6 +49,7 @@ export const SummaryStep: FC = ({ setCurrentStep, isCurrentStep }) => http: { basePath }, }, } = useMlKibana(); + const mlJobService = useMlJobService(); const navigateToPath = useNavigateToPath(); @@ -107,7 +108,7 @@ export const SummaryStep: FC = ({ setCurrentStep, isCurrentStep }) => try { await jobCreator.createJob(); await jobCreator.createDatafeed(); - advancedStartDatafeed(showStartModal ? jobCreator : null, navigateToPath); + advancedStartDatafeed(mlJobService, showStartModal ? jobCreator : null, navigateToPath); } catch (error) { handleJobCreationError(error); } @@ -135,11 +136,11 @@ export const SummaryStep: FC = ({ setCurrentStep, isCurrentStep }) => } function clickResetJob() { - resetJob(jobCreator, navigateToPath); + resetJob(mlJobService, jobCreator, navigateToPath); } const convertToAdvanced = () => { - convertToAdvancedJob(jobCreator, navigateToPath); + convertToAdvancedJob(mlJobService, jobCreator, navigateToPath); }; useEffect(() => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/validation_step/validation.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/validation_step/validation.tsx index ea2752c279a6c..4f92bfeee19c0 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/validation_step/validation.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/validation_step/validation.tsx @@ -11,7 +11,6 @@ import { WizardNav } from '../wizard_nav'; import type { StepProps } from '../step_types'; import { WIZARD_STEPS } from '../step_types'; import { JobCreatorContext } from '../job_creator_context'; -import { ml } from '../../../../../services/ml_api_service'; import { ValidateJob } from '../../../../../components/validate_job'; import { JOB_TYPE } from '../../../../../../../common/constants/new_job'; import { SkipValidationButton } from './skip_validatoin'; @@ -67,7 +66,6 @@ export const ValidationStep: FC = ({ setCurrentStep, isCurrentStep }) { const { services: { + chrome: { recentlyAccessed }, share, notifications: { toasts }, }, @@ -133,7 +134,12 @@ export const Page: FC = () => { { absolute: true } ); - addItemToRecentlyAccessed(ML_PAGES.DATA_VISUALIZER_INDEX_VIEWER, title, dataVisualizerLink); + addItemToRecentlyAccessed( + ML_PAGES.DATA_VISUALIZER_INDEX_VIEWER, + title, + dataVisualizerLink, + recentlyAccessed + ); navigateToPath(`/jobs/new_job/datavisualizer${getUrlParams()}`); }; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx index a5286d400513c..e4cc4dd88a4e2 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx @@ -33,10 +33,10 @@ import { MapLoader } from '../../common/map_loader'; import { ResultsLoader } from '../../common/results_loader'; import { JobValidator } from '../../common/job_validator'; import { useDataSource } from '../../../../contexts/ml'; -import { useMlKibana } from '../../../../contexts/kibana'; +import { useMlApiContext, useMlKibana } from '../../../../contexts/kibana'; import type { ExistingJobsAndGroups } from '../../../../services/job_service'; -import { mlJobService } from '../../../../services/job_service'; -import { newJobCapsService } from '../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useMlJobService } from '../../../../services/job_service'; +import { useNewJobCapsService } from '../../../../services/new_job_capabilities/new_job_capabilities_service'; import { getNewJobDefaults } from '../../../../services/ml_server_info'; import { useToastNotificationService } from '../../../../services/toast_notification_service'; import { MlPageHeader } from '../../../../components/page_header'; @@ -56,12 +56,18 @@ export const Page: FC = ({ existingJobsAndGroups, jobType }) => { const { services: { maps: mapsPlugin, uiSettings }, } = useMlKibana(); + const ml = useMlApiContext(); + const mlJobService = useMlJobService(); + const newJobCapsService = useNewJobCapsService(); const chartInterval = useTimeBuckets(uiSettings); const jobCreator = useMemo( () => jobCreatorFactory(jobType)( + ml, + mlJobService, + newJobCapsService, dataSourceContext.selectedDataView, dataSourceContext.selectedSavedSearch, dataSourceContext.combinedQuery @@ -202,13 +208,13 @@ export const Page: FC = ({ existingJobsAndGroups, jobType }) => { chartInterval.setInterval('auto'); const chartLoader = useMemo( - () => new ChartLoader(dataSourceContext.selectedDataView, jobCreator.query), - [dataSourceContext.selectedDataView, jobCreator.query] + () => new ChartLoader(ml, dataSourceContext.selectedDataView, jobCreator.query), + [ml, dataSourceContext.selectedDataView, jobCreator.query] ); const mapLoader = useMemo( - () => new MapLoader(dataSourceContext.selectedDataView, jobCreator.query, mapsPlugin), - [dataSourceContext.selectedDataView, jobCreator.query, mapsPlugin] + () => new MapLoader(ml, dataSourceContext.selectedDataView, jobCreator.query, mapsPlugin), + [ml, dataSourceContext.selectedDataView, jobCreator.query, mapsPlugin] ); const resultsLoader = useMemo( diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/wizard.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/wizard.tsx index 00950df1c3136..29a6166cd1ead 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/wizard.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/wizard.tsx @@ -20,7 +20,7 @@ import type { ChartLoader } from '../../common/chart_loader'; import type { MapLoader } from '../../common/map_loader'; import type { ResultsLoader } from '../../common/results_loader'; import type { JobValidator } from '../../common/job_validator'; -import { newJobCapsService } from '../../../../services/new_job_capabilities/new_job_capabilities_service'; +import { useNewJobCapsService } from '../../../../services/new_job_capabilities/new_job_capabilities_service'; import { WizardSteps } from './wizard_steps'; import { WizardHorizontalSteps } from './wizard_horizontal_steps'; import { JOB_TYPE } from '../../../../../../common/constants/new_job'; @@ -46,6 +46,7 @@ export const Wizard: FC = ({ existingJobsAndGroups, firstWizardStep = WIZARD_STEPS.TIME_RANGE, }) => { + const newJobCapsService = useNewJobCapsService(); const [jobCreatorUpdated, setJobCreatorUpdate] = useState(0); const jobCreatorUpdate = useCallback(() => { setJobCreatorUpdate((prev) => prev + 1); diff --git a/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx b/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx index 6c31aa8d043bf..7dbcbf5809ae2 100644 --- a/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx +++ b/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx @@ -80,8 +80,8 @@ export const JobsListPage: FC = ({ const [refreshJobs, setRefreshJobs] = useState<(() => void) | null>(null); const mlServices = useMemo( - () => getMlGlobalServices(coreStart.http, data.dataViews, usageCollection), - [coreStart.http, data.dataViews, usageCollection] + () => getMlGlobalServices(coreStart, data.dataViews, usageCollection), + [coreStart, data.dataViews, usageCollection] ); const check = async () => { diff --git a/x-pack/plugins/ml/public/application/ml_nodes_check/check_ml_nodes.ts b/x-pack/plugins/ml/public/application/ml_nodes_check/check_ml_nodes.ts index 2d96721204654..78afdd80fcc24 100644 --- a/x-pack/plugins/ml/public/application/ml_nodes_check/check_ml_nodes.ts +++ b/x-pack/plugins/ml/public/application/ml_nodes_check/check_ml_nodes.ts @@ -5,7 +5,6 @@ * 2.0. */ -import { ml } from '../services/ml_api_service'; import type { MlApiServices } from '../services/ml_api_service'; import type { MlNodeCount } from '../../../common/types/ml_server_info'; @@ -13,9 +12,9 @@ let mlNodeCount: number = 0; let lazyMlNodeCount: number = 0; let userHasPermissionToViewMlNodeCount: boolean = false; -export async function getMlNodeCount(mlApiServices?: MlApiServices): Promise { +export async function getMlNodeCount(mlApiServices: MlApiServices): Promise { try { - const nodes = await (mlApiServices ?? ml).mlNodeCount(); + const nodes = await mlApiServices.mlNodeCount(); mlNodeCount = nodes.count; lazyMlNodeCount = nodes.lazyNodeCount; userHasPermissionToViewMlNodeCount = true; diff --git a/x-pack/plugins/ml/public/application/overview/components/analytics_panel/analytics_panel.tsx b/x-pack/plugins/ml/public/application/overview/components/analytics_panel/analytics_panel.tsx index 902fbddc518c4..c94f594f548c5 100644 --- a/x-pack/plugins/ml/public/application/overview/components/analytics_panel/analytics_panel.tsx +++ b/x-pack/plugins/ml/public/application/overview/components/analytics_panel/analytics_panel.tsx @@ -20,7 +20,7 @@ import { import type { MlStorageKey, TMlStorageMapped } from '../../../../../common/types/storage'; import { ML_OVERVIEW_PANELS } from '../../../../../common/types/storage'; import { AnalyticsTable } from './table'; -import { getAnalyticsFactory } from '../../../data_frame_analytics/pages/analytics_management/services/analytics_service'; +import { useGetAnalytics } from '../../../data_frame_analytics/pages/analytics_management/services/analytics_service'; import type { DataFrameAnalyticsListRow } from '../../../data_frame_analytics/pages/analytics_management/components/analytics_list/common'; import { useMlLink } from '../../../contexts/kibana'; import { ML_PAGES } from '../../../../../common/constants/locator'; @@ -60,7 +60,7 @@ export const AnalyticsPanel: FC = ({ setLazyJobCount }) => { setAnalyticsStats(result); }, []); - const getAnalytics = getAnalyticsFactory( + const getAnalytics = useGetAnalytics( setAnalytics, setAnalyticsStatsCustom, setErrorMessage, diff --git a/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/anomaly_detection_panel.tsx b/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/anomaly_detection_panel.tsx index dba7581577058..c33681f69f76a 100644 --- a/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/anomaly_detection_panel.tsx +++ b/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/anomaly_detection_panel.tsx @@ -17,9 +17,8 @@ import { ML_OVERVIEW_PANELS } from '../../../../../common/types/storage'; import { ML_PAGES } from '../../../../../common/constants/locator'; import { OverviewStatsBar } from '../../../components/collapsible_panel/collapsible_panel'; import { CollapsiblePanel } from '../../../components/collapsible_panel'; -import { useMlKibana, useMlLink } from '../../../contexts/kibana'; +import { useMlApiContext, useMlKibana, useMlLink } from '../../../contexts/kibana'; import { AnomalyDetectionTable } from './table'; -import { ml } from '../../../services/ml_api_service'; import { getGroupsFromJobs, getStatsBarData } from './utils'; import type { Dictionary } from '../../../../../common/types/common'; import type { @@ -57,6 +56,7 @@ export const AnomalyDetectionPanel: FC = ({ anomalyTimelineService, setLa const { services: { charts: chartsService }, } = useMlKibana(); + const ml = useMlApiContext(); const { displayErrorToast } = useToastNotificationService(); const { showNodeInfo } = useEnabledFeatures(); diff --git a/x-pack/plugins/ml/public/application/routing/resolvers.ts b/x-pack/plugins/ml/public/application/routing/resolvers.ts index ed7b6af3a48da..e94f4e189f63c 100644 --- a/x-pack/plugins/ml/public/application/routing/resolvers.ts +++ b/x-pack/plugins/ml/public/application/routing/resolvers.ts @@ -7,9 +7,10 @@ import { getMlNodeCount } from '../ml_nodes_check/check_ml_nodes'; import { loadMlServerInfo } from '../services/ml_server_info'; +import type { MlApiServices } from '../services/ml_api_service'; export interface Resolvers { - [name: string]: () => Promise; + [name: string]: (mlApiServices: MlApiServices) => Promise; } export type ResolverResults = | { diff --git a/x-pack/plugins/ml/public/application/routing/routes/data_frame_analytics/analytics_job_creation.tsx b/x-pack/plugins/ml/public/application/routing/routes/data_frame_analytics/analytics_job_creation.tsx index 0fd239559a30d..ffbcb0b8564ae 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/data_frame_analytics/analytics_job_creation.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/data_frame_analytics/analytics_job_creation.tsx @@ -13,6 +13,7 @@ import { dynamic } from '@kbn/shared-ux-utility'; import { DataSourceContextProvider } from '../../../contexts/ml'; import { ML_PAGES } from '../../../../locator'; import type { NavigateToPath } from '../../../contexts/kibana'; +import { useMlApiContext } from '../../../contexts/kibana'; import { useMlKibana } from '../../../contexts/kibana'; import type { MlRoute, PageProps } from '../../router'; import { createPath, PageLoader } from '../../router'; @@ -57,6 +58,7 @@ const PageWrapper: FC = ({ location }) => { savedSearch: savedSearchService, }, } = useMlKibana(); + const mlApiServices = useMlApiContext(); const { context } = useRouteResolver( 'full', @@ -67,6 +69,7 @@ const PageWrapper: FC = ({ location }) => { loadNewJobCapabilities( index, savedSearchId, + mlApiServices, dataViewsService, savedSearchService, DATA_FRAME_ANALYTICS diff --git a/x-pack/plugins/ml/public/application/routing/routes/explorer/explorer.tsx b/x-pack/plugins/ml/public/application/routing/routes/explorer/explorer.tsx index a96e5b7c4e736..04cd415527ace 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/explorer/explorer.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/explorer/explorer.tsx @@ -19,7 +19,7 @@ import { useMlKibana } from '../../../contexts/kibana'; import type { MlRoute, PageProps } from '../../router'; import { createPath, PageLoader } from '../../router'; import { useRouteResolver } from '../../use_resolver'; -import { mlJobService } from '../../../services/job_service'; +import { useMlJobService } from '../../../services/job_service'; import { getDateFormatTz } from '../../../explorer/explorer_utils'; import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs'; import { MlAnnotationUpdatesContext } from '../../../contexts/ml/ml_annotation_updates_context'; @@ -57,13 +57,15 @@ const PageWrapper: FC = () => { const { services: { mlServices: { mlApiServices }, + uiSettings, }, } = useMlKibana(); + const mlJobService = useMlJobService(); const { context, results } = useRouteResolver('full', ['canGetJobs'], { ...basicResolvers(), jobs: mlJobService.loadJobsWrapper, - jobsWithTimeRange: () => mlApiServices.jobs.jobsWithTimerange(getDateFormatTz()), + jobsWithTimeRange: () => mlApiServices.jobs.jobsWithTimerange(getDateFormatTz(uiSettings)), }); const annotationUpdatesService = useMemo(() => new AnnotationUpdatesService(), []); diff --git a/x-pack/plugins/ml/public/application/routing/routes/explorer/state_manager.tsx b/x-pack/plugins/ml/public/application/routing/routes/explorer/state_manager.tsx index 1c32c29804711..1aa59116be935 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/explorer/state_manager.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/explorer/state_manager.tsx @@ -21,7 +21,6 @@ import { useMlKibana } from '../../../contexts/kibana'; import type { MlJobWithTimeRange } from '../../../../../common/types/anomaly_detection_jobs'; import { useRefresh } from '../../use_refresh'; import { Explorer } from '../../../explorer'; -import { ml } from '../../../services/ml_api_service'; import { useExplorerData } from '../../../explorer/actions'; import { useJobSelection } from '../../../components/job_selector/use_job_selection'; import { useTableInterval } from '../../../components/controls/select_interval'; @@ -40,8 +39,9 @@ export const ExplorerUrlStateManager: FC = ({ jobsWithTimeRange, }) => { const { - services: { cases, presentationUtil, uiSettings }, + services: { cases, presentationUtil, uiSettings, mlServices }, } = useMlKibana(); + const { mlApiServices: ml } = mlServices; const [globalState] = useUrlState('_g'); const [stoppedPartitions, setStoppedPartitions] = useState(); @@ -94,6 +94,7 @@ export const ExplorerUrlStateManager: FC = ({ // eslint-disable-next-line no-console console.error(error); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect( diff --git a/x-pack/plugins/ml/public/application/routing/routes/new_job/from_lens.tsx b/x-pack/plugins/ml/public/application/routing/routes/new_job/from_lens.tsx index 0602332d33380..210198b54afbb 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/new_job/from_lens.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/new_job/from_lens.tsx @@ -15,6 +15,7 @@ import type { MlRoute, PageProps } from '../../router'; import { createPath, PageLoader } from '../../router'; import { useRouteResolver } from '../../use_resolver'; import { resolver } from '../../../jobs/new_job/job_from_lens'; +import { useMlJobService } from '../../../services/job_service'; export const fromLensRouteFactory = (): MlRoute => ({ path: createPath(ML_PAGES.ANOMALY_DETECTION_CREATE_JOB_FROM_LENS), @@ -43,11 +44,20 @@ const PageWrapper: FC = ({ location }) => { lens, }, } = useMlKibana(); + const mlJobService = useMlJobService(); const { context } = useRouteResolver('full', ['canCreateJob'], { redirect: () => resolver( - { dataViews, lens, mlApiServices, timeFilter, kibanaConfig, dashboardService }, + { + dataViews, + lens, + mlApiServices, + mlJobService, + timeFilter, + kibanaConfig, + dashboardService, + }, vis, from, to, diff --git a/x-pack/plugins/ml/public/application/routing/routes/new_job/from_map.tsx b/x-pack/plugins/ml/public/application/routing/routes/new_job/from_map.tsx index ff30edf35e84a..0ba538ec24348 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/new_job/from_map.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/new_job/from_map.tsx @@ -15,6 +15,7 @@ import type { MlRoute, PageProps } from '../../router'; import { createPath, PageLoader } from '../../router'; import { useRouteResolver } from '../../use_resolver'; import { resolver } from '../../../jobs/new_job/job_from_map'; +import { useMlJobService } from '../../../services/job_service'; export const fromMapRouteFactory = (): MlRoute => ({ path: createPath(ML_PAGES.ANOMALY_DETECTION_CREATE_JOB_FROM_MAP), @@ -49,11 +50,12 @@ const PageWrapper: FC = ({ location }) => { mlServices: { mlApiServices }, }, } = useMlKibana(); + const mlJobService = useMlJobService(); const { context } = useRouteResolver('full', ['canCreateJob'], { redirect: () => resolver( - { dataViews, mlApiServices, timeFilter, kibanaConfig, dashboardService }, + { dataViews, mlApiServices, mlJobService, timeFilter, kibanaConfig, dashboardService }, dashboard, dataViewId, embeddable, diff --git a/x-pack/plugins/ml/public/application/routing/routes/new_job/from_pattern_analysis.tsx b/x-pack/plugins/ml/public/application/routing/routes/new_job/from_pattern_analysis.tsx index bf1327abe1770..e6bc8f046a97b 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/new_job/from_pattern_analysis.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/new_job/from_pattern_analysis.tsx @@ -15,6 +15,7 @@ import type { MlRoute, PageProps } from '../../router'; import { createPath, PageLoader } from '../../router'; import { useRouteResolver } from '../../use_resolver'; import { resolver } from '../../../jobs/new_job/job_from_pattern_analysis'; +import { useMlJobService } from '../../../services/job_service'; export const fromPatternAnalysisRouteFactory = (): MlRoute => ({ path: createPath(ML_PAGES.ANOMALY_DETECTION_CREATE_JOB_FROM_PATTERN_ANALYSIS), @@ -43,12 +44,14 @@ const PageWrapper: FC = ({ location }) => { mlServices: { mlApiServices }, }, } = useMlKibana(); + const mlJobService = useMlJobService(); const { context } = useRouteResolver('full', ['canCreateJob'], { redirect: () => resolver( { mlApiServices, + mlJobService, timeFilter: data.query.timefilter.timefilter, kibanaConfig, dashboardService, diff --git a/x-pack/plugins/ml/public/application/routing/routes/new_job/index_or_search.tsx b/x-pack/plugins/ml/public/application/routing/routes/new_job/index_or_search.tsx index d08ab910fdb26..8cc537990b192 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/new_job/index_or_search.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/new_job/index_or_search.tsx @@ -21,6 +21,7 @@ import { basicResolvers } from '../../resolvers'; import { preConfiguredJobRedirect } from '../../../jobs/new_job/pages/index_or_search'; import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs'; import { NavigateToPageButton } from '../../components/navigate_to_page_button'; +import { useMlJobService } from '../../../services/job_service'; enum MODE { NEW_JOB, @@ -218,11 +219,12 @@ const PageWrapper: FC = ({ nextStepPath, mode, extraButt data: { dataViews: dataViewsService }, }, } = useMlKibana(); + const mlJobService = useMlJobService(); const newJobResolvers = { ...basicResolvers(), preConfiguredJobRedirect: () => - preConfiguredJobRedirect(dataViewsService, basePath.get(), navigateToUrl), + preConfiguredJobRedirect(mlJobService, dataViewsService, basePath.get(), navigateToUrl), }; const { context } = useRouteResolver( diff --git a/x-pack/plugins/ml/public/application/routing/routes/new_job/recognize.tsx b/x-pack/plugins/ml/public/application/routing/routes/new_job/recognize.tsx index fc954a44c1377..0a6166c3ff3b0 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/new_job/recognize.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/new_job/recognize.tsx @@ -13,7 +13,7 @@ import { dynamic } from '@kbn/shared-ux-utility'; import { basicResolvers } from '../../resolvers'; import { ML_PAGES } from '../../../../locator'; import type { NavigateToPath } from '../../../contexts/kibana'; -import { useMlKibana, useNavigateToPath } from '../../../contexts/kibana'; +import { useMlApiContext, useMlKibana, useNavigateToPath } from '../../../contexts/kibana'; import type { MlRoute, PageProps } from '../../router'; import { createPath, PageLoader } from '../../router'; import { useRouteResolver } from '../../use_resolver'; @@ -21,6 +21,7 @@ import { mlJobServiceFactory } from '../../../services/job_service'; import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs'; import { useCreateADLinks } from '../../../components/custom_hooks/use_create_ad_links'; import { DataSourceContextProvider } from '../../../contexts/ml'; +import { useToastNotificationService } from '../../../services/toast_notification_service'; const Page = dynamic(async () => ({ default: (await import('../../../jobs/new_job/recognize')).Page, @@ -54,15 +55,13 @@ export const checkViewOrCreateRouteFactory = (): MlRoute => ({ const PageWrapper: FC = ({ location }) => { const { id } = parse(location.search, { sort: false }); - const { - services: { - mlServices: { mlApiServices }, - }, - } = useMlKibana(); + const mlApiServices = useMlApiContext(); + const toastNotificationService = useToastNotificationService(); const { context, results } = useRouteResolver('full', ['canGetJobs'], { ...basicResolvers(), - existingJobsAndGroups: () => mlJobServiceFactory(undefined, mlApiServices).getJobAndGroupIds(), + existingJobsAndGroups: () => + mlJobServiceFactory(toastNotificationService, mlApiServices).getJobAndGroupIds(), }); return ( diff --git a/x-pack/plugins/ml/public/application/routing/routes/new_job/wizard.tsx b/x-pack/plugins/ml/public/application/routing/routes/new_job/wizard.tsx index 7955e8cb7dc9d..66ef374b4879e 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/new_job/wizard.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/new_job/wizard.tsx @@ -20,6 +20,7 @@ import { createPath, PageLoader } from '../../router'; import { useRouteResolver } from '../../use_resolver'; import { JOB_TYPE } from '../../../../../common/constants/new_job'; import { mlJobServiceFactory } from '../../../services/job_service'; +import { useToastNotificationService } from '../../../services/toast_notification_service'; import { loadNewJobCapabilities, ANOMALY_DETECTOR, @@ -209,20 +210,24 @@ const PageWrapper: FC = ({ location, jobType }) => { mlServices: { mlApiServices }, }, } = useMlKibana(); + const toastNotificationService = useToastNotificationService(); const { context, results } = useRouteResolver('full', ['canGetJobs', 'canCreateJob'], { ...basicResolvers(), // TODO useRouteResolver should be responsible for the redirect - privileges: () => checkCreateJobsCapabilitiesResolver(redirectToJobsManagementPage), + privileges: () => + checkCreateJobsCapabilitiesResolver(mlApiServices, redirectToJobsManagementPage), jobCaps: () => loadNewJobCapabilities( index, savedSearchId, + mlApiServices, dataViewsService, savedSearchService, ANOMALY_DETECTOR ), - existingJobsAndGroups: () => mlJobServiceFactory(undefined, mlApiServices).getJobAndGroupIds(), + existingJobsAndGroups: () => + mlJobServiceFactory(toastNotificationService, mlApiServices).getJobAndGroupIds(), }); return ( diff --git a/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer/state_manager.tsx b/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer/state_manager.tsx index 5b74ef608c110..fa1753a4342fc 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer/state_manager.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer/state_manager.tsx @@ -15,11 +15,11 @@ import { useTimefilter } from '@kbn/ml-date-picker'; import type { IUiSettingsClient } from '@kbn/core/public'; import type { TimeRangeBounds } from '@kbn/ml-time-buckets'; import { getViewableDetectors } from '../../../timeseriesexplorer/timeseriesexplorer_utils/get_viewable_detectors'; -import { useMlKibana, useNotifications } from '../../../contexts/kibana'; +import { useNotifications } from '../../../contexts/kibana'; import type { MlJobWithTimeRange } from '../../../../../common/types/anomaly_detection_jobs'; import { isTimeSeriesViewJob } from '../../../../../common/util/job_utils'; import { TimeSeriesExplorer } from '../../../timeseriesexplorer'; -import { mlJobService } from '../../../services/job_service'; +import { useMlJobService } from '../../../services/job_service'; import { useForecastService } from '../../../services/forecast_service'; import { useTimeSeriesExplorerService } from '../../../util/time_series_explorer_service'; import { APP_STATE_ACTION } from '../../../timeseriesexplorer/timeseriesexplorer_constants'; @@ -28,7 +28,6 @@ import { TimeSeriesExplorerPage } from '../../../timeseriesexplorer/timeseriesex import { TimeseriesexplorerNoJobsFound } from '../../../timeseriesexplorer/components/timeseriesexplorer_no_jobs_found'; import { useTableInterval } from '../../../components/controls/select_interval'; import { useTableSeverity } from '../../../components/controls/select_severity'; -import { useToastNotificationService } from '../../../services/toast_notification_service'; import { useTimeSeriesExplorerUrlState } from '../../../timeseriesexplorer/hooks/use_timeseriesexplorer_url_state'; import type { TimeSeriesExplorerAppState } from '../../../../../common/types/locator'; import { useJobSelectionFlyout } from '../../../contexts/ml/use_job_selection_flyout'; @@ -46,14 +45,9 @@ export const TimeSeriesExplorerUrlStateManager: FC { - const { - services: { - data: { dataViews: dataViewsService }, - }, - } = useMlKibana(); + const mlJobService = useMlJobService(); const { toasts } = useNotifications(); const mlForecastService = useForecastService(); - const toastNotificationService = useToastNotificationService(); const [timeSeriesExplorerUrlState, setTimeSeriesExplorerUrlState] = useTimeSeriesExplorerUrlState(); const [globalState, setGlobalState] = useUrlState('_g'); @@ -204,6 +198,7 @@ export const TimeSeriesExplorerUrlStateManager: FC @@ -294,8 +289,6 @@ export const TimeSeriesExplorerUrlStateManager: FC = ({ deps }) => { const mlApi = useMlApiContext(); + const mlJobService = useMlJobService(); const uiSettings = useUiSettings(); const { context, results } = useRouteResolver('full', ['canGetJobs'], { ...basicResolvers(), jobs: mlJobService.loadJobsWrapper, - jobsWithTimeRange: () => mlApi.jobs.jobsWithTimerange(getDateFormatTz()), + jobsWithTimeRange: () => mlApi.jobs.jobsWithTimerange(getDateFormatTz(uiSettings)), }); const annotationUpdatesService = useMemo(() => new AnnotationUpdatesService(), []); diff --git a/x-pack/plugins/ml/public/application/routing/use_resolver.tsx b/x-pack/plugins/ml/public/application/routing/use_resolver.tsx index 5c67ed9769426..d7e7e8762caaf 100644 --- a/x-pack/plugins/ml/public/application/routing/use_resolver.tsx +++ b/x-pack/plugins/ml/public/application/routing/use_resolver.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import useMount from 'react-use/lib/useMount'; import { AccessDeniedCallout } from '../access_denied'; import { PLUGIN_ID } from '../../../common/constants/app'; -import { useMlKibana, useMlLicenseInfo } from '../contexts/kibana'; +import { useMlApiContext, useMlKibana, useMlLicenseInfo } from '../contexts/kibana'; import { type MlCapabilitiesKey } from '../../../common/types/capabilities'; import { usePermissionCheck } from '../capabilities/check_capabilities'; import type { ResolverResults, Resolvers } from './resolvers'; @@ -54,7 +54,7 @@ export const useRouteResolver = ( }, }, } = useMlKibana(); - + const mlApiServices = useMlApiContext(); const mlLicenseInfo = useMlLicenseInfo(); useMount(function refreshCapabilitiesOnMount() { @@ -119,10 +119,12 @@ export const useRouteResolver = ( p[c] = {}; return p; }, {} as Exclude); - const res = await Promise.all(funcs.map((r) => r())); + const res = await Promise.all(funcs.map((r) => r(mlApiServices))); res.forEach((r, i) => (tempResults[funcNames[i]] = r)); return tempResults; + // skip mlApiServices from deps + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect( diff --git a/x-pack/plugins/ml/public/application/services/calendar_service.ts b/x-pack/plugins/ml/public/application/services/calendar_service.ts index 3db4c5a3b9020..d44653e5ee86b 100644 --- a/x-pack/plugins/ml/public/application/services/calendar_service.ts +++ b/x-pack/plugins/ml/public/application/services/calendar_service.ts @@ -6,19 +6,20 @@ */ import { i18n } from '@kbn/i18n'; -import { ml } from './ml_api_service'; import type { Calendar, CalendarId } from '../../../common/types/calendars'; import type { JobId } from '../../../common/types/anomaly_detection_jobs'; +import type { MlApiServices } from './ml_api_service'; + class CalendarService { /** * Assigns a job id to the calendar. * @param calendar * @param jobId */ - async assignNewJobId(calendar: Calendar, jobId: JobId) { + async assignNewJobId(mlApiServices: MlApiServices, calendar: Calendar, jobId: JobId) { const { calendar_id: calendarId } = calendar; try { - await ml.updateCalendar({ + await mlApiServices.updateCalendar({ ...calendar, calendarId, job_ids: [...calendar.job_ids, jobId], @@ -37,9 +38,12 @@ class CalendarService { * Fetches calendars by the list of ids. * @param calendarIds */ - async fetchCalendarsByIds(calendarIds: CalendarId[]): Promise { + async fetchCalendarsByIds( + mlApiServices: MlApiServices, + calendarIds: CalendarId[] + ): Promise { try { - const calendars = await ml.calendars({ calendarIds }); + const calendars = await mlApiServices.calendars({ calendarIds }); return Array.isArray(calendars) ? calendars : [calendars]; } catch (e) { throw new Error( diff --git a/x-pack/plugins/ml/public/application/services/field_format_service.ts b/x-pack/plugins/ml/public/application/services/field_format_service.ts index d01a7294d9c0a..509e791cc75a4 100644 --- a/x-pack/plugins/ml/public/application/services/field_format_service.ts +++ b/x-pack/plugins/ml/public/application/services/field_format_service.ts @@ -6,7 +6,7 @@ */ import { mlFunctionToESAggregation } from '../../../common/util/job_utils'; -import { mlJobService } from './job_service'; +import type { MlJobService } from './job_service'; import type { MlIndexUtils } from '../util/index_service'; import type { MlApiServices } from './ml_api_service'; @@ -19,7 +19,11 @@ export class FieldFormatService { indexPatternIdsByJob: IndexPatternIdsByJob = {}; formatsByJob: FormatsByJobId = {}; - constructor(private mlApiServices: MlApiServices, private mlIndexUtils: MlIndexUtils) {} + constructor( + private mlApiServices: MlApiServices, + private mlIndexUtils: MlIndexUtils, + private mlJobService: MlJobService + ) {} // Populate the service with the FieldFormats for the list of jobs with the // specified IDs. List of Kibana data views is passed, with a title @@ -40,7 +44,7 @@ export class FieldFormatService { const { jobs } = await this.mlApiServices.getJobs({ jobId }); jobObj = jobs[0]; } else { - jobObj = mlJobService.getJob(jobId); + jobObj = this.mlJobService.getJob(jobId); } return { jobId, @@ -85,7 +89,7 @@ export class FieldFormatService { const { jobs } = await this.mlApiServices.getJobs({ jobId }); jobObj = jobs[0]; } else { - jobObj = mlJobService.getJob(jobId); + jobObj = this.mlJobService.getJob(jobId); } const detectors = jobObj.analysis_config.detectors || []; const formatsByDetector: any[] = []; diff --git a/x-pack/plugins/ml/public/application/services/field_format_service_factory.ts b/x-pack/plugins/ml/public/application/services/field_format_service_factory.ts index daefab69154c5..fc59dbdf03ce4 100644 --- a/x-pack/plugins/ml/public/application/services/field_format_service_factory.ts +++ b/x-pack/plugins/ml/public/application/services/field_format_service_factory.ts @@ -8,10 +8,12 @@ import { type MlFieldFormatService, FieldFormatService } from './field_format_service'; import type { MlIndexUtils } from '../util/index_service'; import type { MlApiServices } from './ml_api_service'; +import type { MlJobService } from './job_service'; export function fieldFormatServiceFactory( mlApiServices: MlApiServices, - mlIndexUtils: MlIndexUtils + mlIndexUtils: MlIndexUtils, + mlJobService: MlJobService ): MlFieldFormatService { - return new FieldFormatService(mlApiServices, mlIndexUtils); + return new FieldFormatService(mlApiServices, mlIndexUtils, mlJobService); } diff --git a/x-pack/plugins/ml/public/application/services/http_service.ts b/x-pack/plugins/ml/public/application/services/http_service.ts index cd283c5d58652..86e2266d22351 100644 --- a/x-pack/plugins/ml/public/application/services/http_service.ts +++ b/x-pack/plugins/ml/public/application/services/http_service.ts @@ -7,7 +7,6 @@ import { Observable } from 'rxjs'; import type { HttpFetchOptionsWithPath, HttpFetchOptions, HttpStart } from '@kbn/core/public'; -import { getHttp } from '../util/dependency_cache'; function getResultHeaders(headers: HeadersInit) { return { @@ -48,17 +47,6 @@ function getFetchOptions(options: HttpFetchOptionsWithPath): { }; } -/** - * Function for making HTTP requests to Kibana's backend. - * Wrapper for Kibana's HttpHandler. - * - * @deprecated use {@link HttpService} instead - */ -export async function http(options: HttpFetchOptionsWithPath): Promise { - const { path, fetchOptions } = getFetchOptions(options); - return getHttp().fetch(path, fetchOptions); -} - /** * ML Http Service */ diff --git a/x-pack/plugins/ml/public/application/services/job_service.d.ts b/x-pack/plugins/ml/public/application/services/job_service.d.ts index 509144e96b221..685a0cf86cf9a 100644 --- a/x-pack/plugins/ml/public/application/services/job_service.d.ts +++ b/x-pack/plugins/ml/public/application/services/job_service.d.ts @@ -10,6 +10,7 @@ import type { CombinedJob, Datafeed, Job } from '../../../common/types/anomaly_d import type { Calendar } from '../../../common/types/calendars'; import type { ToastNotificationService } from './toast_notification_service'; import type { MlApiServices } from './ml_api_service'; +import type { JobCreatorType } from '../jobs/new_job/common/job_creator'; export interface ExistingJobsAndGroups { jobIds: string[]; @@ -40,16 +41,28 @@ export declare interface MlJobService { start: number | undefined, end: number | undefined ): Promise; + forceStartDatafeeds( + dIds: string[], + start: number | undefined, + end: number | undefined + ): Promise; createResultsUrl(jobId: string[], start: number, end: number, location: string): string; getJobAndGroupIds(): Promise; getJob(jobId: string): CombinedJob; loadJobsWrapper(): Promise; customUrlsByJob: Record; detectorsByJob: Record; + stashJobForCloning( + jobCreator: JobCreatorType, + skipTimeRangeStep: boolean = false, + includeTimeRange: boolean = false, + autoSetTimeRange: boolean = false + ): void; } -export const mlJobService: MlJobService; export const mlJobServiceFactory: ( - toastNotificationServiceOverride?: ToastNotificationService, - mlOverride?: MlApiServices + toastNotificationService: ToastNotificationService, + mlApiServices: MlApiServices ) => MlJobService; + +export const useMlJobService: () => MlJobService; diff --git a/x-pack/plugins/ml/public/application/services/job_service.js b/x-pack/plugins/ml/public/application/services/job_service.js index a82c1af038489..c37502ab570ac 100644 --- a/x-pack/plugins/ml/public/application/services/job_service.js +++ b/x-pack/plugins/ml/public/application/services/job_service.js @@ -13,27 +13,17 @@ import { validateTimeRange, TIME_FORMAT } from '@kbn/ml-date-utils'; import { parseInterval } from '../../../common/util/parse_interval'; import { isWebUrl } from '../util/url_utils'; +import { useMlApiContext } from '../contexts/kibana'; -import { ml } from './ml_api_service'; -import { getToastNotificationService } from './toast_notification_service'; +import { useToastNotificationService } from './toast_notification_service'; let jobs = []; let datafeedIds = {}; class JobService { - // The overrides allow the use of JobService in contexts where - // the dependency cache is not available, for example when embedding - // the Single Metric Viewer chart. Note we cannot set the members here - // already based on the dependency cache because they will not be - // initialized yet. So this wouldn't work: - // - // this.ml = mlOverride ?? ml; - // - // That's why we have the getters like getMl() below to only access them - // when the methods of this class are being called. - constructor(toastNotificationServiceOverride, mlOverride) { - this.toastNotificationService = toastNotificationServiceOverride; - this.ml = mlOverride; + constructor(toastNotificationService, ml) { + this.toastNotificationService = toastNotificationService; + this.ml = ml; // tempJobCloningObjects -> used to pass a job object between the job management page and // and the advanced wizard. @@ -61,25 +51,17 @@ class JobService { this.customUrlsByJob = {}; } - getMl() { - return this.ml ?? ml; - } - - getToastNotificationService() { - return this.toastNotificationService ?? getToastNotificationService(); - } - loadJobs() { return new Promise((resolve, reject) => { jobs = []; datafeedIds = {}; - this.getMl() + this.ml .getJobs() .then((resp) => { jobs = resp.jobs; // load jobs stats - this.getMl() + this.ml .getJobStats() .then((statsResp) => { // merge jobs stats into jobs @@ -130,7 +112,7 @@ class JobService { function error(err) { console.log('jobService error getting list of jobs:', err); - this.getToastNotificationService().displayErrorToast(err); + this.toastNotificationService.displayErrorToast(err); reject({ jobs, err }); } }); @@ -150,14 +132,14 @@ class JobService { refreshJob(jobId) { return new Promise((resolve, reject) => { - this.getMl() + this.ml .getJobs({ jobId }) .then((resp) => { if (resp.jobs && resp.jobs.length) { const newJob = resp.jobs[0]; // load jobs stats - this.getMl() + this.ml .getJobStats({ jobId }) .then((statsResp) => { // merge jobs stats into jobs @@ -213,7 +195,7 @@ class JobService { function error(err) { console.log('JobService error getting list of jobs:', err); - this.getToastNotificationService().displayErrorToast(err); + this.toastNotificationService.displayErrorToast(err); reject({ jobs, err }); } }); @@ -223,13 +205,13 @@ class JobService { return new Promise((resolve, reject) => { const sId = datafeedId !== undefined ? { datafeed_id: datafeedId } : undefined; - this.getMl() + this.ml .getDatafeeds(sId) .then((resp) => { const datafeeds = resp.datafeeds; // load datafeeds stats - this.getMl() + this.ml .getDatafeedStats() .then((statsResp) => { // merge datafeeds stats into datafeeds @@ -253,7 +235,7 @@ class JobService { function error(err) { console.log('loadDatafeeds error getting list of datafeeds:', err); - this.getToastNotificationService().displayErrorToast(err); + this.toastNotificationService.displayErrorToast(err); reject({ jobs, err }); } }); @@ -263,7 +245,7 @@ class JobService { return new Promise((resolve, reject) => { const datafeedId = this.getDatafeedId(jobId); - this.getMl() + this.ml .getDatafeedStats({ datafeedId }) .then((resp) => { // console.log('updateSingleJobCounts controller query response:', resp); @@ -289,7 +271,7 @@ class JobService { } // return the promise chain - return this.getMl().addJob({ jobId: job.job_id, job }).then(func).catch(func); + return this.ml.addJob({ jobId: job.job_id, job }).then(func).catch(func); } cloneDatafeed(datafeed) { @@ -313,18 +295,18 @@ class JobService { } openJob(jobId) { - return this.getMl().openJob({ jobId }); + return this.ml.openJob({ jobId }); } closeJob(jobId) { - return this.getMl().closeJob({ jobId }); + return this.ml.closeJob({ jobId }); } saveNewDatafeed(datafeedConfig, jobId) { const datafeedId = `datafeed-${jobId}`; datafeedConfig.job_id = jobId; - return this.getMl().addDatafeed({ + return this.ml.addDatafeed({ datafeedId, datafeedConfig, }); @@ -340,7 +322,7 @@ class JobService { end++; } - this.getMl() + this.ml .startDatafeed({ datafeedId, start, @@ -357,29 +339,29 @@ class JobService { } forceStartDatafeeds(dIds, start, end) { - return this.getMl().jobs.forceStartDatafeeds(dIds, start, end); + return this.ml.jobs.forceStartDatafeeds(dIds, start, end); } stopDatafeeds(dIds) { - return this.getMl().jobs.stopDatafeeds(dIds); + return this.ml.jobs.stopDatafeeds(dIds); } deleteJobs(jIds, deleteUserAnnotations, deleteAlertingRules) { - return this.getMl().jobs.deleteJobs(jIds, deleteUserAnnotations, deleteAlertingRules); + return this.ml.jobs.deleteJobs(jIds, deleteUserAnnotations, deleteAlertingRules); } closeJobs(jIds) { - return this.getMl().jobs.closeJobs(jIds); + return this.ml.jobs.closeJobs(jIds); } resetJobs(jIds, deleteUserAnnotations) { - return this.getMl().jobs.resetJobs(jIds, deleteUserAnnotations); + return this.ml.jobs.resetJobs(jIds, deleteUserAnnotations); } validateDetector(detector) { return new Promise((resolve, reject) => { if (detector) { - this.getMl() + this.ml .validateDetector({ detector }) .then((resp) => { resolve(resp); @@ -432,7 +414,7 @@ class JobService { async getJobAndGroupIds() { try { - return await this.getMl().jobs.getAllJobAndGroupIds(); + return await this.ml.jobs.getAllJobAndGroupIds(); } catch (error) { return { jobIds: [], @@ -440,6 +422,26 @@ class JobService { }; } } + + stashJobForCloning(jobCreator, skipTimeRangeStep, includeTimeRange, autoSetTimeRange) { + const tempJobCloningObjects = { + job: jobCreator.jobConfig, + datafeed: jobCreator.datafeedConfig, + createdBy: jobCreator.createdBy ?? undefined, + // skip over the time picker step of the wizard + skipTimeRangeStep, + calendars: jobCreator.calendars, + ...(includeTimeRange === true && autoSetTimeRange === false + ? // auto select the start and end dates of the time picker + { + start: jobCreator.start, + end: jobCreator.end, + } + : { autoSetTimeRange: true }), + }; + + this.tempJobCloningObjects = tempJobCloningObjects; + } } // private function used to check the job saving response @@ -592,6 +594,17 @@ function createResultsUrl(jobIds, start, end, resultsPage, mode = 'absolute') { return path; } -export const mlJobService = new JobService(); -export const mlJobServiceFactory = (toastNotificationServiceOverride, mlOverride) => - new JobService(toastNotificationServiceOverride, mlOverride); +// This is to retain the singleton behavior of the previous direct instantiation and export. +let mlJobService; +export const mlJobServiceFactory = (toastNotificationService, mlApiServices) => { + if (mlJobService) return mlJobService; + + mlJobService = new JobService(toastNotificationService, mlApiServices); + return mlJobService; +}; + +export const useMlJobService = () => { + const toastNotificationService = useToastNotificationService(); + const mlApiServices = useMlApiContext(); + return mlJobServiceFactory(toastNotificationService, mlApiServices); +}; diff --git a/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts b/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts index 6d086f99bce08..77c074a97bec4 100644 --- a/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts +++ b/x-pack/plugins/ml/public/application/services/ml_api_service/index.ts @@ -9,7 +9,6 @@ import type { Observable } from 'rxjs'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import type { HttpStart } from '@kbn/core/public'; import type { RuntimeMappings } from '@kbn/ml-runtime-field-utils'; import { ML_INTERNAL_BASE_PATH } from '../../../../common/constants/app'; @@ -39,9 +38,8 @@ import type { import type { DatafeedValidationResponse } from '../../../../common/types/job_validation'; import type { FieldHistogramRequestConfig } from '../../datavisualizer/index_based/common/request'; -import { getHttp } from '../../util/dependency_cache'; -import { HttpService } from '../http_service'; +import type { HttpService } from '../http_service'; import { jsonSchemaProvider } from './json_schema'; import { annotationsApiProvider } from './annotations'; @@ -101,26 +99,6 @@ export interface GetModelSnapshotsResponse { model_snapshots: ModelSnapshot[]; } -/** - * Temp solution to allow {@link ml} service to use http from - * the dependency_cache. - */ -const proxyHttpStart = new Proxy({} as unknown as HttpStart, { - get(obj, prop: keyof HttpStart) { - try { - return getHttp()[prop]; - } catch (e) { - if (prop === 'getLoadingCount$') { - return () => {}; - } - // eslint-disable-next-line no-console - console.error(e); - } - }, -}); - -export const ml = mlApiServicesProvider(new HttpService(proxyHttpStart)); - export function mlApiServicesProvider(httpService: HttpService) { return { getJobs(obj?: { jobId?: string }) { diff --git a/x-pack/plugins/ml/public/application/services/ml_server_info.test.ts b/x-pack/plugins/ml/public/application/services/ml_server_info.test.ts index 4aabe52b034d1..bb10e9b466f6e 100644 --- a/x-pack/plugins/ml/public/application/services/ml_server_info.test.ts +++ b/x-pack/plugins/ml/public/application/services/ml_server_info.test.ts @@ -5,6 +5,7 @@ * 2.0. */ +import type { MlApiServices } from './ml_api_service'; import { loadMlServerInfo, getCloudDeploymentId, @@ -16,11 +17,9 @@ import { } from './ml_server_info'; import mockMlInfoResponse from './__mocks__/ml_info_response.json'; -jest.mock('./ml_api_service', () => ({ - ml: { - mlInfo: jest.fn(() => Promise.resolve(mockMlInfoResponse)), - }, -})); +const mlApiServicesMock = { + mlInfo: jest.fn(() => Promise.resolve(mockMlInfoResponse)), +} as unknown as MlApiServices; describe('ml_server_info initial state', () => { it('should fail to get server info ', () => { @@ -31,7 +30,7 @@ describe('ml_server_info initial state', () => { describe('ml_server_info', () => { beforeEach(async () => { - await loadMlServerInfo(); + await loadMlServerInfo(mlApiServicesMock); }); describe('cloud information', () => { diff --git a/x-pack/plugins/ml/public/application/services/ml_server_info.ts b/x-pack/plugins/ml/public/application/services/ml_server_info.ts index 0e262c2bf0f95..101cb33264502 100644 --- a/x-pack/plugins/ml/public/application/services/ml_server_info.ts +++ b/x-pack/plugins/ml/public/application/services/ml_server_info.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ml } from './ml_api_service'; +import type { MlApiServices } from './ml_api_service'; import type { MlServerDefaults, MlServerLimits } from '../../../common/types/ml_server_info'; export interface CloudInfo { @@ -28,9 +28,9 @@ const cloudInfo: CloudInfo = { deploymentId: null, }; -export async function loadMlServerInfo() { +export async function loadMlServerInfo(mlApiServices: MlApiServices) { try { - const resp = await ml.mlInfo(); + const resp = await mlApiServices.mlInfo(); defaults = resp.defaults; limits = resp.limits; cloudInfo.cloudId = resp.cloudId ?? null; diff --git a/x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts b/x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts index 4570d838e348f..6c25d43020d52 100644 --- a/x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts +++ b/x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts @@ -9,8 +9,9 @@ import type { DataView, DataViewsContract } from '@kbn/data-views-plugin/public' import type { SavedSearchPublicPluginStart } from '@kbn/saved-search-plugin/public'; import { getDataViewAndSavedSearchCallback } from '../../util/index_utils'; import type { JobType } from '../../../../common/types/saved_objects'; -import { newJobCapsServiceAnalytics } from './new_job_capabilities_service_analytics'; -import { newJobCapsService } from './new_job_capabilities_service'; +import type { MlApiServices } from '../ml_api_service'; +import { mlJobCapsServiceAnalyticsFactory } from './new_job_capabilities_service_analytics'; +import { mlJobCapsServiceFactory } from './new_job_capabilities_service'; export const ANOMALY_DETECTOR = 'anomaly-detector'; export const DATA_FRAME_ANALYTICS = 'data-frame-analytics'; @@ -20,6 +21,7 @@ export const DATA_FRAME_ANALYTICS = 'data-frame-analytics'; export function loadNewJobCapabilities( dataViewId: string, savedSearchId: string, + mlApiServices: MlApiServices, dataViewsService: DataViewsContract, savedSearchService: SavedSearchPublicPluginStart, jobType: JobType @@ -27,7 +29,9 @@ export function loadNewJobCapabilities( return new Promise(async (resolve, reject) => { try { const serviceToUse = - jobType === ANOMALY_DETECTOR ? newJobCapsService : newJobCapsServiceAnalytics; + jobType === ANOMALY_DETECTOR + ? mlJobCapsServiceFactory(mlApiServices) + : mlJobCapsServiceAnalyticsFactory(mlApiServices); if (dataViewId !== undefined) { // index pattern is being used diff --git a/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities._service.test.ts b/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.test.ts similarity index 81% rename from x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities._service.test.ts rename to x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.test.ts index ec7ef70f8d0de..ed257199db16b 100644 --- a/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities._service.test.ts +++ b/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.test.ts @@ -5,20 +5,20 @@ * 2.0. */ -import { newJobCapsService } from './new_job_capabilities_service'; +import { mlJobCapsServiceFactory } from './new_job_capabilities_service'; import type { DataView } from '@kbn/data-views-plugin/public'; +import type { MlApiServices } from '../ml_api_service'; + // there is magic happening here. starting the include name with `mock..` // ensures it can be lazily loaded by the jest.mock function below. import mockCloudwatchResponse from '../__mocks__/cloudwatch_job_caps_response.json'; -jest.mock('../ml_api_service', () => ({ - ml: { - jobs: { - newJobCaps: jest.fn(() => Promise.resolve(mockCloudwatchResponse)), - }, +const mlApiServicesMock = { + jobs: { + newJobCaps: jest.fn(() => Promise.resolve(mockCloudwatchResponse)), }, -})); +} as unknown as MlApiServices; const dataView = { id: 'cloudwatch-*', @@ -28,6 +28,7 @@ const dataView = { describe('new_job_capabilities_service', () => { describe('cloudwatch newJobCaps()', () => { it('can construct job caps objects from endpoint json', async () => { + const newJobCapsService = mlJobCapsServiceFactory(mlApiServicesMock); await newJobCapsService.initializeFromDataVIew(dataView); const { fields, aggs } = await newJobCapsService.newJobCaps; @@ -47,6 +48,7 @@ describe('new_job_capabilities_service', () => { }); it('job caps including text fields', async () => { + const newJobCapsService = mlJobCapsServiceFactory(mlApiServicesMock); await newJobCapsService.initializeFromDataVIew(dataView, true, false); const { fields, aggs } = await newJobCapsService.newJobCaps; @@ -55,6 +57,7 @@ describe('new_job_capabilities_service', () => { }); it('job caps excluding event rate', async () => { + const newJobCapsService = mlJobCapsServiceFactory(mlApiServicesMock); await newJobCapsService.initializeFromDataVIew(dataView, false, true); const { fields, aggs } = await newJobCapsService.newJobCaps; diff --git a/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts b/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts index 0df13dfe2814b..990d411779a6f 100644 --- a/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts +++ b/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts @@ -4,6 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ + import { ES_FIELD_TYPES } from '@kbn/field-types'; import type { DataView } from '@kbn/data-views-plugin/public'; import { @@ -14,8 +15,9 @@ import { EVENT_RATE_FIELD_ID, } from '@kbn/ml-anomaly-utils'; import { DataViewType } from '@kbn/data-views-plugin/public'; +import { useMlApiContext } from '../../contexts/kibana'; import { getGeoFields, filterCategoryFields } from '../../../../common/util/fields_utils'; -import { ml, type MlApiServices } from '../ml_api_service'; +import type { MlApiServices } from '../ml_api_service'; import { processTextAndKeywordFields, NewJobCapabilitiesServiceBase } from './new_job_capabilities'; export class NewJobCapsService extends NewJobCapabilitiesServiceBase { @@ -185,4 +187,16 @@ function addEventRateField(aggs: Aggregation[], fields: Field[]) { fields.splice(0, 0, eventRateField); } -export const newJobCapsService = new NewJobCapsService(ml); +// This is to retain the singleton behavior of the previous direct instantiation and export. +let newJobCapsService: NewJobCapsService; +export const mlJobCapsServiceFactory = (mlApiServices: MlApiServices) => { + if (newJobCapsService) return newJobCapsService; + + newJobCapsService = new NewJobCapsService(mlApiServices); + return newJobCapsService; +}; + +export const useNewJobCapsService = () => { + const mlApiServices = useMlApiContext(); + return mlJobCapsServiceFactory(mlApiServices); +}; diff --git a/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts b/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts index ef9b4219c2994..c2b7a4dc24906 100644 --- a/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts +++ b/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts @@ -25,8 +25,9 @@ import { TOP_CLASSES, type DataFrameAnalyticsConfig, } from '@kbn/ml-data-frame-analytics-utils'; +import { useMlApiContext } from '../../contexts/kibana'; import { processTextAndKeywordFields, NewJobCapabilitiesServiceBase } from './new_job_capabilities'; -import { ml } from '../ml_api_service'; +import type { MlApiServices } from '../ml_api_service'; // Keep top nested field and remove all .* fields export function removeNestedFieldChildren(resp: NewJobCapsResponse, indexPatternTitle: string) { @@ -59,13 +60,21 @@ export function removeNestedFieldChildren(resp: NewJobCapsResponse, indexPattern return fields; } -class NewJobCapsServiceAnalytics extends NewJobCapabilitiesServiceBase { +export class NewJobCapsServiceAnalytics extends NewJobCapabilitiesServiceBase { + private _mlApiService: MlApiServices; + + constructor(mlApiService: MlApiServices) { + super(); + this._mlApiService = mlApiService; + } + public async initializeFromDataVIew(dataView: DataView) { try { - const resp: NewJobCapsResponse = await ml.dataFrameAnalytics.newJobCapsAnalytics( - dataView.getIndexPattern(), - dataView.type === DataViewType.ROLLUP - ); + const resp: NewJobCapsResponse = + await this._mlApiService.dataFrameAnalytics.newJobCapsAnalytics( + dataView.getIndexPattern(), + dataView.type === DataViewType.ROLLUP + ); const allFields = removeNestedFieldChildren(resp, dataView.getIndexPattern()); @@ -216,4 +225,16 @@ class NewJobCapsServiceAnalytics extends NewJobCapabilitiesServiceBase { } } -export const newJobCapsServiceAnalytics = new NewJobCapsServiceAnalytics(); +// This is to retain the singleton behavior of the previous direct instantiation and export. +let newJobCapsServiceAnalytics: NewJobCapsServiceAnalytics; +export const mlJobCapsServiceAnalyticsFactory = (mlApiServices: MlApiServices) => { + if (newJobCapsServiceAnalytics) return newJobCapsServiceAnalytics; + + newJobCapsServiceAnalytics = new NewJobCapsServiceAnalytics(mlApiServices); + return newJobCapsServiceAnalytics; +}; + +export const useNewJobCapsServiceAnalytics = () => { + const mlApiServices = useMlApiContext(); + return mlJobCapsServiceAnalyticsFactory(mlApiServices); +}; diff --git a/x-pack/plugins/ml/public/application/services/results_service/index.ts b/x-pack/plugins/ml/public/application/services/results_service/index.ts index a8f1a5a9bd105..d8621eff633a4 100644 --- a/x-pack/plugins/ml/public/application/services/results_service/index.ts +++ b/x-pack/plugins/ml/public/application/services/results_service/index.ts @@ -5,14 +5,13 @@ * 2.0. */ -import { useMemo } from 'react'; import { resultsServiceRxProvider } from './result_service_rx'; import { resultsServiceProvider } from './results_service'; import type { MlApiServices } from '../ml_api_service'; -import { ml } from '../ml_api_service'; -import { useMlKibana } from '../../contexts/kibana'; +import { useMlApiContext } from '../../contexts/kibana'; -export type MlResultsService = typeof mlResultsService; +export type MlResultsService = ReturnType & + ReturnType; type Time = string; export interface ModelPlotOutputResults { @@ -24,22 +23,20 @@ export interface CriteriaField { fieldValue: any; } -export const mlResultsService = mlResultsServiceProvider(ml); - +// This is to retain the singleton behavior of the previous direct instantiation and export. +let mlResultsService: MlResultsService; export function mlResultsServiceProvider(mlApiServices: MlApiServices) { - return { + if (mlResultsService) return mlResultsService; + + mlResultsService = { ...resultsServiceProvider(mlApiServices), ...resultsServiceRxProvider(mlApiServices), }; + + return mlResultsService; } export function useMlResultsService(): MlResultsService { - const { - services: { - mlServices: { mlApiServices }, - }, - } = useMlKibana(); - - const resultsService = useMemo(() => mlResultsServiceProvider(mlApiServices), [mlApiServices]); - return resultsService; + const mlApiServices = useMlApiContext(); + return mlResultsServiceProvider(mlApiServices); } diff --git a/x-pack/plugins/ml/public/application/services/toast_notification_service/index.ts b/x-pack/plugins/ml/public/application/services/toast_notification_service/index.ts index d2f946777284d..21614dd4d6710 100644 --- a/x-pack/plugins/ml/public/application/services/toast_notification_service/index.ts +++ b/x-pack/plugins/ml/public/application/services/toast_notification_service/index.ts @@ -9,5 +9,4 @@ export type { ToastNotificationService } from './toast_notification_service'; export { toastNotificationServiceProvider, useToastNotificationService, - getToastNotificationService, } from './toast_notification_service'; diff --git a/x-pack/plugins/ml/public/application/services/toast_notification_service/toast_notification_service.ts b/x-pack/plugins/ml/public/application/services/toast_notification_service/toast_notification_service.ts index e07cc1493b5da..f209c985e57a9 100644 --- a/x-pack/plugins/ml/public/application/services/toast_notification_service/toast_notification_service.ts +++ b/x-pack/plugins/ml/public/application/services/toast_notification_service/toast_notification_service.ts @@ -9,7 +9,6 @@ import { i18n } from '@kbn/i18n'; import type { ToastInput, ToastOptions, ToastsStart } from '@kbn/core/public'; import { useMemo } from 'react'; import { extractErrorProperties, type ErrorType, MLRequestFailure } from '@kbn/ml-error-utils'; -import { getToastNotifications } from '../../util/dependency_cache'; import { useNotifications } from '../../contexts/kibana'; export type ToastNotificationService = ReturnType; @@ -42,11 +41,6 @@ export function toastNotificationServiceProvider(toastNotifications: ToastsStart return { displayDangerToast, displayWarningToast, displaySuccessToast, displayErrorToast }; } -export function getToastNotificationService() { - const toastNotifications = getToastNotifications(); - return toastNotificationServiceProvider(toastNotifications); -} - /** * Hook to use {@link ToastNotificationService} in React components. */ diff --git a/x-pack/plugins/ml/public/application/settings/anomaly_detection_settings.tsx b/x-pack/plugins/ml/public/application/settings/anomaly_detection_settings.tsx index 6073c563187ca..5161963e90a46 100644 --- a/x-pack/plugins/ml/public/application/settings/anomaly_detection_settings.tsx +++ b/x-pack/plugins/ml/public/application/settings/anomaly_detection_settings.tsx @@ -22,13 +22,15 @@ import { import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import { useMlApiContext } from '../contexts/kibana'; import { AnomalyDetectionSettingsContext } from './anomaly_detection_settings_context'; -import { ml } from '../services/ml_api_service'; import { useToastNotificationService } from '../services/toast_notification_service'; import { ML_PAGES } from '../../../common/constants/locator'; import { useCreateAndNavigateToMlLink } from '../contexts/kibana/use_create_url'; export const AnomalyDetectionSettings: FC = () => { + const ml = useMlApiContext(); + const [calendarsCount, setCalendarsCount] = useState(0); const [filterListsCount, setFilterListsCount] = useState(0); diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/__snapshots__/new_calendar.test.js.snap b/x-pack/plugins/ml/public/application/settings/calendars/edit/__snapshots__/new_calendar.test.js.snap deleted file mode 100644 index 075c7388acb25..0000000000000 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/__snapshots__/new_calendar.test.js.snap +++ /dev/null @@ -1,42 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`NewCalendar Renders new calendar form 1`] = ` - -
- - - -
- -
-`; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/new_calendar.js b/x-pack/plugins/ml/public/application/settings/calendars/edit/new_calendar.js index 6375dfab79857..79f4d82093f21 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/new_calendar.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/edit/new_calendar.js @@ -16,12 +16,10 @@ import { getCalendarSettingsData, validateCalendarId } from './utils'; import { CalendarForm } from './calendar_form'; import { NewEventModal } from './new_event_modal'; import { ImportModal } from './import_modal'; -import { ml } from '../../../services/ml_api_service'; import { withKibana } from '@kbn/kibana-react-plugin/public'; import { GLOBAL_CALENDAR } from '../../../../../common/constants/calendars'; import { ML_PAGES } from '../../../../../common/constants/locator'; import { toastNotificationServiceProvider } from '../../../services/toast_notification_service'; -import { getDocLinks } from '../../../util/dependency_cache'; import { HelpMenu } from '../../../components/help_menu'; class NewCalendarUI extends Component { @@ -73,7 +71,9 @@ class NewCalendarUI extends Component { async formSetup() { try { - const { jobIds, groupIds, calendars } = await getCalendarSettingsData(); + const { jobIds, groupIds, calendars } = await getCalendarSettingsData( + this.props.kibana.services.mlServices.mlApiServices + ); const jobIdOptions = jobIds.map((jobId) => ({ label: jobId })); const groupIdOptions = groupIds.map((groupId) => ({ label: groupId })); @@ -145,6 +145,7 @@ class NewCalendarUI extends Component { }; onCreate = async () => { + const ml = this.props.kibana.services.mlServices.mlApiServices; const { formCalendarId } = this.state; if (this.isDuplicateId()) { @@ -176,6 +177,7 @@ class NewCalendarUI extends Component { }; onEdit = async () => { + const ml = this.props.kibana.services.mlServices.mlApiServices; const calendar = this.setUpCalendarForApi(); this.setState({ saving: true }); @@ -331,7 +333,7 @@ class NewCalendarUI extends Component { isGlobalCalendar, } = this.state; - const helpLink = getDocLinks().links.ml.calendars; + const helpLink = this.props.kibana.services.docLinks.links.ml.calendars; let modal = ''; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/new_calendar.test.js b/x-pack/plugins/ml/public/application/settings/calendars/edit/new_calendar.test.js index 4e9a16858f816..1e538668d9ac3 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/new_calendar.test.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/edit/new_calendar.test.js @@ -5,6 +5,12 @@ * 2.0. */ +import React from 'react'; +import { render, waitFor } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import '@testing-library/jest-dom/extend-expect'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; + jest.mock('../../../contexts/kibana/use_create_url', () => ({ useCreateAndNavigateToMlLink: jest.fn(), })); @@ -13,14 +19,6 @@ jest.mock('../../../components/help_menu', () => ({ HelpMenu: () =>
, })); -jest.mock('../../../util/dependency_cache', () => ({ - getDocLinks: () => ({ - links: { - ml: { calendars: jest.fn() }, - }, - }), -})); - jest.mock('../../../capabilities/check_capabilities', () => ({ checkPermission: () => true, })); @@ -34,44 +32,8 @@ jest.mock('../../../capabilities/get_capabilities', () => ({ jest.mock('../../../ml_nodes_check/check_ml_nodes', () => ({ mlNodesAvailable: () => true, })); -jest.mock('../../../services/ml_api_service', () => ({ - ml: { - calendars: () => { - return Promise.resolve([]); - }, - jobs: { - jobsSummary: () => { - return Promise.resolve([]); - }, - groups: () => { - return Promise.resolve([]); - }, - }, - }, -})); -jest.mock('./utils', () => ({ - getCalendarSettingsData: jest.fn().mockImplementation( - () => - new Promise((resolve) => { - resolve({ - jobIds: ['test-job-one', 'test-job-2'], - groupIds: ['test-group-one', 'test-group-two'], - calendars: [], - }); - }) - ), -})); -jest.mock('@kbn/kibana-react-plugin/public', () => ({ - withKibana: (comp) => { - return comp; - }, -})); -import { shallowWithIntl, mountWithIntl } from '@kbn/test-jest-helpers'; -import React from 'react'; -import { NewCalendar } from './new_calendar'; - -const calendars = [ +const calendarsMock = [ { calendar_id: 'farequote-calendar', job_ids: ['farequote'], @@ -102,65 +64,129 @@ const calendars = [ }, ]; -const props = { - canCreateCalendar: true, - canDeleteCalendar: true, - kibana: { - services: { - data: { - query: { - timefilter: { - timefilter: { - disableTimeRangeSelector: jest.fn(), - disableAutoRefreshSelector: jest.fn(), - }, - }, +jest.mock('./utils', () => ({ + ...jest.requireActual('./utils'), + getCalendarSettingsData: jest.fn().mockImplementation( + () => + new Promise((resolve) => { + resolve({ + jobIds: ['test-job-one', 'test-job-2'], + groupIds: ['test-group-one', 'test-group-two'], + calendars: calendarsMock, + }); + }) + ), +})); + +const mockAddDanger = jest.fn(); +const mockKibanaContext = { + services: { + docLinks: { links: { ml: { calendars: 'test' } } }, + notifications: { toasts: { addDanger: mockAddDanger, addError: jest.fn() } }, + mlServices: { + mlApiServices: { + calendars: () => { + return Promise.resolve([]); }, - }, - notifications: { - toasts: { - addDanger: () => {}, + jobs: { + jobsSummary: () => { + return Promise.resolve([]); + }, + groups: () => { + return Promise.resolve([]); + }, }, }, }, }, }; +const mockReact = React; +jest.mock('@kbn/kibana-react-plugin/public', () => ({ + withKibana: (type) => { + const EnhancedType = (props) => { + return mockReact.createElement(type, { + ...props, + kibana: mockKibanaContext, + }); + }; + return EnhancedType; + }, +})); + +import { NewCalendar } from './new_calendar'; + +const props = { + canCreateCalendar: true, + canDeleteCalendar: true, +}; + describe('NewCalendar', () => { test('Renders new calendar form', () => { - const wrapper = shallowWithIntl(); + const { getByTestId } = render( + + + + ); - expect(wrapper).toMatchSnapshot(); + expect(getByTestId('mlPageCalendarEdit')).toBeInTheDocument(); }); test('Import modal button is disabled', () => { - const wrapper = mountWithIntl(); + const { getByTestId } = render( + + + + ); + + const importEventsButton = getByTestId('mlCalendarImportEventsButton'); + expect(importEventsButton).toBeInTheDocument(); + expect(importEventsButton).toBeDisabled(); + }); + + test('New event modal button is disabled', async () => { + const { getByTestId } = render( + + + + ); - const importButton = wrapper.find('[data-test-subj="mlCalendarImportEventsButton"]'); - const button = importButton.find('EuiButton'); - expect(button.prop('isDisabled')).toBe(true); + const newEventButton = getByTestId('mlCalendarNewEventButton'); + expect(newEventButton).toBeInTheDocument(); + expect(newEventButton).toBeDisabled(); }); - test('New event modal button is disabled', () => { - const wrapper = mountWithIntl(); + test('isDuplicateId returns true if form calendar id already exists in calendars', async () => { + const { getByTestId, queryByTestId, getByText } = render( + + + + ); - const importButton = wrapper.find('[data-test-subj="mlCalendarNewEventButton"]'); - const button = importButton.find('EuiButton button'); - button.simulate('click'); + const mlCalendarIdFormRow = getByText('Calendar ID'); + expect(mlCalendarIdFormRow).toBeInTheDocument(); + const mlCalendarIdInput = queryByTestId('mlCalendarIdInput'); + expect(mlCalendarIdInput).toBeInTheDocument(); - expect(button.prop('disabled')).toBe(true); - }); + await waitFor(() => { + expect(mlCalendarIdInput).toBeEnabled(); + }); - test('isDuplicateId returns true if form calendar id already exists in calendars', () => { - const wrapper = mountWithIntl(); + await userEvent.type(mlCalendarIdInput, 'this-is-a-new-calendar'); - const instance = wrapper.instance(); - instance.setState({ - calendars, - formCalendarId: calendars[0].calendar_id, + await waitFor(() => { + expect(mlCalendarIdInput).toHaveValue('this-is-a-new-calendar'); }); - wrapper.update(); - expect(instance.isDuplicateId()).toBe(true); + + const mlSaveCalendarButton = getByTestId('mlSaveCalendarButton'); + expect(mlSaveCalendarButton).toBeInTheDocument(); + expect(mlSaveCalendarButton).toBeEnabled(); + + await userEvent.click(mlSaveCalendarButton); + + expect(mockAddDanger).toHaveBeenCalledWith( + 'Cannot create calendar with id [this-is-a-new-calendar] as it already exists.' + ); }); test('Save button is disabled if canCreateCalendar is false', () => { @@ -169,11 +195,13 @@ describe('NewCalendar', () => { canCreateCalendar: false, }; - const wrapper = mountWithIntl(); - - const buttons = wrapper.find('[data-test-subj="mlSaveCalendarButton"]'); - const saveButton = buttons.find('EuiButton'); + const { getByTestId } = render( + + + + ); - expect(saveButton.prop('isDisabled')).toBe(true); + const saveButton = getByTestId('mlSaveCalendarButton'); + expect(saveButton).toBeDisabled(); }); }); diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/utils.js b/x-pack/plugins/ml/public/application/settings/calendars/edit/utils.js index 113a266e39a8d..34fa2f5292f62 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/utils.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/edit/utils.js @@ -5,13 +5,12 @@ * 2.0. */ -import { ml } from '../../../services/ml_api_service'; import { isJobIdValid } from '../../../../../common/util/job_utils'; import { i18n } from '@kbn/i18n'; -function getJobIds() { +function getJobIds(mlApiServices) { return new Promise((resolve, reject) => { - ml.jobs + mlApiServices.jobs .jobsSummary() .then((resp) => { resolve(resp.map((job) => job.id)); @@ -30,9 +29,9 @@ function getJobIds() { }); } -function getGroupIds() { +function getGroupIds(mlApiServices) { return new Promise((resolve, reject) => { - ml.jobs + mlApiServices.jobs .groups() .then((resp) => { resolve(resp.map((group) => group.id)); @@ -51,9 +50,10 @@ function getGroupIds() { }); } -function getCalendars() { +function getCalendars(mlApiServices) { return new Promise((resolve, reject) => { - ml.calendars() + mlApiServices + .calendars() .then((resp) => { resolve(resp); }) @@ -71,13 +71,13 @@ function getCalendars() { }); } -export function getCalendarSettingsData() { +export function getCalendarSettingsData(mlApiServices) { return new Promise(async (resolve, reject) => { try { const [jobIds, groupIds, calendars] = await Promise.all([ - getJobIds(), - getGroupIds(), - getCalendars(), + getJobIds(mlApiServices), + getGroupIds(mlApiServices), + getCalendars(mlApiServices), ]); resolve({ diff --git a/x-pack/plugins/ml/public/application/settings/calendars/list/__snapshots__/calendars_list.test.js.snap b/x-pack/plugins/ml/public/application/settings/calendars/list/__snapshots__/calendars_list.test.js.snap deleted file mode 100644 index ff4b38527bd63..0000000000000 --- a/x-pack/plugins/ml/public/application/settings/calendars/list/__snapshots__/calendars_list.test.js.snap +++ /dev/null @@ -1,66 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CalendarsList Renders calendar list with calendars 1`] = ` - -
- - -
- -
-`; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.js b/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.js index 27c6b4de8389c..413aae794fc15 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.js @@ -12,13 +12,11 @@ import { EuiConfirmModal, EUI_MODAL_CONFIRM_BUTTON } from '@elastic/eui'; import { CalendarsListHeader } from './header'; import { CalendarsListTable } from './table'; -import { ml } from '../../../services/ml_api_service'; import { toastNotificationServiceProvider } from '../../../services/toast_notification_service'; import { mlNodesAvailable } from '../../../ml_nodes_check/check_ml_nodes'; import { deleteCalendars } from './delete_calendars'; import { i18n } from '@kbn/i18n'; import { withKibana } from '@kbn/kibana-react-plugin/public'; -import { getDocLinks } from '../../../util/dependency_cache'; import { HelpMenu } from '../../../components/help_menu'; export class CalendarsListUI extends Component { @@ -40,6 +38,7 @@ export class CalendarsListUI extends Component { } loadCalendars = async () => { + const ml = this.props.kibana.services.mlServices.mlApiServices; this.setState({ loading: true }); try { @@ -82,10 +81,12 @@ export class CalendarsListUI extends Component { }; deleteCalendars = () => { + const ml = this.props.kibana.services.mlServices.mlApiServices; + const toasts = this.props.kibana.services.notifications.toasts; const { selectedForDeletion } = this.state; this.closeDestroyModal(); - deleteCalendars(selectedForDeletion, this.loadCalendars); + deleteCalendars(ml, toasts, selectedForDeletion, this.loadCalendars); }; addRequiredFieldsToList = (calendarsList = []) => { @@ -106,7 +107,7 @@ export class CalendarsListUI extends Component { const { canCreateCalendar, canDeleteCalendar } = this.props; let destroyModal = ''; - const helpLink = getDocLinks().links.ml.calendars; + const helpLink = this.props.kibana.services.docLinks.links.ml.calendars; if (this.state.isDestroyModalVisible) { destroyModal = ( diff --git a/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.test.js b/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.test.js index bbfdf7ef6b0e4..970c1afbe4fbc 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.test.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.test.js @@ -6,21 +6,28 @@ */ import React from 'react'; -import { shallowWithIntl } from '@kbn/test-jest-helpers'; -import { ml } from '../../../services/ml_api_service'; +import { render, screen, waitFor } from '@testing-library/react'; +import { cloneDeep } from 'lodash'; import { CalendarsList } from './calendars_list'; +// Mocking the child components to just assert that they get the data +// received via the async call using mlApiServices in the main component. jest.mock('../../../components/help_menu', () => ({ - HelpMenu: () =>
, + HelpMenu: ({ docLink }) =>
, })); - -jest.mock('../../../util/dependency_cache', () => ({ - getDocLinks: () => ({ - links: { - ml: { calendars: jest.fn() }, - }, - }), +jest.mock('./header', () => ({ + CalendarsListHeader: ({ totalCount }) => ( +
{totalCount}
+ ), +})); +jest.mock('./table', () => ({ + CalendarsListTable: ({ calendarsList }) => ( +
+ ), })); jest.mock('../../../capabilities/check_capabilities', () => ({ @@ -36,100 +43,100 @@ jest.mock('../../../capabilities/get_capabilities', () => ({ jest.mock('../../../ml_nodes_check/check_ml_nodes', () => ({ mlNodesAvailable: () => true, })); -jest.mock('../../../services/ml_api_service', () => ({ - ml: { - calendars: () => { - return Promise.resolve([]); - }, - delete: jest.fn(), - }, -})); - -jest.mock('react', () => { - const r = jest.requireActual('react'); - return { ...r, memo: (x) => x }; -}); -jest.mock('@kbn/kibana-react-plugin/public', () => ({ - withKibana: (node) => { - return node; +const mockCalendars = [ + { + calendar_id: 'farequote-calendar', + job_ids: ['farequote'], + description: 'test ', + events: [ + { + description: 'Downtime feb 9 2017 10:10 to 10:30', + start_time: 1486656600000, + end_time: 1486657800000, + calendar_id: 'farequote-calendar', + event_id: 'Ee-YgGcBxHgQWEhCO_xj', + }, + ], }, -})); - -const testingState = { - loading: false, - calendars: [ - { - calendar_id: 'farequote-calendar', - job_ids: ['farequote'], - description: 'test ', - events: [ - { - description: 'Downtime feb 9 2017 10:10 to 10:30', - start_time: 1486656600000, - end_time: 1486657800000, - calendar_id: 'farequote-calendar', - event_id: 'Ee-YgGcBxHgQWEhCO_xj', + { + calendar_id: 'this-is-a-new-calendar', + job_ids: ['test'], + description: 'new calendar', + events: [ + { + description: 'New event!', + start_time: 1544076000000, + end_time: 1544162400000, + calendar_id: 'this-is-a-new-calendar', + event_id: 'ehWKhGcBqHkXuWNrIrSV', + }, + ], + }, +]; +// need to pass in a copy of mockCalendars because it will be mutated +const mockCalendarsFn = jest.fn(() => Promise.resolve(cloneDeep(mockCalendars))); +const mockKibanaProp = { + services: { + docLinks: { links: { ml: { calendars: 'https://calendars' } } }, + mlServices: { mlApiServices: { calendars: mockCalendarsFn } }, + data: { + query: { + timefilter: { + timefilter: { + disableTimeRangeSelector: jest.fn(), + disableAutoRefreshSelector: jest.fn(), + }, }, - ], + }, }, - { - calendar_id: 'this-is-a-new-calendar', - job_ids: ['test'], - description: 'new calendar', - events: [ - { - description: 'New event!', - start_time: 1544076000000, - end_time: 1544162400000, - calendar_id: 'this-is-a-new-calendar', - event_id: 'ehWKhGcBqHkXuWNrIrSV', - }, - ], + notifications: { + toasts: { + addDanger: jest.fn(), + }, }, - ], - isDestroyModalVisible: false, - calendarId: null, - selectedForDeletion: [], - nodesAvailable: true, + }, }; +const mockReact = React; +jest.mock('@kbn/kibana-react-plugin/public', () => ({ + withKibana: (type) => { + const EnhancedType = (props) => { + return mockReact.createElement(type, { + ...props, + kibana: mockKibanaProp, + }); + }; + return EnhancedType; + }, +})); + const props = { canCreateCalendar: true, canDeleteCalendar: true, - kibana: { - services: { - data: { - query: { - timefilter: { - timefilter: { - disableTimeRangeSelector: jest.fn(), - disableAutoRefreshSelector: jest.fn(), - }, - }, - }, - }, - notifications: { - toasts: { - addDanger: () => {}, - }, - }, - }, - }, }; describe('CalendarsList', () => { - test('loads calendars on mount', () => { - ml.calendars = jest.fn(() => []); - shallowWithIntl(); + test('Renders calendar list with calendars', async () => { + render(); - expect(ml.calendars).toHaveBeenCalled(); - }); + await waitFor(() => { + // Select element by data-test-subj and assert text content + const calendarsListHeaderElement = screen.getByTestId('mockCalendarsListHeader'); + expect(calendarsListHeaderElement).toHaveTextContent('2'); + + // Select element by data-test-subj and assert data attributes + const calendarsListTableElement = screen.getByTestId('mockCalendarsListTable'); + const calendarListData = JSON.parse( + calendarsListTableElement.getAttribute('data-calendar-list') + ); - test('Renders calendar list with calendars', () => { - const wrapper = shallowWithIntl(); - wrapper.instance().setState(testingState); - wrapper.update(); - expect(wrapper).toMatchSnapshot(); + const expectedCalendarsData = cloneDeep(mockCalendars); + expectedCalendarsData[0].events_length = 1; + expectedCalendarsData[0].job_ids_string = 'farequote'; + expectedCalendarsData[1].events_length = 1; + expectedCalendarsData[1].job_ids_string = 'test'; + expect(calendarListData).toEqual(expectedCalendarsData); + }); }); }); diff --git a/x-pack/plugins/ml/public/application/settings/calendars/list/delete_calendars.js b/x-pack/plugins/ml/public/application/settings/calendars/list/delete_calendars.js index a767d7b65e4f3..13de491f10825 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/list/delete_calendars.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/list/delete_calendars.js @@ -8,14 +8,15 @@ import { i18n } from '@kbn/i18n'; import { extractErrorMessage } from '@kbn/ml-error-utils'; -import { getToastNotifications } from '../../../util/dependency_cache'; -import { ml } from '../../../services/ml_api_service'; - -export async function deleteCalendars(calendarsToDelete, callback) { +export async function deleteCalendars( + mlApiServices, + toastNotifications, + calendarsToDelete, + callback +) { if (calendarsToDelete === undefined || calendarsToDelete.length === 0) { return; } - const toastNotifications = getToastNotifications(); // Delete each of the specified calendars in turn, waiting for each response // before deleting the next to minimize load on the cluster. @@ -36,7 +37,7 @@ export async function deleteCalendars(calendarsToDelete, callback) { for (const calendar of calendarsToDelete) { const calendarId = calendar.calendar_id; try { - await ml.deleteCalendar({ calendarId }); + await mlApiServices.deleteCalendar({ calendarId }); } catch (error) { console.log('Error deleting calendar:', error); toastNotifications.addDanger({ diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/components/add_item_popover/__snapshots__/add_item_popover.test.js.snap b/x-pack/plugins/ml/public/application/settings/filter_lists/components/add_item_popover/__snapshots__/add_item_popover.test.js.snap index 61cbe9f028874..c29a40eaba6b9 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/components/add_item_popover/__snapshots__/add_item_popover.test.js.snap +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/components/add_item_popover/__snapshots__/add_item_popover.test.js.snap @@ -31,7 +31,9 @@ exports[`AddItemPopover calls addItems with multiple items on clicking Add butto panelPaddingSize="m" repositionToCrossAxis={true} > - + - + - + - + -
- - - - - - - - - - - - - - - - -
- - -`; - -exports[`EditFilterList renders after selecting an item and deleting it 1`] = ` - -
- - - - - - - - - - - - - - - - -
- -
-`; - -exports[`EditFilterList renders after selecting an item and deleting it 2`] = ` - -
- - - - - - - - - - - - - - - - -
- -
-`; - -exports[`EditFilterList renders the edit page for a new filter list and updates ID 1`] = ` - -
- - - - - - - - - - - - - - - - -
- -
-`; - -exports[`EditFilterList renders the edit page for a new filter list and updates ID 2`] = ` - -
- - - - - - - - - - - - - - - - -
- -
-`; - -exports[`EditFilterList renders the edit page for an existing filter list and updates description 1`] = ` - -
- - - - - - - - - - - - - - - - -
- -
-`; - -exports[`EditFilterList renders the edit page for an existing filter list and updates description 2`] = ` - -
- - - - - - - - - - - - - - - - -
- -
-`; - -exports[`EditFilterList updates the items per page 1`] = ` - -
- - - - - - - - - - - - - - - - -
- -
-`; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.js b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.js index d05484a9d3b89..2f53963a5b3f2 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.js @@ -30,10 +30,8 @@ import { EditFilterListHeader } from './header'; import { EditFilterListToolbar } from './toolbar'; import { ItemsGrid } from '../../../components/items_grid'; import { isValidFilterListId, saveFilterList } from './utils'; -import { ml } from '../../../services/ml_api_service'; import { toastNotificationServiceProvider } from '../../../services/toast_notification_service'; import { ML_PAGES } from '../../../../../common/constants/locator'; -import { getDocLinks } from '../../../util/dependency_cache'; import { HelpMenu } from '../../../components/help_menu'; const DEFAULT_ITEMS_PER_PAGE = 50; @@ -116,6 +114,7 @@ export class EditFilterListUI extends Component { }; loadFilterList = (filterId) => { + const ml = this.props.kibana.services.mlServices.mlApiServices; ml.filters .filters({ filterId }) .then((filter) => { @@ -285,7 +284,14 @@ export class EditFilterListUI extends Component { const { loadedFilter, newFilterId, description, items } = this.state; const filterId = this.props.filterId !== undefined ? this.props.filterId : newFilterId; - saveFilterList(filterId, description, items, loadedFilter) + saveFilterList( + this.props.kibana.services.notifications.toasts, + this.props.kibana.services.mlServices.mlApiServices, + filterId, + description, + items, + loadedFilter + ) .then((savedFilter) => { this.setLoadedFilterState(savedFilter); this.returnToFiltersList(); @@ -321,7 +327,7 @@ export class EditFilterListUI extends Component { const totalItemCount = items !== undefined ? items.length : 0; - const helpLink = getDocLinks().links.ml.customRules; + const helpLink = this.props.kibana.services.docLinks.links.ml.customRules; return ( <> diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.test.js b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.test.js index e3e740f1f7d78..a277457151fa7 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.test.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.test.js @@ -5,22 +5,16 @@ * 2.0. */ -jest.mock('../../../components/help_menu', () => ({ - HelpMenu: () =>
, -})); +import React from 'react'; +import { render, waitFor, within } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import '@testing-library/jest-dom/extend-expect'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; -jest.mock('../../../util/dependency_cache', () => ({ - getDocLinks: () => ({ - links: { - ml: { customRules: jest.fn() }, - }, - }), -})); +import { EditFilterList } from './edit_filter_list'; -// Define the required mocks used for loading, saving and validating the filter list. -jest.mock('./utils', () => ({ - isValidFilterListId: () => true, - saveFilterList: jest.fn(), +jest.mock('../../../components/help_menu', () => ({ + HelpMenu: () =>
, })); // Mock the call for loading the list of filters. @@ -35,104 +29,243 @@ const mockTestFilter = { jobs: ['dns_exfiltration'], }, }; -jest.mock('../../../services/ml_api_service', () => ({ - ml: { - filters: { - filters: () => { - return Promise.resolve(mockTestFilter); +const mockFilters = jest.fn().mockImplementation(() => Promise.resolve(mockTestFilter)); +const mockKibanaContext = { + services: { + docLinks: { links: { ml: { customRules: 'test' } } }, + notifications: { toasts: { addDanger: jest.fn(), addError: jest.fn() } }, + mlServices: { + mlApiServices: { + filters: { + filters: mockFilters, + }, }, }, }, -})); +}; +const mockReact = React; jest.mock('@kbn/kibana-react-plugin/public', () => ({ - withKibana: (node) => { - return node; + withKibana: (type) => { + const EnhancedType = (props) => { + return mockReact.createElement(type, { + ...props, + kibana: mockKibanaContext, + }); + }; + return EnhancedType; }, })); -import { shallowWithIntl } from '@kbn/test-jest-helpers'; -import React from 'react'; - -import { EditFilterList } from './edit_filter_list'; - const props = { canCreateFilter: true, canDeleteFilter: true, - kibana: { - services: { - notifications: { - toasts: { - addWarning: () => {}, - }, - }, - }, - }, }; -function prepareEditTest() { - const wrapper = shallowWithIntl(); +describe('EditFilterList', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + test('renders the edit page for a new filter list and updates ID', async () => { + const { getByTestId, getByText } = render( + + + + ); - // Cannot find a way to generate the snapshot after the Promise in the mock ml.filters - // has resolved. - // So set the loaded filter state directly to ensure the snapshot is generated against - // the test filter and not the default empty state. - const instance = wrapper.instance(); - instance.setLoadedFilterState(mockTestFilter); - wrapper.update(); + // The filter list should be empty. + expect(getByText('No items have been added')).toBeInTheDocument(); - return wrapper; -} + const mlNewFilterListIdInput = getByTestId('mlNewFilterListIdInput'); + expect(mlNewFilterListIdInput).toBeInTheDocument(); -describe('EditFilterList', () => { - test('renders the edit page for a new filter list and updates ID', () => { - const wrapper = shallowWithIntl(); - expect(wrapper).toMatchSnapshot(); - - const instance = wrapper.instance(); - instance.updateNewFilterId('new_filter_list'); - wrapper.update(); - expect(wrapper).toMatchSnapshot(); + await userEvent.type(mlNewFilterListIdInput, 'new_filter_list'); + + await waitFor(() => { + expect(mlNewFilterListIdInput).toHaveValue('new_filter_list'); + }); + + // After entering a valid ID, the save button should be enabled. + expect(getByTestId('mlFilterListSaveButton')).toBeEnabled(); + + await userEvent.clear(mlNewFilterListIdInput); + + // Emptied again, the save button should be disabled. + await waitFor(() => { + expect(getByTestId('mlFilterListSaveButton')).toBeDisabled(); + }); + + await userEvent.type(mlNewFilterListIdInput, '#invalid#$%^', { delay: 1 }); + + await waitFor(() => { + expect(mlNewFilterListIdInput).toHaveValue('#invalid#$%^'); + }); + + // After entering an invalid ID, the save button should still be disabled. + await waitFor(() => { + expect(getByTestId('mlFilterListSaveButton')).toBeDisabled(); + }); + + expect(mockFilters).toHaveBeenCalledTimes(0); }); - test('renders the edit page for an existing filter list and updates description', () => { - const wrapper = prepareEditTest(); - expect(wrapper).toMatchSnapshot(); + // There is a bug in `v13.5.0` of `@testing-library/user-event` that doesn't + // allow to click on elements that (wrongly ?) inherit pointer-events. + // A PR to update the lib is up here: https://github.com/elastic/kibana/pull/189949 + test.skip('renders the edit page for an existing filter list and updates description', async () => { + const { getByTestId } = render( + + + + ); + + expect(mockFilters).toHaveBeenCalledWith({ filterId: 'safe_domains' }); + + waitFor(() => { + expect(getByTestId('mlNewFilterListDescriptionText')).toHaveValue( + 'List of known safe domains' + ); + }); + + const mlFilterListEditDescriptionButton = getByTestId('mlFilterListEditDescriptionButton'); + + expect(mlFilterListEditDescriptionButton).toBeInTheDocument(); - const instance = wrapper.instance(); - instance.updateDescription('Known safe web domains'); - wrapper.update(); - expect(wrapper).toMatchSnapshot(); + // Workaround with `pointerEventsCheck` so we don't get "Error: unable to click element as it has or inherits pointer-events set to "none"." + await userEvent.click(mlFilterListEditDescriptionButton, { pointerEventsCheck: 0 }); + + const mlFilterListDescriptionInput = getByTestId('mlFilterListDescriptionInput'); + + waitFor(() => { + expect(mlFilterListDescriptionInput).toBeInTheDocument(); + expect(mlFilterListDescriptionInput).toHaveValue('List of known safe domains'); + }); + + await userEvent.clear(mlFilterListDescriptionInput); + await userEvent.type(mlFilterListDescriptionInput, 'Known safe web domains'); + await userEvent.click(mlFilterListEditDescriptionButton); + + waitFor(() => { + expect(getByTestId('mlNewFilterListDescriptionText')).toHaveValue('Known safe web domains'); + }); }); - test('updates the items per page', () => { - const wrapper = prepareEditTest(); - const instance = wrapper.instance(); + test('updates the items per page', async () => { + const { findByText, findByTestId, getByTestId, queryByText } = render( + + + + ); + + expect(mockFilters).toHaveBeenCalledWith({ filterId: 'safe_domains' }); + + // Use findByText to be able to wait for the page to be updated. + expect(await findByText('Items per page: 50')).toBeInTheDocument(); + + const mlItemsGridPaginationPopover = getByTestId('mlItemsGridPaginationPopover'); + expect(mlItemsGridPaginationPopover).toBeInTheDocument(); - instance.setItemsPerPage(500); - wrapper.update(); - expect(wrapper).toMatchSnapshot(); + // Click to open the popover + await userEvent.click(mlItemsGridPaginationPopover.querySelector('button')); + + // Use findByText to be able to wait for the page to be updated. + expect(await findByTestId('mlItemsGridPaginationMenuPanel')).toBeInTheDocument(); + // The popover should include the option for 500 items. + expect(await findByText('500 items')).toBeInTheDocument(); + + // Next we want to click the '500 items' button. + const mlItemsGridPaginationMenuPanel = getByTestId('mlItemsGridPaginationMenuPanel'); + const buttons = within(mlItemsGridPaginationMenuPanel).getAllByRole('button'); + expect(buttons.length).toBe(4); + await userEvent.click(buttons[2]); + + // Use findByText to be able to wait for the page to be updated. + expect(await queryByText('Items per page: 50')).not.toBeInTheDocument(); + expect(await findByText('Items per page: 500')).toBeInTheDocument(); }); - test('renders after selecting an item and deleting it', () => { - const wrapper = prepareEditTest(); - const instance = wrapper.instance(); + test('renders after selecting an item and deleting it', async () => { + const { findByText, getAllByTestId, getByTestId, queryByText } = render( + + + + ); + + expect(mockFilters).toHaveBeenCalledWith({ filterId: 'safe_domains' }); - instance.setItemSelected(mockTestFilter.items[1], true); - wrapper.update(); - expect(wrapper).toMatchSnapshot(); + // Use findByText to be able to wait for the page to be updated. + expect(await findByText('google.com')).toBeInTheDocument(); + expect(await findByText('google.co.uk')).toBeInTheDocument(); + expect(await findByText('elastic.co')).toBeInTheDocument(); + expect(await findByText('youtube.com')).toBeInTheDocument(); - instance.deleteSelectedItems(); - wrapper.update(); - expect(wrapper).toMatchSnapshot(); + const checkboxes = getAllByTestId('mlGridItemCheckbox'); + expect(checkboxes.length).toBe(4); + + // Click the checkbox for google.co.uk and then the delete button. + await userEvent.click(checkboxes[1]); + await userEvent.click(getByTestId('mlFilterListDeleteItemButton')); + + expect(await findByText('google.com')).toBeInTheDocument(); + expect(await queryByText('google.co.uk')).not.toBeInTheDocument(); + expect(await findByText('elastic.co')).toBeInTheDocument(); + expect(await findByText('youtube.com')).toBeInTheDocument(); + expect(getAllByTestId('mlGridItemCheckbox')).toHaveLength(3); }); - test('adds new items to filter list', () => { - const wrapper = prepareEditTest(); - const instance = wrapper.instance(); + // There is a bug in `v13.5.0` of `@testing-library/user-event` that doesn't + // allow to click on elements that (wrongly ?) inherit pointer-events. + // A PR to update the lib is up here: https://github.com/elastic/kibana/pull/189949 + test.skip('adds new items to filter list', async () => { + const { getByTestId, getByText, findByText, findByTestId, queryByTestId, queryByText } = render( + + + + ); + + expect(mockFilters).toHaveBeenCalledWith({ filterId: 'safe_domains' }); + + // Use findByText to be able to wait for the page to be updated. + expect(await findByText('google.com')).toBeInTheDocument(); + expect(await findByText('google.co.uk')).toBeInTheDocument(); + expect(await findByText('elastic.co')).toBeInTheDocument(); + expect(await findByText('youtube.com')).toBeInTheDocument(); + expect(await queryByText('amazon.com')).not.toBeInTheDocument(); + expect(await queryByText('spotify.com')).not.toBeInTheDocument(); + + const mlFilterListOpenNewItemsPopoverButton = queryByTestId( + 'mlFilterListOpenNewItemsPopoverButton' + ); + expect(mlFilterListOpenNewItemsPopoverButton).toBeInTheDocument(); + await userEvent.click(mlFilterListOpenNewItemsPopoverButton); + + // Assert that the popover was opened. + expect(await findByTestId('mlFilterListAddItemPopoverContent')).toBeInTheDocument(); + + // Assert that the textarea is present and empty. + const mlFilterListAddItemTextArea = getByTestId('mlFilterListAddItemTextArea'); + expect(mlFilterListAddItemTextArea).toBeInTheDocument(); + expect(mlFilterListAddItemTextArea).toHaveValue(''); + + // Assert that the add items button prenset but disabled. + const mlFilterListAddItemsButton = getByTestId('mlFilterListAddItemsButton'); + expect(mlFilterListAddItemsButton).toBeInTheDocument(); + expect(mlFilterListAddItemsButton).toBeDisabled(); + + // Enter items in the textarea and click the add items button + await userEvent.type(mlFilterListAddItemTextArea, 'amazon.com\nspotify.com'); + await userEvent.click(mlFilterListAddItemsButton); + + // Assert that the popover is closed again + expect(await queryByTestId('mlFilterListAddItemPopover')).not.toBeInTheDocument(); - instance.addItems(['amazon.com', 'spotify.com']); - wrapper.update(); - expect(wrapper).toMatchSnapshot(); + // Assert that the item grid has been updated. + expect(getByText('google.com')).toBeInTheDocument(); + expect(getByText('google.co.uk')).toBeInTheDocument(); + expect(getByText('elastic.co')).toBeInTheDocument(); + expect(getByText('youtube.com')).toBeInTheDocument(); + expect(getByText('amazon.com')).toBeInTheDocument(); + expect(getByText('spotify.com')).toBeInTheDocument(); }); }); diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/utils.js b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/utils.js index 2565a53411298..e1f42e2e636ad 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/utils.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/utils.js @@ -6,9 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { getToastNotifications } from '../../../util/dependency_cache'; import { isJobIdValid } from '../../../../../common/util/job_utils'; -import { ml } from '../../../services/ml_api_service'; export function isValidFilterListId(id) { // Filter List ID requires the same format as a Job ID, therefore isJobIdValid can be used @@ -17,11 +15,18 @@ export function isValidFilterListId(id) { // Saves a filter list, running an update if the supplied loadedFilterList, holding the // original filter list to which edits are being applied, is defined with a filter_id property. -export function saveFilterList(filterId, description, items, loadedFilterList) { +export function saveFilterList( + toastNotifications, + mlApiServices, + filterId, + description, + items, + loadedFilterList +) { return new Promise((resolve, reject) => { if (loadedFilterList === undefined || loadedFilterList.filter_id === undefined) { // Create a new filter. - addFilterList(filterId, description, items) + addFilterList(toastNotifications, mlApiServices, filterId, description, items) .then((newFilter) => { resolve(newFilter); }) @@ -30,7 +35,7 @@ export function saveFilterList(filterId, description, items, loadedFilterList) { }); } else { // Edit to existing filter. - updateFilterList(loadedFilterList, description, items) + updateFilterList(mlApiServices, loadedFilterList, description, items) .then((updatedFilter) => { resolve(updatedFilter); }) @@ -41,7 +46,7 @@ export function saveFilterList(filterId, description, items, loadedFilterList) { }); } -export function addFilterList(filterId, description, items) { +export function addFilterList(toastNotifications, mlApiServices, filterId, description, items) { const filterWithIdExistsErrorMessage = i18n.translate( 'xpack.ml.settings.filterLists.filterWithIdExistsErrorMessage', { @@ -54,13 +59,13 @@ export function addFilterList(filterId, description, items) { return new Promise((resolve, reject) => { // First check the filterId isn't already in use by loading the current list of filters. - ml.filters + mlApiServices.filters .filtersStats() .then((filterLists) => { const savedFilterIds = filterLists.map((filterList) => filterList.filter_id); if (savedFilterIds.indexOf(filterId) === -1) { // Save the new filter. - ml.filters + mlApiServices.filters .addFilter(filterId, description, items) .then((newFilter) => { resolve(newFilter); @@ -69,7 +74,6 @@ export function addFilterList(filterId, description, items) { reject(error); }); } else { - const toastNotifications = getToastNotifications(); toastNotifications.addDanger(filterWithIdExistsErrorMessage); reject(new Error(filterWithIdExistsErrorMessage)); } @@ -80,14 +84,14 @@ export function addFilterList(filterId, description, items) { }); } -export function updateFilterList(loadedFilterList, description, items) { +export function updateFilterList(mlApiServices, loadedFilterList, description, items) { return new Promise((resolve, reject) => { // Get items added and removed from loaded filter. const loadedItems = loadedFilterList.items; const addItems = items.filter((item) => loadedItems.includes(item) === false); const removeItems = loadedItems.filter((item) => items.includes(item) === false); - ml.filters + mlApiServices.filters .updateFilter(loadedFilterList.filter_id, description, addItems, removeItems) .then((updatedFilter) => { resolve(updatedFilter); diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/list/__snapshots__/filter_lists.test.js.snap b/x-pack/plugins/ml/public/application/settings/filter_lists/list/__snapshots__/filter_lists.test.js.snap deleted file mode 100644 index 3078fb3d504c9..0000000000000 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/list/__snapshots__/filter_lists.test.js.snap +++ /dev/null @@ -1,38 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Filter Lists renders a list of filters 1`] = ` - -
- - -
- -
-`; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/list/filter_lists.js b/x-pack/plugins/ml/public/application/settings/filter_lists/list/filter_lists.js index a55473a731322..c955cce8f79d4 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/list/filter_lists.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/list/filter_lists.js @@ -18,10 +18,8 @@ import { withKibana } from '@kbn/kibana-react-plugin/public'; import { FilterListsHeader } from './header'; import { FilterListsTable } from './table'; -import { ml } from '../../../services/ml_api_service'; import { toastNotificationServiceProvider } from '../../../services/toast_notification_service'; -import { getDocLinks } from '../../../util/dependency_cache'; import { HelpMenu } from '../../../components/help_menu'; export class FilterListsUI extends Component { @@ -64,6 +62,7 @@ export class FilterListsUI extends Component { }; refreshFilterLists = () => { + const ml = this.props.kibana.services.mlServices.mlApiServices; // Load the list of filters. ml.filters .filtersStats() @@ -97,7 +96,7 @@ export class FilterListsUI extends Component { render() { const { filterLists, selectedFilterLists } = this.state; const { canCreateFilter, canDeleteFilter } = this.props; - const helpLink = getDocLinks().links.ml.customRules; + const helpLink = this.props.kibana.services.docLinks.links.ml.customRules; return ( <> diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/list/filter_lists.test.js b/x-pack/plugins/ml/public/application/settings/filter_lists/list/filter_lists.test.js index 5d0306564e312..e4a27809019b5 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/list/filter_lists.test.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/list/filter_lists.test.js @@ -5,50 +5,69 @@ * 2.0. */ -import { shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; +import { render, screen, waitFor } from '@testing-library/react'; +import '@testing-library/jest-dom/extend-expect'; import { FilterLists } from './filter_lists'; +// Mocking the child components to just assert that they get the data +// received via the async call using mlApiServices in the main component. jest.mock('../../../components/help_menu', () => ({ - HelpMenu: () =>
, + HelpMenu: ({ docLink }) =>
, })); - -jest.mock('../../../util/dependency_cache', () => ({ - getDocLinks: () => ({ - links: { - ml: { customRules: jest.fn() }, - }, - }), +jest.mock('./header', () => ({ + FilterListsHeader: ({ totalCount }) => ( +
{totalCount}
+ ), +})); +jest.mock('./table', () => ({ + FilterListsTable: ({ filterLists, selectedFilterLists }) => ( +
+ ), })); jest.mock('../../../capabilities/check_capabilities', () => ({ checkPermission: () => true, })); -jest.mock('@kbn/kibana-react-plugin/public', () => ({ - withKibana: (node) => { - return node; - }, -})); - // Mock the call for loading the list of filters. -// The mock is hoisted to the top, so need to prefix the filter variable -// with 'mock' so it can be used lazily. const mockTestFilter = { filter_id: 'safe_domains', description: 'List of known safe domains', item_count: 500, used_by: { jobs: ['dns_exfiltration'] }, }; -jest.mock('../../../services/ml_api_service', () => ({ - ml: { - filters: { - filtersStats: () => { - return Promise.resolve([mockTestFilter]); +const mockKibanaProp = { + services: { + docLinks: { links: { ml: { customRules: 'https://customRules' } } }, + mlServices: { + mlApiServices: { + filters: { + filtersStats: () => { + return Promise.resolve([mockTestFilter]); + }, + }, }, }, }, +}; + +const mockReact = React; +jest.mock('@kbn/kibana-react-plugin/public', () => ({ + withKibana: (type) => { + const EnhancedType = (props) => { + return mockReact.createElement(type, { + ...props, + kibana: mockKibanaProp, + }); + }; + return EnhancedType; + }, })); const props = { @@ -57,15 +76,23 @@ const props = { }; describe('Filter Lists', () => { - test('renders a list of filters', () => { - const wrapper = shallowWithIntl(); + test('renders a list of filters', async () => { + render(); + + // Wait for the elements to appear + await waitFor(() => { + expect(screen.getByTestId('mockFilterListsHeader')).toHaveTextContent('1'); + }); + + // Assert that the child components receive the data based on async calls and kibana context. + const filterListsTableElement = screen.getByTestId('mockFilterListsTable'); + expect(filterListsTableElement).toHaveAttribute( + 'data-filter-lists', + JSON.stringify([mockTestFilter]) + ); + expect(filterListsTableElement).toHaveAttribute('data-selected-filter-lists', '[]'); - // Cannot find a way to generate the snapshot after the Promise in the mock ml.filters - // has resolved. - // So set the filter lists directly to ensure the snapshot is generated against - // the test list and not the default empty state. - wrapper.instance().setFilterLists([mockTestFilter]); - wrapper.update(); - expect(wrapper).toMatchSnapshot(); + const helpMenuElement = screen.getByTestId('mockHelpMenu'); + expect(helpMenuElement).toHaveAttribute('data-link', 'https://customRules'); }); }); diff --git a/x-pack/plugins/ml/public/application/settings/settings.test.tsx b/x-pack/plugins/ml/public/application/settings/settings.test.tsx index 89ad2a965df91..38ef8c784c114 100644 --- a/x-pack/plugins/ml/public/application/settings/settings.test.tsx +++ b/x-pack/plugins/ml/public/application/settings/settings.test.tsx @@ -16,22 +16,19 @@ jest.mock('../components/help_menu', () => ({ })); jest.mock('../contexts/kibana', () => ({ - useNotifications: () => { - return { - toasts: { addDanger: jest.fn(), addError: jest.fn() }, - }; - }, - useMlKibana: () => { - return { - services: { - docLinks: { - links: { - ml: { guide: jest.fn() }, - }, + useNotifications: () => ({ + toasts: { addDanger: jest.fn(), addError: jest.fn() }, + }), + useMlApiContext: jest.fn(), + useMlKibana: () => ({ + services: { + docLinks: { + links: { + ml: { guide: jest.fn() }, }, }, - }; - }, + }, + }), })); jest.mock('../contexts/kibana/use_create_url', () => ({ diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/plot_function_controls/plot_function_controls.tsx b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/plot_function_controls/plot_function_controls.tsx index 6ad84f892eb31..3a44cd19f645d 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/plot_function_controls/plot_function_controls.tsx +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/plot_function_controls/plot_function_controls.tsx @@ -10,7 +10,7 @@ import { EuiFlexItem, EuiFormRow, EuiSelect } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { ML_JOB_AGGREGATION } from '@kbn/ml-anomaly-utils'; import type { MlJob } from '@elastic/elasticsearch/lib/api/types'; -import { mlJobService } from '../../../services/job_service'; +import { useMlJobService } from '../../../services/job_service'; import { getFunctionDescription, isMetricDetector } from '../../get_function_description'; import { useToastNotificationService } from '../../../services/toast_notification_service'; import { useMlResultsService } from '../../../services/results_service'; @@ -56,19 +56,18 @@ export const PlotByFunctionControls = ({ }) => { const toastNotificationService = useToastNotificationService(); const mlResultsService = useMlResultsService(); + const mlJobService = useMlJobService(); const getFunctionDescriptionToPlot = useCallback( async ( _selectedDetectorIndex: number, _selectedEntities: MlEntity | undefined, - _selectedJobId: string, _selectedJob: CombinedJob ) => { const functionToPlot = await getFunctionDescription( { selectedDetectorIndex: _selectedDetectorIndex, selectedEntities: _selectedEntities, - selectedJobId: _selectedJobId, selectedJob: _selectedJob, }, toastNotificationService, @@ -95,12 +94,7 @@ export const PlotByFunctionControls = ({ ) { const detector = selectedJob.analysis_config.detectors[selectedDetectorIndex]; if (detector?.function === ML_JOB_AGGREGATION.METRIC) { - getFunctionDescriptionToPlot( - selectedDetectorIndex, - selectedEntities, - selectedJobId, - selectedJob - ); + getFunctionDescriptionToPlot(selectedDetectorIndex, selectedEntities, selectedJob); } } // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/series_controls.tsx b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/series_controls.tsx index ead36e4ffe3a4..1d9d61e3ddc32 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/series_controls.tsx +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/series_controls.tsx @@ -16,7 +16,7 @@ import { useStorage } from '@kbn/ml-local-storage'; import type { MlEntityFieldType } from '@kbn/ml-anomaly-utils'; import type { MlJob } from '@elastic/elasticsearch/lib/api/types'; import { EntityControl } from '../entity_control'; -import { mlJobService } from '../../../services/job_service'; +import { useMlJobService } from '../../../services/job_service'; import type { CombinedJob, Detector, @@ -105,6 +105,7 @@ export const SeriesControls: FC> = ({ }, }, } = useMlKibana(); + const mlJobService = useMlJobService(); const selectedJob: CombinedJob | MlJob = useMemo( () => job ?? mlJobService.getJob(selectedJobId), @@ -128,7 +129,6 @@ export const SeriesControls: FC> = ({ return getControlsForDetector( selectedDetectorIndex, selectedEntities, - selectedJobId, selectedJob as CombinedJob ); // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js index d1e75c0bea9b0..7882fdfc21513 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.js @@ -161,9 +161,18 @@ class TimeseriesChartIntl extends Component { rowMouseenterSubscriber = null; rowMouseleaveSubscriber = null; - constructor(props) { + constructor(props, constructorContext) { super(props); this.state = { popoverData: null, popoverCoords: [0, 0], showRuleEditorFlyout: () => {} }; + + this.mlTimeSeriesExplorer = timeSeriesExplorerServiceFactory( + constructorContext.services.uiSettings, + constructorContext.services.mlServices.mlApiServices, + constructorContext.services.mlServices.mlResultsService + ); + this.getTimeBuckets = timeBucketsServiceFactory( + constructorContext.services.uiSettings + ).getTimeBuckets; } componentWillUnmount() { @@ -179,15 +188,6 @@ class TimeseriesChartIntl extends Component { } componentDidMount() { - this.mlTimeSeriesExplorer = timeSeriesExplorerServiceFactory( - this.context.services.uiSettings, - this.context.services.mlServices.mlApiServices, - this.context.services.mlServices.mlResultsService - ); - this.getTimeBuckets = timeBucketsServiceFactory( - this.context.services.uiSettings - ).getTimeBuckets; - const { svgWidth, svgHeight } = this.props; const { focusHeight: focusHeightIncoming, focusChartHeight: focusChartIncoming } = svgHeight ? getChartHeights(svgHeight) diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.test.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.test.js index cdd8540dc22bf..1e9da4aa72787 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.test.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart.test.js @@ -7,7 +7,7 @@ import moment from 'moment-timezone'; import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; +import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; import React from 'react'; import { TimeseriesChart } from './timeseries_chart'; @@ -37,10 +37,6 @@ jest.mock('../../../util/time_series_explorer_service', () => ({ }, })); -jest.mock('../../../services/field_format_service', () => ({ - mlFieldFormatService: {}, -})); - function getTimeseriesChartPropsMock() { return { contextChartSelected: jest.fn(), @@ -55,12 +51,13 @@ function getTimeseriesChartPropsMock() { }; } -const servicesMock = { +const kibanaReactContextMock = createKibanaReactContext({ mlServices: { mlApiServices: {}, mlResultsService: {}, }, -}; + notifications: { toasts: { addDanger: jest.fn(), addSuccess: jest.fn() } }, +}); describe('TimeseriesChart', () => { const mockedGetBBox = { x: 0, y: -10, width: 40, height: 20 }; @@ -78,9 +75,9 @@ describe('TimeseriesChart', () => { const props = getTimeseriesChartPropsMock(); const wrapper = mountWithIntl( - + - + ); expect(wrapper.html()).toBe('
'); diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart_with_tooltip.tsx b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart_with_tooltip.tsx index 3a5fe63f7a81a..14c57cbb6c20e 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart_with_tooltip.tsx +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseries_chart/timeseries_chart_with_tooltip.tsx @@ -86,7 +86,7 @@ export const TimeSeriesChartWithTooltips: FC = useEffect(() => { let unmounted = false; - const entities = getControlsForDetector(detectorIndex, selectedEntities, selectedJob.job_id); + const entities = getControlsForDetector(detectorIndex, selectedEntities, selectedJob); const nonBlankEntities = Array.isArray(entities) ? entities.filter((entity) => entity.fieldValue !== null) : undefined; diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/get_controls_for_detector.ts b/x-pack/plugins/ml/public/application/timeseriesexplorer/get_controls_for_detector.ts index 214fe8bf45f47..f4dc6bceaa237 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/get_controls_for_detector.ts +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/get_controls_for_detector.ts @@ -5,9 +5,8 @@ * 2.0. */ -import { mlJobService } from '../services/job_service'; import type { Entity } from './components/entity_control/entity_control'; -import type { JobId, CombinedJob } from '../../../common/types/anomaly_detection_jobs'; +import type { CombinedJob } from '../../../common/types/anomaly_detection_jobs'; import type { MlEntity } from '../../embeddables'; /** @@ -16,11 +15,8 @@ import type { MlEntity } from '../../embeddables'; export function getControlsForDetector( selectedDetectorIndex: number, selectedEntities: MlEntity | undefined, - selectedJobId: JobId, - job?: CombinedJob + selectedJob: CombinedJob ): Entity[] { - const selectedJob = job ?? mlJobService.getJob(selectedJobId); - const entities: Entity[] = []; if (selectedJob === undefined) { diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/get_function_description.ts b/x-pack/plugins/ml/public/application/timeseriesexplorer/get_function_description.ts index 274bfd3c6f27c..ed060c3c66dd4 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/get_function_description.ts +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/get_function_description.ts @@ -34,12 +34,10 @@ export const getFunctionDescription = async ( { selectedDetectorIndex, selectedEntities, - selectedJobId, selectedJob, }: { selectedDetectorIndex: number; selectedEntities: MlEntity | undefined; - selectedJobId: string; selectedJob: CombinedJob; }, toastNotificationService: ToastNotificationService, @@ -52,7 +50,7 @@ export const getFunctionDescription = async ( const entityControls = getControlsForDetector( selectedDetectorIndex, selectedEntities, - selectedJobId + selectedJob ); const criteriaFields = getCriteriaFields(selectedDetectorIndex, entityControls); diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.d.ts b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.d.ts index ec201d29cdc3a..90dfe24946195 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.d.ts +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.d.ts @@ -9,20 +9,21 @@ import React from 'react'; import type { TimeRangeBounds } from '@kbn/ml-time-buckets'; -interface Props { +interface TimeSeriesExplorerProps { appStateHandler: (action: string, payload: any) => void; autoZoomDuration: number | undefined; bounds: TimeRangeBounds | undefined; - dateFormatTz: string; lastRefresh: number; - selectedJobId: string | undefined; - selectedDetectorIndex: number; - selectedEntities: Record | undefined; + previousRefresh?: number; + dateFormatTz: string; + selectedJobId: string; + selectedDetectorIndex?: number; + selectedEntities?: Record; selectedForecastId?: string; - tableInterval: string; - tableSeverity: number; + tableInterval?: string; + tableSeverity?: number; zoom?: { from?: string; to?: string }; } // eslint-disable-next-line react/prefer-stateless-function -declare class TimeSeriesExplorer extends React.Component {} +declare class TimeSeriesExplorer extends React.Component {} diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.js index 0eb8182fa3e3c..4bfcb8e7fd98c 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.js @@ -42,7 +42,6 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { context } from '@kbn/kibana-react-plugin/public'; import { getBoundsRoundedToInterval } from '@kbn/ml-time-buckets'; import { ResizeChecker } from '@kbn/kibana-utils-plugin/public'; -import { TimeSeriesExplorerHelpPopover } from './timeseriesexplorer_help_popover'; import { ANOMALIES_TABLE_DEFAULT_QUERY_SIZE } from '../../../common/constants/search'; import { @@ -56,18 +55,19 @@ import { import { AnnotationFlyout } from '../components/annotations/annotation_flyout'; import { AnnotationsTable } from '../components/annotations/annotations_table'; import { AnomaliesTable } from '../components/anomalies_table/anomalies_table'; -import { ForecastingModal } from './components/forecasting_modal/forecasting_modal'; import { LoadingIndicator } from '../components/loading_indicator/loading_indicator'; import { SelectInterval } from '../components/controls/select_interval/select_interval'; import { SelectSeverity } from '../components/controls/select_severity/select_severity'; -import { TimeseriesexplorerNoChartData } from './components/timeseriesexplorer_no_chart_data'; -import { TimeSeriesExplorerPage } from './timeseriesexplorer_page'; - -import { ml } from '../services/ml_api_service'; import { forecastServiceFactory } from '../services/forecast_service'; import { timeSeriesExplorerServiceFactory } from '../util/time_series_explorer_service'; -import { mlJobService } from '../services/job_service'; +import { mlJobServiceFactory } from '../services/job_service'; import { mlResultsServiceProvider } from '../services/results_service'; +import { toastNotificationServiceProvider } from '../services/toast_notification_service'; + +import { ForecastingModal } from './components/forecasting_modal/forecasting_modal'; +import { TimeseriesexplorerNoChartData } from './components/timeseriesexplorer_no_chart_data'; +import { TimeSeriesExplorerPage } from './timeseriesexplorer_page'; +import { TimeSeriesExplorerHelpPopover } from './timeseriesexplorer_help_popover'; import { APP_STATE_ACTION, @@ -99,13 +99,15 @@ const allValuesLabel = i18n.translate('xpack.ml.timeSeriesExplorer.allPartitionV const containerPadding = 34; export class TimeSeriesExplorer extends React.Component { + static contextType = context; + static propTypes = { appStateHandler: PropTypes.func.isRequired, autoZoomDuration: PropTypes.number.isRequired, bounds: PropTypes.object.isRequired, dateFormatTz: PropTypes.string.isRequired, lastRefresh: PropTypes.number.isRequired, - previousRefresh: PropTypes.number.isRequired, + previousRefresh: PropTypes.number, selectedJobId: PropTypes.string.isRequired, selectedDetectorIndex: PropTypes.number, selectedEntities: PropTypes.object, @@ -113,8 +115,6 @@ export class TimeSeriesExplorer extends React.Component { tableInterval: PropTypes.string, tableSeverity: PropTypes.number, zoom: PropTypes.object, - toastNotificationService: PropTypes.object, - dataViewsService: PropTypes.object, }; state = getTimeseriesexplorerDefaultState(); @@ -141,11 +141,37 @@ export class TimeSeriesExplorer extends React.Component { */ static contextType = context; - mlTimeSeriesExplorer; - mlTimeSeriesSearchService; + dataViewsService; + toastNotificationService; + mlApiServices; mlForecastService; - mlResultsService; mlIndexUtils; + mlJobService; + mlResultsService; + mlTimeSeriesExplorer; + mlTimeSeriesSearchService; + + constructor(props, constructorContext) { + super(props, constructorContext); + this.dataViewsService = constructorContext.services.data.dataViews; + this.toastNotificationService = toastNotificationServiceProvider( + constructorContext.services.notifications.toasts + ); + this.mlApiServices = constructorContext.services.mlServices.mlApiServices; + this.mlForecastService = forecastServiceFactory(this.mlApiServices); + this.mlIndexUtils = indexServiceFactory(this.dataViewsService); + this.mlJobService = mlJobServiceFactory(this.toastNotificationService, this.mlApiServices); + this.mlResultsService = mlResultsServiceProvider(this.mlApiServices); + this.mlTimeSeriesExplorer = timeSeriesExplorerServiceFactory( + constructorContext.services.uiSettings, + this.mlApiServices, + this.mlResultsService + ); + this.mlTimeSeriesSearchService = timeSeriesSearchServiceFactory( + this.mlResultsService, + this.mlApiServices + ); + } /** * Returns field names that don't have a selection yet. @@ -226,7 +252,7 @@ export class TimeSeriesExplorer extends React.Component { getFocusAggregationInterval(selection) { const { selectedJobId } = this.props; - const selectedJob = mlJobService.getJob(selectedJobId); + const selectedJob = this.mlJobService.getJob(selectedJobId); // Calculate the aggregation interval for the focus chart. const bounds = { min: moment(selection.from), max: moment(selection.to) }; @@ -245,7 +271,7 @@ export class TimeSeriesExplorer extends React.Component { const { selectedJobId, selectedForecastId, selectedDetectorIndex, functionDescription } = this.props; const { modelPlotEnabled } = this.state; - const selectedJob = mlJobService.getJob(selectedJobId); + const selectedJob = this.mlJobService.getJob(selectedJobId); if (isMetricDetector(selectedJob, selectedDetectorIndex) && functionDescription === undefined) { return; } @@ -301,9 +327,11 @@ export class TimeSeriesExplorer extends React.Component { tableSeverity, functionDescription, } = this.props; + const mlJobService = this.mlJobService; const selectedJob = mlJobService.getJob(selectedJobId); const entityControls = this.getControlsForDetector(); + const ml = this.mlApiServices; return ml.results .getAnomaliesTableData( [selectedJob.job_id], @@ -365,13 +393,14 @@ export class TimeSeriesExplorer extends React.Component { }; displayErrorToastMessages = (error, errorMsg) => { - if (this.props.toastNotificationService) { - this.props.toastNotificationService.displayErrorToast(error, errorMsg, 2000); + if (this.toastNotificationService) { + this.toastNotificationService.displayErrorToast(error, errorMsg, 2000); } this.setState({ loading: false, chartDataError: errorMsg }); }; loadSingleMetricData = (fullRefresh = true) => { + const mlJobService = this.mlJobService; const { autoZoomDuration, bounds, @@ -653,7 +682,8 @@ export class TimeSeriesExplorer extends React.Component { */ getControlsForDetector = () => { const { selectedDetectorIndex, selectedEntities, selectedJobId } = this.props; - return getControlsForDetector(selectedDetectorIndex, selectedEntities, selectedJobId); + const selectedJob = this.mlJobService.getJob(selectedJobId); + return getControlsForDetector(selectedDetectorIndex, selectedEntities, selectedJob); }; /** @@ -676,7 +706,7 @@ export class TimeSeriesExplorer extends React.Component { loadForJobId(jobId) { const { appStateHandler, selectedDetectorIndex } = this.props; - const selectedJob = mlJobService.getJob(jobId); + const selectedJob = this.mlJobService.getJob(jobId); if (selectedJob === undefined) { return; @@ -698,8 +728,8 @@ export class TimeSeriesExplorer extends React.Component { }, } ); - if (this.props.toastNotificationService) { - this.props.toastNotificationService.displayWarningToast(warningText); + if (this.toastNotificationService) { + this.toastNotificationService.displayWarningToast(warningText); } detectorIndex = detectors[0].index; @@ -715,25 +745,13 @@ export class TimeSeriesExplorer extends React.Component { } componentDidMount() { - const { mlApiServices } = this.context.services.mlServices; - this.mlResultsService = mlResultsServiceProvider(mlApiServices); - this.mlTimeSeriesSearchService = timeSeriesSearchServiceFactory( - this.mlResultsService, - mlApiServices - ); - this.mlTimeSeriesExplorer = timeSeriesExplorerServiceFactory( - this.context.services.uiSettings, - mlApiServices, - this.mlResultsService - ); - this.mlIndexUtils = indexServiceFactory(this.context.services.data.dataViews); - this.mlForecastService = forecastServiceFactory(mlApiServices); + const mlJobService = this.mlJobService; // if timeRange used in the url is incorrect // perhaps due to user's advanced setting using incorrect date-maths const { invalidTimeRangeError } = this.props; if (invalidTimeRangeError) { - if (this.props.toastNotificationService) { - this.props.toastNotificationService.displayWarningToast( + if (this.toastNotificationService) { + this.toastNotificationService.displayWarningToast( i18n.translate('xpack.ml.timeSeriesExplorer.invalidTimeRangeInUrlCallout', { defaultMessage: 'The time filter was changed to the full range for this job due to an invalid default time filter. Check the advanced settings for {field}.', @@ -843,13 +861,9 @@ export class TimeSeriesExplorer extends React.Component { componentDidUpdate(previousProps) { if (previousProps === undefined || previousProps.selectedJobId !== this.props.selectedJobId) { - const selectedJob = mlJobService.getJob(this.props.selectedJobId); + const selectedJob = this.mlJobService.getJob(this.props.selectedJobId); this.contextChartSelectedInitCallDone = false; - getDataViewsAndIndicesWithGeoFields( - [selectedJob], - this.props.dataViewsService, - this.mlIndexUtils - ) + getDataViewsAndIndicesWithGeoFields([selectedJob], this.dataViewsService, this.mlIndexUtils) .then(({ getSourceIndicesWithGeoFieldsResp }) => this.setState( { @@ -931,6 +945,7 @@ export class TimeSeriesExplorer extends React.Component { } render() { + const mlJobService = this.mlJobService; const { autoZoomDuration, bounds, diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_embeddable_chart/timeseriesexplorer_embeddable_chart.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_embeddable_chart/timeseriesexplorer_embeddable_chart.js index 5ff5b88060d70..c574e5d1ce741 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_embeddable_chart/timeseriesexplorer_embeddable_chart.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_embeddable_chart/timeseriesexplorer_embeddable_chart.js @@ -613,13 +613,8 @@ export class TimeSeriesExplorerEmbeddableChart extends React.Component { * @param callback to invoke after a state update. */ getControlsForDetector = () => { - const { selectedDetectorIndex, selectedEntities, selectedJobId, selectedJob } = this.props; - return getControlsForDetector( - selectedDetectorIndex, - selectedEntities, - selectedJobId, - selectedJob - ); + const { selectedDetectorIndex, selectedEntities, selectedJob } = this.props; + return getControlsForDetector(selectedDetectorIndex, selectedEntities, selectedJob); }; /** diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_utils/validate_job_selection.ts b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_utils/validate_job_selection.ts index 617d3047056ac..eb07fb02b09dc 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_utils/validate_job_selection.ts +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_utils/validate_job_selection.ts @@ -13,7 +13,7 @@ import type { ToastsStart } from '@kbn/core/public'; import type { MlJobWithTimeRange } from '../../../../common/types/anomaly_detection_jobs'; import { isTimeSeriesViewJob } from '../../../../common/util/job_utils'; -import { mlJobService } from '../../services/job_service'; +import type { MlJobService } from '../../services/job_service'; import type { GetJobSelection } from '../../contexts/ml/use_job_selection_flyout'; @@ -26,6 +26,7 @@ export function validateJobSelection( jobsWithTimeRange: MlJobWithTimeRange[], selectedJobIds: string[], setGlobalState: (...args: any) => void, + mlJobService: MlJobService, toastNotifications: ToastsStart, getJobSelection: GetJobSelection ): boolean | string { diff --git a/x-pack/plugins/ml/public/application/util/chart_utils.test.js b/x-pack/plugins/ml/public/application/util/chart_utils.test.js index f7bc96e1c18d1..0498ec9f468f1 100644 --- a/x-pack/plugins/ml/public/application/util/chart_utils.test.js +++ b/x-pack/plugins/ml/public/application/util/chart_utils.test.js @@ -7,27 +7,6 @@ import seriesConfig from '../explorer/explorer_charts/__mocks__/mock_series_config_filebeat.json'; -jest.mock('./dependency_cache', () => { - const dateMath = require('@kbn/datemath'); - let _time = undefined; - const timefilter = { - setTime: (time) => { - _time = time; - }, - getActiveBounds: () => { - return { - min: dateMath.parse(_time.from), - max: dateMath.parse(_time.to), - }; - }, - }; - return { - getTimefilter: () => timefilter, - }; -}); -import { getTimefilter } from './dependency_cache'; -const timefilter = getTimefilter(); - import d3 from 'd3'; import moment from 'moment'; import React from 'react'; @@ -46,11 +25,6 @@ import { import { CHART_TYPE } from '../explorer/explorer_constants'; -timefilter.setTime({ - from: moment(seriesConfig.selectedEarliest).toISOString(), - to: moment(seriesConfig.selectedLatest).toISOString(), -}); - describe('ML - chart utils', () => { describe('getChartType', () => { const singleMetricConfig = { diff --git a/x-pack/plugins/ml/public/application/util/dependency_cache.ts b/x-pack/plugins/ml/public/application/util/dependency_cache.ts deleted file mode 100644 index b462207e67d9b..0000000000000 --- a/x-pack/plugins/ml/public/application/util/dependency_cache.ts +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 { DataPublicPluginSetup } from '@kbn/data-plugin/public'; -import type { - IUiSettingsClient, - ApplicationStart, - HttpStart, - I18nStart, - DocLinksStart, - ToastsStart, - ChromeRecentlyAccessed, -} from '@kbn/core/public'; -import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import type { MapsStartApi } from '@kbn/maps-plugin/public'; - -export interface DependencyCache { - timefilter: DataPublicPluginSetup['query']['timefilter'] | null; - config: IUiSettingsClient | null; - docLinks: DocLinksStart | null; - toastNotifications: ToastsStart | null; - recentlyAccessed: ChromeRecentlyAccessed | null; - fieldFormats: FieldFormatsStart | null; - application: ApplicationStart | null; - http: HttpStart | null; - i18n: I18nStart | null; - maps: MapsStartApi | null; -} - -const cache: DependencyCache = { - timefilter: null, - config: null, - docLinks: null, - toastNotifications: null, - recentlyAccessed: null, - fieldFormats: null, - application: null, - http: null, - i18n: null, - maps: null, -}; - -export function setDependencyCache(deps: Partial) { - cache.timefilter = deps.timefilter || null; - cache.config = deps.config || null; - cache.docLinks = deps.docLinks || null; - cache.toastNotifications = deps.toastNotifications || null; - cache.recentlyAccessed = deps.recentlyAccessed || null; - cache.fieldFormats = deps.fieldFormats || null; - cache.application = deps.application || null; - cache.http = deps.http || null; - cache.i18n = deps.i18n || null; -} - -export function getTimefilter() { - if (cache.timefilter === null) { - throw new Error("timefilter hasn't been initialized"); - } - return cache.timefilter.timefilter; -} - -export function getDocLinks() { - if (cache.docLinks === null) { - throw new Error("docLinks hasn't been initialized"); - } - return cache.docLinks; -} - -export function getToastNotifications() { - if (cache.toastNotifications === null) { - throw new Error("toast notifications haven't been initialized"); - } - return cache.toastNotifications; -} - -export function getUiSettings() { - if (cache.config === null) { - throw new Error("uiSettings hasn't been initialized"); - } - return cache.config; -} - -export function getRecentlyAccessed() { - if (cache.recentlyAccessed === null) { - throw new Error("recentlyAccessed hasn't been initialized"); - } - return cache.recentlyAccessed; -} - -export function getFieldFormats() { - if (cache.fieldFormats === null) { - throw new Error("fieldFormats hasn't been initialized"); - } - return cache.fieldFormats; -} - -export function getApplication() { - if (cache.application === null) { - throw new Error("application hasn't been initialized"); - } - return cache.application; -} - -export function getHttp() { - if (cache.http === null) { - throw new Error("http hasn't been initialized"); - } - return cache.http; -} - -export function getI18n() { - if (cache.i18n === null) { - throw new Error("i18n hasn't been initialized"); - } - return cache.i18n; -} - -export function clearCache() { - Object.keys(cache).forEach((k) => { - cache[k as keyof DependencyCache] = null; - }); -} diff --git a/x-pack/plugins/ml/public/application/util/get_services.ts b/x-pack/plugins/ml/public/application/util/get_services.ts index d0d6beb1e3279..330bdc17c8fe9 100644 --- a/x-pack/plugins/ml/public/application/util/get_services.ts +++ b/x-pack/plugins/ml/public/application/util/get_services.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { HttpStart } from '@kbn/core-http-browser'; +import type { CoreStart } from '@kbn/core/public'; import type { DataViewsContract } from '@kbn/data-views-plugin/public'; import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; @@ -16,18 +16,22 @@ import { fieldFormatServiceFactory } from '../services/field_format_service_fact import { HttpService } from '../services/http_service'; import { mlApiServicesProvider } from '../services/ml_api_service'; import { mlUsageCollectionProvider } from '../services/usage_collection'; +import { mlJobServiceFactory } from '../services/job_service'; +import { toastNotificationServiceProvider } from '../services/toast_notification_service'; import { indexServiceFactory } from './index_service'; /** * Provides global services available across the entire ML app. */ export function getMlGlobalServices( - httpStart: HttpStart, + coreStart: CoreStart, dataViews: DataViewsContract, usageCollection?: UsageCollectionSetup ) { - const httpService = new HttpService(httpStart); + const httpService = new HttpService(coreStart.http); const mlApiServices = mlApiServicesProvider(httpService); + const toastNotificationService = toastNotificationServiceProvider(coreStart.notifications.toasts); + const mlJobService = mlJobServiceFactory(toastNotificationService, mlApiServices); // Note on the following services: // - `mlIndexUtils` is just instantiated here to be passed on to `mlFieldFormatService`, // but it's not being made available as part of global services. Since it's just @@ -38,7 +42,7 @@ export function getMlGlobalServices( // its own context or possibly without having a singleton like state at all, since the // way this manages its own state right now doesn't consider React component lifecycles. const mlIndexUtils = indexServiceFactory(dataViews); - const mlFieldFormatService = fieldFormatServiceFactory(mlApiServices, mlIndexUtils); + const mlFieldFormatService = fieldFormatServiceFactory(mlApiServices, mlIndexUtils, mlJobService); return { httpService, diff --git a/x-pack/plugins/ml/public/application/util/get_time_buckets_from_cache.ts b/x-pack/plugins/ml/public/application/util/get_time_buckets_from_cache.ts index 01ce59744ac1b..ce15a6c85c109 100644 --- a/x-pack/plugins/ml/public/application/util/get_time_buckets_from_cache.ts +++ b/x-pack/plugins/ml/public/application/util/get_time_buckets_from_cache.ts @@ -7,11 +7,9 @@ import { UI_SETTINGS } from '@kbn/data-plugin/public'; import { TimeBuckets } from '@kbn/ml-time-buckets'; +import type { IUiSettingsClient } from '@kbn/core/public'; -import { getUiSettings } from './dependency_cache'; - -export function getTimeBucketsFromCache() { - const uiSettings = getUiSettings(); +export function getTimeBucketsFromCache(uiSettings: IUiSettingsClient) { return new TimeBuckets({ [UI_SETTINGS.HISTOGRAM_MAX_BARS]: uiSettings.get(UI_SETTINGS.HISTOGRAM_MAX_BARS), [UI_SETTINGS.HISTOGRAM_BAR_TARGET]: uiSettings.get(UI_SETTINGS.HISTOGRAM_BAR_TARGET), diff --git a/x-pack/plugins/ml/public/application/util/recently_accessed.ts b/x-pack/plugins/ml/public/application/util/recently_accessed.ts index ff995be1c4b82..aa2b0aca4cf8c 100644 --- a/x-pack/plugins/ml/public/application/util/recently_accessed.ts +++ b/x-pack/plugins/ml/public/application/util/recently_accessed.ts @@ -10,13 +10,12 @@ import { i18n } from '@kbn/i18n'; import type { ChromeRecentlyAccessed } from '@kbn/core/public'; -import { getRecentlyAccessed } from './dependency_cache'; export function addItemToRecentlyAccessed( page: string, itemId: string, url: string, - recentlyAccessedService?: ChromeRecentlyAccessed + recentlyAccessedService: ChromeRecentlyAccessed ) { let pageLabel = ''; let id = `ml-job-${itemId}`; @@ -44,6 +43,6 @@ export function addItemToRecentlyAccessed( return; } - const recentlyAccessed = recentlyAccessedService ?? getRecentlyAccessed(); + const recentlyAccessed = recentlyAccessedService; recentlyAccessed.add(url, `ML - ${itemId} - ${pageLabel}`, id); } diff --git a/x-pack/plugins/ml/public/application/util/time_series_explorer_service.ts b/x-pack/plugins/ml/public/application/util/time_series_explorer_service.ts index 7c2d91016555d..05763f62d082c 100644 --- a/x-pack/plugins/ml/public/application/util/time_series_explorer_service.ts +++ b/x-pack/plugins/ml/public/application/util/time_series_explorer_service.ts @@ -30,24 +30,24 @@ import { TIME_FIELD_NAME, } from '../timeseriesexplorer/timeseriesexplorer_constants'; import type { MlApiServices } from '../services/ml_api_service'; -import { mlResultsServiceProvider, type MlResultsService } from '../services/results_service'; +import { useMlResultsService, type MlResultsService } from '../services/results_service'; import { forecastServiceFactory } from '../services/forecast_service'; import { timeSeriesSearchServiceFactory } from '../timeseriesexplorer/timeseriesexplorer_utils/time_series_search_service'; -import { useMlKibana } from '../contexts/kibana'; +import { useMlApiContext, useMlKibana } from '../contexts/kibana'; export interface Interval { asMilliseconds: () => number; expression: string; } -interface ChartDataPoint { +export interface ChartDataPoint { date: Date; value: number | null; upper?: number | null; lower?: number | null; } -interface FocusData { +export interface FocusData { focusChartData: ChartDataPoint[]; anomalyRecords: MlAnomalyRecordDoc[]; scheduledEvents: any; @@ -57,8 +57,6 @@ interface FocusData { focusForecastData?: any; } -// TODO Consolidate with legacy code in -// `ml/public/application/timeseriesexplorer/timeseriesexplorer_utils/timeseriesexplorer_utils.js`. export function timeSeriesExplorerServiceFactory( uiSettings: IUiSettingsClient, mlApiServices: MlApiServices, @@ -648,19 +646,15 @@ export function timeSeriesExplorerServiceFactory( } export function useTimeSeriesExplorerService(): TimeSeriesExplorerService { - const { - services: { - uiSettings, - mlServices: { mlApiServices }, - }, - } = useMlKibana(); - const mlResultsService = mlResultsServiceProvider(mlApiServices); - - const mlTimeSeriesExplorer = useMemo( - () => timeSeriesExplorerServiceFactory(uiSettings, mlApiServices, mlResultsService), - [uiSettings, mlApiServices, mlResultsService] + const { services } = useMlKibana(); + const mlApiServices = useMlApiContext(); + const mlResultsService = useMlResultsService(); + return useMemo( + () => timeSeriesExplorerServiceFactory(services.uiSettings, mlApiServices, mlResultsService), + // initialize only once + // eslint-disable-next-line react-hooks/exhaustive-deps + [] ); - return mlTimeSeriesExplorer; } export type TimeSeriesExplorerService = ReturnType; diff --git a/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_setup_flyout.tsx b/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_setup_flyout.tsx index 1b1ce4070703b..a40d2eb1d74d6 100644 --- a/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_setup_flyout.tsx +++ b/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_setup_flyout.tsx @@ -26,7 +26,7 @@ export async function resolveEmbeddableAnomalyChartsUserInput( ): Promise> { const { http, overlays, ...startServices } = coreStart; const adJobsApiService = jobsApiProvider(new HttpService(http)); - const mlServices = getMlGlobalServices(http, pluginStart.data.dataViews); + const mlServices = getMlGlobalServices(coreStart, pluginStart.data.dataViews); const overlayTracker = tracksOverlays(parentApi) ? parentApi : undefined; return new Promise(async (resolve, reject) => { diff --git a/x-pack/plugins/ml/public/embeddables/anomaly_charts/get_anomaly_charts_services_dependencies.ts b/x-pack/plugins/ml/public/embeddables/anomaly_charts/get_anomaly_charts_services_dependencies.ts index b0c365088beed..b7eec6ab24f5f 100644 --- a/x-pack/plugins/ml/public/embeddables/anomaly_charts/get_anomaly_charts_services_dependencies.ts +++ b/x-pack/plugins/ml/public/embeddables/anomaly_charts/get_anomaly_charts_services_dependencies.ts @@ -12,28 +12,34 @@ import type { AnomalyChartsEmbeddableServices } from '..'; import { AnomalyExplorerChartsService } from '../../application/services/anomaly_explorer_charts_service'; export const getAnomalyChartsServiceDependencies = async ( - coreStartServices: CoreStart, - pluginsStartServices: MlStartDependencies + coreStart: CoreStart, + pluginsStart: MlStartDependencies ): Promise => { const [ { AnomalyDetectorService }, { fieldFormatServiceFactory }, { indexServiceFactory }, { mlApiServicesProvider }, + { mlJobServiceFactory }, { mlResultsServiceProvider }, + { toastNotificationServiceProvider }, ] = await Promise.all([ await import('../../application/services/anomaly_detector_service'), await import('../../application/services/field_format_service_factory'), await import('../../application/util/index_service'), await import('../../application/services/ml_api_service'), + await import('../../application/services/job_service'), await import('../../application/services/results_service'), + await import('../../application/services/toast_notification_service'), ]); - const httpService = new HttpService(coreStartServices.http); + const httpService = new HttpService(coreStart.http); const anomalyDetectorService = new AnomalyDetectorService(httpService); const mlApiServices = mlApiServicesProvider(httpService); + const toastNotificationService = toastNotificationServiceProvider(coreStart.notifications.toasts); + const mlJobService = mlJobServiceFactory(toastNotificationService, mlApiServices); const mlResultsService = mlResultsServiceProvider(mlApiServices); const anomalyExplorerService = new AnomalyExplorerChartsService( - pluginsStartServices.data.query.timefilter.timefilter, + pluginsStart.data.query.timefilter.timefilter, mlApiServices, mlResultsService ); @@ -47,12 +53,12 @@ export const getAnomalyChartsServiceDependencies = async ( // In the long run we should again try to get rid of it here and make it available via // its own context or possibly without having a singleton like state at all, since the // way this manages its own state right now doesn't consider React component lifecycles. - const mlIndexUtils = indexServiceFactory(pluginsStartServices.data.dataViews); - const mlFieldFormatService = fieldFormatServiceFactory(mlApiServices, mlIndexUtils); + const mlIndexUtils = indexServiceFactory(pluginsStart.data.dataViews); + const mlFieldFormatService = fieldFormatServiceFactory(mlApiServices, mlIndexUtils, mlJobService); const anomalyChartsEmbeddableServices: AnomalyChartsEmbeddableServices = [ - coreStartServices, - pluginsStartServices as MlDependencies, + coreStart, + pluginsStart as MlDependencies, { anomalyDetectorService, anomalyExplorerService, diff --git a/x-pack/plugins/ml/public/embeddables/job_creation/aiops/flyout/create_job.tsx b/x-pack/plugins/ml/public/embeddables/job_creation/aiops/flyout/create_job.tsx index df5048d7261ad..d52aed02d88a3 100644 --- a/x-pack/plugins/ml/public/embeddables/job_creation/aiops/flyout/create_job.tsx +++ b/x-pack/plugins/ml/public/embeddables/job_creation/aiops/flyout/create_job.tsx @@ -34,6 +34,8 @@ import { } from '../../../../application/jobs/new_job/job_from_pattern_analysis'; import { useMlFromLensKibanaContext } from '../../common/context'; import { JobDetails, type CreateADJobParams } from '../../common/job_details'; +import { mlJobServiceFactory } from '../../../../application/services/job_service'; +import { toastNotificationServiceProvider } from '../../../../application/services/toast_notification_service'; interface Props { dataView: DataView; @@ -48,10 +50,13 @@ export const CreateJob: FC = ({ dataView, field, query, timeRange }) => { data, share, uiSettings, - mlServices: { mlApiServices }, dashboardService, + notifications: { toasts }, + mlServices: { mlApiServices }, }, } = useMlFromLensKibanaContext(); + const toastNotificationService = toastNotificationServiceProvider(toasts); + const mlJobService = mlJobServiceFactory(toastNotificationService, mlApiServices); const [categorizationType, setCategorizationType] = useState( CATEGORIZATION_TYPE.COUNT @@ -91,10 +96,10 @@ export const CreateJob: FC = ({ dataView, field, query, timeRange }) => { data.query.timefilter.timefilter, dashboardService, data, - mlApiServices + mlApiServices, + mlJobService ), - - [dashboardService, data, mlApiServices, uiSettings] + [dashboardService, data, mlApiServices, mlJobService, uiSettings] ); function createADJobInWizard() { diff --git a/x-pack/plugins/ml/public/embeddables/job_creation/common/create_flyout.tsx b/x-pack/plugins/ml/public/embeddables/job_creation/common/create_flyout.tsx index 5bab4967f0cdb..0016a5c8d3a9a 100644 --- a/x-pack/plugins/ml/public/embeddables/job_creation/common/create_flyout.tsx +++ b/x-pack/plugins/ml/public/embeddables/job_creation/common/create_flyout.tsx @@ -52,7 +52,7 @@ export function createFlyout( data, lens, dashboardService, - mlServices: getMlGlobalServices(http, data.dataViews), + mlServices: getMlGlobalServices(coreStart, data.dataViews), }} > = ({ layer, layerIndex, embeddable }) => data, share, uiSettings, - mlServices: { mlApiServices }, lens, dashboardService, + notifications: { toasts }, + mlServices: { mlApiServices }, }, } = useMlFromLensKibanaContext(); + const toastNotificationService = toastNotificationServiceProvider(toasts); + const mlJobService = mlJobServiceFactory(toastNotificationService, mlApiServices); const quickJobCreator = useMemo( () => @@ -46,7 +51,8 @@ export const CompatibleLayer: FC = ({ layer, layerIndex, embeddable }) => uiSettings, data.query.timefilter.timefilter, dashboardService, - mlApiServices + mlApiServices, + mlJobService ), // eslint-disable-next-line react-hooks/exhaustive-deps [data, uiSettings] diff --git a/x-pack/plugins/ml/public/embeddables/job_creation/map/map_vis_layer_selection_flyout/layer/compatible_layer.tsx b/x-pack/plugins/ml/public/embeddables/job_creation/map/map_vis_layer_selection_flyout/layer/compatible_layer.tsx index b5f3f30420188..76beaa6788f13 100644 --- a/x-pack/plugins/ml/public/embeddables/job_creation/map/map_vis_layer_selection_flyout/layer/compatible_layer.tsx +++ b/x-pack/plugins/ml/public/embeddables/job_creation/map/map_vis_layer_selection_flyout/layer/compatible_layer.tsx @@ -29,6 +29,8 @@ import { import { useMlFromLensKibanaContext } from '../../../common/context'; import type { CreateADJobParams } from '../../../common/job_details'; import { JobDetails } from '../../../common/job_details'; +import { mlJobServiceFactory } from '../../../../../application/services/job_service'; +import { toastNotificationServiceProvider } from '../../../../../application/services/toast_notification_service'; interface DropDownLabel { label: string; @@ -51,9 +53,12 @@ export const CompatibleLayer: FC = ({ embeddable, layer, layerIndex }) => share, uiSettings, dashboardService, + notifications: { toasts }, mlServices: { mlApiServices }, }, } = useMlFromLensKibanaContext(); + const toastNotificationService = toastNotificationServiceProvider(toasts); + const mlJobService = mlJobServiceFactory(toastNotificationService, mlApiServices); const quickJobCreator = useMemo( () => @@ -62,7 +67,8 @@ export const CompatibleLayer: FC = ({ embeddable, layer, layerIndex }) => uiSettings, data.query.timefilter.timefilter, dashboardService, - mlApiServices + mlApiServices, + mlJobService ), // eslint-disable-next-line react-hooks/exhaustive-deps [data, uiSettings] diff --git a/x-pack/plugins/ml/public/embeddables/single_metric_viewer/get_services.ts b/x-pack/plugins/ml/public/embeddables/single_metric_viewer/get_services.ts index 8dab0f4b65ea0..f4460331e6256 100644 --- a/x-pack/plugins/ml/public/embeddables/single_metric_viewer/get_services.ts +++ b/x-pack/plugins/ml/public/embeddables/single_metric_viewer/get_services.ts @@ -74,7 +74,7 @@ export const getMlServices = async ( // its own context or possibly without having a singleton like state at all, since the // way this manages its own state right now doesn't consider React component lifecycles. const mlIndexUtils = indexServiceFactory(pluginsStart.data.dataViews); - const mlFieldFormatService = fieldFormatServiceFactory(mlApiServices, mlIndexUtils); + const mlFieldFormatService = fieldFormatServiceFactory(mlApiServices, mlIndexUtils, mlJobService); return { anomalyDetectorService, anomalyExplorerService, diff --git a/x-pack/plugins/ml/public/plugin.ts b/x-pack/plugins/ml/public/plugin.ts index ae41b31d3eaaf..456259fd6d28d 100644 --- a/x-pack/plugins/ml/public/plugin.ts +++ b/x-pack/plugins/ml/public/plugin.ts @@ -57,7 +57,6 @@ import { getMlSharedServices } from './application/services/get_shared_ml_servic import { registerManagementSection } from './application/management'; import type { MlLocatorParams } from './locator'; import { MlLocatorDefinition, type MlLocator } from './locator'; -import { setDependencyCache } from './application/util/dependency_cache'; import { registerHomeFeature } from './register_home_feature'; import { isFullLicense, isMlEnabled } from '../common/license'; import { @@ -318,12 +317,6 @@ export class MlPlugin implements Plugin { mlApi?: MlApiServices; components: { AnomalySwimLane: typeof AnomalySwimLane }; } { - setDependencyCache({ - docLinks: core.docLinks!, - http: core.http, - i18n: core.i18n, - }); - return { locator: this.locator, elasticModels: this.sharedMlServices?.elasticModels, diff --git a/x-pack/plugins/ml/server/routes/schemas/modules.ts b/x-pack/plugins/ml/server/routes/schemas/modules.ts index 50fe45b653e42..8cb6bfdc96fd8 100644 --- a/x-pack/plugins/ml/server/routes/schemas/modules.ts +++ b/x-pack/plugins/ml/server/routes/schemas/modules.ts @@ -138,11 +138,11 @@ const moduleSchema = schema.object({ type: schema.string(), logo: schema.maybe(schema.any()), logoFile: schema.maybe(schema.string()), - defaultIndexPattern: schema.string(), - query: schema.any(), + defaultIndexPattern: schema.maybe(schema.string()), + query: schema.maybe(schema.any()), jobs: schema.arrayOf(schema.any()), datafeeds: schema.arrayOf(schema.any()), - kibana: schema.any(), + kibana: schema.maybe(schema.any()), tags: schema.maybe(schema.arrayOf(schema.string())), }); @@ -157,7 +157,7 @@ export const dataRecognizerConfigResponse = () => schema.object({ datafeeds: schema.arrayOf(schema.any()), jobs: schema.arrayOf(schema.any()), - kibana: schema.any(), + kibana: schema.maybe(schema.any()), }); export const jobExistsResponse = () => diff --git a/x-pack/plugins/observability_solution/apm/kibana.jsonc b/x-pack/plugins/observability_solution/apm/kibana.jsonc index c6a53232aaec0..0e305bc449c0e 100644 --- a/x-pack/plugins/observability_solution/apm/kibana.jsonc +++ b/x-pack/plugins/observability_solution/apm/kibana.jsonc @@ -45,6 +45,7 @@ "ml", "security", "spaces", + "serverless", "taskManager", "usageCollection", "customIntegrations", // Move this to requiredPlugins after completely migrating from the Tutorials Home App diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/breadcrumb/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/breadcrumb/index.tsx index d6afe4a7c1d19..24c4b7e88fb1b 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/breadcrumb/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/breadcrumb/index.tsx @@ -11,16 +11,22 @@ import { useBreadcrumb } from '../../../context/breadcrumbs/use_breadcrumb'; export const Breadcrumb = ({ title, href, + omitOnServerless = false, children, }: { title: string; href: string; + omitOnServerless?: boolean; children: React.ReactElement; }) => { const { core } = useApmPluginContext(); + useBreadcrumb( () => ({ title, href: core.http.basePath.prepend('/app/apm' + href) }), - [core.http.basePath, href, title] + [core.http.basePath, href, title], + { + omitOnServerless, + } ); return children; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/dependency_detail_view/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/dependency_detail_view/index.tsx index 5f6542fc7fe15..64ba12d64c06d 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/dependency_detail_view/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/dependency_detail_view/index.tsx @@ -69,7 +69,10 @@ export function DependencyDetailView({ children }: { children: React.ReactChild rangeTo, refreshInterval, refreshPaused, - ] + ], + { + omitRootOnServerless: true, + } ); return {children}; } diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/dependency_operation_detail_view/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/dependency_operation_detail_view/index.tsx index 63a7bf42c6650..ef7ea348d37f7 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/dependency_operation_detail_view/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/dependency_operation_detail_view/index.tsx @@ -50,7 +50,12 @@ export function DependencyOperationDetailView() { }, } = useApmParams('/dependencies/operation'); - useDependencyDetailOperationsBreadcrumb(); + useDependencyDetailOperationsBreadcrumb({ + title: spanName, + href: router.link('/dependencies/operation', { + query, + }), + }); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/entities/charts/log_error_rate_chart.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/entities/charts/log_error_rate_chart.tsx index d734da4fbf80f..68b41a6542a1a 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/entities/charts/log_error_rate_chart.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/entities/charts/log_error_rate_chart.tsx @@ -22,6 +22,7 @@ import { ChartMetricType, getMetricsFormula, } from '../../../shared/charts/helper/get_metrics_formulas'; +import { ExploreLogsButton } from '../../../shared/explore_logs_button/explore_logs_button'; type LogErrorRateReturnType = APIReturnType<'GET /internal/apm/entities/services/{serviceName}/logs_error_rate_timeseries'>; @@ -34,7 +35,7 @@ export function LogErrorRateChart({ height }: { height: number }) { const { query: { rangeFrom, rangeTo, environment, kuery }, path: { serviceName }, - } = useApmParams('/logs-services/{serviceName}'); + } = useApmParams('/services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); const { data = INITIAL_STATE, status } = useFetcher( @@ -76,44 +77,56 @@ export function LogErrorRateChart({ height }: { height: number }) { return ( - - -

- {i18n.translate('xpack.apm.logErrorRate', { - defaultMessage: 'Log error %', - })} -

-
-
- - - - {i18n.translate( - 'xpack.apm.multiSignal.servicesTable.logErrorRate.tooltip.serviceNameLabel', - { - defaultMessage: 'service.name', - } - )} - - ), - }} - /> - } + + + +

+ {i18n.translate('xpack.apm.logErrorRate', { + defaultMessage: 'Log error %', + })}{' '} + + + {i18n.translate( + 'xpack.apm.multiSignal.servicesTable.logErrorRate.tooltip.serviceNameLabel', + { + defaultMessage: 'service.name', + } + )} + + ), + }} + /> + } + /> + +

+
+
+ + -
-
+ +
; @@ -34,7 +35,7 @@ export function LogRateChart({ height }: { height: number }) { const { query: { rangeFrom, rangeTo, environment, kuery }, path: { serviceName }, - } = useApmParams('/logs-services/{serviceName}'); + } = useApmParams('/services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); const { data = INITIAL_STATE, status } = useFetcher( @@ -76,44 +77,57 @@ export function LogRateChart({ height }: { height: number }) { return ( - - -

- {i18n.translate('xpack.apm.logRate', { - defaultMessage: 'Log rate', - })} -

-
-
- - - - {i18n.translate( - 'xpack.apm.multiSignal.servicesTable.logRate.tooltip.serviceNameLabel', - { - defaultMessage: 'service.name', - } - )} - - ), - }} - /> - } + + + +

+ {i18n.translate('xpack.apm.logRate', { + defaultMessage: 'Log rate', + })}{' '} + + + {i18n.translate( + 'xpack.apm.multiSignal.servicesTable.logRate.tooltip.serviceNameLabel', + { + defaultMessage: 'service.name', + } + )} + + ), + }} + /> + } + /> + +

+
+
+ + + -
-
+ +
{ - return callAPI('GET /internal/apm/entities/services/{serviceName}/summary', { - params: { path: { serviceName }, query: { end, environment, start } }, - }); - }, - [end, environment, serviceName, start] - ); - - const { isLarge } = useBreakpoints(); - const isSingleColumn = isLarge; - - const rowDirection: EuiFlexGroupProps['direction'] = isSingleColumn ? 'column' : 'row'; - - if (isPending(status)) { - return ( -
- -
- ); - } - - return ( - - - {isLogsApmCalloutEnabled ? ( - <> - { - setIsLogsApmCalloutEnabled(false); - }} - /> - - - ) : null} - {data?.entity?.hasLogMetrics === false ? ( - <> - - - {i18n.translate('xpack.apm.logsServiceOverview.logLevelLink', { - defaultMessage: 'log.level', - })} - - ), - learnMoreLink: ( - - {i18n.translate('xpack.apm.logsServiceOverview.learnMoreLink', { - defaultMessage: 'Learn more', - })} - - ), - }} - /> - - - - ) : null} - - - - - - - - - - - - - - - - ); -} diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/error_group_overview/error_group_list/error_group_list.stories.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/error_group_overview/error_group_list/error_group_list.stories.tsx index d1183c91cb3e4..6cdb74ba1535c 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/error_group_overview/error_group_list/error_group_list.stories.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/error_group_overview/error_group_list/error_group_list.stories.tsx @@ -94,6 +94,7 @@ const stories: Meta = { transactionTypeStatus: FETCH_STATUS.SUCCESS, transactionTypes: ['request'], serviceAgentStatus: FETCH_STATUS.SUCCESS, + serviceEntitySummaryStatus: FETCH_STATUS.SUCCESS, }} > diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/index.tsx index 458a2e647cc2b..1b299182debab 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/index.tsx @@ -51,8 +51,7 @@ export function ServiceDashboards({ checkForEntities = false }: { checkForEntiti query: { environment, kuery, rangeFrom, rangeTo, dashboardId }, } = useAnyOfApmParams( '/services/{serviceName}/dashboards', - '/mobile-services/{serviceName}/dashboards', - '/logs-services/{serviceName}/dashboards' + '/mobile-services/{serviceName}/dashboards' ); const [dashboard, setDashboard] = useState(); const [serviceDashboards, setServiceDashboards] = useState([]); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_logs/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_logs/index.tsx index 90f31e29b5960..4df52758ceda3 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_logs/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_logs/index.tsx @@ -22,7 +22,7 @@ export function ServiceLogs() { const { query: { environment, kuery, rangeFrom, rangeTo }, - } = useAnyOfApmParams('/services/{serviceName}/logs', '/logs-services/{serviceName}/logs'); + } = useAnyOfApmParams('/services/{serviceName}/logs'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/apm_overview/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/apm_overview/index.tsx new file mode 100644 index 0000000000000..7995402eb29a9 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/apm_overview/index.tsx @@ -0,0 +1,194 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { + EuiFlexGroup, + EuiFlexGroupProps, + EuiFlexItem, + EuiLink, + EuiPanel, + EuiSpacer, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React from 'react'; +import { chartHeight } from '..'; +import { AgentName } from '../../../../../typings/es_schemas/ui/fields/agent'; +import { + isOpenTelemetryAgentName, + isRumAgentName, + isServerlessAgentName, +} from '../../../../../common/agent_name'; +import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; +import { useApmParams } from '../../../../hooks/use_apm_params'; +import { useApmRouter } from '../../../../hooks/use_apm_router'; +import { useBreakpoints } from '../../../../hooks/use_breakpoints'; +import { useTimeRange } from '../../../../hooks/use_time_range'; +import { AggregatedTransactionsBadge } from '../../../shared/aggregated_transactions_badge'; +import { FailedTransactionRateChart } from '../../../shared/charts/failed_transaction_rate_chart'; +import { LatencyChart } from '../../../shared/charts/latency_chart'; +import { TransactionBreakdownChart } from '../../../shared/charts/transaction_breakdown_chart'; +import { TransactionColdstartRateChart } from '../../../shared/charts/transaction_coldstart_rate_chart'; +import { TransactionsTable } from '../../../shared/transactions_table'; +import { ServiceOverviewDependenciesTable } from '../service_overview_dependencies_table'; +import { ServiceOverviewErrorsTable } from '../service_overview_errors_table'; +import { ServiceOverviewInstancesChartAndTable } from '../service_overview_instances_chart_and_table'; +import { ServiceOverviewThroughputChart } from '../service_overview_throughput_chart'; +import { SloCallout } from '../../../shared/slo_callout'; +import { useLocalStorage } from '../../../../hooks/use_local_storage'; + +const latencyChartHeight = 200; + +export function ApmOverview() { + const router = useApmRouter(); + const { serviceName, fallbackToTransactions, agentName, serverlessType } = useApmServiceContext(); + const { + query, + query: { kuery, environment, rangeFrom, rangeTo, transactionType }, + } = useApmParams('/services/{serviceName}/overview'); + + const { start, end } = useTimeRange({ rangeFrom, rangeTo }); + + const isRumAgent = isRumAgentName(agentName); + const isOpenTelemetryAgent = isOpenTelemetryAgentName(agentName as AgentName); + const isServerless = isServerlessAgentName(serverlessType); + + // The default EuiFlexGroup breaks at 768, but we want to break at 1200, so we + // observe the window width and set the flex directions of rows accordingly + const { isLarge } = useBreakpoints(); + const isSingleColumn = isLarge; + + const nonLatencyChartHeight = isSingleColumn ? latencyChartHeight : chartHeight; + const rowDirection: EuiFlexGroupProps['direction'] = isSingleColumn ? 'column' : 'row'; + + const [sloCalloutDismissed, setSloCalloutDismissed] = useLocalStorage( + 'apm.sloCalloutDismissed', + false + ); + + return ( + <> + {!sloCalloutDismissed && ( + <> + { + setSloCalloutDismissed(true); + }} + serviceName={serviceName} + environment={environment} + transactionType={transactionType} + /> + + + )} + {fallbackToTransactions && ( + + + + )} + + + + + + + + + + + + + + + + + + + + {!isRumAgent && ( + + + + )} + + + + + + + + + + {isServerless ? ( + + + + ) : ( + !isOpenTelemetryAgent && ( + + + + ) + )} + {!isRumAgent && ( + + + + {i18n.translate('xpack.apm.serviceOverview.dependenciesTableTabLink', { + defaultMessage: 'View dependencies', + })} + + } + showSparkPlots={!isSingleColumn} + /> + + + )} + + + {!isRumAgent && !isServerless && ( + + + + + + )} + + ); +} diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/index.tsx index 1f3005c2be44c..f7b0920408be2 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/index.tsx @@ -5,43 +5,19 @@ * 2.0. */ -import { i18n } from '@kbn/i18n'; +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import React, { useEffect } from 'react'; - -import { - EuiFlexGroup, - EuiFlexGroupProps, - EuiFlexItem, - EuiLink, - EuiPanel, - EuiSpacer, -} from '@elastic/eui'; -import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; -import { AgentName } from '../../../../typings/es_schemas/ui/fields/agent'; -import { - isOpenTelemetryAgentName, - isRumAgentName, - isServerlessAgentName, -} from '../../../../common/agent_name'; +import { SignalTypes } from '../../../../common/entities/types'; import { AnnotationsContextProvider } from '../../../context/annotations/annotations_context'; +import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; import { ChartPointerEventContextProvider } from '../../../context/chart_pointer_event/chart_pointer_event_context'; +import { useEntityManagerEnablementContext } from '../../../context/entity_manager_context/use_entity_manager_enablement_context'; import { useApmParams } from '../../../hooks/use_apm_params'; -import { useApmRouter } from '../../../hooks/use_apm_router'; -import { useBreakpoints } from '../../../hooks/use_breakpoints'; import { useTimeRange } from '../../../hooks/use_time_range'; -import { AggregatedTransactionsBadge } from '../../shared/aggregated_transactions_badge'; -import { FailedTransactionRateChart } from '../../shared/charts/failed_transaction_rate_chart'; -import { LatencyChart } from '../../shared/charts/latency_chart'; -import { TransactionBreakdownChart } from '../../shared/charts/transaction_breakdown_chart'; -import { TransactionColdstartRateChart } from '../../shared/charts/transaction_coldstart_rate_chart'; -import { TransactionsTable } from '../../shared/transactions_table'; -import { ServiceOverviewDependenciesTable } from './service_overview_dependencies_table'; -import { ServiceOverviewErrorsTable } from './service_overview_errors_table'; -import { ServiceOverviewInstancesChartAndTable } from './service_overview_instances_chart_and_table'; -import { ServiceOverviewThroughputChart } from './service_overview_throughput_chart'; -import { SloCallout } from '../../shared/slo_callout'; -import { useLocalStorage } from '../../../hooks/use_local_storage'; +import { isApmSignal, isLogsSignal } from '../../../utils/get_signal_type'; +import { ApmOverview } from './apm_overview'; +import { LogsOverview } from './logs_overview'; /** * The height a chart should be if it's next to a table with 5 rows and a title. * Add the height of the pagination row. @@ -49,8 +25,8 @@ import { useLocalStorage } from '../../../hooks/use_local_storage'; export const chartHeight = 288; export function ServiceOverview() { - const router = useApmRouter(); - const { serviceName, fallbackToTransactions, agentName, serverlessType } = useApmServiceContext(); + const { isEntityCentricExperienceViewEnabled } = useEntityManagerEnablementContext(); + const { serviceName, serviceEntitySummary } = useApmServiceContext(); const setScreenContext = useApmPluginContext().observabilityAIAssistant?.service.setScreenContext; @@ -68,35 +44,21 @@ export function ServiceOverview() { }, [setScreenContext, serviceName]); const { - query, - query: { kuery, environment, rangeFrom, rangeTo, transactionType }, + query: { environment, rangeFrom, rangeTo }, } = useApmParams('/services/{serviceName}/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const isRumAgent = isRumAgentName(agentName); - const isOpenTelemetryAgent = isOpenTelemetryAgentName(agentName as AgentName); - const isServerless = isServerlessAgentName(serverlessType); - const dependenciesLink = router.link('/services/{serviceName}/dependencies', { - path: { - serviceName, - }, - query, - }); + const hasLogsSignal = + serviceEntitySummary?.signalTypes && + isLogsSignal(serviceEntitySummary.signalTypes as SignalTypes[]); - // The default EuiFlexGroup breaks at 768, but we want to break at 1200, so we - // observe the window width and set the flex directions of rows accordingly - const { isLarge } = useBreakpoints(); - const isSingleColumn = isLarge; + const hasApmSignal = + serviceEntitySummary?.signalTypes && + isApmSignal(serviceEntitySummary.signalTypes as SignalTypes[]); - const latencyChartHeight = 200; - const nonLatencyChartHeight = isSingleColumn ? latencyChartHeight : chartHeight; - const rowDirection: EuiFlexGroupProps['direction'] = isSingleColumn ? 'column' : 'row'; - - const [sloCalloutDismissed, setSloCalloutDismissed] = useLocalStorage( - 'apm.sloCalloutDismissed', - false - ); + // Shows APM overview when entity has APM signal or when Entity centric is not enabled + const showApmOverview = isEntityCentricExperienceViewEnabled === false || hasApmSignal; return ( - {!sloCalloutDismissed && ( - { - setSloCalloutDismissed(true); - }} - serviceName={serviceName} - environment={environment} - transactionType={transactionType} - /> - )} - - {fallbackToTransactions && ( - - - - )} - - - - - - - - - - - - - - - - - - - - {!isRumAgent && ( - - - - )} - - - - - - - - - - {isServerless ? ( - - - - ) : ( - !isOpenTelemetryAgent && ( - - - - ) - )} - {!isRumAgent && ( - - - - {i18n.translate('xpack.apm.serviceOverview.dependenciesTableTabLink', { - defaultMessage: 'View dependencies', - })} - - } - showSparkPlots={!isSingleColumn} - /> - - - )} - - - {!isRumAgent && !isServerless && ( + {showApmOverview ? : null} + {/* Only shows Logs overview when entity has Logs signal */} + {hasLogsSignal ? ( - - - + - )} + ) : null} diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/logs_overview/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/logs_overview/index.tsx new file mode 100644 index 0000000000000..163b5aa11898a --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/logs_overview/index.tsx @@ -0,0 +1,48 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; +import React from 'react'; +import { useLocalStorage } from '../../../../hooks/use_local_storage'; +import { AddAPMCallOut } from '../../entities/logs/add_apm_callout'; +import { LogRateChart } from '../../entities/charts/log_rate_chart'; +import { LogErrorRateChart } from '../../entities/charts/log_error_rate_chart'; +import { chartHeight } from '..'; + +interface Props { + hasApmSignal?: boolean; +} + +export function LogsOverview({ hasApmSignal }: Props) { + const [isLogsApmCalloutEnabled, setIsLogsApmCalloutEnabled] = useLocalStorage( + 'apm.isLogsApmCalloutEnabled', + true + ); + + return ( + <> + {!hasApmSignal && isLogsApmCalloutEnabled ? ( + <> + { + setIsLogsApmCalloutEnabled(false); + }} + /> + + + ) : null} + + + + + + + + + + ); +} diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview.stories.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview.stories.tsx index d35cce84c9d71..4545bed866119 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview.stories.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview.stories.tsx @@ -12,6 +12,7 @@ import { MockApmPluginStorybook } from '../../../context/apm_plugin/mock_apm_plu import { APMServiceContextValue } from '../../../context/apm_service/apm_service_context'; import { FETCH_STATUS } from '../../../hooks/use_fetcher'; import { mockApmApiCallResponse } from '../../../services/rest/call_apm_api_spy'; +import { SignalTypes } from '../../../../common/entities/types'; const stories: Meta<{}> = { title: 'app/ServiceOverview', @@ -21,6 +22,9 @@ const stories: Meta<{}> = { const serviceName = 'testServiceName'; const transactionType = 'type'; const transactionTypeStatus = FETCH_STATUS.SUCCESS; + const serviceEntitySummary = { + signalTypes: [SignalTypes.METRICS, SignalTypes.LOGS], + }; mockApmApiCallResponse( `GET /api/apm/services/{serviceName}/annotation/search 2023-10-31`, @@ -37,6 +41,7 @@ const stories: Meta<{}> = { serviceName, transactionType, transactionTypeStatus, + serviceEntitySummary, } as unknown as APMServiceContextValue; return ( diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview.test.tsx index a8a9624065b0c..35a5e48307147 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview.test.tsx @@ -16,6 +16,6 @@ describe('ServiceOverview', () => { it('renders', async () => { render(); - expect(await screen.findByRole('heading', { name: /Latency/ })).toBeInTheDocument(); + expect(await screen.findByRole('heading', { name: 'Latency' })).toBeInTheDocument(); }); }); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_instances_chart_and_table.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_instances_chart_and_table/index.tsx similarity index 88% rename from x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_instances_chart_and_table.tsx rename to x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_instances_chart_and_table/index.tsx index 267a307604d2a..a60ead6d60682 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_instances_chart_and_table.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_instances_chart_and_table/index.tsx @@ -8,16 +8,16 @@ import { EuiFlexItem, EuiPanel } from '@elastic/eui'; import React, { useState } from 'react'; import { v4 as uuidv4 } from 'uuid'; -import { isTimeComparison } from '../../shared/time_comparison/get_comparison_options'; -import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; -import { useApmParams } from '../../../hooks/use_apm_params'; -import { FETCH_STATUS, isPending, useFetcher } from '../../../hooks/use_fetcher'; -import { useTimeRange } from '../../../hooks/use_time_range'; -import { APIReturnType } from '../../../services/rest/create_call_apm_api'; -import { InstancesLatencyDistributionChart } from '../../shared/charts/instances_latency_distribution_chart'; -import { ServiceOverviewInstancesTable, TableOptions } from './service_overview_instances_table'; -import { LatencyAggregationType } from '../../../../common/latency_aggregation_types'; -import { InstancesSortField } from '../../../../common/instances'; +import { isTimeComparison } from '../../../shared/time_comparison/get_comparison_options'; +import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; +import { useApmParams } from '../../../../hooks/use_apm_params'; +import { FETCH_STATUS, isPending, useFetcher } from '../../../../hooks/use_fetcher'; +import { useTimeRange } from '../../../../hooks/use_time_range'; +import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; +import { InstancesLatencyDistributionChart } from '../../../shared/charts/instances_latency_distribution_chart'; +import { ServiceOverviewInstancesTable, TableOptions } from '../service_overview_instances_table'; +import { LatencyAggregationType } from '../../../../../common/latency_aggregation_types'; +import { InstancesSortField } from '../../../../../common/instances'; interface ServiceOverviewInstancesChartAndTableProps { chartHeight: number; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/get_throughput_screen_context.ts b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_throughput_chart/get_throughput_screen_context.ts similarity index 87% rename from x-pack/plugins/observability_solution/apm/public/components/app/service_overview/get_throughput_screen_context.ts rename to x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_throughput_chart/get_throughput_screen_context.ts index 9c92e7909ede6..ad60e71a7093d 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/get_throughput_screen_context.ts +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_throughput_chart/get_throughput_screen_context.ts @@ -6,14 +6,14 @@ */ import { SERVICE_ENVIRONMENT } from '@kbn/observability-shared-plugin/common'; -import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; -import { Environment } from '../../../../common/environment_rt'; +import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; +import { Environment } from '../../../../../common/environment_rt'; import { PROCESSOR_EVENT, SERVICE_NAME, TRANSACTION_NAME, TRANSACTION_TYPE, -} from '../../../../common/es_fields/apm'; +} from '../../../../../common/es_fields/apm'; export function getThroughputScreenContext({ serviceName, diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_throughput_chart/index.tsx similarity index 77% rename from x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx rename to x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_throughput_chart/index.tsx index 9fbdee4bf8502..331d14d652fed 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_throughput_chart/index.tsx @@ -8,22 +8,22 @@ import { EuiPanel, EuiTitle, EuiIconTip, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useEffect } from 'react'; -import { usePreviousPeriodLabel } from '../../../hooks/use_previous_period_text'; -import { isTimeComparison } from '../../shared/time_comparison/get_comparison_options'; -import { AnomalyDetectorType } from '../../../../common/anomaly_detection/apm_ml_detectors'; -import { asExactTransactionRate } from '../../../../common/utils/formatters'; -import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; -import { useEnvironmentsContext } from '../../../context/environments_context/use_environments_context'; -import { useAnyOfApmParams } from '../../../hooks/use_apm_params'; -import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher'; -import { usePreferredServiceAnomalyTimeseries } from '../../../hooks/use_preferred_service_anomaly_timeseries'; -import { useTimeRange } from '../../../hooks/use_time_range'; -import { TimeseriesChartWithContext } from '../../shared/charts/timeseries_chart_with_context'; -import { getComparisonChartTheme } from '../../shared/time_comparison/get_comparison_chart_theme'; -import { ChartType, getTimeSeriesColor } from '../../shared/charts/helper/get_timeseries_color'; -import { usePreferredDataSourceAndBucketSize } from '../../../hooks/use_preferred_data_source_and_bucket_size'; -import { ApmDocumentType } from '../../../../common/document_type'; -import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; +import { usePreviousPeriodLabel } from '../../../../hooks/use_previous_period_text'; +import { isTimeComparison } from '../../../shared/time_comparison/get_comparison_options'; +import { AnomalyDetectorType } from '../../../../../common/anomaly_detection/apm_ml_detectors'; +import { asExactTransactionRate } from '../../../../../common/utils/formatters'; +import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; +import { useEnvironmentsContext } from '../../../../context/environments_context/use_environments_context'; +import { useAnyOfApmParams } from '../../../../hooks/use_apm_params'; +import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; +import { usePreferredServiceAnomalyTimeseries } from '../../../../hooks/use_preferred_service_anomaly_timeseries'; +import { useTimeRange } from '../../../../hooks/use_time_range'; +import { TimeseriesChartWithContext } from '../../../shared/charts/timeseries_chart_with_context'; +import { getComparisonChartTheme } from '../../../shared/time_comparison/get_comparison_chart_theme'; +import { ChartType, getTimeSeriesColor } from '../../../shared/charts/helper/get_timeseries_color'; +import { usePreferredDataSourceAndBucketSize } from '../../../../hooks/use_preferred_data_source_and_bucket_size'; +import { ApmDocumentType } from '../../../../../common/document_type'; +import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; import { getThroughputScreenContext } from './get_throughput_screen_context'; const INITIAL_STATE = { diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/trace_overview/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/trace_overview/index.tsx index 9304dc298a2d6..40b079b684498 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/trace_overview/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/trace_overview/index.tsx @@ -96,7 +96,7 @@ export function TraceOverview({ children }: { children: React.ReactElement }) { : []; return ( - + @@ -95,7 +95,7 @@ const apmRoutes = { // this route fails on navigation unless it's defined before home '/service-groups': { element: ( - + ['selectedTabKey']; - element: React.ReactElement; - searchBarOptions?: React.ComponentProps; -}): { - element: React.ReactElement; -} { - return { - element: ( - - {element} - - ), - }; -} - -export const logsServiceDetailsRoute = { - '/logs-services/{serviceName}': { - element: ( - - - - ), - params: t.intersection([ - t.type({ - path: t.type({ - serviceName: t.string, - }), - }), - t.type({ - query: t.intersection([ - environmentRt, - t.type({ - rangeFrom: t.string, - rangeTo: t.string, - kuery: t.string, - serviceGroup: t.string, - comparisonEnabled: toBooleanRt, - }), - t.partial({ - transactionType: t.string, - refreshPaused: t.union([t.literal('true'), t.literal('false')]), - refreshInterval: t.string, - }), - offsetRt, - ]), - }), - ]), - defaults: { - query: { - kuery: '', - environment: ENVIRONMENT_ALL.value, - serviceGroup: '', - }, - }, - children: { - '/logs-services/{serviceName}/overview': { - ...page({ - element: , - tabKey: 'overview', - title: i18n.translate('xpack.apm.views.overview.title', { - defaultMessage: 'Overview', - }), - searchBarOptions: { - showUnifiedSearchBar: true, - showQueryInput: false, - }, - }), - params: t.partial({ - query: t.partial({ - page: toNumberRt, - pageSize: toNumberRt, - sortField: t.string, - sortDirection: t.union([t.literal('asc'), t.literal('desc')]), - }), - }), - }, - '/logs-services/{serviceName}/logs': { - ...page({ - tabKey: 'logs', - title: i18n.translate('xpack.apm.views.logs.title', { - defaultMessage: 'Logs', - }), - element: , - searchBarOptions: { - showUnifiedSearchBar: false, - }, - }), - }, - '/logs-services/{serviceName}/dashboards': { - ...page({ - tabKey: 'dashboards', - title: i18n.translate('xpack.apm.views.dashboard.title', { - defaultMessage: 'Dashboards', - }), - element: , - searchBarOptions: { - showUnifiedSearchBar: false, - }, - }), - params: t.partial({ - query: t.partial({ - dashboardId: t.string, - }), - }), - }, - '/logs-services/{serviceName}/': { - element: , - }, - }, - }, -}; diff --git a/x-pack/plugins/observability_solution/apm/public/components/routing/home/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/routing/home/index.tsx index 4ce7266bc2bc0..d517ae654468b 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/routing/home/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/routing/home/index.tsx @@ -14,7 +14,6 @@ import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { environmentRt } from '../../../../common/environment_rt'; import { TraceSearchType } from '../../../../common/trace_explorer'; import { ApmTimeRangeMetadataContextProvider } from '../../../context/time_range_metadata/time_range_metadata_context'; -import { Breadcrumb } from '../../app/breadcrumb'; import { ServiceInventory } from '../../app/service_inventory'; import { ServiceMapHome } from '../../app/service_map'; import { TopTracesOverview } from '../../app/top_traces_overview'; @@ -50,11 +49,13 @@ function serviceGroupPage({ return { [path]: { element: ( - - - {element} - - + + {element} + ), params: t.type({ query: t.type({ serviceGroup: t.string }), diff --git a/x-pack/plugins/observability_solution/apm/public/components/routing/home/page_template.tsx b/x-pack/plugins/observability_solution/apm/public/components/routing/home/page_template.tsx index e003de27d982d..1e5508bceb4ed 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/routing/home/page_template.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/routing/home/page_template.tsx @@ -38,7 +38,7 @@ export function page< return { [path]: { element: ( - + ; diff --git a/x-pack/plugins/observability_solution/apm/public/components/routing/service_detail/redirect_to_default_service_route_view.tsx b/x-pack/plugins/observability_solution/apm/public/components/routing/service_detail/redirect_to_default_service_route_view.tsx index 4a61888b919f3..bcf0fbd435ae9 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/routing/service_detail/redirect_to_default_service_route_view.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/routing/service_detail/redirect_to_default_service_route_view.tsx @@ -19,14 +19,3 @@ export function RedirectToDefaultServiceRouteView() { return ; } - -export function RedirectToDefaultLogsServiceRouteView() { - const { - path: { serviceName }, - query, - } = useApmParams('/logs-services/{serviceName}/*'); - - const search = qs.stringify(query); - - return ; -} diff --git a/x-pack/plugins/observability_solution/apm/public/components/routing/settings/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/routing/settings/index.tsx index 1cb7d7ec9ede1..e8f03da90c4c6 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/routing/settings/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/routing/settings/index.tsx @@ -52,6 +52,7 @@ export const settingsRoute = { title={i18n.translate('xpack.apm.views.listSettings.title', { defaultMessage: 'Settings', })} + omitOnServerless > diff --git a/x-pack/plugins/observability_solution/apm/public/components/routing/templates/apm_service_template/analyze_data_button.stories.tsx b/x-pack/plugins/observability_solution/apm/public/components/routing/templates/apm_service_template/analyze_data_button.stories.tsx index a08e575dcd752..4bfb69810a524 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/routing/templates/apm_service_template/analyze_data_button.stories.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/routing/templates/apm_service_template/analyze_data_button.stories.tsx @@ -54,6 +54,7 @@ export default { serviceName, fallbackToTransactions: false, serviceAgentStatus: FETCH_STATUS.SUCCESS, + serviceEntitySummaryStatus: FETCH_STATUS.SUCCESS, }} > diff --git a/x-pack/plugins/observability_solution/apm/public/components/routing/templates/entities/logs_service_template/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/routing/templates/entities/logs_service_template/index.tsx deleted file mode 100644 index 1588b6ffafece..0000000000000 --- a/x-pack/plugins/observability_solution/apm/public/components/routing/templates/entities/logs_service_template/index.tsx +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiFlexGroup, EuiFlexItem, EuiPageHeaderProps, EuiTitle } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { omit } from 'lodash'; -import React from 'react'; -import { ApmServiceContextProvider } from '../../../../../context/apm_service/apm_service_context'; -import { useBreadcrumb } from '../../../../../context/breadcrumbs/use_breadcrumb'; -import { ServiceAnomalyTimeseriesContextProvider } from '../../../../../context/service_anomaly_timeseries/service_anomaly_timeseries_context'; -import { useApmParams } from '../../../../../hooks/use_apm_params'; -import { useApmRouter } from '../../../../../hooks/use_apm_router'; -import { useTimeRange } from '../../../../../hooks/use_time_range'; -import { SearchBar } from '../../../../shared/search_bar/search_bar'; -import { ServiceIcons } from '../../../../shared/service_icons'; -import { TechnicalPreviewBadge } from '../../../../shared/technical_preview_badge'; -import { ApmMainTemplate } from '../../apm_main_template'; - -type Tab = NonNullable[0] & { - key: 'overview' | 'logs' | 'dashboards'; - hidden?: boolean; -}; - -interface Props { - title: string; - children: React.ReactChild; - selectedTabKey: Tab['key']; - searchBarOptions?: React.ComponentProps; -} - -export function LogsServiceTemplate(props: Props) { - return ( - - - - ); -} - -function TemplateWithContext({ title, children, selectedTabKey, searchBarOptions }: Props) { - const { - path: { serviceName }, - query, - query: { rangeFrom, rangeTo, environment }, - } = useApmParams('/logs-services/{serviceName}/*'); - - const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - - const router = useApmRouter(); - - const tabs = useTabs({ selectedTabKey }); - const selectedTab = tabs?.find(({ isSelected }) => isSelected); - - const servicesLink = router.link('/services', { - query: { ...query }, - }); - - useBreadcrumb( - () => [ - { - title: i18n.translate('xpack.apm.logServices.breadcrumb.title', { - defaultMessage: 'Services', - }), - href: servicesLink, - }, - ...(selectedTab - ? [ - { - title: serviceName, - href: router.link('/logs-services/{serviceName}', { - path: { serviceName }, - query, - }), - }, - { - title: selectedTab.label, - href: selectedTab.href, - } as { title: string; href: string }, - ] - : []), - ], - [query, router, selectedTab, serviceName, servicesLink] - ); - - return ( - - - - - -

- {serviceName} -

-
-
- - - -
-
- - ), - }} - > - - {children} -
- ); -} - -function useTabs({ selectedTabKey }: { selectedTabKey: Tab['key'] }) { - const router = useApmRouter(); - - const { - path: { serviceName }, - query: queryFromUrl, - } = useApmParams(`/logs-services/{serviceName}/${selectedTabKey}` as const); - - const query = omit(queryFromUrl, 'page', 'pageSize', 'sortField', 'sortDirection'); - - const tabs: Tab[] = [ - { - key: 'overview', - href: router.link('/logs-services/{serviceName}/overview', { - path: { serviceName }, - query, - }), - label: i18n.translate('xpack.apm.logsServiceDetails.overviewTabLabel', { - defaultMessage: 'Overview', - }), - }, - { - key: 'logs', - href: router.link('/logs-services/{serviceName}/logs', { - path: { serviceName }, - query, - }), - label: i18n.translate('xpack.apm.logsServiceDetails.logsTabLabel', { - defaultMessage: 'Logs', - }), - }, - { - key: 'dashboards', - href: router.link('/logs-services/{serviceName}/dashboards', { - path: { serviceName }, - query, - }), - append: , - label: i18n.translate('xpack.apm.logsServiceDetails.dashboardsTabLabel', { - defaultMessage: 'Dashboards', - }), - }, - ]; - - return tabs - .filter((t) => !t.hidden) - .map(({ href, key, label, append }) => ({ - href, - label, - append, - isSelected: key === selectedTabKey, - 'data-test-subj': `${key}Tab`, - })); -} diff --git a/x-pack/plugins/observability_solution/apm/public/components/routing/templates/mobile_service_template/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/routing/templates/mobile_service_template/index.tsx index d9069c7d9f2f2..0c6a1f4176ec5 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/routing/templates/mobile_service_template/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/routing/templates/mobile_service_template/index.tsx @@ -92,7 +92,10 @@ function TemplateWithContext({ title, children, selectedTabKey, searchBarOptions ] : []), ], - [query, router, selectedTab, serviceName, servicesLink] + [query, router, selectedTab, serviceName, servicesLink], + { + omitRootOnServerless: true, + } ); return ( diff --git a/x-pack/plugins/observability_solution/apm/public/components/routing/templates/service_group_template.tsx b/x-pack/plugins/observability_solution/apm/public/components/routing/templates/service_group_template.tsx index 0617e900c601f..67695c6485006 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/routing/templates/service_group_template.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/routing/templates/service_group_template.tsx @@ -26,13 +26,15 @@ import { useEntityManagerEnablementContext } from '../../../context/entity_manag export function ServiceGroupTemplate({ pageTitle, pageHeader, + pagePath, children, environmentFilter = true, serviceGroupContextTab, ...pageTemplateProps }: { - pageTitle?: React.ReactNode; + pageTitle: string; pageHeader?: EuiPageHeaderProps; + pagePath: string; children: React.ReactNode; environmentFilter?: boolean; serviceGroupContextTab: ServiceGroupContextTab['key']; @@ -81,34 +83,44 @@ export function ServiceGroupTemplate({ ); const tabs = useTabs(serviceGroupContextTab); - const selectedTab = tabs?.find(({ isSelected }) => isSelected); + const selectedTab = tabs.find(({ isSelected }) => isSelected); + + // this is only used for building the breadcrumbs for the service group page useBreadcrumb( - () => [ - { - title: i18n.translate('xpack.apm.serviceGroups.breadcrumb.title', { - defaultMessage: 'Services', - }), - href: serviceGroupsLink, - }, - ...(selectedTab + () => + !serviceGroupName ? [ - ...(serviceGroupName + { + title: pageTitle, + href: pagePath, + }, + ] + : [ + { + title: i18n.translate('xpack.apm.serviceGroups.breadcrumb.title', { + defaultMessage: 'Services', + }), + href: serviceGroupsLink, + }, + { + title: serviceGroupName, + href: router.link('/services', { query }), + }, + ...(selectedTab ? [ { - title: serviceGroupName, - href: router.link('/services', { query }), - }, + title: selectedTab.breadcrumbLabel || selectedTab.label, + href: selectedTab.href, + } as { title: string; href: string }, ] : []), - { - title: selectedTab.breadcrumbLabel || selectedTab.label, - href: selectedTab.href, - } as { title: string; href: string }, - ] - : []), - ], - [query, router, selectedTab, serviceGroupName, serviceGroupsLink] + ], + [pagePath, pageTitle, query, router, selectedTab, serviceGroupName, serviceGroupsLink], + { + omitRootOnServerless: true, + } ); + return ( = { transactionTypes: [], fallbackToTransactions: false, serviceAgentStatus: FETCH_STATUS.SUCCESS, + serviceEntitySummaryStatus: FETCH_STATUS.SUCCESS, }} > diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/explore_logs_button/explore_logs_button.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/explore_logs_button/explore_logs_button.tsx new file mode 100644 index 0000000000000..4d09b6bd08fe6 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/explore_logs_button/explore_logs_button.tsx @@ -0,0 +1,58 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. 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 { AllDatasetsLocatorParams, ALL_DATASETS_LOCATOR_ID } from '@kbn/deeplinks-observability'; +import { EuiButtonEmpty } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; +import { buildLogsExplorerLocatorConfig } from './logs_explorer_locator_config'; + +export function ExploreLogsButton({ + start, + end, + kuery, +}: { + start: string; + end: string; + kuery?: string; +}) { + const { share } = useApmPluginContext(); + + const logsExplorerLocator = + share.url.locators.get(ALL_DATASETS_LOCATOR_ID)!; + + if (!logsExplorerLocator) { + return null; + } + + const { logsExplorerLinkProps } = buildLogsExplorerLocatorConfig({ + locator: logsExplorerLocator, + from: start, + to: end, + kuery, + }); + + return ( + + {i18n.translate('xpack.apm.button.exploreLogs', { + defaultMessage: 'Explore logs', + })} + + ); +} diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/explore_logs_button/logs_explorer_locator_config.ts b/x-pack/plugins/observability_solution/apm/public/components/shared/explore_logs_button/logs_explorer_locator_config.ts new file mode 100644 index 0000000000000..e5baa87856b31 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/explore_logs_button/logs_explorer_locator_config.ts @@ -0,0 +1,48 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { AllDatasetsLocatorParams } from '@kbn/deeplinks-observability'; +import { LocatorPublic } from '@kbn/share-plugin/common'; +import { getRouterLinkProps } from '@kbn/router-utils'; +import { RouterLinkProps } from '@kbn/router-utils/src/get_router_link_props'; + +export const buildLogsExplorerLocatorConfig = ({ + locator, + kuery, + from, + to, +}: { + locator: LocatorPublic; + kuery?: string; + from: string; + to: string; +}): { + logsExplorerLinkProps: RouterLinkProps; +} => { + const params: AllDatasetsLocatorParams = { + timeRange: { + from, + to, + }, + ...(kuery && { + query: { language: 'kuery', query: kuery }, + }), + }; + + const urlToLogsExplorer = locator.getRedirectUrl(params); + + const navigateToLogsExplorer = () => { + locator.navigate(params); + }; + + const logsExplorerLinkProps = getRouterLinkProps({ + href: urlToLogsExplorer, + onClick: navigateToLogsExplorer, + }); + + return { logsExplorerLinkProps }; +}; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/is_route_with_time_range.ts b/x-pack/plugins/observability_solution/apm/public/components/shared/is_route_with_time_range.ts index f27b00dfc0c03..f5ec673745939 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/is_route_with_time_range.ts +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/is_route_with_time_range.ts @@ -25,7 +25,6 @@ export function isRouteWithTimeRange({ route.path === '/dependencies/inventory' || route.path === '/services/{serviceName}' || route.path === '/mobile-services/{serviceName}' || - route.path === '/logs-services/{serviceName}' || route.path === '/service-groups' || route.path === '/storage-explorer' || location.pathname === '/' || diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/links/apm/service_link/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/links/apm/service_link/index.tsx index f32dc38234c74..4dcf3ac79802c 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/links/apm/service_link/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/links/apm/service_link/index.tsx @@ -16,12 +16,11 @@ import { SignalTypes } from '../../../../../../common/entities/types'; import { NOT_AVAILABLE_LABEL } from '../../../../../../common/i18n'; import { AgentName } from '../../../../../../typings/es_schemas/ui/fields/agent'; import { useApmRouter } from '../../../../../hooks/use_apm_router'; -import { isApmSignal } from '../../../../../utils/get_signal_type'; import { truncate, unit } from '../../../../../utils/style'; import { ApmRoutes } from '../../../../routing/apm_route_config'; import { PopoverTooltip } from '../../../popover_tooltip'; import { TruncateWithTooltip } from '../../../truncate_with_tooltip'; -import { OTHER_SERVICE_NAME, MaxGroupsMessage } from '../max_groups_message'; +import { MaxGroupsMessage, OTHER_SERVICE_NAME } from '../max_groups_message'; const StyledLink = euiStyled(EuiLink)`${truncate('100%')};`; @@ -46,9 +45,7 @@ export function ServiceLink({ const serviceLink = isMobileAgentName(agentName) ? '/mobile-services/{serviceName}/overview' - : isApmSignal(signalTypes) - ? '/services/{serviceName}/overview' - : '/logs-services/{serviceName}/overview'; + : '/services/{serviceName}/overview'; if (serviceName === OTHER_SERVICE_NAME) { return ( diff --git a/x-pack/plugins/observability_solution/apm/public/context/apm_plugin/mock_apm_plugin_storybook.tsx b/x-pack/plugins/observability_solution/apm/public/context/apm_plugin/mock_apm_plugin_storybook.tsx index f2f6ae0d15854..0c851093a5bb1 100644 --- a/x-pack/plugins/observability_solution/apm/public/context/apm_plugin/mock_apm_plugin_storybook.tsx +++ b/x-pack/plugins/observability_solution/apm/public/context/apm_plugin/mock_apm_plugin_storybook.tsx @@ -128,6 +128,13 @@ const mockApmPluginContext = { observabilityAIAssistant: { service: { setScreenContext: () => noop }, }, + share: { + url: { + locators: { + get: jest.fn(), + }, + }, + }, } as unknown as ApmPluginContextValue; export function MockApmPluginStorybook({ diff --git a/x-pack/plugins/observability_solution/apm/public/context/apm_service/apm_service_context.tsx b/x-pack/plugins/observability_solution/apm/public/context/apm_service/apm_service_context.tsx index 3fe833e6d9c64..9080e641e16fa 100644 --- a/x-pack/plugins/observability_solution/apm/public/context/apm_service/apm_service_context.tsx +++ b/x-pack/plugins/observability_solution/apm/public/context/apm_service/apm_service_context.tsx @@ -19,6 +19,10 @@ import { replace } from '../../components/shared/links/url_helpers'; import { FETCH_STATUS } from '../../hooks/use_fetcher'; import { ServerlessType } from '../../../common/serverless'; import { usePreferredDataSourceAndBucketSize } from '../../hooks/use_preferred_data_source_and_bucket_size'; +import { + type ServiceEntitySummary, + useServiceEntitySummaryFetcher, +} from './use_service_entity_summary_fetcher'; export interface APMServiceContextValue { serviceName: string; @@ -30,6 +34,8 @@ export interface APMServiceContextValue { runtimeName?: string; fallbackToTransactions: boolean; serviceAgentStatus: FETCH_STATUS; + serviceEntitySummary?: ServiceEntitySummary; + serviceEntitySummaryStatus: FETCH_STATUS; } export const APMServiceContext = createContext({ @@ -38,6 +44,7 @@ export const APMServiceContext = createContext({ transactionTypes: [], fallbackToTransactions: false, serviceAgentStatus: FETCH_STATUS.NOT_INITIATED, + serviceEntitySummaryStatus: FETCH_STATUS.NOT_INITIATED, }); export function ApmServiceContextProvider({ children }: { children: ReactNode }) { @@ -46,12 +53,8 @@ export function ApmServiceContextProvider({ children }: { children: ReactNode }) const { path: { serviceName }, query, - query: { kuery, rangeFrom, rangeTo }, - } = useAnyOfApmParams( - '/services/{serviceName}', - '/mobile-services/{serviceName}', - '/logs-services/{serviceName}' - ); + query: { kuery, rangeFrom, rangeTo, environment }, + } = useAnyOfApmParams('/services/{serviceName}', '/mobile-services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); @@ -82,6 +85,13 @@ export function ApmServiceContextProvider({ children }: { children: ReactNode }) rollupInterval: preferred?.source.rollupInterval, }); + const { serviceEntitySummary, serviceEntitySummaryStatus } = useServiceEntitySummaryFetcher({ + serviceName, + start, + end, + environment, + }); + const currentTransactionType = getOrRedirectToTransactionType({ transactionType: query.transactionType, transactionTypes, @@ -105,6 +115,8 @@ export function ApmServiceContextProvider({ children }: { children: ReactNode }) runtimeName, fallbackToTransactions, serviceAgentStatus, + serviceEntitySummary, + serviceEntitySummaryStatus, }} children={children} /> diff --git a/x-pack/plugins/observability_solution/apm/public/context/apm_service/use_service_entity_summary_fetcher.ts b/x-pack/plugins/observability_solution/apm/public/context/apm_service/use_service_entity_summary_fetcher.ts new file mode 100644 index 0000000000000..c5cb0b698c7b9 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/public/context/apm_service/use_service_entity_summary_fetcher.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useFetcher } from '../../hooks/use_fetcher'; +import { APIReturnType } from '../../services/rest/create_call_apm_api'; +import { useEntityManagerEnablementContext } from '../entity_manager_context/use_entity_manager_enablement_context'; + +export type ServiceEntitySummary = + APIReturnType<'GET /internal/apm/entities/services/{serviceName}/summary'>; + +export function useServiceEntitySummaryFetcher({ + serviceName, + start, + end, + environment, +}: { + serviceName?: string; + start?: string; + end?: string; + environment?: string; +}) { + const { isEntityCentricExperienceViewEnabled } = useEntityManagerEnablementContext(); + + const { data, status } = useFetcher( + (callAPI) => { + if (isEntityCentricExperienceViewEnabled && serviceName && start && end && environment) { + return callAPI('GET /internal/apm/entities/services/{serviceName}/summary', { + params: { path: { serviceName }, query: { end, environment, start } }, + }); + } + }, + [end, environment, isEntityCentricExperienceViewEnabled, serviceName, start] + ); + + return { serviceEntitySummary: data, serviceEntitySummaryStatus: status }; +} diff --git a/x-pack/plugins/observability_solution/apm/public/context/breadcrumbs/context.tsx b/x-pack/plugins/observability_solution/apm/public/context/breadcrumbs/context.tsx index 1765b3f2be92b..e661ef2450310 100644 --- a/x-pack/plugins/observability_solution/apm/public/context/breadcrumbs/context.tsx +++ b/x-pack/plugins/observability_solution/apm/public/context/breadcrumbs/context.tsx @@ -9,6 +9,7 @@ import { ChromeBreadcrumb } from '@kbn/core/public'; import { compact, isEqual } from 'lodash'; import React, { createContext, useMemo, useState } from 'react'; import { useBreadcrumbs } from '@kbn/observability-shared-plugin/public'; +import { useKibana } from '../kibana_context/use_kibana'; export interface Breadcrumb { title: string; @@ -25,6 +26,9 @@ export const BreadcrumbsContext = createContext(undef export function BreadcrumbsContextProvider({ children }: { children: React.ReactElement }) { const [, forceUpdate] = useState({}); + const { + services: { serverless }, + } = useKibana(); const breadcrumbs = useMemo(() => { return new Map(); @@ -72,7 +76,7 @@ export function BreadcrumbsContextProvider({ children }: { children: React.React }; }); - useBreadcrumbs(formattedBreadcrumbs); + useBreadcrumbs(formattedBreadcrumbs, { serverless }); return {children}; } diff --git a/x-pack/plugins/observability_solution/apm/public/context/breadcrumbs/use_breadcrumb.ts b/x-pack/plugins/observability_solution/apm/public/context/breadcrumbs/use_breadcrumb.ts index 5e3fb08b8f276..a6b80fd088bff 100644 --- a/x-pack/plugins/observability_solution/apm/public/context/breadcrumbs/use_breadcrumb.ts +++ b/x-pack/plugins/observability_solution/apm/public/context/breadcrumbs/use_breadcrumb.ts @@ -9,8 +9,16 @@ import { useCurrentRoute } from '@kbn/typed-react-router-config'; import { useContext, useEffect, useRef } from 'react'; import { castArray } from 'lodash'; import { Breadcrumb, BreadcrumbsContext } from './context'; +import { useKibanaEnvironmentContext } from '../kibana_environment_context/use_kibana_environment_context'; + +export function useBreadcrumb( + callback: () => Breadcrumb | Breadcrumb[], + fnDeps: any[], + options?: { omitRootOnServerless?: boolean; omitOnServerless?: boolean } +) { + const { isServerlessEnv } = useKibanaEnvironmentContext(); + const { omitRootOnServerless = false, omitOnServerless = false } = options || {}; -export function useBreadcrumb(callback: () => Breadcrumb | Breadcrumb[], fnDeps: any[]) { const api = useContext(BreadcrumbsContext); if (!api) { @@ -22,6 +30,10 @@ export function useBreadcrumb(callback: () => Breadcrumb | Breadcrumb[], fnDeps: const matchedRoute = useRef(match?.route); useEffect(() => { + if (isServerlessEnv && omitOnServerless) { + return; + } + if (matchedRoute.current && matchedRoute.current !== match?.route) { api.unset(matchedRoute.current); } @@ -29,7 +41,14 @@ export function useBreadcrumb(callback: () => Breadcrumb | Breadcrumb[], fnDeps: matchedRoute.current = match?.route; if (matchedRoute.current) { - api.set(matchedRoute.current, castArray(callback())); + const breadcrumbs = castArray(callback()); + + api.set( + matchedRoute.current, + isServerlessEnv && omitRootOnServerless && breadcrumbs.length >= 1 + ? breadcrumbs.slice(1) + : breadcrumbs + ); } return () => { diff --git a/x-pack/plugins/observability_solution/apm/public/context/kibana_environment_context/kibana_environment_context.tsx b/x-pack/plugins/observability_solution/apm/public/context/kibana_environment_context/kibana_environment_context.tsx index acf974d4d2dae..61c7f1e5e7ff1 100644 --- a/x-pack/plugins/observability_solution/apm/public/context/kibana_environment_context/kibana_environment_context.tsx +++ b/x-pack/plugins/observability_solution/apm/public/context/kibana_environment_context/kibana_environment_context.tsx @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +import React from 'react'; import { createContext } from 'react'; export interface KibanaEnvContext { @@ -14,3 +14,17 @@ export interface KibanaEnvContext { } export const KibanaEnvironmentContext = createContext({}); + +export function KibanaEnvironmentContextProvider({ + children, + kibanaEnvironment, +}: { + kibanaEnvironment: KibanaEnvContext; + children: React.ReactElement; +}) { + return ( + + {children} + + ); +} diff --git a/x-pack/plugins/observability_solution/apm/public/context/kibana_environment_context/use_kibana_environment_context.tsx b/x-pack/plugins/observability_solution/apm/public/context/kibana_environment_context/use_kibana_environment_context.tsx index 5f3830a5524f0..fbdbe1073cf8c 100644 --- a/x-pack/plugins/observability_solution/apm/public/context/kibana_environment_context/use_kibana_environment_context.tsx +++ b/x-pack/plugins/observability_solution/apm/public/context/kibana_environment_context/use_kibana_environment_context.tsx @@ -5,35 +5,9 @@ * 2.0. */ -import { useMemo, createElement, FC, PropsWithChildren } from 'react'; -import { KibanaEnvironmentContext, type KibanaEnvContext } from './kibana_environment_context'; +import { useContext } from 'react'; +import { KibanaEnvironmentContext } from './kibana_environment_context'; -export const useKibanaEnvironmentContextProvider = ({ - kibanaVersion, - isCloudEnv, - isServerlessEnv, -}: KibanaEnvContext) => { - const value = useMemo( - () => ({ - kibanaVersion, - isCloudEnv, - isServerlessEnv, - }), - [kibanaVersion, isCloudEnv, isServerlessEnv] - ); - - const Provider: FC< - PropsWithChildren<{ - kibanaEnvironment?: KibanaEnvContext; - }> - > = ({ kibanaEnvironment = {}, children }) => { - const newProvider = createElement(KibanaEnvironmentContext.Provider, { - value: { ...kibanaEnvironment, ...value }, - children, - }); - - return newProvider; - }; - - return Provider; +export const useKibanaEnvironmentContext = () => { + return useContext(KibanaEnvironmentContext); }; diff --git a/x-pack/plugins/observability_solution/apm/public/context/service_anomaly_timeseries/service_anomaly_timeseries_context.tsx b/x-pack/plugins/observability_solution/apm/public/context/service_anomaly_timeseries/service_anomaly_timeseries_context.tsx index 30e6481b951b9..986730c99691e 100644 --- a/x-pack/plugins/observability_solution/apm/public/context/service_anomaly_timeseries/service_anomaly_timeseries_context.tsx +++ b/x-pack/plugins/observability_solution/apm/public/context/service_anomaly_timeseries/service_anomaly_timeseries_context.tsx @@ -41,11 +41,7 @@ export function ServiceAnomalyTimeseriesContextProvider({ const { query: { rangeFrom, rangeTo }, - } = useAnyOfApmParams( - '/services/{serviceName}', - '/mobile-services/{serviceName}', - '/logs-services/{serviceName}' - ); + } = useAnyOfApmParams('/services/{serviceName}', '/mobile-services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); const { preferredEnvironment } = useEnvironmentsContext(); diff --git a/x-pack/plugins/observability_solution/apm/public/hooks/use_dependency_detail_operations_breadcrumb.ts b/x-pack/plugins/observability_solution/apm/public/hooks/use_dependency_detail_operations_breadcrumb.ts index 5a0516531f443..197e03845a953 100644 --- a/x-pack/plugins/observability_solution/apm/public/hooks/use_dependency_detail_operations_breadcrumb.ts +++ b/x-pack/plugins/observability_solution/apm/public/hooks/use_dependency_detail_operations_breadcrumb.ts @@ -6,11 +6,15 @@ */ import { i18n } from '@kbn/i18n'; +import { castArray } from 'lodash'; import { useBreadcrumb } from '../context/breadcrumbs/use_breadcrumb'; import { useAnyOfApmParams } from './use_apm_params'; import { useApmRouter } from './use_apm_router'; +import { Breadcrumb } from '../context/breadcrumbs/context'; -export function useDependencyDetailOperationsBreadcrumb() { +export function useDependencyDetailOperationsBreadcrumb( + extraBreadCrumbs: Breadcrumb | Breadcrumb[] = [] +) { const { query: { dependencyName, @@ -45,12 +49,14 @@ export function useDependencyDetailOperationsBreadcrumb() { }, }), }, + ...castArray(extraBreadCrumbs), ], [ apmRouter, comparisonEnabled, dependencyName, environment, + extraBreadCrumbs, kuery, rangeFrom, rangeTo, diff --git a/x-pack/plugins/observability_solution/apm/public/plugin.ts b/x-pack/plugins/observability_solution/apm/public/plugin.ts index c45d8f7abba64..9524f328755c0 100644 --- a/x-pack/plugins/observability_solution/apm/public/plugin.ts +++ b/x-pack/plugins/observability_solution/apm/public/plugin.ts @@ -69,6 +69,7 @@ import type { IUiSettingsClient } from '@kbn/core-ui-settings-browser'; import { from } from 'rxjs'; import { map } from 'rxjs'; import type { CloudSetup } from '@kbn/cloud-plugin/public'; +import type { ServerlessPluginStart } from '@kbn/serverless/public'; import type { ConfigSchema } from '.'; import { registerApmRuleTypes } from './components/alerting/rule_types/register_apm_rule_types'; import { registerEmbeddables } from './embeddable/register_embeddables'; @@ -134,6 +135,7 @@ export interface ApmPluginStartDeps { fieldFormats?: FieldFormatsStart; security?: SecurityPluginStart; spaces?: SpacesPluginStart; + serverless?: ServerlessPluginStart; dataViews: DataViewsPublicPluginStart; unifiedSearch: UnifiedSearchPublicPluginStart; storage: IStorageWrapper; diff --git a/x-pack/plugins/observability_solution/apm/tsconfig.json b/x-pack/plugins/observability_solution/apm/tsconfig.json index 7389566ed6a4c..7de9609dbbafe 100644 --- a/x-pack/plugins/observability_solution/apm/tsconfig.json +++ b/x-pack/plugins/observability_solution/apm/tsconfig.json @@ -128,9 +128,9 @@ "@kbn/core-analytics-browser", "@kbn/apm-types", "@kbn/entities-schema", - "@kbn/aiops-log-rate-analysis" + "@kbn/serverless", + "@kbn/aiops-log-rate-analysis", + "@kbn/router-utils" ], - "exclude": [ - "target/**/*" - ] + "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/built_in/services.ts b/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/built_in/services.ts index 87b876249f33f..4c97d5cec72ed 100644 --- a/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/built_in/services.ts +++ b/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/built_in/services.ts @@ -42,9 +42,6 @@ export const builtInServicesFromLogsEntityDefinition: EntityDefinition = syncDelay: '2m', }, }, - latest: { - lookback: '5m', - }, identityFields: ['service.name', { field: 'service.environment', optional: true }], displayNameTemplate: '{{service.name}}{{#service.environment}}:{{.}}{{/service.environment}}', metadata: [ diff --git a/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/find_entity_definition.ts b/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/find_entity_definition.ts index d683c39a44890..0ea681676e9b1 100644 --- a/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/find_entity_definition.ts +++ b/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/find_entity_definition.ts @@ -58,6 +58,25 @@ export async function findEntityDefinitions({ ); } +export async function findEntityDefinitionById({ + id, + esClient, + soClient, +}: { + id: string; + esClient: ElasticsearchClient; + soClient: SavedObjectsClientContract; +}) { + const [definition] = await findEntityDefinitions({ + esClient, + soClient, + id, + perPage: 1, + }); + + return definition; +} + async function getEntityDefinitionState( esClient: ElasticsearchClient, definition: EntityDefinition diff --git a/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/helpers/merge_definition_update.ts b/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/helpers/merge_definition_update.ts new file mode 100644 index 0000000000000..7352bfed33c62 --- /dev/null +++ b/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/helpers/merge_definition_update.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EntityDefinition, EntityDefinitionUpdate } from '@kbn/entities-schema'; +import { mergeWith, omit } from 'lodash'; + +export function mergeEntityDefinitionUpdate( + definition: EntityDefinition, + update: EntityDefinitionUpdate +) { + const updatedDefinition = mergeWith(definition, update, (value, other) => { + // we don't want to merge arrays (metrics, metadata..) but overwrite them + if (Array.isArray(value)) { + return other; + } + }); + + return omit(updatedDefinition, ['state']) as EntityDefinition; +} diff --git a/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/install_entity_definition.ts b/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/install_entity_definition.ts index cbebbb804d538..7b0b18bc08a57 100644 --- a/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/install_entity_definition.ts +++ b/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/install_entity_definition.ts @@ -8,7 +8,7 @@ import semver from 'semver'; import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; -import { EntityDefinition } from '@kbn/entities-schema'; +import { EntityDefinition, EntityDefinitionUpdate } from '@kbn/entities-schema'; import { Logger } from '@kbn/logging'; import { generateHistoryIndexTemplateId, @@ -26,7 +26,7 @@ import { import { validateDefinitionCanCreateValidTransformIds } from './transform/validate_transform_ids'; import { deleteEntityDefinition } from './delete_entity_definition'; import { deleteHistoryIngestPipeline, deleteLatestIngestPipeline } from './delete_ingest_pipeline'; -import { findEntityDefinitions } from './find_entity_definition'; +import { findEntityDefinitionById } from './find_entity_definition'; import { entityDefinitionExists, saveEntityDefinition, @@ -44,6 +44,7 @@ import { generateEntitiesHistoryIndexTemplateConfig } from './templates/entities import { EntityIdConflict } from './errors/entity_id_conflict_error'; import { EntityDefinitionNotFound } from './errors/entity_not_found'; import { EntityDefinitionWithState } from './types'; +import { mergeEntityDefinitionUpdate } from './helpers/merge_definition_update'; export interface InstallDefinitionParams { esClient: ElasticsearchClient; @@ -140,13 +141,13 @@ export async function installBuiltInEntityDefinitions({ logger.debug(`Starting installation of ${definitions.length} built-in definitions`); const installPromises = definitions.map(async (builtInDefinition) => { - const installedDefinitions = await findEntityDefinitions({ + const installedDefinition = await findEntityDefinitionById({ esClient, soClient, id: builtInDefinition.id, }); - if (installedDefinitions.length === 0) { + if (!installedDefinition) { return await installEntityDefinition({ definition: builtInDefinition, esClient, @@ -156,20 +157,19 @@ export async function installBuiltInEntityDefinitions({ } // verify existing installation - const installedDefinition = installedDefinitions[0]; - if (!shouldReinstall(installedDefinition, builtInDefinition)) { + if (!shouldReinstallBuiltinDefinition(installedDefinition, builtInDefinition)) { return installedDefinition; } logger.debug( `Detected failed or outdated installation of definition [${installedDefinition.id}] v${installedDefinition.version}, installing v${builtInDefinition.version}` ); - return await reinstall({ + return await reinstallEntityDefinition({ soClient, esClient, logger, definition: installedDefinition, - latestDefinition: builtInDefinition, + definitionUpdate: builtInDefinition, }); }); @@ -223,30 +223,36 @@ async function install({ ]).then(throwIfRejected); await updateEntityDefinition(soClient, definition.id, { installStatus: 'installed' }); - return { ...definition, installStatus: 'installed' }; } // stop and delete the current transforms and reinstall all the components -async function reinstall({ +export async function reinstallEntityDefinition({ esClient, soClient, definition, - latestDefinition, + definitionUpdate, logger, -}: InstallDefinitionParams & { latestDefinition: EntityDefinition }): Promise { - logger.debug( - `Reinstalling definition ${definition.id} from v${definition.version} to v${latestDefinition.version}` - ); - +}: InstallDefinitionParams & { + definitionUpdate: EntityDefinitionUpdate; +}): Promise { try { - await updateEntityDefinition(soClient, latestDefinition.id, { - ...latestDefinition, + const updatedDefinition = mergeEntityDefinitionUpdate(definition, definitionUpdate); + + logger.debug( + () => + `Reinstalling definition ${definition.id} from v${definition.version} to v${ + definitionUpdate.version + }\n${JSON.stringify(updatedDefinition, null, 2)}` + ); + + await updateEntityDefinition(soClient, definition.id, { + ...updatedDefinition, installStatus: 'upgrading', installStartedAt: new Date().toISOString(), }); - logger.debug(`Stopping transforms for definition ${definition.id} v${definition.version}`); + logger.debug(`Deleting transforms for definition ${definition.id} v${definition.version}`); await Promise.all([ stopAndDeleteHistoryTransform(esClient, definition, logger), isBackfillEnabled(definition) @@ -259,10 +265,10 @@ async function reinstall({ esClient, soClient, logger, - definition: latestDefinition, + definition: updatedDefinition, }); } catch (err) { - await updateEntityDefinition(soClient, latestDefinition.id, { + await updateEntityDefinition(soClient, definition.id, { installStatus: 'failed', }); @@ -271,19 +277,34 @@ async function reinstall({ } const INSTALLATION_TIMEOUT = 5 * 60 * 1000; -const shouldReinstall = ( - definition: EntityDefinitionWithState, - latestDefinition: EntityDefinition -) => { +export const installationInProgress = (definition: EntityDefinition) => { + const { installStatus, installStartedAt } = definition; + + return ( + (installStatus === 'installing' || installStatus === 'upgrading') && + Date.now() - Date.parse(installStartedAt!) < INSTALLATION_TIMEOUT + ); +}; + +const installationTimedOut = (definition: EntityDefinition) => { const { installStatus, installStartedAt } = definition; - const isStale = + return ( (installStatus === 'installing' || installStatus === 'upgrading') && - Date.now() - Date.parse(installStartedAt!) >= INSTALLATION_TIMEOUT; - const isOutdated = - installStatus === 'installed' && semver.neq(definition.version, latestDefinition.version); - const isFailed = installStatus === 'failed'; - const isPartial = installStatus === 'installed' && !definition.state.installed; + Date.now() - Date.parse(installStartedAt!) >= INSTALLATION_TIMEOUT + ); +}; + +const shouldReinstallBuiltinDefinition = ( + installedDefinition: EntityDefinitionWithState, + latestDefinition: EntityDefinition +) => { + const { installStatus, version, state } = installedDefinition; + + const timedOut = installationTimedOut(installedDefinition); + const outdated = installStatus === 'installed' && semver.neq(version, latestDefinition.version); + const failed = installStatus === 'failed'; + const partial = installStatus === 'installed' && !state.installed; - return isStale || isOutdated || isFailed || isPartial; + return timedOut || outdated || failed || partial; }; diff --git a/x-pack/plugins/observability_solution/entity_manager/server/lib/entity_client.ts b/x-pack/plugins/observability_solution/entity_manager/server/lib/entity_client.ts new file mode 100644 index 0000000000000..7fd0bb3c5ee18 --- /dev/null +++ b/x-pack/plugins/observability_solution/entity_manager/server/lib/entity_client.ts @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EntityDefinition } from '@kbn/entities-schema'; +import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; +import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; +import { Logger } from '@kbn/logging'; +import { installEntityDefinition } from './entities/install_entity_definition'; +import { startTransform } from './entities/start_transform'; +import { findEntityDefinitions } from './entities/find_entity_definition'; +import { uninstallEntityDefinition } from './entities/uninstall_entity_definition'; +import { EntityDefinitionNotFound } from './entities/errors/entity_not_found'; + +export class EntityClient { + constructor( + private options: { + esClient: ElasticsearchClient; + soClient: SavedObjectsClientContract; + logger: Logger; + } + ) {} + + async createEntityDefinition({ + definition, + installOnly = false, + }: { + definition: EntityDefinition; + installOnly?: boolean; + }) { + const installedDefinition = await installEntityDefinition({ + definition, + soClient: this.options.soClient, + esClient: this.options.esClient, + logger: this.options.logger, + }); + + if (!installOnly) { + await startTransform(this.options.esClient, definition, this.options.logger); + } + + return installedDefinition; + } + + async deleteEntityDefinition({ id, deleteData = false }: { id: string; deleteData?: boolean }) { + const [definition] = await findEntityDefinitions({ + id, + perPage: 1, + soClient: this.options.soClient, + esClient: this.options.esClient, + }); + + if (!definition) { + const message = `Unable to find entity definition with [${id}]`; + this.options.logger.error(message); + throw new EntityDefinitionNotFound(message); + } + + await uninstallEntityDefinition({ + definition, + deleteData, + soClient: this.options.soClient, + esClient: this.options.esClient, + logger: this.options.logger, + }); + } + + async getEntityDefinitions({ page = 1, perPage = 10 }: { page?: number; perPage?: number }) { + const definitions = await findEntityDefinitions({ + esClient: this.options.esClient, + soClient: this.options.soClient, + page, + perPage, + }); + + return { definitions }; + } +} diff --git a/x-pack/plugins/observability_solution/entity_manager/server/plugin.ts b/x-pack/plugins/observability_solution/entity_manager/server/plugin.ts index de9e8bec2826f..d65a2a9e186f3 100644 --- a/x-pack/plugins/observability_solution/entity_manager/server/plugin.ts +++ b/x-pack/plugins/observability_solution/entity_manager/server/plugin.ts @@ -14,6 +14,7 @@ import { PluginInitializerContext, PluginConfigDescriptor, Logger, + KibanaRequest, } from '@kbn/core/server'; import { installEntityManagerTemplates } from './lib/manage_index_templates'; import { setupRoutes } from './routes'; @@ -26,6 +27,7 @@ import { EntityManagerConfig, configSchema, exposeToBrowserConfig } from '../com import { entityDefinition, EntityDiscoveryApiKeyType } from './saved_objects'; import { upgradeBuiltInEntityDefinitions } from './lib/entities/upgrade_entity_definition'; import { builtInDefinitions } from './lib/entities/built_in'; +import { EntityClient } from './lib/entity_client'; export type EntityManagerServerPluginSetup = ReturnType; export type EntityManagerServerPluginStart = ReturnType; @@ -73,6 +75,12 @@ export class EntityManagerServerPlugin router, logger: this.logger, server: this.server, + getScopedClient: async ({ request }: { request: KibanaRequest }) => { + const [coreStart] = await core.getStartServices(); + const esClient = coreStart.elasticsearch.client.asScoped(request).asCurrentUser; + const soClient = coreStart.savedObjects.getScopedClient(request); + return new EntityClient({ esClient, soClient, logger: this.logger }); + }, }); return {}; diff --git a/x-pack/plugins/observability_solution/entity_manager/server/routes/enablement/enable.ts b/x-pack/plugins/observability_solution/entity_manager/server/routes/enablement/enable.ts index cd90f7f167b68..382e9a26ac6e5 100644 --- a/x-pack/plugins/observability_solution/entity_manager/server/routes/enablement/enable.ts +++ b/x-pack/plugins/observability_solution/entity_manager/server/routes/enablement/enable.ts @@ -10,7 +10,6 @@ import { CreateEntityDefinitionQuery, createEntityDefinitionQuerySchema, } from '@kbn/entities-schema'; -import { buildRouteValidationWithZod } from '@kbn/zod-helpers'; import { SetupRouteOptions } from '../types'; import { canEnableEntityDiscovery, @@ -71,7 +70,7 @@ export function enableEntityDiscoveryRoute({ { path: '/internal/entities/managed/enablement', validate: { - query: buildRouteValidationWithZod(createEntityDefinitionQuerySchema), + query: createEntityDefinitionQuerySchema, }, }, async (context, req, res) => { diff --git a/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/create.ts b/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/create.ts index 3472578ef4c0b..62a2b88cd99f8 100644 --- a/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/create.ts +++ b/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/create.ts @@ -12,13 +12,11 @@ import { createEntityDefinitionQuerySchema, CreateEntityDefinitionQuery, } from '@kbn/entities-schema'; -import { buildRouteValidationWithZod } from '@kbn/zod-helpers'; import { SetupRouteOptions } from '../types'; import { EntityIdConflict } from '../../lib/entities/errors/entity_id_conflict_error'; import { EntitySecurityException } from '../../lib/entities/errors/entity_security_exception'; import { InvalidTransformError } from '../../lib/entities/errors/invalid_transform_error'; -import { startTransform } from '../../lib/entities/start_transform'; -import { installEntityDefinition } from '../../lib/entities/install_entity_definition'; +import { EntityDefinitionIdInvalid } from '../../lib/entities/errors/entity_definition_id_invalid'; /** * @openapi @@ -56,41 +54,41 @@ import { installEntityDefinition } from '../../lib/entities/install_entity_defin */ export function createEntityDefinitionRoute({ router, - server, + getScopedClient, + logger, }: SetupRouteOptions) { router.post( { path: '/internal/entities/definition', validate: { - body: buildRouteValidationWithZod(entityDefinitionSchema.strict()), - query: buildRouteValidationWithZod(createEntityDefinitionQuerySchema), + body: entityDefinitionSchema.strict(), + query: createEntityDefinitionQuerySchema, }, }, - async (context, req, res) => { - const { logger } = server; - const core = await context.core; - const soClient = core.savedObjects.client; - const esClient = core.elasticsearch.client.asCurrentUser; + async (context, request, res) => { try { - const definition = await installEntityDefinition({ - soClient, - esClient, - logger, - definition: req.body, + const client = await getScopedClient({ request }); + const definition = await client.createEntityDefinition({ + definition: request.body, + installOnly: request.query.installOnly, }); - if (!req.query.installOnly) { - await startTransform(esClient, definition, logger); - } - return res.ok({ body: definition }); } catch (e) { + logger.error(e); + + if (e instanceof EntityDefinitionIdInvalid) { + return res.badRequest({ body: e }); + } + if (e instanceof EntityIdConflict) { return res.conflict({ body: e }); } + if (e instanceof EntitySecurityException || e instanceof InvalidTransformError) { return res.customError({ body: e, statusCode: 400 }); } + return res.customError({ body: e, statusCode: 500 }); } } diff --git a/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/delete.ts b/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/delete.ts index 65fb7ed2b3e2b..c2798aef9eb14 100644 --- a/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/delete.ts +++ b/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/delete.ts @@ -6,7 +6,6 @@ */ import { RequestHandlerContext } from '@kbn/core/server'; -import { buildRouteValidationWithZod } from '@kbn/zod-helpers'; import { deleteEntityDefinitionParamsSchema, deleteEntityDefinitionQuerySchema, @@ -14,9 +13,7 @@ import { import { SetupRouteOptions } from '../types'; import { EntitySecurityException } from '../../lib/entities/errors/entity_security_exception'; import { InvalidTransformError } from '../../lib/entities/errors/invalid_transform_error'; -import { readEntityDefinition } from '../../lib/entities/read_entity_definition'; import { EntityDefinitionNotFound } from '../../lib/entities/errors/entity_not_found'; -import { uninstallEntityDefinition } from '../../lib/entities/uninstall_entity_definition'; /** * @openapi @@ -54,33 +51,29 @@ import { uninstallEntityDefinition } from '../../lib/entities/uninstall_entity_d */ export function deleteEntityDefinitionRoute({ router, - server, + getScopedClient, + logger, }: SetupRouteOptions) { router.delete<{ id: string }, { deleteData?: boolean }, unknown>( { path: '/internal/entities/definition/{id}', validate: { - params: buildRouteValidationWithZod(deleteEntityDefinitionParamsSchema.strict()), - query: buildRouteValidationWithZod(deleteEntityDefinitionQuerySchema.strict()), + params: deleteEntityDefinitionParamsSchema.strict(), + query: deleteEntityDefinitionQuerySchema.strict(), }, }, - async (context, req, res) => { + async (context, request, res) => { try { - const { logger } = server; - const soClient = (await context.core).savedObjects.client; - const esClient = (await context.core).elasticsearch.client.asCurrentUser; - - const definition = await readEntityDefinition(soClient, req.params.id, logger); - await uninstallEntityDefinition({ - definition, - soClient, - esClient, - logger, - deleteData: req.query.deleteData, + const client = await getScopedClient({ request }); + await client.deleteEntityDefinition({ + id: request.params.id, + deleteData: request.query.deleteData, }); return res.ok({ body: { acknowledged: true } }); } catch (e) { + logger.error(e); + if (e instanceof EntityDefinitionNotFound) { return res.notFound({ body: e }); } diff --git a/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/get.ts b/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/get.ts index b91e1115894ff..454679779c6a9 100644 --- a/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/get.ts +++ b/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/get.ts @@ -5,11 +5,10 @@ * 2.0. */ +import { z } from '@kbn/zod'; import { RequestHandlerContext } from '@kbn/core/server'; -import { buildRouteValidationWithZod } from '@kbn/zod-helpers'; import { getEntityDefinitionQuerySchema } from '@kbn/entities-schema'; import { SetupRouteOptions } from '../types'; -import { findEntityDefinitions } from '../../lib/entities/find_entity_definition'; /** * @openapi @@ -52,26 +51,28 @@ import { findEntityDefinitions } from '../../lib/entities/find_entity_definition */ export function getEntityDefinitionRoute({ router, + getScopedClient, + logger, }: SetupRouteOptions) { - router.get( + router.get<{ id?: string }, { page?: number; perPage?: number }, unknown>( { - path: '/internal/entities/definition', + path: '/internal/entities/definition/{id?}', validate: { - query: buildRouteValidationWithZod(getEntityDefinitionQuerySchema.strict()), + query: getEntityDefinitionQuerySchema.strict(), + params: z.object({ id: z.optional(z.string()) }), }, }, - async (context, req, res) => { + async (context, request, res) => { try { - const esClient = (await context.core).elasticsearch.client.asCurrentUser; - const soClient = (await context.core).savedObjects.client; - const definitions = await findEntityDefinitions({ - esClient, - soClient, - page: req.query.page ?? 1, - perPage: req.query.perPage ?? 10, + const client = await getScopedClient({ request }); + const result = await client.getEntityDefinitions({ + page: request.query.page, + perPage: request.query.perPage, }); - return res.ok({ body: { definitions } }); + + return res.ok({ body: result }); } catch (e) { + logger.error(e); return res.customError({ body: e, statusCode: 500 }); } } diff --git a/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/reset.ts b/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/reset.ts index 7755fcf65b3c3..b1fd385d22102 100644 --- a/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/reset.ts +++ b/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/reset.ts @@ -6,7 +6,6 @@ */ import { RequestHandlerContext } from '@kbn/core/server'; -import { buildRouteValidationWithZod } from '@kbn/zod-helpers'; import { resetEntityDefinitionParamsSchema } from '@kbn/entities-schema'; import { SetupRouteOptions } from '../types'; import { EntitySecurityException } from '../../lib/entities/errors/entity_security_exception'; @@ -43,7 +42,7 @@ export function resetEntityDefinitionRoute({ { path: '/internal/entities/definition/{id}/_reset', validate: { - params: buildRouteValidationWithZod(resetEntityDefinitionParamsSchema.strict()), + params: resetEntityDefinitionParamsSchema.strict(), }, }, async (context, req, res) => { @@ -75,6 +74,8 @@ export function resetEntityDefinitionRoute({ return res.ok({ body: { acknowledged: true } }); } catch (e) { + logger.error(e); + if (e instanceof EntityDefinitionNotFound) { return res.notFound({ body: e }); } diff --git a/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/update.ts b/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/update.ts new file mode 100644 index 0000000000000..0668287d6d765 --- /dev/null +++ b/x-pack/plugins/observability_solution/entity_manager/server/routes/entities/update.ts @@ -0,0 +1,131 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { z } from '@kbn/zod'; +import { RequestHandlerContext } from '@kbn/core/server'; +import { + createEntityDefinitionQuerySchema, + CreateEntityDefinitionQuery, + entityDefinitionUpdateSchema, + EntityDefinitionUpdate, +} from '@kbn/entities-schema'; +import { SetupRouteOptions } from '../types'; +import { EntitySecurityException } from '../../lib/entities/errors/entity_security_exception'; +import { InvalidTransformError } from '../../lib/entities/errors/invalid_transform_error'; +import { startTransform } from '../../lib/entities/start_transform'; +import { + installationInProgress, + reinstallEntityDefinition, +} from '../../lib/entities/install_entity_definition'; +import { findEntityDefinitionById } from '../../lib/entities/find_entity_definition'; + +/** + * @openapi + * /internal/entities/definition: + * put: + * description: Update an entity definition. + * tags: + * - definitions + * parameters: + * - in: query + * name: installOnly + * description: If true, the definition transforms will not be started + * required: false + * schema: + * type: boolean + * default: false + * requestBody: + * description: The definition properties to update + * required: true + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/entityDefinitionUpdateSchema' + * responses: + * 200: + * description: Success + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/entityDefinitionSchema' + * 400: + * description: The entity definition cannot be installed; see the error for more details + * 404: + * description: The entity definition does not exist + * 403: + * description: User is not allowed to update the entity definition + * 409: + * description: The entity definition is being updated by another request + */ +export function updateEntityDefinitionRoute({ + router, + server, +}: SetupRouteOptions) { + router.patch<{ id: string }, CreateEntityDefinitionQuery, EntityDefinitionUpdate>( + { + path: '/internal/entities/definition/{id}', + validate: { + body: entityDefinitionUpdateSchema.strict(), + query: createEntityDefinitionQuerySchema, + params: z.object({ id: z.string() }), + }, + }, + async (context, req, res) => { + const { logger } = server; + const core = await context.core; + const soClient = core.savedObjects.client; + const esClient = core.elasticsearch.client.asCurrentUser; + + try { + const installedDefinition = await findEntityDefinitionById({ + soClient, + esClient, + id: req.params.id, + }); + + if (!installedDefinition) { + return res.notFound({ + body: { message: `Entity definition [${req.params.id}] not found` }, + }); + } + + if (installedDefinition.managed) { + return res.forbidden({ + body: { message: `Managed definition cannot be modified` }, + }); + } + + if (installationInProgress(installedDefinition)) { + return res.conflict({ + body: { message: `Entity definition [${req.params.id}] has changes in progress` }, + }); + } + + const updatedDefinition = await reinstallEntityDefinition({ + soClient, + esClient, + logger, + definition: installedDefinition, + definitionUpdate: req.body, + }); + + if (!req.query.installOnly) { + await startTransform(esClient, updatedDefinition, logger); + } + + return res.ok({ body: updatedDefinition }); + } catch (e) { + logger.error(e); + + if (e instanceof EntitySecurityException || e instanceof InvalidTransformError) { + return res.customError({ body: e, statusCode: 400 }); + } + return res.customError({ body: e, statusCode: 500 }); + } + } + ); +} diff --git a/x-pack/plugins/observability_solution/entity_manager/server/routes/index.ts b/x-pack/plugins/observability_solution/entity_manager/server/routes/index.ts index 939bc755ae994..2fb9734187119 100644 --- a/x-pack/plugins/observability_solution/entity_manager/server/routes/index.ts +++ b/x-pack/plugins/observability_solution/entity_manager/server/routes/index.ts @@ -11,6 +11,7 @@ import { createEntityDefinitionRoute } from './entities/create'; import { deleteEntityDefinitionRoute } from './entities/delete'; import { resetEntityDefinitionRoute } from './entities/reset'; import { getEntityDefinitionRoute } from './entities/get'; +import { updateEntityDefinitionRoute } from './entities/update'; import { checkEntityDiscoveryEnabledRoute } from './enablement/check'; import { enableEntityDiscoveryRoute } from './enablement/enable'; import { disableEntityDiscoveryRoute } from './enablement/disable'; @@ -23,4 +24,5 @@ export function setupRoutes(dependencies: Setup checkEntityDiscoveryEnabledRoute(dependencies); enableEntityDiscoveryRoute(dependencies); disableEntityDiscoveryRoute(dependencies); + updateEntityDefinitionRoute(dependencies); } diff --git a/x-pack/plugins/observability_solution/entity_manager/server/routes/types.ts b/x-pack/plugins/observability_solution/entity_manager/server/routes/types.ts index 8e3dc7111298d..d4d8cfba815ae 100644 --- a/x-pack/plugins/observability_solution/entity_manager/server/routes/types.ts +++ b/x-pack/plugins/observability_solution/entity_manager/server/routes/types.ts @@ -5,12 +5,14 @@ * 2.0. */ -import { IRouter, RequestHandlerContextBase } from '@kbn/core-http-server'; +import { IRouter, KibanaRequest, RequestHandlerContextBase } from '@kbn/core-http-server'; import { Logger } from '@kbn/core/server'; import { EntityManagerServerSetup } from '../types'; +import { EntityClient } from '../lib/entity_client'; export interface SetupRouteOptions { router: IRouter; server: EntityManagerServerSetup; logger: Logger; + getScopedClient: ({ request }: { request: KibanaRequest }) => Promise; } diff --git a/x-pack/plugins/observability_solution/entity_manager/tsconfig.json b/x-pack/plugins/observability_solution/entity_manager/tsconfig.json index 66dbddf1a261e..cba8dbcd50fee 100644 --- a/x-pack/plugins/observability_solution/entity_manager/tsconfig.json +++ b/x-pack/plugins/observability_solution/entity_manager/tsconfig.json @@ -24,10 +24,10 @@ "@kbn/core-saved-objects-api-server-mocks", "@kbn/entities-schema", "@kbn/es-query", - "@kbn/zod-helpers", "@kbn/security-plugin", "@kbn/encrypted-saved-objects-plugin", "@kbn/logging-mocks", "@kbn/licensing-plugin", + "@kbn/zod", ] } diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/index.tsx b/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/index.tsx index 392420ee547f8..c4061f05ce91b 100644 --- a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/index.tsx +++ b/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/index.tsx @@ -60,7 +60,7 @@ export function ExploratoryViewPage({ }), }, ], - app + { app } ); const kbnUrlStateStorage = useSessionStorage diff --git a/x-pack/plugins/observability_solution/infra/public/components/asset_details/tabs/metadata/add_metadata_filter_button.tsx b/x-pack/plugins/observability_solution/infra/public/components/asset_details/tabs/metadata/add_metadata_filter_button.tsx index f1e0b9073c036..49dfd3d42d5c4 100644 --- a/x-pack/plugins/observability_solution/infra/public/components/asset_details/tabs/metadata/add_metadata_filter_button.tsx +++ b/x-pack/plugins/observability_solution/infra/public/components/asset_details/tabs/metadata/add_metadata_filter_button.tsx @@ -90,7 +90,7 @@ export const AddMetadataFilterButton = ({ item }: AddMetadataFilterButtonProps) } return ( - + { return ( - - + + {title} {helpMessage} @@ -62,8 +62,6 @@ export const ControlTitle = ({ title, embeddableId }: { title?: string; embeddab return helpMessage ? ( ) : ( - - {title} - + {title} ); }; diff --git a/x-pack/plugins/observability_solution/infra/public/pages/metrics/hosts/index.tsx b/x-pack/plugins/observability_solution/infra/public/pages/metrics/hosts/index.tsx index c5853f533a222..b3ae46cf520fb 100644 --- a/x-pack/plugins/observability_solution/infra/public/pages/metrics/hosts/index.tsx +++ b/x-pack/plugins/observability_solution/infra/public/pages/metrics/hosts/index.tsx @@ -10,7 +10,6 @@ import React from 'react'; import { useTrackPageview, FeatureFeedbackButton } from '@kbn/observability-shared-plugin/public'; import { APP_WRAPPER_CLASS } from '@kbn/core/public'; import { css } from '@emotion/react'; -import { i18n } from '@kbn/i18n'; import { OnboardingFlow } from '../../../components/shared/templates/no_data_config'; import { InfraPageTemplate } from '../../../components/shared/templates/infra_page_template'; import { SYSTEM_INTEGRATION } from '../../../../common/constants'; @@ -19,7 +18,6 @@ import { useMetricsBreadcrumbs } from '../../../hooks/use_metrics_breadcrumbs'; import { hostsTitle } from '../../../translations'; import { fullHeightContentStyles } from '../../../page_template.styles'; import { HostContainer } from './components/hosts_container'; -import { BetaBadge } from '../../../components/beta_badge'; const HOSTS_FEEDBACK_LINK = 'https://docs.google.com/forms/d/e/1FAIpQLScRHG8TIVb1Oq8ZhD4aks3P1TmgiM58TY123QpDCcBz83YC6w/viewform'; @@ -55,12 +53,6 @@ export const HostsPage = () => { `} >

{hostsTitle}

-
), rightSideItems: [ diff --git a/x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/components/layout.tsx b/x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/components/layout.tsx index bdc518ffeb13e..df5dd3dbe5973 100644 --- a/x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/components/layout.tsx +++ b/x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/components/layout.tsx @@ -5,13 +5,11 @@ * 2.0. */ -import React, { useCallback, useEffect, useRef, useState } from 'react'; +import React, { useCallback, useEffect, useState } from 'react'; import useInterval from 'react-use/lib/useInterval'; import { css } from '@emotion/react'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { i18n } from '@kbn/i18n'; -import useLocalStorage from 'react-use/lib/useLocalStorage'; import { InventoryView } from '../../../../../common/inventory_views'; import { SnapshotNode } from '../../../../../common/http_api'; import { AutoSizer } from '../../../../components/auto_sizer'; @@ -33,7 +31,6 @@ import { createLegend } from '../lib/create_legend'; import { useWaffleViewState } from '../hooks/use_waffle_view_state'; import { BottomDrawer } from './bottom_drawer'; import { LegendControls } from './waffle/legend_controls'; -import { TryItButton } from '../../../../components/try_it_button'; interface Props { currentView?: InventoryView | null; @@ -49,8 +46,6 @@ interface LegendControlOptions { legend: WaffleLegendOptions; } -const HOSTS_LINK_LOCAL_STORAGE_KEY = 'inventoryUI:hostsLinkClicked'; - export const Layout = React.memo(({ currentView, reload, interval, nodes, loading }: Props) => { const [showLoading, setShowLoading] = useState(true); const { @@ -73,11 +68,6 @@ export const Layout = React.memo(({ currentView, reload, interval, nodes, loadin const legendSteps = legend?.steps ?? DEFAULT_LEGEND.steps; const legendReverseColors = legend?.reverseColors ?? DEFAULT_LEGEND.reverseColors; - const [hostsLinkClicked, setHostsLinkClicked] = useLocalStorage( - HOSTS_LINK_LOCAL_STORAGE_KEY, - false - ); - const hostsLinkClickedRef = useRef(hostsLinkClicked); const AUTO_REFRESH_INTERVAL = 5 * 1000; const options = { @@ -171,24 +161,6 @@ export const Layout = React.memo(({ currentView, reload, interval, nodes, loadin - - {!hostsLinkClickedRef.current && nodeType === 'host' && ( - { - setHostsLinkClicked(true); - }} - /> - )} - ; + +export function useUpdateInvestigationNote() { + const { + core: { + http, + notifications: { toasts }, + }, + } = useKibana(); + + return useMutation< + void, + ServerError, + { investigationId: string; noteId: string; note: UpdateInvestigationNoteParams }, + { investigationId: string } + >( + ['deleteInvestigationNote'], + ({ investigationId, noteId, note }) => { + const body = JSON.stringify(note); + return http.put( + `/api/observability/investigations/${investigationId}/notes/${noteId}`, + { body, version: '2023-10-31' } + ); + }, + { + onSuccess: (response, {}) => { + toasts.addSuccess('Note updated'); + }, + onError: (error, {}, context) => { + toasts.addError(new Error(error.body?.message ?? 'An error occurred'), { title: 'Error' }); + }, + } + ); +} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx b/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx index e07c940c8ca5f..7e331a6604721 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx @@ -166,7 +166,7 @@ export function registerEmbeddableItem({ services, }: Options) { investigate.registerItemDefinition({ - type: 'esql', + type: 'embeddable', generate: async (option: { itemParams: EmbeddableItemParams; globalParams: GlobalWidgetParameters; diff --git a/x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/register_esql_item.tsx b/x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/register_esql_item.tsx index 1b62b5476f021..695daf1f48cb2 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/register_esql_item.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/register_esql_item.tsx @@ -59,6 +59,8 @@ interface EsqlItemData { }; } +export const ESQL_ITEM_TYPE = 'esql'; + export function EsqlWidget({ suggestion, dataView, @@ -228,7 +230,7 @@ export function registerEsqlItem({ services, }: Options) { investigate.registerItemDefinition({ - type: 'esql', + type: ESQL_ITEM_TYPE, generate: async (option: { itemParams: EsqlItemParams; globalParams: GlobalWidgetParameters; diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/esql_widget_preview.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/esql_widget_preview.tsx index c865dfcf91826..7ceedaed3b312 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/esql_widget_preview.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/esql_widget_preview.tsx @@ -17,7 +17,7 @@ import { ErrorMessage } from '../../../../components/error_message'; import { SuggestVisualizationList } from '../../../../components/suggest_visualization_list'; import { useKibana } from '../../../../hooks/use_kibana'; import { getDateHistogramResults } from '../../../../items/esql_item/get_date_histogram_results'; -import { EsqlWidget } from '../../../../items/esql_item/register_esql_item'; +import { ESQL_ITEM_TYPE, EsqlWidget } from '../../../../items/esql_item/register_esql_item'; import { getEsFilterFromOverrides } from '../../../../utils/get_es_filter_from_overrides'; function getItemFromSuggestion({ @@ -29,7 +29,7 @@ function getItemFromSuggestion({ }): Item { return { title: suggestion.title, - type: 'esql', + type: ESQL_ITEM_TYPE, params: { esql: query, suggestion, diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/investigation_details.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/investigation_details.tsx index 5f6e1ca4515d3..ebeb1a4dc1b42 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/investigation_details.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/investigation_details.tsx @@ -27,11 +27,11 @@ export function InvestigationDetails({ user, investigationId }: Props) { return ( - + - + ); diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_items/investigation_items.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_items/investigation_items.tsx index dcc83eb968344..7be8799077118 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_items/investigation_items.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_items/investigation_items.tsx @@ -18,13 +18,12 @@ import { InvestigationItemsList } from '../investigation_items_list/investigatio import { InvestigationSearchBar } from '../investigation_search_bar/investigation_search_bar'; export interface Props { - investigationId: string; investigation: GetInvestigationResponse; } -export function InvestigationItems({ investigationId, investigation }: Props) { +export function InvestigationItems({ investigation }: Props) { const { data: items, refetch } = useFetchInvestigationItems({ - investigationId, + investigationId: investigation.id, initialItems: investigation.items, }); const renderableItems = useRenderItems({ items, params: investigation.params }); @@ -34,12 +33,12 @@ export function InvestigationItems({ investigationId, investigation }: Props) { useDeleteInvestigationItem(); const onAddItem = async (item: Item) => { - await addInvestigationItem({ investigationId, item }); + await addInvestigationItem({ investigationId: investigation.id, item }); refetch(); }; const onDeleteItem = async (itemId: string) => { - await deleteInvestigationItem({ investigationId, itemId }); + await deleteInvestigationItem({ investigationId: investigation.id, itemId }); refetch(); }; diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/edit_note_form.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/edit_note_form.tsx new file mode 100644 index 0000000000000..9a0e7e585bb63 --- /dev/null +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/edit_note_form.tsx @@ -0,0 +1,88 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { InvestigationNoteResponse } from '@kbn/investigation-shared'; +import React, { useState } from 'react'; +import { ResizableTextInput } from './resizable_text_input'; +import { useUpdateInvestigationNote } from '../../../../hooks/use_update_investigation_note'; + +interface Props { + investigationId: string; + note: InvestigationNoteResponse; + onCancel: () => void; + onUpdate: () => void; +} + +export function EditNoteForm({ investigationId, note, onCancel, onUpdate }: Props) { + const [noteInput, setNoteInput] = useState(note.content); + const { mutateAsync: updateNote, isLoading: isUpdating } = useUpdateInvestigationNote(); + + const handleUpdateNote = async () => { + await updateNote({ investigationId, noteId: note.id, note: { content: noteInput.trim() } }); + onUpdate(); + }; + + return ( + + + { + setNoteInput(value); + }} + onSubmit={() => { + handleUpdateNote(); + }} + placeholder={note.content} + /> + + + + + onCancel()} + > + {i18n.translate('xpack.investigateApp.investigationNotes.cancelEditButtonLabel', { + defaultMessage: 'Cancel', + })} + + + + { + handleUpdateNote(); + }} + > + {i18n.translate('xpack.investigateApp.investigationNotes.updateNoteButtonLabel', { + defaultMessage: 'Update note', + })} + + + + + ); +} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/investigation_notes.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/investigation_notes.tsx index 8406ba8fe3f03..9096b2ec7434e 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/investigation_notes.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/investigation_notes.tsx @@ -6,7 +6,6 @@ */ import { - EuiAvatar, EuiButton, EuiFlexGroup, EuiFlexItem, @@ -16,43 +15,36 @@ import { } from '@elastic/eui'; import { css } from '@emotion/css'; import { i18n } from '@kbn/i18n'; -import { InvestigationNoteResponse, GetInvestigationResponse } from '@kbn/investigation-shared'; +import { GetInvestigationResponse, InvestigationNoteResponse } from '@kbn/investigation-shared'; +import { AuthenticatedUser } from '@kbn/security-plugin/common'; import React, { useState } from 'react'; import { useAddInvestigationNote } from '../../../../hooks/use_add_investigation_note'; -import { useDeleteInvestigationNote } from '../../../../hooks/use_delete_investigation_note'; import { useFetchInvestigationNotes } from '../../../../hooks/use_fetch_investigation_notes'; import { useTheme } from '../../../../hooks/use_theme'; +import { Note } from './note'; import { ResizableTextInput } from './resizable_text_input'; -import { TimelineMessage } from './timeline_message'; export interface Props { - investigationId: string; investigation: GetInvestigationResponse; + user: AuthenticatedUser; } -export function InvestigationNotes({ investigationId, investigation }: Props) { +export function InvestigationNotes({ investigation, user }: Props) { const theme = useTheme(); const [noteInput, setNoteInput] = useState(''); const { data: notes, refetch } = useFetchInvestigationNotes({ - investigationId, + investigationId: investigation.id, initialNotes: investigation.notes, }); const { mutateAsync: addInvestigationNote, isLoading: isAdding } = useAddInvestigationNote(); - const { mutateAsync: deleteInvestigationNote, isLoading: isDeleting } = - useDeleteInvestigationNote(); const onAddNote = async (content: string) => { - await addInvestigationNote({ investigationId, note: { content } }); + await addInvestigationNote({ investigationId: investigation.id, note: { content } }); refetch(); setNoteInput(''); }; - const onDeleteNote = async (noteId: string) => { - await deleteInvestigationNote({ investigationId, noteId }); - refetch(); - }; - const panelClassName = css` background-color: ${theme.colors.lightShade}; `; @@ -72,12 +64,12 @@ export function InvestigationNotes({ investigationId, investigation }: Props) { {notes?.map((currNote: InvestigationNoteResponse) => { return ( - } + investigationId={investigation.id} note={currNote} - onDelete={() => onDeleteNote(currNote.id)} - isDeleting={isDeleting} + disabled={currNote.createdBy !== user.username} + onUpdateOrDeleteCompleted={() => refetch()} /> ); })} @@ -110,7 +102,7 @@ export function InvestigationNotes({ investigationId, investigation }: Props) { void; +} + +export function Note({ note, investigationId, disabled, onUpdateOrDeleteCompleted }: Props) { + const [isEditing, setIsEditing] = useState(false); + const { mutateAsync: deleteInvestigationNote, isLoading: isDeleting } = + useDeleteInvestigationNote(); + + const theme = useTheme(); + const timelineContainerClassName = css` + padding-bottom: 16px; + border-bottom: 1px solid ${theme.colors.lightShade}; + :last-child { + border-bottom: 0px; + } + `; + + const deleteNote = async () => { + await deleteInvestigationNote({ investigationId, noteId: note.id }); + onUpdateOrDeleteCompleted(); + }; + + const handleUpdateCompleted = async () => { + setIsEditing(false); + onUpdateOrDeleteCompleted(); + }; + + return ( + + + + + + + + + {formatDistance(new Date(note.createdAt), new Date(), { addSuffix: true })} + + + + + + + { + setIsEditing(!isEditing); + }} + /> + + + deleteNote()} + data-test-subj="deleteInvestigationNoteButton" + /> + + + + + {isEditing ? ( + setIsEditing(false)} + onUpdate={() => handleUpdateCompleted()} + /> + ) : ( + + {note.content} + + )} + + + ); +} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/timeline_message.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/timeline_message.tsx deleted file mode 100644 index d93492d8c5d33..0000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/timeline_message.tsx +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { EuiFlexGroup, EuiFlexItem, EuiMarkdownFormat, EuiText } from '@elastic/eui'; -import { css } from '@emotion/css'; -import { InvestigationNoteResponse } from '@kbn/investigation-shared'; -// eslint-disable-next-line import/no-extraneous-dependencies -import { formatDistance } from 'date-fns'; -import React from 'react'; -import { InvestigateTextButton } from '../../../../components/investigate_text_button'; -import { useTheme } from '../../../../hooks/use_theme'; - -const textContainerClassName = css` - padding-top: 2px; -`; - -export function TimelineMessage({ - icon, - note, - onDelete, - isDeleting, -}: { - icon: React.ReactNode; - note: InvestigationNoteResponse; - onDelete: () => void; - isDeleting: boolean; -}) { - const theme = useTheme(); - const timelineContainerClassName = css` - padding-bottom: 16px; - border-bottom: 1px solid ${theme.colors.lightShade}; - :last-child { - border-bottom: 0px; - } - `; - return ( - - - - {icon} - - - {formatDistance(new Date(note.createdAt), new Date(), { addSuffix: true })} - - - - - - - - - - - {note.content} - - - - ); -} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/plugin.tsx b/x-pack/plugins/observability_solution/investigate_app/public/plugin.tsx index abbe762562541..de3aa5f5ed003 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/plugin.tsx @@ -125,7 +125,6 @@ export class InvestigateAppPlugin .getStartServices() .then(([, pluginsStart]) => pluginsStart); - // new Promise.all([ pluginsStartPromise, import('./items/register_items').then((m) => m.registerItems), diff --git a/x-pack/plugins/observability_solution/investigate_app/server/routes/get_global_investigate_app_server_route_repository.ts b/x-pack/plugins/observability_solution/investigate_app/server/routes/get_global_investigate_app_server_route_repository.ts index 0829a11762160..07e83e1fad368 100644 --- a/x-pack/plugins/observability_solution/investigate_app/server/routes/get_global_investigate_app_server_route_repository.ts +++ b/x-pack/plugins/observability_solution/investigate_app/server/routes/get_global_investigate_app_server_route_repository.ts @@ -16,6 +16,7 @@ import { getInvestigationItemsParamsSchema, getInvestigationNotesParamsSchema, getInvestigationParamsSchema, + updateInvestigationNoteParamsSchema, } from '@kbn/investigation-shared'; import { createInvestigation } from '../services/create_investigation'; import { createInvestigationItem } from '../services/create_investigation_item'; @@ -29,6 +30,7 @@ import { getInvestigationNotes } from '../services/get_investigation_notes'; import { investigationRepositoryFactory } from '../services/investigation_repository'; import { createInvestigateAppServerRoute } from './create_investigate_app_server_route'; import { getInvestigationItems } from '../services/get_investigation_items'; +import { updateInvestigationNote } from '../services/update_investigation_note'; const createInvestigationRoute = createInvestigateAppServerRoute({ endpoint: 'POST /api/observability/investigations 2023-10-31', @@ -125,7 +127,33 @@ const getInvestigationNotesRoute = createInvestigateAppServerRoute({ }, }); -const deleteInvestigationNotesRoute = createInvestigateAppServerRoute({ +const updateInvestigationNoteRoute = createInvestigateAppServerRoute({ + endpoint: 'PUT /api/observability/investigations/{investigationId}/notes/{noteId} 2023-10-31', + options: { + tags: [], + }, + params: updateInvestigationNoteParamsSchema, + handler: async ({ params, context, request, logger }) => { + const user = (await context.core).coreStart.security.authc.getCurrentUser(request); + if (!user) { + throw new Error('User is not authenticated'); + } + const soClient = (await context.core).savedObjects.client; + const repository = investigationRepositoryFactory({ soClient, logger }); + + return await updateInvestigationNote( + params.path.investigationId, + params.path.noteId, + params.body, + { + repository, + user, + } + ); + }, +}); + +const deleteInvestigationNoteRoute = createInvestigateAppServerRoute({ endpoint: 'DELETE /api/observability/investigations/{investigationId}/notes/{noteId} 2023-10-31', options: { tags: [], @@ -207,10 +235,11 @@ export function getGlobalInvestigateAppServerRouteRepository() { ...createInvestigationRoute, ...findInvestigationsRoute, ...getInvestigationRoute, - ...deleteInvestigationRoute, ...createInvestigationNoteRoute, ...getInvestigationNotesRoute, - ...deleteInvestigationNotesRoute, + ...updateInvestigationNoteRoute, + ...deleteInvestigationNoteRoute, + ...deleteInvestigationRoute, ...createInvestigationItemRoute, ...deleteInvestigationItemRoute, ...getInvestigationItemsRoute, diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/update_investigation_note.ts b/x-pack/plugins/observability_solution/investigate_app/server/services/update_investigation_note.ts new file mode 100644 index 0000000000000..4c359c06d5e32 --- /dev/null +++ b/x-pack/plugins/observability_solution/investigate_app/server/services/update_investigation_note.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 type { AuthenticatedUser } from '@kbn/core-security-common'; +import { UpdateInvestigationNoteParams } from '@kbn/investigation-shared'; +import { InvestigationRepository } from './investigation_repository'; + +export async function updateInvestigationNote( + investigationId: string, + noteId: string, + params: UpdateInvestigationNoteParams, + { repository, user }: { repository: InvestigationRepository; user: AuthenticatedUser } +): Promise { + const investigation = await repository.findById(investigationId); + const note = investigation.notes.find((currNote) => currNote.id === noteId); + if (!note) { + throw new Error('Note not found'); + } + + if (note.createdBy !== user.username) { + throw new Error('User does not have permission to delete note'); + } + + investigation.notes = investigation.notes.filter((currNote) => { + if (currNote.id === noteId) { + currNote.content = params.content; + } + + return currNote; + }); + + await repository.save(investigation); +} diff --git a/x-pack/plugins/observability_solution/observability/public/pages/annotations/annotations.tsx b/x-pack/plugins/observability_solution/observability/public/pages/annotations/annotations.tsx index d0c6723f4f438..f601b4ff99a3f 100644 --- a/x-pack/plugins/observability_solution/observability/public/pages/annotations/annotations.tsx +++ b/x-pack/plugins/observability_solution/observability/public/pages/annotations/annotations.tsx @@ -22,20 +22,24 @@ export const ANNOTATIONS_PAGE_ID = 'annotations-container'; export function AnnotationsPage() { const { http: { basePath }, + serverless, } = useKibana().services; const { ObservabilityPageTemplate } = usePluginContext(); const checkPrivileges = useAnnotationsPrivileges(); - useBreadcrumbs([ - { - href: basePath.prepend(paths.observability.annotations), - text: i18n.translate('xpack.observability.breadcrumbs.annotationsLinkText', { - defaultMessage: 'Annotations', - }), - deepLinkId: 'observability-overview', - }, - ]); + useBreadcrumbs( + [ + { + href: basePath.prepend(paths.observability.annotations), + text: i18n.translate('xpack.observability.breadcrumbs.annotationsLinkText', { + defaultMessage: 'Annotations', + }), + deepLinkId: 'observability-overview', + }, + ], + { serverless } + ); return ( {}, + warn: () => {}, + error: () => {}, + }, +}); const triggersActionsUiStartMock = { createStart() { @@ -29,7 +43,11 @@ const triggersActionsUiStartMock = {
mocked component
)), getAlertsTableDefaultAlertActions: (props: AlertActionsProps) => { - return getAlertsTableDefaultAlertActionsLazy(props); + return ( + + {getAlertsTableDefaultAlertActionsLazy(props)} + + ); }, getAddRuleFlyout: jest.fn(() =>
mocked component
), getEditRuleFlyout: jest.fn(() => ( diff --git a/x-pack/plugins/observability_solution/observability/server/ui_settings.ts b/x-pack/plugins/observability_solution/observability/server/ui_settings.ts index 409a4756439db..d404606b4ce79 100644 --- a/x-pack/plugins/observability_solution/observability/server/ui_settings.ts +++ b/x-pack/plugins/observability_solution/observability/server/ui_settings.ts @@ -238,10 +238,7 @@ export const uiSettings: Record = { }), value: true, description: i18n.translate('xpack.observability.enableInfrastructureHostsViewDescription', { - defaultMessage: '{betaLabel} Enable the Hosts view in the Infrastructure app.', - values: { - betaLabel: `[${betaLabel}]`, - }, + defaultMessage: 'Enable the Hosts view in the Infrastructure app.', }), schema: schema.boolean(), }, diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/index.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/common/index.ts index 81b8a6ac56292..78c3d55e706e3 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/common/index.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/common/index.ts @@ -38,7 +38,6 @@ export { } from './conversation_complete'; export { - aiAssistantResponseLanguage, aiAssistantLogsIndexPattern, aiAssistantSimulatedFunctionCalling, aiAssistantSearchConnectorIndexPattern, @@ -46,8 +45,6 @@ export { export { concatenateChatCompletionChunks } from './utils/concatenate_chat_completion_chunks'; -export { DEFAULT_LANGUAGE_OPTION, LANGUAGE_OPTIONS } from './ui_settings/language_options'; - export { isSupportedConnectorType } from './connectors'; export { ShortIdTable } from './utils/short_id_table'; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts index 68595e457a355..eb34e2bb2ee5e 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts @@ -115,6 +115,7 @@ export enum KnowledgeBaseType { } export interface ObservabilityAIAssistantScreenContextRequest { + starterPrompts?: StarterPrompt[]; screenDescription?: string; data?: Array<{ name: string; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/language_options.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/language_options.ts deleted file mode 100644 index b4f89d512cd95..0000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/language_options.ts +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -/* eslint-disable @typescript-eslint/naming-convention */ -// Data taken from https://github.com/L-P/native-language-list/blob/master/data/langs.json -export const languages: { [key: string]: string } = { - af: 'Afrikaans', - ak: 'Akan', - am: '\u12a0\u121b\u122d\u129b', - ar: '\u0627\u0644\u0639\u0631\u0628\u064a\u0629', - as: '\u0985\u09b8\u09ae\u09c0\u09af\u09bc\u09be', - az: 'az\u0259rbaycan', - be: '\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f', - bg: '\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438', - bm: 'bamanakan', - bn: '\u09ac\u09be\u0982\u09b2\u09be', - bo: '\u0f56\u0f7c\u0f51\u0f0b\u0f66\u0f90\u0f51\u0f0b', - br: 'brezhoneg', - bs: 'bosanski', - ca: 'catal\u00e0', - cs: '\u010de\u0161tina', - cy: 'Cymraeg', - da: 'dansk', - de: 'Deutsch', - de_AT: '\u00d6sterreichisches Deutsch', - de_CH: 'Schweizer Hochdeutsch', - dz: '\u0f62\u0fab\u0f7c\u0f44\u0f0b\u0f41', - ee: 'e\u028begbe', - el: '\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac', - en: 'English', - en_AU: 'Australian English', - en_CA: 'Canadian English', - en_GB: 'British English', - en_US: 'American English', - eo: 'esperanto', - es: 'espa\u00f1ol', - es_ES: 'espa\u00f1ol de Espa\u00f1a', - es_MX: 'espa\u00f1ol de M\u00e9xico', - et: 'eesti', - eu: 'euskara', - fa: '\u0641\u0627\u0631\u0633\u06cc', - ff: 'Pulaar', - fi: 'suomi', - fo: 'f\u00f8royskt', - fr: 'fran\u00e7ais', - fr_CA: 'fran\u00e7ais canadien', - fr_CH: 'fran\u00e7ais suisse', - fy: 'West-Frysk', - ga: 'Gaeilge', - gd: 'G\u00e0idhlig', - gl: 'galego', - gu: '\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0', - gv: 'Gaelg', - ha: 'Hausa', - he: '\u05e2\u05d1\u05e8\u05d9\u05ea', - hi: '\u0939\u093f\u0902\u0926\u0940', - hr: 'hrvatski', - hu: 'magyar', - hy: '\u0570\u0561\u0575\u0565\u0580\u0565\u0576', - id: 'Bahasa Indonesia', - ig: 'Igbo', - ii: '\ua188\ua320\ua259', - is: '\u00edslenska', - it: 'italiano', - ja: '\u65e5\u672c\u8a9e', - ka: '\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8', - ki: 'Gikuyu', - kk: '\u049b\u0430\u0437\u0430\u049b \u0442\u0456\u043b\u0456', - kl: 'kalaallisut', - km: '\u1781\u17d2\u1798\u17c2\u179a', - kn: '\u0c95\u0ca8\u0ccd\u0ca8\u0ca1', - ko: '\ud55c\uad6d\uc5b4', - ks: '\u06a9\u0672\u0634\u064f\u0631', - kw: 'kernewek', - ky: '\u043a\u044b\u0440\u0433\u044b\u0437\u0447\u0430', - lb: 'L\u00ebtzebuergesch', - lg: 'Luganda', - ln: 'ling\u00e1la', - lo: '\u0ea5\u0eb2\u0ea7', - lt: 'lietuvi\u0173', - lu: 'Tshiluba', - lv: 'latvie\u0161u', - mg: 'Malagasy', - mk: '\u043c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438', - ml: '\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02', - mn: '\u043c\u043e\u043d\u0433\u043e\u043b', - mr: '\u092e\u0930\u093e\u0920\u0940', - ms: 'Bahasa Melayu', - mt: 'Malti', - my: '\u1017\u1019\u102c', - nb: 'norsk bokm\u00e5l', - nd: 'isiNdebele', - ne: '\u0928\u0947\u092a\u093e\u0932\u0940', - nl: 'Nederlands', - nl_BE: 'Vlaams', - nn: 'nynorsk', - no: 'norsk', - om: 'Oromoo', - or: '\u0b13\u0b21\u0b3c\u0b3f\u0b06', - os: '\u0438\u0440\u043e\u043d', - pa: '\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40', - pl: 'polski', - ps: '\u067e\u069a\u062a\u0648', - pt: 'portugu\u00eas', - pt_BR: 'portugu\u00eas do Brasil', - pt_PT: 'portugu\u00eas europeu', - qu: 'Runasimi', - rm: 'rumantsch', - rn: 'Ikirundi', - ro: 'rom\u00e2n\u0103', - ro_MD: 'moldoveneasc\u0103', - ru: '\u0440\u0443\u0441\u0441\u043a\u0438\u0439', - rw: 'Kinyarwanda', - se: 'davvis\u00e1megiella', - sg: 'S\u00e4ng\u00f6', - sh: 'Srpskohrvatski', - si: '\u0dc3\u0dd2\u0d82\u0dc4\u0dbd', - sk: 'sloven\u010dina', - sl: 'sloven\u0161\u010dina', - sn: 'chiShona', - so: 'Soomaali', - sq: 'shqip', - sr: '\u0441\u0440\u043f\u0441\u043a\u0438', - sv: 'svenska', - sw: 'Kiswahili', - ta: '\u0ba4\u0bae\u0bbf\u0bb4\u0bcd', - te: '\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41', - th: '\u0e44\u0e17\u0e22', - ti: '\u1275\u130d\u122d\u129b', - tl: 'Tagalog', - to: 'lea fakatonga', - tr: 'T\u00fcrk\u00e7e', - ug: '\u0626\u06c7\u064a\u063a\u06c7\u0631\u0686\u06d5', - uk: '\u0443\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430', - ur: '\u0627\u0631\u062f\u0648', - uz: 'o\u02bbzbekcha', - vi: 'Ti\u1ebfng Vi\u1ec7t', - yi: '\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9', - yo: '\u00c8d\u00e8 Yor\u00f9b\u00e1', - zh: '\u4e2d\u6587', - zh_Hans: '\u7b80\u4f53\u4e2d\u6587', - zh_Hant: '\u7e41\u9ad4\u4e2d\u6587', - zu: 'isiZulu', -}; - -export const KIBANA_LOCALE_SETTING = { - value: 'locale_setting', - label: 'Kibana locale setting', -}; - -export const BROWSER_LANGUAGE_SETTING = { - value: 'browser_setting', - label: 'Browser language setting', -}; - -export const DEFAULT_LANGUAGE_OPTION = KIBANA_LOCALE_SETTING; -export const LANGUAGE_OPTIONS = [ - KIBANA_LOCALE_SETTING, - BROWSER_LANGUAGE_SETTING, - ...Object.entries(languages).map(([value, label]) => ({ value, label })), -]; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts index 4685befa9df24..eae50d1116a8f 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts @@ -7,7 +7,6 @@ // AI Assistant export const aiAssistantLogsIndexPattern = 'observability:aiAssistantLogsIndexPattern'; -export const aiAssistantResponseLanguage = 'observability:aiAssistantResponseLanguage'; export const aiAssistantSimulatedFunctionCalling = 'observability:aiAssistantSimulatedFunctionCalling'; export const aiAssistantSearchConnectorIndexPattern = diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts index 4d850118bb736..712b102c36f85 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts @@ -21,7 +21,6 @@ import { import type { ObservabilityAIAssistantChatService, ObservabilityAIAssistantService } from '..'; import { useKibana } from './use_kibana'; import { useOnce } from './use_once'; -import { useUserPreferredLanguage } from './use_user_preferred_language'; export enum ChatState { Ready = 'ready', @@ -88,8 +87,6 @@ function useChatWithoutContext({ const abortControllerRef = useRef(new AbortController()); - const { getPreferredLanguage } = useUserPreferredLanguage(); - const onChatCompleteRef = useRef(onChatComplete); onChatCompleteRef.current = onChatComplete; @@ -164,7 +161,6 @@ function useChatWithoutContext({ disableFunctions: disableFunctions ?? false, signal: abortControllerRef.current.signal, conversationId, - responseLanguage: getPreferredLanguage(), }); function getPendingMessages() { @@ -263,7 +259,6 @@ function useChatWithoutContext({ disableFunctions, service, systemMessage, - getPreferredLanguage, ] ); diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_user_preferred_language.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_user_preferred_language.ts deleted file mode 100644 index 16e4edbf8ceb7..0000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_user_preferred_language.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import { useCallback } from 'react'; -import { - DEFAULT_LANGUAGE_OPTION, - KIBANA_LOCALE_SETTING, - BROWSER_LANGUAGE_SETTING, - languages, -} from '../../common/ui_settings/language_options'; -import { aiAssistantResponseLanguage } from '../../common'; - -import { useKibana } from './use_kibana'; - -export type UseUserPreferredLanguageResult = ReturnType; - -export function useUserPreferredLanguage() { - const { - services: { uiSettings }, - } = useKibana(); - - const selectedLanguage = uiSettings.get( - aiAssistantResponseLanguage, - DEFAULT_LANGUAGE_OPTION.value - ); - - const getPreferredLanguage = useCallback(() => { - if (selectedLanguage === KIBANA_LOCALE_SETTING.value) { - return getLanguageFromKibanaSettings(); - } else if (selectedLanguage === BROWSER_LANGUAGE_SETTING.value) { - return getLanguageFromBrowserSetting(); - } else { - return languages[selectedLanguage] || 'English'; - } - }, [selectedLanguage]); - - return { selectedLanguage, getPreferredLanguage }; -} - -function getLanguageFromKibanaSettings() { - switch (i18n.getLocale()) { - case 'en': - return 'English'; - case 'zh-cn': - return '简体中文'; - case 'ja-jp': - return '日本語'; - case 'fr-fr': - return 'français'; - default: - return 'English'; - } -} - -function getLanguageFromBrowserSetting() { - return languages[navigator.language] || 'English'; -} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/index.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/public/index.ts index 81cee3036e9c2..ab2dea089dcf1 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/public/index.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/public/index.ts @@ -93,10 +93,8 @@ export type { } from './api'; export type { UseChatResult } from './hooks/use_chat'; -export { LANGUAGE_OPTIONS, DEFAULT_LANGUAGE_OPTION } from '../common/ui_settings/language_options'; export { - aiAssistantResponseLanguage, aiAssistantLogsIndexPattern, aiAssistantSimulatedFunctionCalling, aiAssistantSearchConnectorIndexPattern, diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/mock.tsx b/x-pack/plugins/observability_solution/observability_ai_assistant/public/mock.tsx index 31907f54c49bf..b5d85be11dfe2 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/public/mock.tsx +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/public/mock.tsx @@ -79,12 +79,6 @@ function createStartContract(): ObservabilityAIAssistantPublicStart { selectConnector: () => {}, reloadConnectors: () => {}, }), - useUserPreferredLanguage: () => ({ - LANGUAGE_OPTIONS: [{ label: 'English' }], - selectedLanguage: 'English', - setSelectedLanguage: () => {}, - getPreferredLanguage: () => 'English', - }), getContextualInsightMessages: () => [], createScreenContextAction: () => ({} as ScreenContextActionDefinition), }; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/plugin.tsx b/x-pack/plugins/observability_solution/observability_ai_assistant/public/plugin.tsx index 2c2c68f407d84..fd2a60dcdfc3a 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/public/plugin.tsx @@ -16,7 +16,6 @@ import { ObservabilityAIAssistantMultipaneFlyoutContext } from './context/observ import { ObservabilityAIAssistantProvider } from './context/observability_ai_assistant_provider'; import { useGenAIConnectorsWithoutContext } from './hooks/use_genai_connectors'; import { useObservabilityAIAssistantChatService } from './hooks/use_observability_ai_assistant_chat_service'; -import { useUserPreferredLanguage } from './hooks/use_user_preferred_language'; import { createUseChat } from './hooks/use_chat'; import { createService } from './service/create_service'; import { createScreenContextAction } from './utils/create_screen_context_action'; @@ -97,7 +96,6 @@ export class ObservabilityAIAssistantPlugin useChat: createUseChat({ notifications: coreStart.notifications, }), - useUserPreferredLanguage, ObservabilityAIAssistantMultipaneFlyoutContext, ObservabilityAIAssistantChatServiceContext, useObservabilityAIAssistantChatService, diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/complete.test.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/complete.test.ts index 4665f9b7b486b..59b3e7c9087d9 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/complete.test.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/complete.test.ts @@ -101,7 +101,6 @@ describe('complete', () => { persist: false, disableFunctions: false, signal: new AbortController().signal, - responseLanguage: 'orcish', ...params, }, requestCallback diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/complete.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/complete.ts index 90a8f16639ed6..85f5f0397ff31 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/complete.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/complete.ts @@ -42,7 +42,6 @@ export function complete( persist, disableFunctions, signal, - responseLanguage, instructions, }: { client: Pick; @@ -65,7 +64,6 @@ export function complete( disableFunctions, screenContexts, conversationId, - responseLanguage, instructions, }, }, @@ -131,7 +129,6 @@ export function complete( messages: initialMessages.concat(nextMessages), signal, persist, - responseLanguage, disableFunctions, instructions, }, diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_chat_service.test.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_chat_service.test.ts index 6555c310b14f9..6d0332602c869 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_chat_service.test.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_chat_service.test.ts @@ -229,38 +229,4 @@ describe('createChatService', () => { ).rejects.toEqual(expect.any(AbortError)); }); }); - - describe('complete', () => { - it("sends the user's preferred response language to the API", async () => { - respondWithChunks({ - chunks: [ - '{"id":"my-id","type":"chatCompletionChunk","message":{"content":"Some message"}}', - ], - }); - - const response$ = service.complete({ - connectorId: '', - getScreenContexts: () => [], - messages: [], - persist: false, - disableFunctions: false, - signal: new AbortController().signal, - responseLanguage: 'orcish', - }); - - await getConcatenatedMessage(response$); - - expect(clientSpy).toHaveBeenNthCalledWith( - 2, - 'POST /internal/observability_ai_assistant/chat/complete', - expect.objectContaining({ - params: expect.objectContaining({ - body: expect.objectContaining({ - responseLanguage: 'orcish', - }), - }), - }) - ); - }); - }); }); diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_chat_service.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_chat_service.ts index db3c8b1f5bbf3..fc8c06ef55f51 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_chat_service.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_chat_service.ts @@ -214,7 +214,7 @@ export async function createChatService({ persist, disableFunctions, signal, - responseLanguage, + instructions, }) { return complete( @@ -227,7 +227,6 @@ export async function createChatService({ disableFunctions, signal, client, - responseLanguage, instructions, }, ({ params }) => { diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts index c00cf4805ff8d..71a8a7e402748 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts @@ -29,7 +29,6 @@ import { ObservabilityAIAssistantMultipaneFlyoutContext } from './context/observ import { useChat } from './hooks/use_chat'; import type { UseGenAIConnectorsResult } from './hooks/use_genai_connectors'; import { useObservabilityAIAssistantChatService } from './hooks/use_observability_ai_assistant_chat_service'; -import type { UseUserPreferredLanguageResult } from './hooks/use_user_preferred_language'; import { createScreenContextAction } from './utils/create_screen_context_action'; /* eslint-disable @typescript-eslint/no-empty-interface*/ @@ -67,7 +66,6 @@ export interface ObservabilityAIAssistantChatService { except: string[]; }; signal: AbortSignal; - responseLanguage?: string; instructions?: AdHocInstruction[]; }) => Observable; getFunctions: (options?: { contexts?: string[]; filter?: string }) => FunctionDefinition[]; @@ -135,7 +133,6 @@ export interface ObservabilityAIAssistantPublicStart { useObservabilityAIAssistantChatService: typeof useObservabilityAIAssistantChatService; useGenAIConnectors: () => UseGenAIConnectorsResult; useChat: typeof useChat; - useUserPreferredLanguage: () => UseUserPreferredLanguageResult; getContextualInsightMessages: ({}: { message: string; instructions: string }) => Message[]; createScreenContextAction: typeof createScreenContextAction; } diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/index.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/index.ts index 03b3f4ccdc766..7d1409b29dde3 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/index.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/server/index.ts @@ -19,7 +19,6 @@ export type { } from './types'; export { - aiAssistantResponseLanguage, aiAssistantLogsIndexPattern, aiAssistantSimulatedFunctionCalling, aiAssistantSearchConnectorIndexPattern, diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/chat/route.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/chat/route.ts index 73d8b0d1354e0..d57051cf9fb62 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/chat/route.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/chat/route.ts @@ -33,7 +33,6 @@ const chatCompleteBaseRt = t.type({ t.partial({ conversationId: t.string, title: t.string, - responseLanguage: t.string, disableFunctions: t.union([ toBooleanRt, t.type({ @@ -241,7 +240,6 @@ async function chatComplete( title, persist, screenContexts, - responseLanguage, instructions, disableFunctions, }, @@ -266,7 +264,6 @@ async function chatComplete( persist, signal, functionClient, - responseLanguage, instructions, simulateFunctionCalling, disableFunctions, diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/runtime_types.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/runtime_types.ts index 1c4de53fc4420..968c182ed75cf 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/runtime_types.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/runtime_types.ts @@ -14,6 +14,7 @@ import { type Message, MessageRole, type ObservabilityAIAssistantScreenContextRequest, + type StarterPrompt, } from '../../common/types'; const serializeableRt = t.any; @@ -129,6 +130,12 @@ export const functionRt = t.intersection([ }), ]); +export const starterPromptRt: t.Type = t.type({ + title: t.string, + prompt: t.string, + icon: t.any, +}); + export const screenContextRt: t.Type = t.partial({ description: t.string, data: t.array( @@ -139,4 +146,6 @@ export const screenContextRt: t.Type; -const EXPECTED_STORED_SYSTEM_MESSAGE = `system\n\nYou MUST respond in the users preferred language which is: English.`; +const EXPECTED_STORED_SYSTEM_MESSAGE = `system`; const nextTick = () => { return new Promise(process.nextTick); @@ -366,8 +366,8 @@ describe('Observability AI Assistant client', () => { last_updated: expect.any(String), token_count: { completion: 1, - prompt: 46, - total: 47, + prompt: 33, + total: 34, }, }, type: StreamingChatResponseEventType.ConversationCreate, @@ -423,8 +423,8 @@ describe('Observability AI Assistant client', () => { last_updated: expect.any(String), token_count: { completion: 6, - prompt: 230, - total: 236, + prompt: 210, + total: 216, }, }, type: StreamingChatResponseEventType.ConversationCreate, @@ -441,8 +441,8 @@ describe('Observability AI Assistant client', () => { title: 'An auto-generated title', token_count: { completion: 6, - prompt: 230, - total: 236, + prompt: 210, + total: 216, }, }, labels: {}, @@ -572,8 +572,8 @@ describe('Observability AI Assistant client', () => { last_updated: expect.any(String), token_count: { completion: 2, - prompt: 124, - total: 126, + prompt: 111, + total: 113, }, }, type: StreamingChatResponseEventType.ConversationUpdate, @@ -591,8 +591,8 @@ describe('Observability AI Assistant client', () => { title: 'My stored conversation', token_count: { completion: 2, - prompt: 124, - total: 126, + prompt: 111, + total: 113, }, }, labels: {}, @@ -1583,39 +1583,6 @@ describe('Observability AI Assistant client', () => { ); }); - it("Adds the user's preferred language to the system prompt", async () => { - client = createClient(); - const chatSpy = jest.spyOn(client, 'chat'); - - actionsClientMock.execute.mockImplementation(async () => { - return { - actionId: '', - status: 'ok', - data: createLlmSimulator().stream, - }; - }); - - client - .complete({ - connectorId: 'foo', - messages: [system('This is a system message'), user('A user message to cause completion')], - functionClient: functionClientMock, - signal: new AbortController().signal, - title: 'My predefined title', - persist: false, - responseLanguage: 'Orcish', - }) - .subscribe(() => {}); // To trigger call to chat - await nextTick(); - - const systemMessage = chatSpy.mock.calls[0][1].messages[0]; - - expect(systemMessage.message.role).toEqual(MessageRole.System); - expect(systemMessage.message.content).toEqual( - EXPECTED_STORED_SYSTEM_MESSAGE.replace('English', 'Orcish') - ); - }); - describe('when executing an action', () => { let completePromise: Promise; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.ts index 293d2da9c04b9..45309911375d1 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.ts @@ -166,7 +166,6 @@ export class ObservabilityAIAssistantClient { instructions: adHocInstructions = [], messages: initialMessages, signal, - responseLanguage = 'English', persist, kibanaPublicUrl, isPublic, @@ -179,7 +178,6 @@ export class ObservabilityAIAssistantClient { signal: AbortSignal; functionClient: ChatFunctionClient; persist: boolean; - responseLanguage?: string; conversationId?: string; title?: string; isPublic?: boolean; @@ -195,13 +193,6 @@ export class ObservabilityAIAssistantClient { return new LangTracer(context.active()).startActiveSpan( 'complete', ({ tracer: completeTracer }) => { - if (responseLanguage) { - adHocInstructions.push({ - instruction_type: 'application_instruction', - text: `You MUST respond in the users preferred language which is: ${responseLanguage}.`, - }); - } - const isConversationUpdate = persist && !!predefinedConversationId; const conversationId = persist ? predefinedConversationId || v4() : ''; @@ -252,7 +243,6 @@ export class ObservabilityAIAssistantClient { switchMap((messages) => getGeneratedTitle({ messages, - responseLanguage, logger: this.dependencies.logger, chat: (name, chatParams) => { return this.chat(name, { diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.test.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.test.ts index 02f5e5c294466..a8ddd5233132a 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.test.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.test.ts @@ -38,9 +38,7 @@ describe('getGeneratedTitle', () => { }; } - function callGenerateTitle( - ...rest: [ChatEvent[]] | [{ responseLanguage?: string }, ChatEvent[]] - ) { + function callGenerateTitle(...rest: [ChatEvent[]] | [{}, ChatEvent[]]) { const options = rest.length === 1 ? {} : rest[0]; const chunks = rest.length === 1 ? rest[0] : rest[1]; @@ -119,27 +117,6 @@ describe('getGeneratedTitle', () => { expect(await testTitle(`"User's request for a title"`)).toEqual(`User's request for a title`); }); - it('mentions the given response language in the instruction', async () => { - const { chatSpy, title$ } = callGenerateTitle( - { - responseLanguage: 'Orcish', - }, - [ - createChatCompletionChunk({ - function_call: { - name: 'title_conversation', - arguments: JSON.stringify({ title: 'My title' }), - }, - }), - ] - ); - - await lastValueFrom(title$); - - const [, params] = chatSpy.mock.calls[0]; - expect(params.messages[0].message.content).toContain('Orcish'); - }); - it('handles partial updates', async () => { const { title$ } = callGenerateTitle([ createChatCompletionChunk({ diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.ts index 23440c30bdcca..79dac3c036046 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.ts @@ -25,13 +25,11 @@ type ChatFunctionWithoutConnectorAndTokenCount = ( ) => Observable; export function getGeneratedTitle({ - responseLanguage, messages, chat, logger, tracer, }: { - responseLanguage?: string; messages: Message[]; chat: ChatFunctionWithoutConnectorAndTokenCount; logger: Pick; @@ -44,7 +42,7 @@ export function getGeneratedTitle({ '@timestamp': new Date().toString(), message: { role: MessageRole.System, - content: `You are a helpful assistant for Elastic Observability. Assume the following message is the start of a conversation between you and a user; give this conversation a title based on the content below. DO NOT UNDER ANY CIRCUMSTANCES wrap this title in single or double quotes. This title is shown in a list of conversations to the user, so title it for the user, not for you. Please create the title in ${responseLanguage}.`, + content: `You are a helpful assistant for Elastic Observability. Assume the following message is the start of a conversation between you and a user; give this conversation a title based on the content below. DO NOT UNDER ANY CIRCUMSTANCES wrap this title in single or double quotes. This title is shown in a list of conversations to the user, so title it for the user, not for you.`, }, }, { diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/common/ui_settings.ts b/x-pack/plugins/observability_solution/observability_ai_assistant_management/common/ui_settings.ts index 967ef4a96fbf5..f972eb5742a91 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_management/common/ui_settings.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant_management/common/ui_settings.ts @@ -10,44 +10,11 @@ import { UiSettingsParams } from '@kbn/core-ui-settings-common'; import { i18n } from '@kbn/i18n'; import { aiAssistantLogsIndexPattern, - aiAssistantResponseLanguage, aiAssistantSimulatedFunctionCalling, aiAssistantSearchConnectorIndexPattern, } from '@kbn/observability-ai-assistant-plugin/common'; -import { - DEFAULT_LANGUAGE_OPTION, - LANGUAGE_OPTIONS, -} from '@kbn/observability-ai-assistant-plugin/common'; export const uiSettings: Record = { - [aiAssistantResponseLanguage]: { - category: ['observability'], - name: i18n.translate( - 'xpack.observabilityAiAssistantManagement.settingsPage.userPreferencesLabel', - { - defaultMessage: 'Response language', - } - ), - value: DEFAULT_LANGUAGE_OPTION.value, - description: i18n.translate( - 'xpack.observabilityAiAssistantManagement.settingsPage.selectYourLanguageLabel', - { - defaultMessage: - 'Select the language you wish the Assistant to use when generating responses.', - } - ), - - // Argument of type 'Type[]' is not assignable to parameter of type '[Type]'. - // @ts-expect-error - schema: schema.oneOf(LANGUAGE_OPTIONS.map((lang) => schema.literal(lang.value))), - type: 'select', - options: LANGUAGE_OPTIONS.map((lang) => lang.value), - optionLabels: LANGUAGE_OPTIONS.reduce( - (acc, { value, label }) => ({ ...acc, [value]: label }), - {} - ), - requiresPageReload: true, - }, [aiAssistantLogsIndexPattern]: { category: ['observability'], name: i18n.translate( diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/settings_tab.test.tsx b/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/settings_tab.test.tsx index 9b7022efc324c..807bde0557d8d 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/settings_tab.test.tsx +++ b/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/settings_tab.test.tsx @@ -9,10 +9,7 @@ import React from 'react'; import { fireEvent, waitFor } from '@testing-library/react'; import { render } from '../../../helpers/test_helper'; import { SettingsTab } from './settings_tab'; -import { - aiAssistantLogsIndexPattern, - aiAssistantResponseLanguage, -} from '@kbn/observability-ai-assistant-plugin/server'; +import { aiAssistantLogsIndexPattern } from '@kbn/observability-ai-assistant-plugin/server'; import { uiSettings } from '../../../../common/ui_settings'; jest.mock('../../../hooks/use_app_context'); @@ -76,13 +73,6 @@ describe('SettingsTab', () => { target: { value: 'observability-ai-assistant-*' }, }); - fireEvent.change( - getByTestId(`management-settings-editField-${aiAssistantResponseLanguage}`), - { - target: { value: 'da' }, - } - ); - fireEvent.click(getByTestId('observabilityAiAssistantManagementBottomBarActionsButton')); await waitFor(() => expect(windowLocationReloadMock).toHaveBeenCalledTimes(1)); @@ -97,7 +87,6 @@ describe('SettingsTab', () => { aiAssistantLogsIndexPattern, 'observability-ai-assistant-*' ); - expect(settingsClientSet).toBeCalledWith(aiAssistantResponseLanguage, 'da'); }); }); }); diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/ui_settings.tsx b/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/ui_settings.tsx index 4b30a568bd5e1..5be8456954d64 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/ui_settings.tsx +++ b/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/ui_settings.tsx @@ -9,7 +9,6 @@ import React from 'react'; import { BottomBarActions, useEditableSettings } from '@kbn/observability-shared-plugin/public'; import { aiAssistantLogsIndexPattern, - aiAssistantResponseLanguage, aiAssistantSimulatedFunctionCalling, aiAssistantSearchConnectorIndexPattern, aiAssistantPreferredAIAssistantType, @@ -22,7 +21,6 @@ import { useKibana } from '../../../hooks/use_kibana'; const settingsKeys = [ aiAssistantLogsIndexPattern, - aiAssistantResponseLanguage, aiAssistantSimulatedFunctionCalling, aiAssistantSearchConnectorIndexPattern, aiAssistantPreferredAIAssistantType, diff --git a/x-pack/plugins/observability_solution/observability_shared/public/hooks/use_breadcrumbs.ts b/x-pack/plugins/observability_solution/observability_shared/public/hooks/use_breadcrumbs.ts index 18a08f59db249..4137d541c4e39 100644 --- a/x-pack/plugins/observability_solution/observability_shared/public/hooks/use_breadcrumbs.ts +++ b/x-pack/plugins/observability_solution/observability_shared/public/hooks/use_breadcrumbs.ts @@ -7,9 +7,10 @@ import { i18n } from '@kbn/i18n'; import { ApplicationStart, ChromeBreadcrumb, ChromeStart } from '@kbn/core/public'; -import { MouseEvent, useEffect } from 'react'; +import { MouseEvent, useEffect, useMemo } from 'react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { ChromeBreadcrumbsAppendExtension } from '@kbn/core-chrome-browser'; +import type { ServerlessPluginStart } from '@kbn/serverless/public'; import { useQueryParams } from './use_query_params'; function addClickHandlers( @@ -37,14 +38,18 @@ function getTitleFromBreadCrumbs(breadcrumbs: ChromeBreadcrumb[]) { export const useBreadcrumbs = ( extraCrumbs: ChromeBreadcrumb[], - app?: { id: string; label: string }, - breadcrumbsAppendExtension?: ChromeBreadcrumbsAppendExtension + options?: { + app?: { id: string; label: string }; + breadcrumbsAppendExtension?: ChromeBreadcrumbsAppendExtension; + serverless?: ServerlessPluginStart; + } ) => { const params = useQueryParams(); + const { app, breadcrumbsAppendExtension, serverless } = options ?? {}; const { services: { - chrome: { docTitle, setBreadcrumbs, setBreadcrumbsAppendExtension }, + chrome: { docTitle, setBreadcrumbs: chromeSetBreadcrumbs, setBreadcrumbsAppendExtension }, application: { getUrlForApp, navigateToUrl }, }, } = useKibana<{ @@ -54,6 +59,11 @@ export const useBreadcrumbs = ( const setTitle = docTitle.change; const appPath = getUrlForApp(app?.id ?? 'observability-overview') ?? ''; + const setBreadcrumbs = useMemo( + () => serverless?.setBreadcrumbs ?? chromeSetBreadcrumbs, + [serverless, chromeSetBreadcrumbs] + ); + useEffect(() => { if (breadcrumbsAppendExtension) { setBreadcrumbsAppendExtension(breadcrumbsAppendExtension); @@ -66,22 +76,34 @@ export const useBreadcrumbs = ( }, [breadcrumbsAppendExtension, setBreadcrumbsAppendExtension]); useEffect(() => { - const breadcrumbs = [ - { - text: - app?.label ?? - i18n.translate('xpack.observabilityShared.breadcrumbs.observabilityLinkText', { - defaultMessage: 'Observability', - }), - href: appPath + '/overview', - }, - ...extraCrumbs, - ]; + const breadcrumbs = serverless + ? extraCrumbs + : [ + { + text: + app?.label ?? + i18n.translate('xpack.observabilityShared.breadcrumbs.observabilityLinkText', { + defaultMessage: 'Observability', + }), + href: appPath + '/overview', + }, + ...extraCrumbs, + ]; + if (setBreadcrumbs) { setBreadcrumbs(addClickHandlers(breadcrumbs, navigateToUrl)); } if (setTitle) { setTitle(getTitleFromBreadCrumbs(breadcrumbs)); } - }, [app?.label, appPath, extraCrumbs, navigateToUrl, params, setBreadcrumbs, setTitle]); + }, [ + app?.label, + appPath, + extraCrumbs, + navigateToUrl, + params, + serverless, + setBreadcrumbs, + setTitle, + ]); }; diff --git a/x-pack/plugins/observability_solution/observability_shared/tsconfig.json b/x-pack/plugins/observability_solution/observability_shared/tsconfig.json index 371807ecdd5a2..6453bae28d999 100644 --- a/x-pack/plugins/observability_solution/observability_shared/tsconfig.json +++ b/x-pack/plugins/observability_solution/observability_shared/tsconfig.json @@ -43,6 +43,7 @@ "@kbn/core-chrome-browser", "@kbn/rule-data-utils", "@kbn/es-query", + "@kbn/serverless", ], "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/slo_permissions_callout/index.tsx b/x-pack/plugins/observability_solution/slo/public/components/slo/slo_permissions_callout/index.tsx index 720f31ccea3fa..bf49fa4393282 100644 --- a/x-pack/plugins/observability_solution/slo/public/components/slo/slo_permissions_callout/index.tsx +++ b/x-pack/plugins/observability_solution/slo/public/components/slo/slo_permissions_callout/index.tsx @@ -46,7 +46,7 @@ export function SloPermissionsCallout() {
  • @@ -62,13 +62,7 @@ export function SloPermissionsCallout() {
  • -
  • -
  • -
  • diff --git a/x-pack/plugins/observability_solution/slo/server/routes/slo/route.ts b/x-pack/plugins/observability_solution/slo/server/routes/slo/route.ts index 3a06e653c8159..fffbd7aa1e924 100644 --- a/x-pack/plugins/observability_solution/slo/server/routes/slo/route.ts +++ b/x-pack/plugins/observability_solution/slo/server/routes/slo/route.ts @@ -105,27 +105,30 @@ const createSLORoute = createSloServerRoute({ const dataViews = await dependencies.getDataViewsStart(); const spaceId = (await spaces?.spacesService?.getActiveSpace(request))?.id ?? 'default'; - const esClient = (await context.core).elasticsearch.client.asCurrentUser; + const core = await context.core; + const scopedClusterClient = core.elasticsearch.client; + const esClient = core.elasticsearch.client.asCurrentUser; const basePath = dependencies.pluginsSetup.core.http.basePath; - const soClient = (await context.core).savedObjects.client; + const soClient = core.savedObjects.client; const repository = new KibanaSavedObjectsSLORepository(soClient, logger); const dataViewsService = await dataViews.dataViewsServiceFactory(soClient, esClient); const transformManager = new DefaultTransformManager( transformGenerators, - esClient, + scopedClusterClient, logger, spaceId, dataViewsService ); const summaryTransformManager = new DefaultSummaryTransformManager( new DefaultSummaryTransformGenerator(), - esClient, + scopedClusterClient, logger ); const createSLO = new CreateSLO( esClient, + scopedClusterClient, repository, transformManager, summaryTransformManager, @@ -154,25 +157,28 @@ const inspectSLORoute = createSloServerRoute({ const dataViews = await dependencies.getDataViewsStart(); const spaceId = (await spaces?.spacesService?.getActiveSpace(request))?.id ?? 'default'; const basePath = dependencies.pluginsSetup.core.http.basePath; - const esClient = (await context.core).elasticsearch.client.asCurrentUser; - const soClient = (await context.core).savedObjects.client; + const core = await context.core; + const scopedClusterClient = core.elasticsearch.client; + const esClient = core.elasticsearch.client.asCurrentUser; + const soClient = core.savedObjects.client; const repository = new KibanaSavedObjectsSLORepository(soClient, logger); const dataViewsService = await dataViews.dataViewsServiceFactory(soClient, esClient); const transformManager = new DefaultTransformManager( transformGenerators, - esClient, + scopedClusterClient, logger, spaceId, dataViewsService ); const summaryTransformManager = new DefaultSummaryTransformManager( new DefaultSummaryTransformGenerator(), - esClient, + scopedClusterClient, logger ); const createSLO = new CreateSLO( esClient, + scopedClusterClient, repository, transformManager, summaryTransformManager, @@ -200,20 +206,22 @@ const updateSLORoute = createSloServerRoute({ const dataViews = await dependencies.getDataViewsStart(); const basePath = dependencies.pluginsSetup.core.http.basePath; - const esClient = (await context.core).elasticsearch.client.asCurrentUser; - const soClient = (await context.core).savedObjects.client; + const core = await context.core; + const scopedClusterClient = core.elasticsearch.client; + const esClient = core.elasticsearch.client.asCurrentUser; + const soClient = core.savedObjects.client; const dataViewsService = await dataViews.dataViewsServiceFactory(soClient, esClient); const repository = new KibanaSavedObjectsSLORepository(soClient, logger); const transformManager = new DefaultTransformManager( transformGenerators, - esClient, + scopedClusterClient, logger, spaceId, dataViewsService ); const summaryTransformManager = new DefaultSummaryTransformManager( new DefaultSummaryTransformGenerator(), - esClient, + scopedClusterClient, logger ); @@ -222,6 +230,7 @@ const updateSLORoute = createSloServerRoute({ transformManager, summaryTransformManager, esClient, + scopedClusterClient, logger, spaceId, basePath @@ -247,8 +256,10 @@ const deleteSLORoute = createSloServerRoute({ const spaceId = (await spaces?.spacesService?.getActiveSpace(request))?.id ?? 'default'; const dataViews = await dependencies.getDataViewsStart(); - const esClient = (await context.core).elasticsearch.client.asCurrentUser; - const soClient = (await context.core).savedObjects.client; + const core = await context.core; + const scopedClusterClient = core.elasticsearch.client; + const esClient = core.elasticsearch.client.asCurrentUser; + const soClient = core.savedObjects.client; const rulesClient = await dependencies.getRulesClientWithRequest(request); const dataViewsService = await dataViews.dataViewsServiceFactory(soClient, esClient); @@ -256,7 +267,7 @@ const deleteSLORoute = createSloServerRoute({ const repository = new KibanaSavedObjectsSLORepository(soClient, logger); const transformManager = new DefaultTransformManager( transformGenerators, - esClient, + scopedClusterClient, logger, spaceId, dataViewsService @@ -264,7 +275,7 @@ const deleteSLORoute = createSloServerRoute({ const summaryTransformManager = new DefaultSummaryTransformManager( new DefaultSummaryTransformGenerator(), - esClient, + scopedClusterClient, logger ); @@ -273,6 +284,7 @@ const deleteSLORoute = createSloServerRoute({ transformManager, summaryTransformManager, esClient, + scopedClusterClient, rulesClient ); @@ -319,20 +331,22 @@ const enableSLORoute = createSloServerRoute({ const spaceId = (await spaces?.spacesService?.getActiveSpace(request))?.id ?? 'default'; const dataViews = await dependencies.getDataViewsStart(); - const soClient = (await context.core).savedObjects.client; - const esClient = (await context.core).elasticsearch.client.asCurrentUser; + const core = await context.core; + const scopedClusterClient = core.elasticsearch.client; + const soClient = core.savedObjects.client; + const esClient = core.elasticsearch.client.asCurrentUser; const dataViewsService = await dataViews.dataViewsServiceFactory(soClient, esClient); const repository = new KibanaSavedObjectsSLORepository(soClient, logger); const transformManager = new DefaultTransformManager( transformGenerators, - esClient, + scopedClusterClient, logger, spaceId, dataViewsService ); const summaryTransformManager = new DefaultSummaryTransformManager( new DefaultSummaryTransformGenerator(), - esClient, + scopedClusterClient, logger ); @@ -358,20 +372,22 @@ const disableSLORoute = createSloServerRoute({ const spaceId = (await spaces?.spacesService?.getActiveSpace(request))?.id ?? 'default'; const dataViews = await dependencies.getDataViewsStart(); - const soClient = (await context.core).savedObjects.client; - const esClient = (await context.core).elasticsearch.client.asCurrentUser; + const core = await context.core; + const scopedClusterClient = core.elasticsearch.client; + const soClient = core.savedObjects.client; + const esClient = core.elasticsearch.client.asCurrentUser; const dataViewsService = await dataViews.dataViewsServiceFactory(soClient, esClient); const repository = new KibanaSavedObjectsSLORepository(soClient, logger); const transformManager = new DefaultTransformManager( transformGenerators, - esClient, + scopedClusterClient, logger, spaceId, dataViewsService ); const summaryTransformManager = new DefaultSummaryTransformManager( new DefaultSummaryTransformGenerator(), - esClient, + scopedClusterClient, logger ); @@ -396,27 +412,30 @@ const resetSLORoute = createSloServerRoute({ const spaces = await dependencies.getSpacesStart(); const dataViews = await dependencies.getDataViewsStart(); const spaceId = (await spaces?.spacesService?.getActiveSpace(request))?.id ?? 'default'; - const soClient = (await context.core).savedObjects.client; - const esClient = (await context.core).elasticsearch.client.asCurrentUser; + const core = await context.core; + const scopedClusterClient = core.elasticsearch.client; + const soClient = core.savedObjects.client; + const esClient = core.elasticsearch.client.asCurrentUser; const basePath = dependencies.pluginsSetup.core.http.basePath; const dataViewsService = await dataViews.dataViewsServiceFactory(soClient, esClient); const repository = new KibanaSavedObjectsSLORepository(soClient, logger); const transformManager = new DefaultTransformManager( transformGenerators, - esClient, + scopedClusterClient, logger, spaceId, dataViewsService ); const summaryTransformManager = new DefaultSummaryTransformManager( new DefaultSummaryTransformGenerator(), - esClient, + scopedClusterClient, logger ); const resetSLO = new ResetSLO( esClient, + scopedClusterClient, repository, transformManager, summaryTransformManager, @@ -598,11 +617,13 @@ const fetchSloHealthRoute = createSloServerRoute({ handler: async ({ context, params, logger }) => { await assertPlatinumLicense(context); - const soClient = (await context.core).savedObjects.client; - const esClient = (await context.core).elasticsearch.client.asCurrentUser; + const core = await context.core; + const scopedClusterClient = core.elasticsearch.client; + const soClient = core.savedObjects.client; + const esClient = core.elasticsearch.client.asCurrentUser; const repository = new KibanaSavedObjectsSLORepository(soClient, logger); - const getSLOHealth = new GetSLOHealth(esClient, repository); + const getSLOHealth = new GetSLOHealth(esClient, scopedClusterClient, repository); return await getSLOHealth.execute(params.body); }, diff --git a/x-pack/plugins/observability_solution/slo/server/services/create_slo.test.ts b/x-pack/plugins/observability_solution/slo/server/services/create_slo.test.ts index 1acc263a2d655..9499294eeb89b 100644 --- a/x-pack/plugins/observability_solution/slo/server/services/create_slo.test.ts +++ b/x-pack/plugins/observability_solution/slo/server/services/create_slo.test.ts @@ -10,6 +10,7 @@ import { elasticsearchServiceMock, httpServiceMock, loggingSystemMock, + ScopedClusterClientMock, } from '@kbn/core/server/mocks'; import { MockedLogger } from '@kbn/logging-mocks'; import { CreateSLO } from './create_slo'; @@ -25,6 +26,7 @@ import { TransformManager } from './transform_manager'; describe('CreateSLO', () => { let mockEsClient: ElasticsearchClientMock; + let mockScopedClusterClient: ScopedClusterClientMock; let mockLogger: jest.Mocked; let mockRepository: jest.Mocked; let mockTransformManager: jest.Mocked; @@ -35,12 +37,14 @@ describe('CreateSLO', () => { beforeEach(() => { mockEsClient = elasticsearchServiceMock.createElasticsearchClient(); + mockScopedClusterClient = elasticsearchServiceMock.createScopedClusterClient(); mockLogger = loggingSystemMock.createLogger(); mockRepository = createSLORepositoryMock(); mockTransformManager = createTransformManagerMock(); mockSummaryTransformManager = createSummaryTransformManagerMock(); createSLO = new CreateSLO( mockEsClient, + mockScopedClusterClient, mockRepository, mockTransformManager, mockSummaryTransformManager, @@ -82,7 +86,9 @@ describe('CreateSLO', () => { expect(mockTransformManager.install).toHaveBeenCalled(); expect(mockTransformManager.start).toHaveBeenCalled(); - expect(mockEsClient.ingest.putPipeline.mock.calls[0]).toMatchSnapshot(); + expect( + mockScopedClusterClient.asSecondaryAuthUser.ingest.putPipeline.mock.calls[0] + ).toMatchSnapshot(); expect(mockSummaryTransformManager.install).toHaveBeenCalled(); expect(mockSummaryTransformManager.start).toHaveBeenCalled(); expect(mockEsClient.index.mock.calls[0]).toMatchSnapshot(); @@ -165,7 +171,9 @@ describe('CreateSLO', () => { ); expect(mockRepository.deleteById).toHaveBeenCalled(); - expect(mockEsClient.ingest.deletePipeline).toHaveBeenCalledTimes(1); + expect( + mockScopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline + ).toHaveBeenCalledTimes(1); expect(mockSummaryTransformManager.stop).not.toHaveBeenCalled(); expect(mockSummaryTransformManager.uninstall).not.toHaveBeenCalled(); @@ -186,7 +194,9 @@ describe('CreateSLO', () => { expect(mockRepository.deleteById).toHaveBeenCalled(); expect(mockTransformManager.stop).toHaveBeenCalled(); expect(mockTransformManager.uninstall).toHaveBeenCalled(); - expect(mockEsClient.ingest.deletePipeline).toHaveBeenCalledTimes(2); + expect( + mockScopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline + ).toHaveBeenCalledTimes(2); expect(mockSummaryTransformManager.uninstall).toHaveBeenCalled(); expect(mockSummaryTransformManager.stop).not.toHaveBeenCalled(); @@ -203,7 +213,9 @@ describe('CreateSLO', () => { expect(mockRepository.deleteById).toHaveBeenCalled(); expect(mockTransformManager.stop).toHaveBeenCalled(); expect(mockTransformManager.uninstall).toHaveBeenCalled(); - expect(mockEsClient.ingest.deletePipeline).toHaveBeenCalledTimes(2); + expect( + mockScopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline + ).toHaveBeenCalledTimes(2); expect(mockSummaryTransformManager.stop).toHaveBeenCalled(); expect(mockSummaryTransformManager.uninstall).toHaveBeenCalled(); }); diff --git a/x-pack/plugins/observability_solution/slo/server/services/create_slo.ts b/x-pack/plugins/observability_solution/slo/server/services/create_slo.ts index f3abb8554f3dd..0f6885dd44c6c 100644 --- a/x-pack/plugins/observability_solution/slo/server/services/create_slo.ts +++ b/x-pack/plugins/observability_solution/slo/server/services/create_slo.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +import { IScopedClusterClient } from '@kbn/core/server'; import { TransformPutTransformRequest } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { ElasticsearchClient, IBasePath, Logger } from '@kbn/core/server'; import { ALL_VALUE, CreateSLOParams, CreateSLOResponse } from '@kbn/slo-schema'; @@ -32,6 +32,7 @@ import { getTransformQueryComposite } from './utils/get_transform_compite_query' export class CreateSLO { constructor( private esClient: ElasticsearchClient, + private scopedClusterClient: IScopedClusterClient, private repository: SLORepository, private transformManager: TransformManager, private summaryTransformManager: TransformManager, @@ -53,11 +54,14 @@ export class CreateSLO { const summaryTransformId = getSLOSummaryTransformId(slo.id, slo.revision); try { await retryTransientEsErrors( - () => this.esClient.ingest.putPipeline(getSLOPipelineTemplate(slo)), + () => + this.scopedClusterClient.asSecondaryAuthUser.ingest.putPipeline( + getSLOPipelineTemplate(slo) + ), { logger: this.logger } ); rollbackOperations.push(() => - this.esClient.ingest.deletePipeline( + this.scopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline( { id: getSLOPipelineId(slo.id, slo.revision) }, { ignore: [404] } ) @@ -71,13 +75,13 @@ export class CreateSLO { await retryTransientEsErrors( () => - this.esClient.ingest.putPipeline( + this.scopedClusterClient.asSecondaryAuthUser.ingest.putPipeline( getSLOSummaryPipelineTemplate(slo, this.spaceId, this.basePath) ), { logger: this.logger } ); rollbackOperations.push(() => - this.esClient.ingest.deletePipeline( + this.scopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline( { id: getSLOSummaryPipelineId(slo.id, slo.revision) }, { ignore: [404] } ) diff --git a/x-pack/plugins/observability_solution/slo/server/services/delete_slo.test.ts b/x-pack/plugins/observability_solution/slo/server/services/delete_slo.test.ts index 506151da864d3..2b8a2352f8026 100644 --- a/x-pack/plugins/observability_solution/slo/server/services/delete_slo.test.ts +++ b/x-pack/plugins/observability_solution/slo/server/services/delete_slo.test.ts @@ -8,7 +8,7 @@ import { rulesClientMock } from '@kbn/alerting-plugin/server/rules_client.mock'; import { RulesClientApi } from '@kbn/alerting-plugin/server/types'; import { ElasticsearchClient } from '@kbn/core/server'; -import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; +import { elasticsearchServiceMock, ScopedClusterClientMock } from '@kbn/core/server/mocks'; import { DeleteSLO } from './delete_slo'; import { createAPMTransactionErrorRateIndicator, createSLO } from './fixtures/slo'; import { @@ -24,6 +24,7 @@ describe('DeleteSLO', () => { let mockTransformManager: jest.Mocked; let mockSummaryTransformManager: jest.Mocked; let mockEsClient: jest.Mocked; + let mockScopedClusterClient: ScopedClusterClientMock; let mockRulesClient: jest.Mocked; let deleteSLO: DeleteSLO; @@ -32,12 +33,14 @@ describe('DeleteSLO', () => { mockTransformManager = createTransformManagerMock(); mockSummaryTransformManager = createSummaryTransformManagerMock(); mockEsClient = elasticsearchServiceMock.createElasticsearchClient(); + mockScopedClusterClient = elasticsearchServiceMock.createScopedClusterClient(); mockRulesClient = rulesClientMock.create(); deleteSLO = new DeleteSLO( mockRepository, mockTransformManager, mockSummaryTransformManager, mockEsClient, + mockScopedClusterClient, mockRulesClient ); }); @@ -57,7 +60,7 @@ describe('DeleteSLO', () => { expect(mockSummaryTransformManager.uninstall).toMatchSnapshot(); expect(mockTransformManager.stop).toMatchSnapshot(); expect(mockTransformManager.uninstall).toMatchSnapshot(); - expect(mockEsClient.ingest.deletePipeline).toMatchSnapshot(); + expect(mockScopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline).toMatchSnapshot(); expect(mockEsClient.deleteByQuery).toMatchSnapshot(); expect(mockRulesClient.bulkDeleteRules).toMatchSnapshot(); expect(mockRepository.deleteById).toMatchSnapshot(); diff --git a/x-pack/plugins/observability_solution/slo/server/services/delete_slo.ts b/x-pack/plugins/observability_solution/slo/server/services/delete_slo.ts index 9bd64727e286b..e86fab0a1620d 100644 --- a/x-pack/plugins/observability_solution/slo/server/services/delete_slo.ts +++ b/x-pack/plugins/observability_solution/slo/server/services/delete_slo.ts @@ -6,7 +6,7 @@ */ import { RulesClientApi } from '@kbn/alerting-plugin/server/types'; -import { ElasticsearchClient } from '@kbn/core/server'; +import { ElasticsearchClient, IScopedClusterClient } from '@kbn/core/server'; import { getSLOPipelineId, getSLOSummaryPipelineId, @@ -25,6 +25,7 @@ export class DeleteSLO { private transformManager: TransformManager, private summaryTransformManager: TransformManager, private esClient: ElasticsearchClient, + private scopedClusterClient: IScopedClusterClient, private rulesClient: RulesClientApi ) {} @@ -40,14 +41,14 @@ export class DeleteSLO { await this.transformManager.uninstall(rollupTransformId); await retryTransientEsErrors(() => - this.esClient.ingest.deletePipeline( + this.scopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline( { id: getSLOPipelineId(slo.id, slo.revision) }, { ignore: [404] } ) ); await retryTransientEsErrors(() => - this.esClient.ingest.deletePipeline( + this.scopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline( { id: getSLOSummaryPipelineId(slo.id, slo.revision) }, { ignore: [404] } ) diff --git a/x-pack/plugins/observability_solution/slo/server/services/get_diagnosis.ts b/x-pack/plugins/observability_solution/slo/server/services/get_diagnosis.ts index 38c183316a591..7a090de252c1d 100644 --- a/x-pack/plugins/observability_solution/slo/server/services/get_diagnosis.ts +++ b/x-pack/plugins/observability_solution/slo/server/services/get_diagnosis.ts @@ -8,17 +8,37 @@ import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { LicensingApiRequestHandlerContext } from '@kbn/licensing-plugin/server'; +export const MINIMUM_INDEX_PRIVILEGE_SET_EDITOR = [ + 'write', + 'read', + 'view_index_metadata', + 'manage', +]; +export const TOTAL_INDEX_PRIVILEGE_SET_EDITOR = [ + 'write', + 'read', + 'read_cross_cluster', + 'view_index_metadata', + 'manage', +]; +export const MINIMUM_INDEX_PRIVILEGE_SET_VIEWER = ['read']; +export const TOTAL_INDEX_PRIVILEGE_SET_VIEWER = ['read', 'read_cross_cluster']; + export async function getGlobalDiagnosis( esClient: ElasticsearchClient, licensing: LicensingApiRequestHandlerContext ) { const licenseInfo = licensing.license.toJSON(); const userWritePrivileges = await esClient.security.hasPrivileges({ - cluster: ['manage_transform', 'manage_ingest_pipelines'], - index: [{ names: '.slo-*', privileges: ['all'] }], + index: [ + { + names: '.slo-observability.*', + privileges: MINIMUM_INDEX_PRIVILEGE_SET_EDITOR, + }, + ], }); const userReadPrivileges = await esClient.security.hasPrivileges({ - index: [{ names: '.slo-*', privileges: ['read'] }], + index: [{ names: '.slo-observability.*', privileges: MINIMUM_INDEX_PRIVILEGE_SET_VIEWER }], }); return { diff --git a/x-pack/plugins/observability_solution/slo/server/services/get_slo_health.test.ts b/x-pack/plugins/observability_solution/slo/server/services/get_slo_health.test.ts index ce1522de40ada..a6553e6f069aa 100644 --- a/x-pack/plugins/observability_solution/slo/server/services/get_slo_health.test.ts +++ b/x-pack/plugins/observability_solution/slo/server/services/get_slo_health.test.ts @@ -4,9 +4,9 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +import type { TransformGetTransformStatsTransformStats } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { ElasticsearchClient } from '@kbn/core/server'; -import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; +import { ScopedClusterClientMock, elasticsearchServiceMock } from '@kbn/core/server/mocks'; import { ALL_VALUE } from '@kbn/slo-schema'; import { getSLOSummaryTransformId, getSLOTransformId } from '../../common/constants'; import { createSLO } from './fixtures/slo'; @@ -22,12 +22,14 @@ import { SLORepository } from './slo_repository'; describe('GetSLOHealth', () => { let mockRepository: jest.Mocked; let mockEsClient: jest.Mocked; + let mockScopedClusterClient: ScopedClusterClientMock; let getSLOHealth: GetSLOHealth; beforeEach(() => { mockRepository = createSLORepositoryMock(); mockEsClient = elasticsearchServiceMock.createElasticsearchClient(); - getSLOHealth = new GetSLOHealth(mockEsClient, mockRepository); + mockScopedClusterClient = elasticsearchServiceMock.createScopedClusterClient(); + getSLOHealth = new GetSLOHealth(mockEsClient, mockScopedClusterClient, mockRepository); }); it('returns the health and state', async () => { @@ -128,10 +130,16 @@ describe('GetSLOHealth', () => { }); // @ts-ignore - mockEsClient.transform.getTransformStats.mockResolvedValue({ + mockScopedClusterClient.asSecondaryAuthUser.transform.getTransformStats.mockResolvedValue({ transforms: [ - { id: getSLOTransformId(slo.id, slo.revision), health: { status: 'green' } }, - { id: getSLOSummaryTransformId(slo.id, slo.revision), health: { status: 'green' } }, + { + id: getSLOTransformId(slo.id, slo.revision), + health: { status: 'green' }, + } as TransformGetTransformStatsTransformStats, + { + id: getSLOSummaryTransformId(slo.id, slo.revision), + health: { status: 'green' }, + } as TransformGetTransformStatsTransformStats, ], }); @@ -179,10 +187,16 @@ describe('GetSLOHealth', () => { }); // @ts-ignore - mockEsClient.transform.getTransformStats.mockResolvedValue({ + mockScopedClusterClient.asSecondaryAuthUser.transform.getTransformStats.mockResolvedValue({ transforms: [ - { id: getSLOTransformId(slo.id, slo.revision), health: { status: 'yellow' } }, - { id: getSLOSummaryTransformId(slo.id, slo.revision), health: { status: 'green' } }, + { + id: getSLOTransformId(slo.id, slo.revision), + health: { status: 'yellow' }, + } as TransformGetTransformStatsTransformStats, + { + id: getSLOSummaryTransformId(slo.id, slo.revision), + health: { status: 'green' }, + } as TransformGetTransformStatsTransformStats, ], }); @@ -240,10 +254,16 @@ describe('GetSLOHealth', () => { }); // @ts-ignore - mockEsClient.transform.getTransformStats.mockResolvedValue({ + mockScopedClusterClient.asSecondaryAuthUser.transform.getTransformStats.mockResolvedValue({ transforms: [ - { id: getSLOTransformId(slo.id, slo.revision), health: { status: 'green' } }, - { id: getSLOSummaryTransformId(slo.id, slo.revision), health: { status: 'green' } }, + { + id: getSLOTransformId(slo.id, slo.revision), + health: { status: 'green' }, + } as TransformGetTransformStatsTransformStats, + { + id: getSLOSummaryTransformId(slo.id, slo.revision), + health: { status: 'green' }, + } as TransformGetTransformStatsTransformStats, ], }); @@ -286,10 +306,16 @@ describe('GetSLOHealth', () => { }); // @ts-ignore - mockEsClient.transform.getTransformStats.mockResolvedValue({ + mockScopedClusterClient.asSecondaryAuthUser.transform.getTransformStats.mockResolvedValue({ transforms: [ - { id: getSLOTransformId(slo.id, slo.revision), health: { status: 'green' } }, - { id: getSLOSummaryTransformId(slo.id, slo.revision), health: { status: 'green' } }, + { + id: getSLOTransformId(slo.id, slo.revision), + health: { status: 'green' }, + } as TransformGetTransformStatsTransformStats, + { + id: getSLOSummaryTransformId(slo.id, slo.revision), + health: { status: 'green' }, + } as TransformGetTransformStatsTransformStats, ], }); @@ -332,10 +358,16 @@ describe('GetSLOHealth', () => { }); // @ts-ignore - mockEsClient.transform.getTransformStats.mockResolvedValue({ + mockScopedClusterClient.asSecondaryAuthUser.transform.getTransformStats.mockResolvedValue({ transforms: [ - { id: getSLOTransformId(slo.id, slo.revision), health: { status: 'green' } }, - { id: getSLOSummaryTransformId(slo.id, slo.revision), health: { status: 'green' } }, + { + id: getSLOTransformId(slo.id, slo.revision), + health: { status: 'green' }, + } as TransformGetTransformStatsTransformStats, + { + id: getSLOSummaryTransformId(slo.id, slo.revision), + health: { status: 'green' }, + } as TransformGetTransformStatsTransformStats, ], }); diff --git a/x-pack/plugins/observability_solution/slo/server/services/get_slo_health.ts b/x-pack/plugins/observability_solution/slo/server/services/get_slo_health.ts index 76493e8a7f4e4..585bf7ef5d4e2 100644 --- a/x-pack/plugins/observability_solution/slo/server/services/get_slo_health.ts +++ b/x-pack/plugins/observability_solution/slo/server/services/get_slo_health.ts @@ -6,7 +6,7 @@ */ import { TransformGetTransformStatsTransformStats } from '@elastic/elasticsearch/lib/api/types'; -import { ElasticsearchClient } from '@kbn/core/server'; +import { ElasticsearchClient, IScopedClusterClient } from '@kbn/core/server'; import { FetchSLOHealthParams, FetchSLOHealthResponse, @@ -28,7 +28,11 @@ const LAG_THRESHOLD_MINUTES = 10; const STALE_THRESHOLD_MINUTES = 2 * 24 * 60; export class GetSLOHealth { - constructor(private esClient: ElasticsearchClient, private repository: SLORepository) {} + constructor( + private esClient: ElasticsearchClient, + private scopedClusterClient: IScopedClusterClient, + private repository: SLORepository + ) {} public async execute(params: FetchSLOHealthParams): Promise { const sloIds = params.list.map(({ sloId }) => sloId); @@ -91,19 +95,20 @@ export class GetSLOHealth { private async getTransformStats( sloList: SLODefinition[] ): Promise> { - const transformStats = await this.esClient.transform.getTransformStats( - { - transform_id: sloList - .map((slo: SLODefinition) => [ - getSLOTransformId(slo.id, slo.revision), - getSLOSummaryTransformId(slo.id, slo.revision), - ]) - .flat(), - allow_no_match: true, - size: sloList.length * 2, - }, - { ignore: [404] } - ); + const transformStats = + await this.scopedClusterClient.asSecondaryAuthUser.transform.getTransformStats( + { + transform_id: sloList + .map((slo: SLODefinition) => [ + getSLOTransformId(slo.id, slo.revision), + getSLOSummaryTransformId(slo.id, slo.revision), + ]) + .flat(), + allow_no_match: true, + size: sloList.length * 2, + }, + { ignore: [404] } + ); return keyBy(transformStats.transforms, (transform) => transform.id); } diff --git a/x-pack/plugins/observability_solution/slo/server/services/reset_slo.test.ts b/x-pack/plugins/observability_solution/slo/server/services/reset_slo.test.ts index 6f9a8dda4a128..efbf3eedb52e1 100644 --- a/x-pack/plugins/observability_solution/slo/server/services/reset_slo.test.ts +++ b/x-pack/plugins/observability_solution/slo/server/services/reset_slo.test.ts @@ -10,6 +10,7 @@ import { elasticsearchServiceMock, httpServiceMock, loggingSystemMock, + ScopedClusterClientMock, } from '@kbn/core/server/mocks'; import { MockedLogger } from '@kbn/logging-mocks'; @@ -31,6 +32,7 @@ describe('ResetSLO', () => { let mockTransformManager: jest.Mocked; let mockSummaryTransformManager: jest.Mocked; let mockEsClient: jest.Mocked; + let mockScopedClusterClient: ScopedClusterClientMock; let loggerMock: jest.Mocked; let resetSLO: ResetSLO; @@ -39,9 +41,11 @@ describe('ResetSLO', () => { mockRepository = createSLORepositoryMock(); mockTransformManager = createTransformManagerMock(); mockEsClient = elasticsearchServiceMock.createElasticsearchClient(); + mockScopedClusterClient = elasticsearchServiceMock.createScopedClusterClient(); mockSummaryTransformManager = createSummaryTransformManagerMock(); resetSLO = new ResetSLO( mockEsClient, + mockScopedClusterClient, mockRepository, mockTransformManager, mockSummaryTransformManager, @@ -76,7 +80,7 @@ describe('ResetSLO', () => { expect(mockSummaryTransformManager.install).toMatchSnapshot(); expect(mockSummaryTransformManager.start).toMatchSnapshot(); - expect(mockEsClient.ingest.putPipeline).toMatchSnapshot(); + expect(mockScopedClusterClient.asSecondaryAuthUser.ingest.putPipeline).toMatchSnapshot(); expect(mockTransformManager.install).toMatchSnapshot(); expect(mockTransformManager.start).toMatchSnapshot(); diff --git a/x-pack/plugins/observability_solution/slo/server/services/reset_slo.ts b/x-pack/plugins/observability_solution/slo/server/services/reset_slo.ts index 3eb5dc6d89672..f69651ff2ad8a 100644 --- a/x-pack/plugins/observability_solution/slo/server/services/reset_slo.ts +++ b/x-pack/plugins/observability_solution/slo/server/services/reset_slo.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ElasticsearchClient, IBasePath, Logger } from '@kbn/core/server'; +import { ElasticsearchClient, IBasePath, Logger, IScopedClusterClient } from '@kbn/core/server'; import { resetSLOResponseSchema } from '@kbn/slo-schema'; import { getSLOPipelineId, @@ -27,6 +27,7 @@ import { TransformManager } from './transform_manager'; export class ResetSLO { constructor( private esClient: ElasticsearchClient, + private scopedClusterClient: IScopedClusterClient, private repository: SLORepository, private transformManager: TransformManager, private summaryTransformManager: TransformManager, @@ -50,7 +51,10 @@ export class ResetSLO { try { await retryTransientEsErrors( - () => this.esClient.ingest.putPipeline(getSLOPipelineTemplate(slo)), + () => + this.scopedClusterClient.asSecondaryAuthUser.ingest.putPipeline( + getSLOPipelineTemplate(slo) + ), { logger: this.logger } ); @@ -59,7 +63,7 @@ export class ResetSLO { await retryTransientEsErrors( () => - this.esClient.ingest.putPipeline( + this.scopedClusterClient.asSecondaryAuthUser.ingest.putPipeline( getSLOSummaryPipelineTemplate(slo, this.spaceId, this.basePath) ), { logger: this.logger } @@ -87,12 +91,12 @@ export class ResetSLO { await this.summaryTransformManager.uninstall(summaryTransformId); await this.transformManager.stop(rollupTransformId); await this.transformManager.uninstall(rollupTransformId); - await this.esClient.ingest.deletePipeline( + await this.scopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline( { id: getSLOSummaryPipelineId(slo.id, slo.revision) }, { ignore: [404] } ); - await this.esClient.ingest.deletePipeline( + await this.scopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline( { id: getSLOPipelineId(slo.id, slo.revision) }, { ignore: [404] } ); diff --git a/x-pack/plugins/observability_solution/slo/server/services/summay_transform_manager.ts b/x-pack/plugins/observability_solution/slo/server/services/summay_transform_manager.ts index 5529591a81e20..27d24e7fb5039 100644 --- a/x-pack/plugins/observability_solution/slo/server/services/summay_transform_manager.ts +++ b/x-pack/plugins/observability_solution/slo/server/services/summay_transform_manager.ts @@ -6,7 +6,7 @@ */ import { TransformPutTransformRequest } from '@elastic/elasticsearch/lib/api/types'; -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import { IScopedClusterClient, Logger } from '@kbn/core/server'; import { SLODefinition } from '../domain/models'; import { SecurityException } from '../errors'; import { retryTransientEsErrors } from '../utils/retry'; @@ -18,16 +18,19 @@ type TransformId = string; export class DefaultSummaryTransformManager implements TransformManager { constructor( private generator: SummaryTransformGenerator, - private esClient: ElasticsearchClient, + private scopedClusterClient: IScopedClusterClient, private logger: Logger ) {} async install(slo: SLODefinition): Promise { const transformParams = await this.generator.generate(slo); try { - await retryTransientEsErrors(() => this.esClient.transform.putTransform(transformParams), { - logger: this.logger, - }); + await retryTransientEsErrors( + () => this.scopedClusterClient.asSecondaryAuthUser.transform.putTransform(transformParams), + { + logger: this.logger, + } + ); } catch (err) { this.logger.error(`Cannot create summary transform for SLO [${slo.id}]`); if (err.meta?.body?.error?.type === 'security_exception') { @@ -47,7 +50,10 @@ export class DefaultSummaryTransformManager implements TransformManager { async preview(transformId: string): Promise { try { await retryTransientEsErrors( - () => this.esClient.transform.previewTransform({ transform_id: transformId }), + () => + this.scopedClusterClient.asSecondaryAuthUser.transform.previewTransform({ + transform_id: transformId, + }), { logger: this.logger } ); } catch (err) { @@ -60,8 +66,13 @@ export class DefaultSummaryTransformManager implements TransformManager { try { await retryTransientEsErrors( () => - this.esClient.transform.startTransform({ transform_id: transformId }, { ignore: [409] }), - { logger: this.logger } + this.scopedClusterClient.asSecondaryAuthUser.transform.startTransform( + { transform_id: transformId }, + { ignore: [409] } + ), + { + logger: this.logger, + } ); } catch (err) { this.logger.error(`Cannot start SLO summary transform [${transformId}]`); @@ -73,7 +84,7 @@ export class DefaultSummaryTransformManager implements TransformManager { try { await retryTransientEsErrors( () => - this.esClient.transform.stopTransform( + this.scopedClusterClient.asSecondaryAuthUser.transform.stopTransform( { transform_id: transformId, wait_for_completion: true, force: true }, { ignore: [404] } ), @@ -89,7 +100,7 @@ export class DefaultSummaryTransformManager implements TransformManager { try { await retryTransientEsErrors( () => - this.esClient.transform.deleteTransform( + this.scopedClusterClient.asSecondaryAuthUser.transform.deleteTransform( { transform_id: transformId, force: true }, { ignore: [404] } ), diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_manager.test.ts b/x-pack/plugins/observability_solution/slo/server/services/transform_manager.test.ts index 7e6cf50c169fa..b7b5d7ba4fcd9 100644 --- a/x-pack/plugins/observability_solution/slo/server/services/transform_manager.test.ts +++ b/x-pack/plugins/observability_solution/slo/server/services/transform_manager.test.ts @@ -7,7 +7,7 @@ /* eslint-disable max-classes-per-file */ import { - ElasticsearchClientMock, + ScopedClusterClientMock, elasticsearchServiceMock, loggingSystemMock, } from '@kbn/core/server/mocks'; @@ -30,12 +30,12 @@ import { dataViewsService } from '@kbn/data-views-plugin/server/mocks'; import { DataViewsService } from '@kbn/data-views-plugin/common'; describe('TransformManager', () => { - let esClientMock: ElasticsearchClientMock; + let scopedClusterClientMock: ScopedClusterClientMock; let loggerMock: jest.Mocked; const spaceId = 'default'; beforeEach(() => { - esClientMock = elasticsearchServiceMock.createElasticsearchClient(); + scopedClusterClientMock = elasticsearchServiceMock.createScopedClusterClient(); loggerMock = loggingSystemMock.createLogger(); }); @@ -48,7 +48,7 @@ describe('TransformManager', () => { }; const service = new DefaultTransformManager( generators, - esClientMock, + scopedClusterClientMock, loggerMock, spaceId, dataViewsService @@ -66,7 +66,7 @@ describe('TransformManager', () => { }; const transformManager = new DefaultTransformManager( generators, - esClientMock, + scopedClusterClientMock, loggerMock, spaceId, dataViewsService @@ -87,7 +87,7 @@ describe('TransformManager', () => { }; const transformManager = new DefaultTransformManager( generators, - esClientMock, + scopedClusterClientMock, loggerMock, spaceId, dataViewsService @@ -96,7 +96,9 @@ describe('TransformManager', () => { const transformId = await transformManager.install(slo); - expect(esClientMock.transform.putTransform).toHaveBeenCalledTimes(1); + expect( + scopedClusterClientMock.asSecondaryAuthUser.transform.putTransform + ).toHaveBeenCalledTimes(1); expect(transformId).toBe(`slo-${slo.id}-${slo.revision}`); }); }); @@ -109,7 +111,7 @@ describe('TransformManager', () => { }; const transformManager = new DefaultTransformManager( generators, - esClientMock, + scopedClusterClientMock, loggerMock, spaceId, dataViewsService @@ -117,7 +119,9 @@ describe('TransformManager', () => { await transformManager.preview('slo-transform-id'); - expect(esClientMock.transform.previewTransform).toHaveBeenCalledTimes(1); + expect( + scopedClusterClientMock.asSecondaryAuthUser.transform.previewTransform + ).toHaveBeenCalledTimes(1); }); }); @@ -129,7 +133,7 @@ describe('TransformManager', () => { }; const transformManager = new DefaultTransformManager( generators, - esClientMock, + scopedClusterClientMock, loggerMock, spaceId, dataViewsService @@ -137,7 +141,9 @@ describe('TransformManager', () => { await transformManager.start('slo-transform-id'); - expect(esClientMock.transform.startTransform).toHaveBeenCalledTimes(1); + expect( + scopedClusterClientMock.asSecondaryAuthUser.transform.startTransform + ).toHaveBeenCalledTimes(1); }); }); @@ -149,7 +155,7 @@ describe('TransformManager', () => { }; const transformManager = new DefaultTransformManager( generators, - esClientMock, + scopedClusterClientMock, loggerMock, spaceId, dataViewsService @@ -157,7 +163,9 @@ describe('TransformManager', () => { await transformManager.stop('slo-transform-id'); - expect(esClientMock.transform.stopTransform).toHaveBeenCalledTimes(1); + expect( + scopedClusterClientMock.asSecondaryAuthUser.transform.stopTransform + ).toHaveBeenCalledTimes(1); }); }); @@ -169,7 +177,7 @@ describe('TransformManager', () => { }; const transformManager = new DefaultTransformManager( generators, - esClientMock, + scopedClusterClientMock, loggerMock, spaceId, dataViewsService @@ -177,11 +185,13 @@ describe('TransformManager', () => { await transformManager.uninstall('slo-transform-id'); - expect(esClientMock.transform.deleteTransform).toHaveBeenCalledTimes(1); + expect( + scopedClusterClientMock.asSecondaryAuthUser.transform.deleteTransform + ).toHaveBeenCalledTimes(1); }); it('retries on transient error', async () => { - esClientMock.transform.deleteTransform.mockRejectedValueOnce( + scopedClusterClientMock.asSecondaryAuthUser.transform.deleteTransform.mockRejectedValueOnce( new EsErrors.ConnectionError('irrelevant') ); // @ts-ignore defining only a subset of the possible SLI @@ -190,7 +200,7 @@ describe('TransformManager', () => { }; const transformManager = new DefaultTransformManager( generators, - esClientMock, + scopedClusterClientMock, loggerMock, spaceId, dataViewsService @@ -198,7 +208,9 @@ describe('TransformManager', () => { await transformManager.uninstall('slo-transform-id'); - expect(esClientMock.transform.deleteTransform).toHaveBeenCalledTimes(2); + expect( + scopedClusterClientMock.asSecondaryAuthUser.transform.deleteTransform + ).toHaveBeenCalledTimes(2); }); }); }); diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_manager.ts b/x-pack/plugins/observability_solution/slo/server/services/transform_manager.ts index 822817962a2e9..7e5ddce8bcad6 100644 --- a/x-pack/plugins/observability_solution/slo/server/services/transform_manager.ts +++ b/x-pack/plugins/observability_solution/slo/server/services/transform_manager.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import { IScopedClusterClient, Logger } from '@kbn/core/server'; import { TransformPutTransformRequest } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { DataViewsService } from '@kbn/data-views-plugin/server'; @@ -28,7 +28,7 @@ export interface TransformManager { export class DefaultTransformManager implements TransformManager { constructor( private generators: Record, - private esClient: ElasticsearchClient, + private scopedClusterClient: IScopedClusterClient, private logger: Logger, private spaceId: string, private dataViewService: DataViewsService @@ -47,9 +47,12 @@ export class DefaultTransformManager implements TransformManager { this.dataViewService ); try { - await retryTransientEsErrors(() => this.esClient.transform.putTransform(transformParams), { - logger: this.logger, - }); + await retryTransientEsErrors( + () => this.scopedClusterClient.asSecondaryAuthUser.transform.putTransform(transformParams), + { + logger: this.logger, + } + ); } catch (err) { this.logger.error(`Cannot create SLO transform for indicator type [${slo.indicator.type}]`); if (err.meta?.body?.error?.type === 'security_exception') { @@ -75,7 +78,10 @@ export class DefaultTransformManager implements TransformManager { async preview(transformId: string): Promise { try { await retryTransientEsErrors( - () => this.esClient.transform.previewTransform({ transform_id: transformId }), + () => + this.scopedClusterClient.asSecondaryAuthUser.transform.previewTransform({ + transform_id: transformId, + }), { logger: this.logger } ); } catch (err) { @@ -88,7 +94,10 @@ export class DefaultTransformManager implements TransformManager { try { await retryTransientEsErrors( () => - this.esClient.transform.startTransform({ transform_id: transformId }, { ignore: [409] }), + this.scopedClusterClient.asSecondaryAuthUser.transform.startTransform( + { transform_id: transformId }, + { ignore: [409] } + ), { logger: this.logger } ); await this.scheduleNowTransform(transformId); @@ -102,7 +111,7 @@ export class DefaultTransformManager implements TransformManager { try { await retryTransientEsErrors( () => - this.esClient.transform.stopTransform( + this.scopedClusterClient.asSecondaryAuthUser.transform.stopTransform( { transform_id: transformId, wait_for_completion: true, force: true }, { ignore: [404] } ), @@ -118,7 +127,7 @@ export class DefaultTransformManager implements TransformManager { try { await retryTransientEsErrors( () => - this.esClient.transform.deleteTransform( + this.scopedClusterClient.asSecondaryAuthUser.transform.deleteTransform( { transform_id: transformId, force: true }, { ignore: [404] } ), @@ -131,7 +140,7 @@ export class DefaultTransformManager implements TransformManager { } async scheduleNowTransform(transformId: TransformId) { - this.esClient.transform + this.scopedClusterClient.asSecondaryAuthUser.transform .scheduleNowTransform({ transform_id: transformId }) .then(() => { this.logger.debug(`SLO transform [${transformId}] scheduled now successfully`); diff --git a/x-pack/plugins/observability_solution/slo/server/services/update_slo.test.ts b/x-pack/plugins/observability_solution/slo/server/services/update_slo.test.ts index 7f8f8ff1e3150..37855bd4d8fa4 100644 --- a/x-pack/plugins/observability_solution/slo/server/services/update_slo.test.ts +++ b/x-pack/plugins/observability_solution/slo/server/services/update_slo.test.ts @@ -10,6 +10,7 @@ import { elasticsearchServiceMock, httpServiceMock, loggingSystemMock, + ScopedClusterClientMock, } from '@kbn/core/server/mocks'; import { MockedLogger } from '@kbn/logging-mocks'; import { UpdateSLOParams } from '@kbn/slo-schema'; @@ -42,6 +43,7 @@ describe('UpdateSLO', () => { let mockRepository: jest.Mocked; let mockTransformManager: jest.Mocked; let mockEsClient: jest.Mocked; + let mockScopedClusterClient: ScopedClusterClientMock; let mockLogger: jest.Mocked; let mockSummaryTransformManager: jest.Mocked; let updateSLO: UpdateSLO; @@ -52,11 +54,13 @@ describe('UpdateSLO', () => { mockLogger = loggingSystemMock.createLogger(); mockSummaryTransformManager = createSummaryTransformManagerMock(); mockEsClient = elasticsearchServiceMock.createElasticsearchClient(); + mockScopedClusterClient = elasticsearchServiceMock.createScopedClusterClient(); updateSLO = new UpdateSLO( mockRepository, mockTransformManager, mockSummaryTransformManager, mockEsClient, + mockScopedClusterClient, mockLogger, 'some-space', httpServiceMock.createStartContract().basePath @@ -76,7 +80,7 @@ describe('UpdateSLO', () => { expect(mockSummaryTransformManager.start).not.toBeCalled(); expect(mockEsClient.deleteByQuery).not.toBeCalled(); - expect(mockEsClient.ingest.putPipeline).not.toBeCalled(); + expect(mockScopedClusterClient.asSecondaryAuthUser.ingest.putPipeline).not.toBeCalled(); } it('returns early with a fully identical SLO payload', async () => { @@ -313,7 +317,9 @@ describe('UpdateSLO', () => { ).rejects.toThrowError('Transform install error'); expect(mockRepository.save).toHaveBeenCalledWith(originalSlo); - expect(mockEsClient.ingest.deletePipeline).toHaveBeenCalledTimes(1); // for the sli only + expect( + mockScopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline + ).toHaveBeenCalledTimes(1); // for the sli only expect(mockSummaryTransformManager.stop).not.toHaveBeenCalled(); expect(mockSummaryTransformManager.uninstall).not.toHaveBeenCalled(); @@ -339,7 +345,7 @@ describe('UpdateSLO', () => { expect(mockRepository.save).toHaveBeenCalledWith(originalSlo); expect(mockSummaryTransformManager.uninstall).toHaveBeenCalled(); - expect(mockEsClient.ingest.deletePipeline).toHaveBeenCalled(); + expect(mockScopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline).toHaveBeenCalled(); expect(mockTransformManager.stop).toHaveBeenCalled(); expect(mockTransformManager.uninstall).toHaveBeenCalled(); @@ -351,7 +357,7 @@ describe('UpdateSLO', () => { expect(mockTransformManager.install).toHaveBeenCalled(); expect(mockTransformManager.start).toHaveBeenCalled(); - expect(mockEsClient.ingest.putPipeline).toHaveBeenCalled(); + expect(mockScopedClusterClient.asSecondaryAuthUser.ingest.putPipeline).toHaveBeenCalled(); expect(mockSummaryTransformManager.install).toHaveBeenCalled(); expect(mockSummaryTransformManager.start).toHaveBeenCalled(); @@ -368,7 +374,7 @@ describe('UpdateSLO', () => { expect(mockSummaryTransformManager.stop).toHaveBeenCalledWith(summaryTransformId); expect(mockSummaryTransformManager.uninstall).toHaveBeenCalledWith(summaryTransformId); - expect(mockEsClient.ingest.deletePipeline).toHaveBeenCalled(); + expect(mockScopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline).toHaveBeenCalled(); expect(mockEsClient.deleteByQuery).toHaveBeenCalledTimes(2); expect(mockEsClient.deleteByQuery).toHaveBeenNthCalledWith( diff --git a/x-pack/plugins/observability_solution/slo/server/services/update_slo.ts b/x-pack/plugins/observability_solution/slo/server/services/update_slo.ts index 3175402eb1476..0f1967800d1df 100644 --- a/x-pack/plugins/observability_solution/slo/server/services/update_slo.ts +++ b/x-pack/plugins/observability_solution/slo/server/services/update_slo.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ElasticsearchClient, IBasePath, Logger } from '@kbn/core/server'; +import { ElasticsearchClient, IBasePath, Logger, IScopedClusterClient } from '@kbn/core/server'; import { UpdateSLOParams, UpdateSLOResponse, updateSLOResponseSchema } from '@kbn/slo-schema'; import { asyncForEach } from '@kbn/std'; import { isEqual, pick } from 'lodash'; @@ -34,6 +34,7 @@ export class UpdateSLO { private transformManager: TransformManager, private summaryTransformManager: TransformManager, private esClient: ElasticsearchClient, + private scopedClusterClient: IScopedClusterClient, private logger: Logger, private spaceId: string, private basePath: IBasePath @@ -77,11 +78,14 @@ export class UpdateSLO { try { await retryTransientEsErrors( - () => this.esClient.ingest.putPipeline(getSLOPipelineTemplate(updatedSlo)), + () => + this.scopedClusterClient.asSecondaryAuthUser.ingest.putPipeline( + getSLOPipelineTemplate(updatedSlo) + ), { logger: this.logger } ); rollbackOperations.push(() => - this.esClient.ingest.deletePipeline( + this.scopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline( { id: getSLOPipelineId(updatedSlo.id, updatedSlo.revision) }, { ignore: [404] } ) @@ -89,7 +93,7 @@ export class UpdateSLO { await retryTransientEsErrors( () => - this.esClient.ingest.putPipeline( + this.scopedClusterClient.asSecondaryAuthUser.ingest.putPipeline( getSLOSummaryPipelineTemplate(updatedSlo, this.spaceId, this.basePath) ), { logger: this.logger } @@ -122,11 +126,14 @@ export class UpdateSLO { try { await retryTransientEsErrors( - () => this.esClient.ingest.putPipeline(getSLOPipelineTemplate(updatedSlo)), + () => + this.scopedClusterClient.asSecondaryAuthUser.ingest.putPipeline( + getSLOPipelineTemplate(updatedSlo) + ), { logger: this.logger } ); rollbackOperations.push(() => - this.esClient.ingest.deletePipeline( + this.scopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline( { id: getSLOPipelineId(updatedSlo.id, updatedSlo.revision) }, { ignore: [404] } ) @@ -140,13 +147,13 @@ export class UpdateSLO { await retryTransientEsErrors( () => - this.esClient.ingest.putPipeline( + this.scopedClusterClient.asSecondaryAuthUser.ingest.putPipeline( getSLOSummaryPipelineTemplate(updatedSlo, this.spaceId, this.basePath) ), { logger: this.logger } ); rollbackOperations.push(() => - this.esClient.ingest.deletePipeline( + this.scopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline( { id: getSLOSummaryPipelineId(updatedSlo.id, updatedSlo.revision) }, { ignore: [404] } ) @@ -208,12 +215,12 @@ export class UpdateSLO { await this.summaryTransformManager.stop(originalSummaryTransformId); await this.summaryTransformManager.uninstall(originalSummaryTransformId); - await this.esClient.ingest.deletePipeline( + await this.scopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline( { id: getSLOSummaryPipelineId(originalSlo.id, originalSlo.revision) }, { ignore: [404] } ); - await this.esClient.ingest.deletePipeline( + await this.scopedClusterClient.asSecondaryAuthUser.ingest.deletePipeline( { id: getSLOPipelineId(originalSlo.id, originalSlo.revision) }, { ignore: [404] } ); diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx index e16633fed2444..da28ccc325ca3 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx +++ b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx @@ -9,6 +9,8 @@ import { EuiFlexGroup, EuiSpacer, EuiFlexItem } from '@elastic/eui'; import { useDispatch, useSelector } from 'react-redux'; import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { Redirect, useLocation } from 'react-router-dom'; +import { usePageReady } from '@kbn/ebt-tools'; +import { selectOverviewStatus } from '../../../state/overview_status'; import { DisabledCallout } from '../management/disabled_callout'; import { FilterGroup } from '../common/monitor_filters/filter_group'; import { OverviewAlerts } from './overview/overview_alerts'; @@ -45,6 +47,9 @@ export const OverviewPage: React.FC = () => { const { search } = useLocation(); const { loading: locationsLoading, locationsLoaded } = useSelector(selectServiceLocationsState); + const { loaded } = useSelector(selectOverviewStatus); + + usePageReady({ isReady: loaded }); useEffect(() => { if (!locationsLoading && !locationsLoaded) { diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/synthetics_app.tsx b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/synthetics_app.tsx index 61cf6b69763da..014043efa5cee 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/synthetics_app.tsx +++ b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/synthetics_app.tsx @@ -14,6 +14,7 @@ import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; import { Router } from '@kbn/shared-ux-router'; +import { PerformanceContextProvider } from '@kbn/ebt-tools'; import { SyntheticsSharedContext } from './contexts/synthetics_shared_context'; import { kibanaService } from '../../utils/kibana_service'; import { ActionMenu } from './components/common/header/action_menu'; @@ -72,13 +73,15 @@ const Application = (props: SyntheticsAppProps) => { -
    - - - - - -
    + +
    + + + + + +
    +
    diff --git a/x-pack/plugins/observability_solution/synthetics/common/config.ts b/x-pack/plugins/observability_solution/synthetics/server/config.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/config.ts rename to x-pack/plugins/observability_solution/synthetics/server/config.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/index.ts b/x-pack/plugins/observability_solution/synthetics/server/index.ts index 80cbe388a3015..e785ba27a3681 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/index.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/index.ts @@ -11,4 +11,4 @@ export const plugin = async (initializerContext: PluginInitializerContext) => { return new Plugin(initializerContext); }; -export { config } from '../common/config'; +export { config } from './config'; diff --git a/x-pack/plugins/observability_solution/synthetics/server/plugin.ts b/x-pack/plugins/observability_solution/synthetics/server/plugin.ts index 29dc85e4aa0f9..e3c0ad1ef7bf6 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/plugin.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/plugin.ts @@ -25,7 +25,7 @@ import { SyntheticsMonitorClient } from './synthetics_service/synthetics_monitor import { initSyntheticsServer } from './server'; import { syntheticsFeature } from './feature'; import { registerSyntheticsSavedObjects } from './saved_objects/saved_objects'; -import { UptimeConfig } from '../common/config'; +import { UptimeConfig } from './config'; import { SyntheticsService } from './synthetics_service/synthetics_service'; import { syntheticsServiceApiKey } from './saved_objects/service_api_key'; import { SYNTHETICS_RULE_TYPES_ALERT_CONTEXT } from '../common/constants/synthetics_alerts'; diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/common.test.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/common.test.ts new file mode 100644 index 0000000000000..82520c68b5fc4 --- /dev/null +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/common.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 { getSavedObjectKqlFilter } from './common'; + +describe('getSavedObjectKqlFilter', () => { + it('returns empty string if no values are provided', () => { + expect(getSavedObjectKqlFilter({ field: 'tags' })).toBe(''); + }); + + it('returns KQL string if values are provided', () => { + expect(getSavedObjectKqlFilter({ field: 'tags', values: 'apm' })).toBe( + 'synthetics-monitor.attributes.tags:"apm"' + ); + }); + + it('searches at root when specified', () => { + expect(getSavedObjectKqlFilter({ field: 'tags', values: 'apm', searchAtRoot: true })).toBe( + 'tags:"apm"' + ); + }); + + it('handles array values', () => { + expect(getSavedObjectKqlFilter({ field: 'tags', values: ['apm', 'synthetics'] })).toBe( + 'synthetics-monitor.attributes.tags:("apm" OR "synthetics")' + ); + }); + + it('escapes quotes', () => { + expect(getSavedObjectKqlFilter({ field: 'tags', values: ['"apm', 'synthetics'] })).toBe( + 'synthetics-monitor.attributes.tags:("\\"apm" OR "synthetics")' + ); + }); +}); diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/common.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/common.ts index 491b67160677e..bc58a866bef83 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/common.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/common.ts @@ -7,6 +7,7 @@ import { schema, TypeOf } from '@kbn/config-schema'; import { SavedObjectsFindResponse } from '@kbn/core/server'; +import { escapeQuotes } from '@kbn/es-query'; import { RouteContext } from './types'; import { MonitorSortFieldSchema } from '../../common/runtime_types/monitor_management/sort_field'; import { getAllLocations } from '../synthetics_service/get_all_locations'; @@ -132,19 +133,19 @@ export const getMonitorFilters = async ({ const filtersStr = [ filter, - getKqlFilter({ field: 'tags', values: tags }), - getKqlFilter({ field: 'project_id', values: projects }), - getKqlFilter({ field: 'type', values: monitorTypes }), - getKqlFilter({ field: 'locations.id', values: locationFilter }), - getKqlFilter({ field: 'schedule.number', values: schedules }), - getKqlFilter({ field: 'id', values: monitorQueryIds }), + getSavedObjectKqlFilter({ field: 'tags', values: tags }), + getSavedObjectKqlFilter({ field: 'project_id', values: projects }), + getSavedObjectKqlFilter({ field: 'type', values: monitorTypes }), + getSavedObjectKqlFilter({ field: 'locations.id', values: locationFilter }), + getSavedObjectKqlFilter({ field: 'schedule.number', values: schedules }), + getSavedObjectKqlFilter({ field: 'id', values: monitorQueryIds }), ] .filter((f) => !!f) .join(' AND '); return { filtersStr, locationFilter }; }; -export const getKqlFilter = ({ +export const getSavedObjectKqlFilter = ({ field, values, operator = 'OR', @@ -166,10 +167,12 @@ export const getKqlFilter = ({ } if (Array.isArray(values)) { - return ` (${fieldKey}:"${values.join(`" ${operator} ${fieldKey}:"`)}" )`; + return `${fieldKey}:(${values + .map((value) => `"${escapeQuotes(value)}"`) + .join(` ${operator} `)})`; } - return `${fieldKey}:"${values}"`; + return `${fieldKey}:"${escapeQuotes(values)}"`; }; const parseLocationFilter = async (context: RouteContext, locations?: string | string[]) => { diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor/add_monitor_api.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor/add_monitor_api.ts index 1c38e093237e1..359f3373cfd35 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor/add_monitor_api.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor/add_monitor_api.ts @@ -12,7 +12,7 @@ import { isValidNamespace } from '@kbn/fleet-plugin/common'; import { i18n } from '@kbn/i18n'; import { parseMonitorLocations } from './utils'; import { MonitorValidationError } from '../monitor_validation'; -import { getKqlFilter } from '../../common'; +import { getSavedObjectKqlFilter } from '../../common'; import { deleteMonitor } from '../delete_monitor'; import { monitorAttributes, syntheticsMonitorType } from '../../../../common/types/saved_objects'; import { PrivateLocationAttributes } from '../../../runtime_types/private_locations'; @@ -238,7 +238,7 @@ export class AddEditMonitorAPI { async validateUniqueMonitorName(name: string, id?: string) { const { savedObjectsClient } = this.routeContext; - const kqlFilter = getKqlFilter({ field: 'name.keyword', values: name }); + const kqlFilter = getSavedObjectKqlFilter({ field: 'name.keyword', values: name }); const { total } = await savedObjectsClient.find({ perPage: 0, type: syntheticsMonitorType, diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/delete_monitor_project.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/delete_monitor_project.ts index b5c8dc2b4f0b1..2136634be7ef7 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/delete_monitor_project.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/delete_monitor_project.ts @@ -10,7 +10,7 @@ import { SyntheticsRestApiRouteFactory } from '../types'; import { syntheticsMonitorType } from '../../../common/types/saved_objects'; import { ConfigKey } from '../../../common/runtime_types'; import { SYNTHETICS_API_URLS } from '../../../common/constants'; -import { getMonitors, getKqlFilter } from '../common'; +import { getMonitors, getSavedObjectKqlFilter } from '../common'; import { deleteMonitorBulk } from './bulk_cruds/delete_monitor_bulk'; export const deleteSyntheticsMonitorProjectRoute: SyntheticsRestApiRouteFactory = () => ({ @@ -39,7 +39,7 @@ export const deleteSyntheticsMonitorProjectRoute: SyntheticsRestApiRouteFactory const deleteFilter = `${syntheticsMonitorType}.attributes.${ ConfigKey.PROJECT_ID - }: "${decodedProjectName}" AND ${getKqlFilter({ + }: "${decodedProjectName}" AND ${getSavedObjectKqlFilter({ field: 'journey_id', values: monitorsToDelete.map((id: string) => `${id}`), })}`; diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/get_location_monitors.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/get_location_monitors.ts index de96ba8eb9438..6701946c8a6d6 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/get_location_monitors.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/get_location_monitors.ts @@ -6,7 +6,7 @@ */ import { ALL_SPACES_ID } from '@kbn/spaces-plugin/common/constants'; -import { getKqlFilter } from '../../common'; +import { getSavedObjectKqlFilter } from '../../common'; import { SyntheticsRestApiRouteFactory } from '../../types'; import { SYNTHETICS_API_URLS } from '../../../../common/constants'; import { monitorAttributes, syntheticsMonitorType } from '../../../../common/types/saved_objects'; @@ -47,7 +47,7 @@ export const getLocationMonitors: SyntheticsRestApiRouteFactory = () => export const getMonitorsByLocation = async (server: SyntheticsServerSetup, locationId?: string) => { const soClient = server.coreStart.savedObjects.createInternalRepository(); - const locationFilter = getKqlFilter({ field: 'locations.id', values: locationId }); + const locationFilter = getSavedObjectKqlFilter({ field: 'locations.id', values: locationId }); const locationMonitors = await soClient.find({ type: syntheticsMonitorType, diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_es_hosts.ts b/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_es_hosts.ts index 23a3f5aaf27ce..32faa634df518 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_es_hosts.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_es_hosts.ts @@ -13,7 +13,7 @@ */ import type { CloudSetup } from '@kbn/cloud-plugin/server'; -import { ServiceConfig } from '../../common/config'; +import { ServiceConfig } from '../config'; export function getEsHosts({ cloud, diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts b/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts index fd59e7a0ec40a..6069076e375a2 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts @@ -11,7 +11,7 @@ import { } from '@kbn/core/server'; import { i18n } from '@kbn/i18n'; import { EncryptedSavedObjectsClient } from '@kbn/encrypted-saved-objects-plugin/server'; -import { getKqlFilter } from '../../routes/common'; +import { getSavedObjectKqlFilter } from '../../routes/common'; import { InvalidLocationError } from './normalizers/common_fields'; import { SyntheticsServerSetup } from '../../types'; import { RouteContext } from '../../routes/types'; @@ -337,7 +337,10 @@ export class ProjectMonitorFormatter { monitors: Array> ) => { const configIds = monitors.map((monitor) => monitor.attributes[ConfigKey.CONFIG_ID]); - const monitorFilter = getKqlFilter({ field: ConfigKey.CONFIG_ID, values: configIds }); + const monitorFilter = getSavedObjectKqlFilter({ + field: ConfigKey.CONFIG_ID, + values: configIds, + }); const finder = await this.encryptedSavedObjectsClient.createPointInTimeFinderDecryptedAsInternalUser( { diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/service_api_client.test.ts b/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/service_api_client.test.ts index 66ef4e9faa0c8..93b3ca2fb3742 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/service_api_client.test.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/service_api_client.test.ts @@ -10,7 +10,7 @@ import { CoreStart } from '@kbn/core/server'; import { coreMock } from '@kbn/core/server/mocks'; import { Logger } from '@kbn/core/server'; import { ServiceAPIClient } from './service_api_client'; -import { ServiceConfig } from '../../common/config'; +import { ServiceConfig } from '../config'; import axios from 'axios'; import { LocationStatus, PublicLocations } from '../../common/runtime_types'; import { LicenseGetResponse } from '@elastic/elasticsearch/lib/api/types'; diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/service_api_client.ts b/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/service_api_client.ts index 09ad88476ec06..3d334f32e9407 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/service_api_client.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/service_api_client.ts @@ -24,7 +24,7 @@ import { ServiceLocation, ServiceLocationErrors, } from '../../common/runtime_types'; -import { ServiceConfig } from '../../common/config'; +import { ServiceConfig } from '../config'; const TEST_SERVICE_USERNAME = 'localKibanaIntegrationTestsUser'; diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/synthetics_service.ts b/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/synthetics_service.ts index 35bf0d9dc7ce6..be72ca4d9a496 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/synthetics_service.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/synthetics_service.ts @@ -25,7 +25,7 @@ import { sendErrorTelemetryEvents } from '../routes/telemetry/monitor_upgrade_se import { installSyntheticsIndexTemplates } from '../routes/synthetics_service/install_index_templates'; import { getAPIKeyForSyntheticsService } from './get_api_key'; import { getEsHosts } from './get_es_hosts'; -import { ServiceConfig } from '../../common/config'; +import { ServiceConfig } from '../config'; import { ServiceAPIClient, ServiceData } from './service_api_client'; import { diff --git a/x-pack/plugins/observability_solution/synthetics/server/types.ts b/x-pack/plugins/observability_solution/synthetics/server/types.ts index 2e1fac95023b9..032cee048e8bd 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/types.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/types.ts @@ -38,7 +38,7 @@ import { TaskManagerStartContract, } from '@kbn/task-manager-plugin/server'; import { TelemetryEventsSender } from './telemetry/sender'; -import { UptimeConfig } from '../common/config'; +import { UptimeConfig } from './config'; import { SyntheticsEsClient } from './lib'; export interface SyntheticsServerSetup { diff --git a/x-pack/plugins/observability_solution/synthetics/tsconfig.json b/x-pack/plugins/observability_solution/synthetics/tsconfig.json index 500bb735ddc58..8446b7850d3a9 100644 --- a/x-pack/plugins/observability_solution/synthetics/tsconfig.json +++ b/x-pack/plugins/observability_solution/synthetics/tsconfig.json @@ -98,7 +98,8 @@ "@kbn/presentation-util-plugin", "@kbn/core-application-browser", "@kbn/dashboard-plugin", - "@kbn/slo-plugin" + "@kbn/slo-plugin", + "@kbn/ebt-tools" ], "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/uptime_app.tsx b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/uptime_app.tsx index 1f4be8fa943f0..3ce07ac9803f7 100644 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/uptime_app.tsx +++ b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/uptime_app.tsx @@ -16,6 +16,7 @@ import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { InspectorContextProvider } from '@kbn/observability-shared-plugin/public'; +import { PerformanceContextProvider } from '@kbn/ebt-tools'; import { ClientPluginsSetup, ClientPluginsStart } from '../../plugin'; import { UMUpdateBadge } from '../lib/lib'; import { @@ -133,19 +134,21 @@ const Application = (props: UptimeAppProps) => { -
    - - - - - - - -
    + +
    + + + + + + + +
    +
    diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_container.tsx b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_container.tsx index 8447f1c9d3e71..78fbdc686050e 100644 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_container.tsx +++ b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_container.tsx @@ -7,6 +7,7 @@ import React, { useContext, useEffect, useState } from 'react'; import { useSelector, useDispatch } from 'react-redux'; +import { usePageReady } from '@kbn/ebt-tools'; import { getMonitorList } from '../../../state/actions'; import { esKuerySelector, monitorListSelector } from '../../../state/selectors'; import { MonitorListComponent } from './monitor_list'; @@ -46,6 +47,8 @@ export const MonitorList: React.FC = (props) => { const monitorList = useSelector(monitorListSelector); useMappingCheck(monitorList.error); + usePageReady({ isReady: Boolean(monitorList.isLoaded) }); + useEffect(() => { filterCheck(() => dispatch( diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/overview.test.tsx b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/overview.test.tsx index 57ca69c0de184..9999215d02e8f 100644 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/overview.test.tsx +++ b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/overview.test.tsx @@ -9,6 +9,10 @@ import React from 'react'; import { OverviewPageComponent } from './overview'; import { render } from '../lib/helper/rtl_helpers'; +jest.mock('@kbn/ebt-tools', () => ({ + usePageReady: jest.fn(), +})); + describe('MonitorPage', () => { it('renders expected elements for valid props', async () => { const { findByText } = render(); diff --git a/x-pack/plugins/observability_solution/uptime/public/plugin.ts b/x-pack/plugins/observability_solution/uptime/public/plugin.ts index b02ee95e12032..b2558fe83e33b 100644 --- a/x-pack/plugins/observability_solution/uptime/public/plugin.ts +++ b/x-pack/plugins/observability_solution/uptime/public/plugin.ts @@ -311,7 +311,7 @@ function setUptimeAppStatus( } else { const hasUptimePrivileges = coreStart.application.capabilities.uptime?.show; if (hasUptimePrivileges) { - const indexStatusPromise = UptimeDataHelper(coreStart).indexStatus('now-7d', 'now'); + const indexStatusPromise = UptimeDataHelper(coreStart).indexStatus('now-7d/d', 'now/d'); indexStatusPromise.then((indexStatus) => { if (indexStatus.indexExists) { registerUptimeRoutesWithNavigation(coreStart, pluginsStart); diff --git a/x-pack/plugins/observability_solution/uptime/tsconfig.json b/x-pack/plugins/observability_solution/uptime/tsconfig.json index f797a5a7f930d..8fa4d21627252 100644 --- a/x-pack/plugins/observability_solution/uptime/tsconfig.json +++ b/x-pack/plugins/observability_solution/uptime/tsconfig.json @@ -78,6 +78,7 @@ "@kbn/react-kibana-context-theme", "@kbn/react-kibana-mount", "@kbn/deeplinks-observability", + "@kbn/ebt-tools", ], "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/osquery/common/api/live_query/live_queries.schema.yaml b/x-pack/plugins/osquery/common/api/live_query/live_queries.schema.yaml index 964d0938676a9..fa9fc90742bbb 100644 --- a/x-pack/plugins/osquery/common/api/live_query/live_queries.schema.yaml +++ b/x-pack/plugins/osquery/common/api/live_query/live_queries.schema.yaml @@ -5,7 +5,8 @@ info: paths: /api/osquery/live_queries: get: - summary: Find live queries + summary: Get live queries + description: Get a list of all live queries. operationId: OsqueryFindLiveQueries x-codegen-enabled: true x-labels: [serverless, ess] @@ -25,6 +26,7 @@ paths: post: summary: Create a live query + description: Create and run a live query. operationId: OsqueryCreateLiveQuery x-codegen-enabled: true x-labels: [serverless, ess] @@ -45,6 +47,7 @@ paths: /api/osquery/live_queries/{id}: get: summary: Get live query details + description: Get the details of a live query using the query ID. operationId: OsqueryGetLiveQueryDetails x-codegen-enabled: true x-labels: [serverless, ess] @@ -70,6 +73,7 @@ paths: /api/osquery/live_queries/{id}/results/{actionId}: get: summary: Get live query results + description: Get the results of a live query using the query action ID. operationId: OsqueryGetLiveQueryResults x-codegen-enabled: true x-labels: [serverless, ess] diff --git a/x-pack/plugins/osquery/common/api/packs/packs.schema.yaml b/x-pack/plugins/osquery/common/api/packs/packs.schema.yaml index bc9afa2ff0964..7bdb90151b73d 100644 --- a/x-pack/plugins/osquery/common/api/packs/packs.schema.yaml +++ b/x-pack/plugins/osquery/common/api/packs/packs.schema.yaml @@ -5,7 +5,8 @@ info: paths: /api/osquery/packs: get: - summary: Find packs + summary: Get packs + description: Get a list of all query packs. operationId: OsqueryFindPacks x-codegen-enabled: true x-labels: [serverless, ess] @@ -23,7 +24,8 @@ paths: schema: $ref: '../model/schema/common_attributes.schema.yaml#/components/schemas/DefaultSuccessResponse' post: - summary: Create a packs + summary: Create a pack + description: Create a query pack. operationId: OsqueryCreatePacks x-codegen-enabled: true x-labels: [serverless, ess] @@ -42,7 +44,8 @@ paths: $ref: '../model/schema/common_attributes.schema.yaml#/components/schemas/DefaultSuccessResponse' /api/osquery/packs/{id}: get: - summary: Get packs details + summary: Get pack details + description: Get the details of a query pack using the pack ID. operationId: OsqueryGetPacksDetails x-codegen-enabled: true x-labels: [serverless, ess] @@ -60,7 +63,8 @@ paths: schema: $ref: '../model/schema/common_attributes.schema.yaml#/components/schemas/DefaultSuccessResponse' delete: - summary: Delete packs + summary: Delete a pack + description: Delete a query pack using the pack ID. operationId: OsqueryDeletePacks x-codegen-enabled: true x-labels: [serverless, ess] @@ -78,7 +82,11 @@ paths: schema: $ref: '../model/schema/common_attributes.schema.yaml#/components/schemas/DefaultSuccessResponse' put: - summary: Update packs + summary: Update a pack + description: | + Update a query pack using the pack ID. + > info + > You cannot update a prebuilt pack. operationId: OsqueryUpdatePacks x-codegen-enabled: true x-labels: [serverless, ess] diff --git a/x-pack/plugins/osquery/common/api/saved_query/saved_query.schema.yaml b/x-pack/plugins/osquery/common/api/saved_query/saved_query.schema.yaml index 181dbb6350b56..359770016fb82 100644 --- a/x-pack/plugins/osquery/common/api/saved_query/saved_query.schema.yaml +++ b/x-pack/plugins/osquery/common/api/saved_query/saved_query.schema.yaml @@ -5,7 +5,8 @@ info: paths: /api/osquery/saved_queries: get: - summary: Find saved queries + summary: Get saved queries + description: Get a list of all saved queries. operationId: OsqueryFindSavedQueries x-codegen-enabled: true x-labels: [serverless, ess] @@ -24,6 +25,7 @@ paths: $ref: '../model/schema/common_attributes.schema.yaml#/components/schemas/DefaultSuccessResponse' post: summary: Create a saved query + description: Create and run a saved query. operationId: OsqueryCreateSavedQuery x-codegen-enabled: true x-labels: [serverless, ess] @@ -43,6 +45,7 @@ paths: /api/osquery/saved_queries/{id}: get: summary: Get saved query details + description: Get the details of a saved query using the query ID. operationId: OsqueryGetSavedQueryDetails x-codegen-enabled: true x-labels: [serverless, ess] @@ -60,7 +63,8 @@ paths: schema: $ref: '../model/schema/common_attributes.schema.yaml#/components/schemas/DefaultSuccessResponse' delete: - summary: Delete saved query + summary: Delete a saved query + description: Delete a saved query using the query ID. operationId: OsqueryDeleteSavedQuery x-codegen-enabled: true x-labels: [serverless, ess] @@ -78,7 +82,11 @@ paths: schema: $ref: '../model/schema/common_attributes.schema.yaml#/components/schemas/DefaultSuccessResponse' put: - summary: Update saved query + summary: Update a saved query + description: | + Update a saved query using the query ID. + > info + > You cannot update a prebuilt saved query. operationId: OsqueryUpdateSavedQuery x-codegen-enabled: true x-labels: [serverless, ess] diff --git a/x-pack/plugins/osquery/docs/openapi/ess/osquery_api_2023_10_31.bundled.schema.yaml b/x-pack/plugins/osquery/docs/openapi/ess/osquery_api_2023_10_31.bundled.schema.yaml index e8635fbc478e4..4f6933aef5f2f 100644 --- a/x-pack/plugins/osquery/docs/openapi/ess/osquery_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/plugins/osquery/docs/openapi/ess/osquery_api_2023_10_31.bundled.schema.yaml @@ -13,6 +13,7 @@ servers: paths: /api/osquery/live_queries: get: + description: Get a list of all live queries. operationId: OsqueryFindLiveQueries parameters: - in: query @@ -27,10 +28,11 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Find live queries + summary: Get live queries tags: - Security Solution Osquery API post: + description: Create and run a live query. operationId: OsqueryCreateLiveQuery requestBody: content: @@ -50,6 +52,7 @@ paths: - Security Solution Osquery API '/api/osquery/live_queries/{id}': get: + description: Get the details of a live query using the query ID. operationId: OsqueryGetLiveQueryDetails parameters: - in: path @@ -74,6 +77,7 @@ paths: - Security Solution Osquery API '/api/osquery/live_queries/{id}/results/{actionId}': get: + description: Get the results of a live query using the query action ID. operationId: OsqueryGetLiveQueryResults parameters: - in: path @@ -103,6 +107,7 @@ paths: - Security Solution Osquery API /api/osquery/packs: get: + description: Get a list of all query packs. operationId: OsqueryFindPacks parameters: - in: query @@ -117,10 +122,11 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Find packs + summary: Get packs tags: - Security Solution Osquery API post: + description: Create a query pack. operationId: OsqueryCreatePacks requestBody: content: @@ -135,11 +141,12 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Create a packs + summary: Create a pack tags: - Security Solution Osquery API '/api/osquery/packs/{id}': delete: + description: Delete a query pack using the pack ID. operationId: OsqueryDeletePacks parameters: - in: path @@ -154,10 +161,11 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Delete packs + summary: Delete a pack tags: - Security Solution Osquery API get: + description: Get the details of a query pack using the pack ID. operationId: OsqueryGetPacksDetails parameters: - in: path @@ -172,10 +180,14 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Get packs details + summary: Get pack details tags: - Security Solution Osquery API put: + description: | + Update a query pack using the pack ID. + > info + > You cannot update a prebuilt pack. operationId: OsqueryUpdatePacks parameters: - in: path @@ -196,11 +208,12 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Update packs + summary: Update a pack tags: - Security Solution Osquery API /api/osquery/saved_queries: get: + description: Get a list of all saved queries. operationId: OsqueryFindSavedQueries parameters: - in: query @@ -215,10 +228,11 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Find saved queries + summary: Get saved queries tags: - Security Solution Osquery API post: + description: Create and run a saved query. operationId: OsqueryCreateSavedQuery requestBody: content: @@ -238,6 +252,7 @@ paths: - Security Solution Osquery API '/api/osquery/saved_queries/{id}': delete: + description: Delete a saved query using the query ID. operationId: OsqueryDeleteSavedQuery parameters: - in: path @@ -252,10 +267,11 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Delete saved query + summary: Delete a saved query tags: - Security Solution Osquery API get: + description: Get the details of a saved query using the query ID. operationId: OsqueryGetSavedQueryDetails parameters: - in: path @@ -274,6 +290,10 @@ paths: tags: - Security Solution Osquery API put: + description: | + Update a saved query using the query ID. + > info + > You cannot update a prebuilt saved query. operationId: OsqueryUpdateSavedQuery parameters: - in: path @@ -294,7 +314,7 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Update saved query + summary: Update a saved query tags: - Security Solution Osquery API components: diff --git a/x-pack/plugins/osquery/docs/openapi/serverless/osquery_api_2023_10_31.bundled.schema.yaml b/x-pack/plugins/osquery/docs/openapi/serverless/osquery_api_2023_10_31.bundled.schema.yaml index 5ee7cc382c480..836298b2e7cba 100644 --- a/x-pack/plugins/osquery/docs/openapi/serverless/osquery_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/plugins/osquery/docs/openapi/serverless/osquery_api_2023_10_31.bundled.schema.yaml @@ -13,6 +13,7 @@ servers: paths: /api/osquery/live_queries: get: + description: Get a list of all live queries. operationId: OsqueryFindLiveQueries parameters: - in: query @@ -27,10 +28,11 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Find live queries + summary: Get live queries tags: - Security Solution Osquery API post: + description: Create and run a live query. operationId: OsqueryCreateLiveQuery requestBody: content: @@ -50,6 +52,7 @@ paths: - Security Solution Osquery API '/api/osquery/live_queries/{id}': get: + description: Get the details of a live query using the query ID. operationId: OsqueryGetLiveQueryDetails parameters: - in: path @@ -74,6 +77,7 @@ paths: - Security Solution Osquery API '/api/osquery/live_queries/{id}/results/{actionId}': get: + description: Get the results of a live query using the query action ID. operationId: OsqueryGetLiveQueryResults parameters: - in: path @@ -103,6 +107,7 @@ paths: - Security Solution Osquery API /api/osquery/packs: get: + description: Get a list of all query packs. operationId: OsqueryFindPacks parameters: - in: query @@ -117,10 +122,11 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Find packs + summary: Get packs tags: - Security Solution Osquery API post: + description: Create a query pack. operationId: OsqueryCreatePacks requestBody: content: @@ -135,11 +141,12 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Create a packs + summary: Create a pack tags: - Security Solution Osquery API '/api/osquery/packs/{id}': delete: + description: Delete a query pack using the pack ID. operationId: OsqueryDeletePacks parameters: - in: path @@ -154,10 +161,11 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Delete packs + summary: Delete a pack tags: - Security Solution Osquery API get: + description: Get the details of a query pack using the pack ID. operationId: OsqueryGetPacksDetails parameters: - in: path @@ -172,10 +180,14 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Get packs details + summary: Get pack details tags: - Security Solution Osquery API put: + description: | + Update a query pack using the pack ID. + > info + > You cannot update a prebuilt pack. operationId: OsqueryUpdatePacks parameters: - in: path @@ -196,11 +208,12 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Update packs + summary: Update a pack tags: - Security Solution Osquery API /api/osquery/saved_queries: get: + description: Get a list of all saved queries. operationId: OsqueryFindSavedQueries parameters: - in: query @@ -215,10 +228,11 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Find saved queries + summary: Get saved queries tags: - Security Solution Osquery API post: + description: Create and run a saved query. operationId: OsqueryCreateSavedQuery requestBody: content: @@ -238,6 +252,7 @@ paths: - Security Solution Osquery API '/api/osquery/saved_queries/{id}': delete: + description: Delete a saved query using the query ID. operationId: OsqueryDeleteSavedQuery parameters: - in: path @@ -252,10 +267,11 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Delete saved query + summary: Delete a saved query tags: - Security Solution Osquery API get: + description: Get the details of a saved query using the query ID. operationId: OsqueryGetSavedQueryDetails parameters: - in: path @@ -274,6 +290,10 @@ paths: tags: - Security Solution Osquery API put: + description: | + Update a saved query using the query ID. + > info + > You cannot update a prebuilt saved query. operationId: OsqueryUpdateSavedQuery parameters: - in: path @@ -294,7 +314,7 @@ paths: schema: $ref: '#/components/schemas/DefaultSuccessResponse' description: OK - summary: Update saved query + summary: Update a saved query tags: - Security Solution Osquery API components: diff --git a/x-pack/plugins/search_indices/kibana.jsonc b/x-pack/plugins/search_indices/kibana.jsonc index 287719e99b350..7f23aa80fef15 100644 --- a/x-pack/plugins/search_indices/kibana.jsonc +++ b/x-pack/plugins/search_indices/kibana.jsonc @@ -18,6 +18,8 @@ "console", "usageCollection", ], - "requiredBundles": [] + "requiredBundles": [ + "kibanaReact", + ] } } diff --git a/x-pack/plugins/search_indices/public/application.tsx b/x-pack/plugins/search_indices/public/application.tsx new file mode 100644 index 0000000000000..e87834ccc59d2 --- /dev/null +++ b/x-pack/plugins/search_indices/public/application.tsx @@ -0,0 +1,43 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import ReactDOM from 'react-dom'; +import { CoreStart } from '@kbn/core/public'; +import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; +import { I18nProvider } from '@kbn/i18n-react'; +import { QueryClientProvider } from '@tanstack/react-query'; + +import { UsageTrackerContextProvider } from './contexts/usage_tracker_context'; +import { initQueryClient } from './services/query_client'; +import { SearchIndicesServicesContext } from './types'; + +export const renderApp = async ( + App: React.FC<{}>, + core: CoreStart, + services: Partial, + element: HTMLElement +) => { + const queryClient = initQueryClient(core.notifications.toasts); + ReactDOM.render( + + + + + + + + + + + , + element + ); + + return () => ReactDOM.unmountComponentAtNode(element); +}; diff --git a/x-pack/plugins/search_indices/public/components/start/start_page.tsx b/x-pack/plugins/search_indices/public/components/start/start_page.tsx new file mode 100644 index 0000000000000..0982a67843cce --- /dev/null +++ b/x-pack/plugins/search_indices/public/components/start/start_page.tsx @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo } from 'react'; + +import { EuiLoadingLogo, EuiPageTemplate } from '@elastic/eui'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; + +import { useKibana } from '../../hooks/use_kibana'; + +export const ElasticsearchStartPage = () => { + const { console: consolePlugin } = useKibana().services; + + const embeddableConsole = useMemo( + () => (consolePlugin?.EmbeddableConsole ? : null), + [consolePlugin] + ); + + return ( + + + + + {embeddableConsole} + + ); +}; diff --git a/x-pack/plugins/search_indices/public/contexts/usage_tracker_context.tsx b/x-pack/plugins/search_indices/public/contexts/usage_tracker_context.tsx new file mode 100644 index 0000000000000..298c4a2430d40 --- /dev/null +++ b/x-pack/plugins/search_indices/public/contexts/usage_tracker_context.tsx @@ -0,0 +1,43 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { createContext, useContext, useMemo } from 'react'; +import type { + UsageCollectionSetup, + UsageCollectionStart, +} from '@kbn/usage-collection-plugin/public'; + +import { createUsageTracker, createEmptyUsageTracker } from '../services/usage_tracker'; +import { AppUsageTracker } from '../types'; + +const UsageTrackerContext = createContext(createEmptyUsageTracker()); + +export interface UsageTrackerContextProviderProps { + children: React.ReactNode | React.ReactNode[]; + usageCollection?: UsageCollectionSetup | UsageCollectionStart; +} +export function UsageTrackerContextProvider({ + children, + usageCollection, +}: UsageTrackerContextProviderProps) { + const usageTracker = useMemo(() => { + const searchIndicesUsageTracker = createUsageTracker(usageCollection); + searchIndicesUsageTracker.load('opened_app'); + return searchIndicesUsageTracker; + }, [usageCollection]); + return ( + {children} + ); +} + +export const useUsageTracker = () => { + const ctx = useContext(UsageTrackerContext); + if (!ctx) { + throw new Error('UsageTrackerContext should be used inside of the UsageTrackerContextProvider'); + } + return ctx; +}; diff --git a/x-pack/plugins/search_indices/public/hooks/use_kibana.ts b/x-pack/plugins/search_indices/public/hooks/use_kibana.ts new file mode 100644 index 0000000000000..8c626418f4373 --- /dev/null +++ b/x-pack/plugins/search_indices/public/hooks/use_kibana.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useKibana as _useKibana } from '@kbn/kibana-react-plugin/public'; +import { SearchIndicesServicesContext } from '../types'; + +export const useKibana = () => _useKibana(); diff --git a/x-pack/plugins/search_indices/public/hooks/use_usage_tracker.ts b/x-pack/plugins/search_indices/public/hooks/use_usage_tracker.ts new file mode 100644 index 0000000000000..44b2c85d048e2 --- /dev/null +++ b/x-pack/plugins/search_indices/public/hooks/use_usage_tracker.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 { useUsageTracker } from '../contexts/usage_tracker_context'; diff --git a/x-pack/plugins/search_indices/public/plugin.ts b/x-pack/plugins/search_indices/public/plugin.ts index 88df6c1e4c10e..5ede34fa604a4 100644 --- a/x-pack/plugins/search_indices/public/plugin.ts +++ b/x-pack/plugins/search_indices/public/plugin.ts @@ -6,13 +6,41 @@ */ import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; -import type { SearchIndicesPluginSetup, SearchIndicesPluginStart } from './types'; +import { i18n } from '@kbn/i18n'; +import type { + SearchIndicesAppPluginStartDependencies, + SearchIndicesPluginSetup, + SearchIndicesPluginStart, + SearchIndicesServicesContext, +} from './types'; export class SearchIndicesPlugin implements Plugin { - public setup(core: CoreSetup): SearchIndicesPluginSetup { - return {}; + public setup( + core: CoreSetup + ): SearchIndicesPluginSetup { + core.application.register({ + id: 'elasticsearchStart', + appRoute: '/app/elasticsearch/start', + title: i18n.translate('xpack.searchIndices.startAppTitle', { + defaultMessage: 'Elasticsearch Start', + }), + async mount({ element, history }) { + const { renderApp } = await import('./application'); + const { ElasticsearchStartPage } = await import('./components/start/start_page'); + const [coreStart, depsStart] = await core.getStartServices(); + const startDeps: Partial = { + ...depsStart, + history, + }; + return renderApp(ElasticsearchStartPage, coreStart, startDeps, element); + }, + }); + + return { + enabled: true, + }; } public start(core: CoreStart): SearchIndicesPluginStart { diff --git a/x-pack/plugins/search_indices/public/services/query_client.ts b/x-pack/plugins/search_indices/public/services/query_client.ts new file mode 100644 index 0000000000000..6c1797c49d0a4 --- /dev/null +++ b/x-pack/plugins/search_indices/public/services/query_client.ts @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { IToasts } from '@kbn/core/public'; +import { QueryClient, MutationCache, QueryCache } from '@tanstack/react-query'; +import { getErrorCode, getErrorMessage, isKibanaServerError } from '../utils/errors'; + +export function initQueryClient(toasts: IToasts): QueryClient { + return new QueryClient({ + mutationCache: new MutationCache({ + onError: (e, _vars, _ctx, _mutation) => { + // TODO: can we verify this instead of a blind cast? + const error = e as Error; + toasts.addError(error, { + title: error.name, + toastMessage: getErrorMessage(error), + toastLifeTimeMs: 1000, + }); + }, + }), + queryCache: new QueryCache({ + onError: (error) => { + // 404s are often functionally okay and shouldn't show toasts by default + if (getErrorCode(error) === 404) { + return; + } + if (isKibanaServerError(error) && !error.skipToast) { + toasts.addError(error, { + title: error.name, + toastMessage: getErrorMessage(error), + toastLifeTimeMs: 1000, + }); + } + }, + }), + }); +} diff --git a/x-pack/plugins/search_indices/public/services/usage_tracker.ts b/x-pack/plugins/search_indices/public/services/usage_tracker.ts new file mode 100644 index 0000000000000..717f7a00cbaaa --- /dev/null +++ b/x-pack/plugins/search_indices/public/services/usage_tracker.ts @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { METRIC_TYPE, UiCounterMetricType } from '@kbn/analytics'; +import type { + UsageCollectionSetup, + UsageCollectionStart, +} from '@kbn/usage-collection-plugin/public'; +import { AppUsageTracker } from '../types'; + +const APP_TRACKER_NAME = 'searchIndices'; + +export function createUsageTracker( + usageCollection?: UsageCollectionSetup | UsageCollectionStart +): AppUsageTracker { + const track = (type: UiCounterMetricType, name: string | string[]) => + usageCollection?.reportUiCounter(APP_TRACKER_NAME, type, name); + + return { + click: (eventName: string | string[]) => { + track(METRIC_TYPE.CLICK, eventName); + }, + count: (eventName: string | string[]) => { + track(METRIC_TYPE.COUNT, eventName); + }, + load: (eventName: string | string[]) => { + track(METRIC_TYPE.LOADED, eventName); + }, + }; +} + +export function createEmptyUsageTracker(): AppUsageTracker { + return { + click: (_eventName: string | string[]) => {}, + count: (_eventName: string | string[]) => {}, + load: (_eventName: string | string[]) => {}, + }; +} diff --git a/x-pack/plugins/search_indices/public/types.ts b/x-pack/plugins/search_indices/public/types.ts index b16086803be53..e0b895a332d17 100644 --- a/x-pack/plugins/search_indices/public/types.ts +++ b/x-pack/plugins/search_indices/public/types.ts @@ -5,13 +5,35 @@ * 2.0. */ +import type { ConsolePluginStart } from '@kbn/console-plugin/public'; +import type { AppMountParameters, CoreStart } from '@kbn/core/public'; import type { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public'; +import type { SharePluginStart } from '@kbn/share-plugin/public'; +import type { UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface SearchIndicesPluginSetup {} +export interface SearchIndicesPluginSetup { + enabled: boolean; +} // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface SearchIndicesPluginStart {} export interface AppPluginStartDependencies { navigation: NavigationPublicPluginStart; } + +export interface SearchIndicesAppPluginStartDependencies { + console?: ConsolePluginStart; + share: SharePluginStart; + usageCollection?: UsageCollectionStart; +} + +export type SearchIndicesServicesContext = CoreStart & + SearchIndicesAppPluginStartDependencies & { + history: AppMountParameters['history']; + }; + +export interface AppUsageTracker { + click: (eventName: string | string[]) => void; + count: (eventName: string | string[]) => void; + load: (eventName: string | string[]) => void; +} diff --git a/x-pack/plugins/search_indices/public/utils/errors.ts b/x-pack/plugins/search_indices/public/utils/errors.ts new file mode 100644 index 0000000000000..4625b2cf5240c --- /dev/null +++ b/x-pack/plugins/search_indices/public/utils/errors.ts @@ -0,0 +1,43 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { KibanaServerError } from '@kbn/kibana-utils-plugin/common'; + +export function getErrorMessage(error: unknown, defaultMessage?: string): string { + if (typeof error === 'string') { + return error; + } + if (isKibanaServerError(error)) { + return error.body.message; + } + + if (typeof error === 'object' && (error as { name: string }).name) { + return (error as { name: string }).name; + } + + return defaultMessage ?? ''; +} + +export function getErrorCode(error: unknown): number | undefined { + if (isKibanaServerError(error)) { + return error.body.statusCode; + } + return undefined; +} + +export function isKibanaServerError( + input: unknown +): input is Error & { body: KibanaServerError; name: string; skipToast?: boolean } { + if ( + typeof input === 'object' && + (input as { body: KibanaServerError }).body && + typeof (input as { body: KibanaServerError }).body.message === 'string' + ) { + return true; + } + return false; +} diff --git a/x-pack/plugins/search_indices/tsconfig.json b/x-pack/plugins/search_indices/tsconfig.json index 406b9de2400ce..dc1929035310f 100644 --- a/x-pack/plugins/search_indices/tsconfig.json +++ b/x-pack/plugins/search_indices/tsconfig.json @@ -16,6 +16,16 @@ "@kbn/config-schema", "@kbn/core-elasticsearch-server", "@kbn/logging", + "@kbn/react-kibana-context-render", + "@kbn/kibana-react-plugin", + "@kbn/i18n-react", + "@kbn/shared-ux-page-kibana-template", + "@kbn/usage-collection-plugin", + "@kbn/i18n", + "@kbn/analytics", + "@kbn/console-plugin", + "@kbn/share-plugin", + "@kbn/kibana-utils-plugin", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_deployment_status/deployment_status.test.tsx b/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_deployment_status/deployment_status.test.tsx index 59414cd6c90ef..d8b13d9f00d69 100644 --- a/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_deployment_status/deployment_status.test.tsx +++ b/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_deployment_status/deployment_status.test.tsx @@ -8,20 +8,26 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import { DeploymentStatus } from './deployment_status'; -import { DeploymentStatusEnum } from '../../types'; +import { DeploymentState } from '@kbn/ml-trained-models-utils'; describe('DeploymentStatus component', () => { - it.each([[DeploymentStatusEnum.deployed, DeploymentStatusEnum.notDeployed]])( - 'renders with %s status, expects %s color, and correct data-test-subj attribute', - (status) => { - render(); - const healthComponent = screen.getByTestId(`table-column-deployment-${status}`); - expect(healthComponent).toBeInTheDocument(); - } - ); + it('starting renders with warning status', () => { + render(); + const healthComponent = screen.getByTestId(`table-column-deployment-starting`); + expect(healthComponent).toBeInTheDocument(); + expect(healthComponent).toHaveAttribute('color', 'warning'); + }); + it('stopping renders with danger status', () => { + render(); + const healthComponent = screen.getByTestId(`table-column-deployment-stopping`); + expect(healthComponent).toBeInTheDocument(); + expect(healthComponent).toHaveAttribute('color', 'danger'); + }); - it('does not render when status is notApplicable', () => { - const { container } = render(); - expect(container).toBeEmptyDOMElement(); + it('started renders with success status', () => { + render(); + const healthComponent = screen.getByTestId(`table-column-deployment-started`); + expect(healthComponent).toBeInTheDocument(); + expect(healthComponent).toHaveAttribute('color', 'success'); }); }); diff --git a/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_deployment_status/deployment_status.tsx b/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_deployment_status/deployment_status.tsx index cd2466e483ac2..61bee26333a88 100644 --- a/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_deployment_status/deployment_status.tsx +++ b/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_deployment_status/deployment_status.tsx @@ -7,42 +7,52 @@ import React from 'react'; import { EuiIcon, EuiToolTip } from '@elastic/eui'; -import { DeploymentStatusEnum } from '../../types'; +import { DeploymentState } from '@kbn/ml-trained-models-utils'; import * as i18n from './translations'; interface DeploymentStatusProps { - status: DeploymentStatusEnum; + status: DeploymentState | undefined; } -export const DeploymentStatus: React.FC = ({ status }) => { - if (status === DeploymentStatusEnum.notApplicable || !status) { - return null; - } +function getStatus(status: DeploymentState | undefined) { + switch (status) { + case 'started': + return { + statusColor: 'success', + type: 'dot', + tooltip: i18n.MODEL_DEPLOYED, + }; - let statusColor: string; - let type: string; - let tooltip: string; + case 'starting': + return { + statusColor: 'warning', + type: 'warning', + tooltip: i18n.MODEL_STARTING, + }; - switch (status) { - case DeploymentStatusEnum.deployed: - statusColor = 'success'; - type = 'dot'; - tooltip = i18n.MODEL_DEPLOYED; - break; - case DeploymentStatusEnum.notDeployed: - statusColor = 'warning'; - type = 'warning'; - tooltip = i18n.MODEL_NOT_DEPLOYED; - break; - case DeploymentStatusEnum.notDeployable: - statusColor = 'danger'; - type = 'dot'; - tooltip = i18n.MODEL_FAILED_TO_BE_DEPLOYED; + case 'stopping': + return { + statusColor: 'danger', + type: 'dot', + tooltip: i18n.MODEL_STOPPING, + }; + + case undefined: + return { + statusColor: 'danger', + type: 'dot', + tooltip: i18n.MODEL_NOT_DEPLOYED, + }; } +} + +export const DeploymentStatus: React.FC = ({ status }) => { + const { statusColor, type, tooltip } = getStatus(status); return ( ({ })); describe('When the tabular page is loaded', () => { - const queryClient = new QueryClient(); - queryClient.setQueryData([TRAINED_MODEL_STATS_QUERY_KEY], { - trained_model_stats: [{ model_id: '.elser_model_2', deployment_stats: { state: 'started' } }], - }); - const wrapper = ({ children }: { children: React.ReactNode }) => { - return {children}; - }; beforeEach(() => { + const queryClient = new QueryClient(); + queryClient.setQueryData([TRAINED_MODEL_STATS_QUERY_KEY], { + trained_model_stats: [ + { + model_id: '.elser_model_2', + deployment_stats: { deployment_id: 'my-elser-model-05', state: 'started' }, + }, + { + model_id: '.own_model', + deployment_stats: { deployment_id: 'local-model', state: 'started' }, + }, + ], + }); + const wrapper = ({ children }: { children: React.ReactNode }) => { + return {children}; + }; render(wrapper({ children: })); }); it('should display all model_ids in the table', () => { const rows = screen.getAllByRole('row'); - expect(rows[1]).toHaveTextContent('my-elser-model-04'); + expect(rows[1]).toHaveTextContent('local-model'); expect(rows[2]).toHaveTextContent('my-elser-model-05'); + expect(rows[3]).toHaveTextContent('third-party-model'); + }); + it('should render deployment status for inference endpoints with local trained models', () => { + const deploymentStatusStarted = screen.getAllByTestId('table-column-deployment-started'); + expect(deploymentStatusStarted).toHaveLength(2); + }); + it('should not render deployment status for third-party endpoints', () => { + expect(screen.queryByTestId('table-column-deployment-undefined')).not.toBeInTheDocument(); + expect(screen.queryByTestId('table-column-deployment-starting')).not.toBeInTheDocument(); + expect(screen.queryByTestId('table-column-deployment-stopping')).not.toBeInTheDocument(); }); }); diff --git a/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/tabular_page.tsx b/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/tabular_page.tsx index 9157e27c268cd..36a20584ae874 100644 --- a/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/tabular_page.tsx +++ b/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/tabular_page.tsx @@ -15,14 +15,13 @@ import { HorizontalAlignment, } from '@elastic/eui'; import { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; +import { isLocalModel } from '@kbn/ml-trained-models-utils/src/constants/trained_models'; import { TaskTypes } from '../../../common/types'; import * as i18n from '../../../common/translations'; import { useTableData } from '../../hooks/use_table_data'; import { FilterOptions, InferenceEndpointUI, ServiceProviderKeys } from './types'; -import { DeploymentStatusEnum } from './types'; - import { useAllInferenceEndpointsState } from '../../hooks/use_all_inference_endpoints_state'; import { ServiceProviderFilter } from './filter/service_provider_filter'; import { TaskTypeFilter } from './filter/task_type_filter'; @@ -59,9 +58,9 @@ export const TabularPage: React.FC = ({ inferenceEndpoints }) const tableColumns: Array> = [ { - field: 'deployment', name: '', - render: (deployment: DeploymentStatusEnum) => , + render: ({ endpoint, deployment }: InferenceEndpointUI) => + isLocalModel(endpoint) ? : null, align: 'center' as HorizontalAlignment, width: '64px', }, diff --git a/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/types.ts b/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/types.ts index 8af83816ea09d..d7b1ca58424dd 100644 --- a/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/types.ts +++ b/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/types.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; +import { DeploymentState, InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; import { TaskTypes } from '../../types'; export const INFERENCE_ENDPOINTS_TABLE_PER_PAGE_VALUES = [10, 25, 50, 100]; @@ -55,15 +55,8 @@ export interface EuiBasicTableSortTypes { field: string; } -export enum DeploymentStatusEnum { - deployed = 'deployed', - notDeployed = 'not_deployed', - notDeployable = 'not_deployable', - notApplicable = 'not_applicable', -} - export interface InferenceEndpointUI { - deployment: DeploymentStatusEnum; + deployment: DeploymentState | undefined; endpoint: InferenceAPIConfigResponse; provider: string; type: string; diff --git a/x-pack/plugins/search_inference_endpoints/public/components/inference_endpoints_header.tsx b/x-pack/plugins/search_inference_endpoints/public/components/inference_endpoints_header.tsx index be8a922aa7c74..014a596ec9e79 100644 --- a/x-pack/plugins/search_inference_endpoints/public/components/inference_endpoints_header.tsx +++ b/x-pack/plugins/search_inference_endpoints/public/components/inference_endpoints_header.tsx @@ -20,17 +20,15 @@ export const InferenceEndpointsHeader: React.FC = () => { pageTitle={i18n.INFERENCE_ENDPOINT_LABEL} description={ -

    - {i18n.MANAGE_INFERENCE_ENDPOINTS_LABEL} - - - {i18n.LEARN_HOW_TO_CREATE_INFERENCE_ENDPOINTS_LINK} - -

    + {i18n.MANAGE_INFERENCE_ENDPOINTS_LABEL} + + + {i18n.LEARN_HOW_TO_CREATE_INFERENCE_ENDPOINTS_LINK} +
    } bottomBorder={true} diff --git a/x-pack/plugins/search_inference_endpoints/public/hooks/use_table_data.test.tsx b/x-pack/plugins/search_inference_endpoints/public/hooks/use_table_data.test.tsx index 3b10e2d56887d..b3b23b4e88f58 100644 --- a/x-pack/plugins/search_inference_endpoints/public/hooks/use_table_data.test.tsx +++ b/x-pack/plugins/search_inference_endpoints/public/hooks/use_table_data.test.tsx @@ -72,7 +72,12 @@ describe('useTableData', () => { beforeEach(() => { queryClient.setQueryData([TRAINED_MODEL_STATS_QUERY_KEY], { - trained_model_stats: [{ model_id: '.elser_model_2', deployment_stats: { state: 'started' } }], + trained_model_stats: [ + { + model_id: '.elser_model_2', + deployment_stats: { deployment_id: 'my-elser-model-01', state: 'started' }, + }, + ], }); }); it('should return correct pagination', () => { @@ -160,6 +165,7 @@ describe('useTableData', () => { ); const updatedData = result.current.sortedTableData; - expect(updatedData[0].deployment).toEqual('deployed'); + + expect(updatedData[2].deployment).toEqual('started'); }); }); diff --git a/x-pack/plugins/search_inference_endpoints/public/hooks/use_table_data.tsx b/x-pack/plugins/search_inference_endpoints/public/hooks/use_table_data.tsx index e5a6b1ca44d1f..811a84e7e46f8 100644 --- a/x-pack/plugins/search_inference_endpoints/public/hooks/use_table_data.tsx +++ b/x-pack/plugins/search_inference_endpoints/public/hooks/use_table_data.tsx @@ -7,7 +7,7 @@ import type { EuiTableSortingType } from '@elastic/eui'; import { Pagination } from '@elastic/eui'; -import { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; +import { DeploymentState, InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils'; import { useMemo } from 'react'; import { TaskTypes } from '../../common/types'; import { DEFAULT_TABLE_LIMIT } from '../components/all_inference_endpoints/constants'; @@ -19,7 +19,6 @@ import { SortOrder, ServiceProviderKeys, } from '../components/all_inference_endpoints/types'; -import { DeploymentStatusEnum } from '../components/all_inference_endpoints/types'; import { useTrainedModelStats } from './use_trained_model_stats'; interface UseTableDataReturn { @@ -39,14 +38,11 @@ export const useTableData = ( const { data: trainedModelStats } = useTrainedModelStats(); const deploymentStatus = trainedModelStats?.trained_model_stats.reduce((acc, modelStat) => { - if (modelStat.model_id) { - acc[modelStat.model_id] = - modelStat?.deployment_stats?.state === 'started' - ? DeploymentStatusEnum.deployed - : DeploymentStatusEnum.notDeployed; + if (modelStat.deployment_stats?.deployment_id) { + acc[modelStat.deployment_stats.deployment_id] = modelStat?.deployment_stats?.state; } return acc; - }, {} as Record); + }, {} as Record); const tableData: InferenceEndpointUI[] = useMemo(() => { let filteredEndpoints = inferenceEndpoints; @@ -69,18 +65,11 @@ export const useTableData = ( const isElasticService = endpoint.service === ServiceProviderKeys.elasticsearch || endpoint.service === ServiceProviderKeys.elser; - - let deploymentStatusValue = DeploymentStatusEnum.notApplicable; - if (isElasticService) { - const modelId = endpoint.service_settings?.model_id; - deploymentStatusValue = - modelId && deploymentStatus?.[modelId] - ? deploymentStatus[modelId] - : DeploymentStatusEnum.notDeployable; - } + const deploymentId = isElasticService ? endpoint.inference_id : undefined; + const deployment = (deploymentId && deploymentStatus?.[deploymentId]) || undefined; return { - deployment: deploymentStatusValue, + deployment, endpoint, provider: endpoint.service, type: endpoint.task_type, diff --git a/x-pack/plugins/search_playground/public/components/header.tsx b/x-pack/plugins/search_playground/public/components/header.tsx index d24c8648ecec6..b5ef4b2b3024f 100644 --- a/x-pack/plugins/search_playground/public/components/header.tsx +++ b/x-pack/plugins/search_playground/public/components/header.tsx @@ -64,7 +64,7 @@ export const Header: React.FC = ({ .euiFlexGroup': { flexWrap: 'wrap' }, - backgroundColor: euiTheme.colors.ghost, + backgroundColor: euiTheme.colors.emptyShade, }} paddingSize="s" data-test-subj="chat-playground-home-page" diff --git a/x-pack/plugins/search_playground/public/components/message_list/assistant_message.tsx b/x-pack/plugins/search_playground/public/components/message_list/assistant_message.tsx index e0b14c2a31934..fb1d877cdd5bd 100644 --- a/x-pack/plugins/search_playground/public/components/message_list/assistant_message.tsx +++ b/x-pack/plugins/search_playground/public/components/message_list/assistant_message.tsx @@ -49,6 +49,15 @@ export const AssistantMessage: React.FC = ({ message }) = const username = i18n.translate('xpack.searchPlayground.chat.message.assistant.username', { defaultMessage: 'AI', }); + const AIMessageWrapperCSS = css` + .euiAvatar { + background-color: ${euiTheme.colors.emptyShade}; + }, + .euiCommentEvent { + border: ${euiTheme.border.thin}; + border-radius: ${euiTheme.border.radius.medium}; + }, +`; return ( <> @@ -59,13 +68,7 @@ export const AssistantMessage: React.FC = ({ message }) = timelineAvatar="dot" data-test-subj="assistant-message-searching" eventColor="subdued" - css={{ - '.euiAvatar': { backgroundColor: euiTheme.colors.ghost }, - '.euiCommentEvent': { - border: euiTheme.border.thin, - borderRadius: euiTheme.border.radius.medium, - }, - }} + css={AIMessageWrapperCSS} event={

    @@ -83,13 +86,7 @@ export const AssistantMessage: React.FC = ({ message }) = timelineAvatar="dot" data-test-subj="retrieval-docs-comment" eventColor="subdued" - css={{ - '.euiAvatar': { backgroundColor: euiTheme.colors.ghost }, - '.euiCommentEvent': { - border: euiTheme.border.thin, - borderRadius: euiTheme.border.radius.medium, - }, - }} + css={AIMessageWrapperCSS} event={ <> @@ -133,13 +130,7 @@ export const AssistantMessage: React.FC = ({ message }) = timelineAvatar="dot" data-test-subj="retrieval-docs-comment-no-docs" eventColor="subdued" - css={{ - '.euiAvatar': { backgroundColor: euiTheme.colors.ghost }, - '.euiCommentEvent': { - border: euiTheme.border.thin, - borderRadius: euiTheme.border.radius.medium, - }, - }} + css={AIMessageWrapperCSS} event={ <> @@ -189,9 +180,9 @@ export const AssistantMessage: React.FC = ({ message }) = }) } css={{ - '.euiAvatar': { backgroundColor: euiTheme.colors.ghost }, + '.euiAvatar': { backgroundColor: euiTheme.colors.emptyShade }, '.euiCommentEvent__body': { - backgroundColor: euiTheme.colors.ghost, + backgroundColor: euiTheme.colors.emptyShade, }, }} eventColor="subdued" diff --git a/x-pack/plugins/search_playground/public/components/message_list/system_message.tsx b/x-pack/plugins/search_playground/public/components/message_list/system_message.tsx index e973bea3c8a14..63a7c9f5595f4 100644 --- a/x-pack/plugins/search_playground/public/components/message_list/system_message.tsx +++ b/x-pack/plugins/search_playground/public/components/message_list/system_message.tsx @@ -32,7 +32,7 @@ export const SystemMessage: React.FC = ({ content }) => { timelineAvatar="dot" eventColor="subdued" css={{ - '.euiAvatar': { backgroundColor: euiTheme.colors.ghost }, + '.euiAvatar': { backgroundColor: euiTheme.colors.emptyShade }, '.euiCommentEvent': { border: euiTheme.border.thin, borderRadius: euiTheme.border.radius.medium, diff --git a/x-pack/plugins/search_playground/public/components/message_list/user_message.tsx b/x-pack/plugins/search_playground/public/components/message_list/user_message.tsx index 8c15ca1b6b69e..7680adce47b24 100644 --- a/x-pack/plugins/search_playground/public/components/message_list/user_message.tsx +++ b/x-pack/plugins/search_playground/public/components/message_list/user_message.tsx @@ -34,7 +34,7 @@ export const UserMessage: React.FC = ({ content, createdAt }) eventColor="subdued" css={{ '.euiCommentEvent__body': { - backgroundColor: euiTheme.colors.ghost, + backgroundColor: euiTheme.colors.emptyShade, }, }} username={i18n.translate('xpack.searchPlayground.chat.message.user.name', { diff --git a/x-pack/plugins/search_playground/public/components/view_code/examples/__snapshots__/py_lang_client.test.tsx.snap b/x-pack/plugins/search_playground/public/components/view_code/examples/__snapshots__/py_lang_client.test.tsx.snap index e0815458898ce..0001f45600ec2 100644 --- a/x-pack/plugins/search_playground/public/components/view_code/examples/__snapshots__/py_lang_client.test.tsx.snap +++ b/x-pack/plugins/search_playground/public/components/view_code/examples/__snapshots__/py_lang_client.test.tsx.snap @@ -28,7 +28,7 @@ index_source_fields = { ] } -def get_elasticsearch_results(query): +def get_elasticsearch_results(): es_query = { \\"query\\": {}, \\"size\\": 10 @@ -82,7 +82,7 @@ def generate_openai_completion(user_prompt, question): if __name__ == \\"__main__\\": question = \\"my question\\" - elasticsearch_results = get_elasticsearch_results(question) + elasticsearch_results = get_elasticsearch_results() context_prompt = create_openai_prompt(elasticsearch_results) openai_completion = generate_openai_completion(context_prompt, question) print(openai_completion) diff --git a/x-pack/plugins/search_playground/public/components/view_code/examples/py_lang_client.tsx b/x-pack/plugins/search_playground/public/components/view_code/examples/py_lang_client.tsx index 582606a4f6b14..a2d92583c6b63 100644 --- a/x-pack/plugins/search_playground/public/components/view_code/examples/py_lang_client.tsx +++ b/x-pack/plugins/search_playground/public/components/view_code/examples/py_lang_client.tsx @@ -28,7 +28,7 @@ openai_client = OpenAI( index_source_fields = ${JSON.stringify(formValues.source_fields, null, 4)} -def get_elasticsearch_results(query): +def get_elasticsearch_results(): es_query = ${getESQuery({ ...formValues.elasticsearch_query, size: formValues.doc_size, @@ -71,7 +71,7 @@ def generate_openai_completion(user_prompt, question): if __name__ == "__main__": question = "my question" - elasticsearch_results = get_elasticsearch_results(question) + elasticsearch_results = get_elasticsearch_results() context_prompt = create_openai_prompt(elasticsearch_results) openai_completion = generate_openai_completion(context_prompt, question) print(openai_completion) diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/index.tsx b/x-pack/plugins/security_solution/public/assistant/get_comments/index.tsx index 3550f8dfda568..3a0f9a83f303f 100644 --- a/x-pack/plugins/security_solution/public/assistant/get_comments/index.tsx +++ b/x-pack/plugins/security_solution/public/assistant/get_comments/index.tsx @@ -197,6 +197,7 @@ export const getComments: GetAssistantMessages = ({ content={transformedMessage.content} index={index} isControlsEnabled={isControlsEnabled} + isError={message.isError} // reader is used to determine if streaming controls are shown reader={transformedMessage.reader} regenerateMessage={regenerateMessageOfConversation} diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/index.tsx b/x-pack/plugins/security_solution/public/assistant/get_comments/stream/index.tsx index f25a93b017bf5..8ca072e805458 100644 --- a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/index.tsx +++ b/x-pack/plugins/security_solution/public/assistant/get_comments/stream/index.tsx @@ -102,7 +102,14 @@ export const StreamComment = ({ return ( } + body={ + + } error={error ? new Error(error) : undefined} controls={controls} /> diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/message_text.tsx b/x-pack/plugins/security_solution/public/assistant/get_comments/stream/message_text.tsx index c40b0c04043ad..ff526c33497c3 100644 --- a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/message_text.tsx +++ b/x-pack/plugins/security_solution/public/assistant/get_comments/stream/message_text.tsx @@ -30,6 +30,7 @@ interface Props { content: string; index: number; loading: boolean; + ['data-test-subj']?: string; } const ANIMATION_TIME = 1; @@ -143,7 +144,7 @@ const getPluginDependencies = () => { }; }; -export function MessageText({ loading, content, index }: Props) { +export function MessageText({ loading, content, index, 'data-test-subj': dataTestSubj }: Props) { const containerClassName = css` overflow-wrap: anywhere; `; @@ -151,7 +152,7 @@ export function MessageText({ loading, content, index }: Props) { const { parsingPluginList, processingPluginList } = getPluginDependencies(); return ( - + @@ -270,6 +271,7 @@ export const SendToTimelineButton: FC diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.test.tsx b/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.test.tsx index 14a707958b888..7eb1eb2eb5408 100644 --- a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.test.tsx +++ b/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.test.tsx @@ -32,7 +32,7 @@ describe('Countdown', () => { ]; beforeAll(() => { - jest.useFakeTimers({ legacyFakeTimers: true }); + jest.useFakeTimers(); }); beforeEach(() => { @@ -76,7 +76,7 @@ describe('Countdown', () => { ); act(() => { - jest.runOnlyPendingTimers(); + jest.advanceTimersByTime(1000); }); expect(screen.getByTestId('timerText')).toHaveTextContent('00:59'); diff --git a/x-pack/plugins/security_solution/public/common/hooks/eql/api.ts b/x-pack/plugins/security_solution/public/common/hooks/eql/api.ts index 921d4fde4bfd0..569344297f319 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/eql/api.ts +++ b/x-pack/plugins/security_solution/public/common/hooks/eql/api.ts @@ -36,6 +36,17 @@ interface Params { options: Omit | undefined; } +export interface EqlResponseError { + code: EQL_ERROR_CODES; + messages?: string[]; + error?: Error; +} + +export interface ValidateEqlResponse { + valid: boolean; + error?: EqlResponseError; +} + export const validateEql = async ({ data, dataViewTitle, @@ -43,10 +54,7 @@ export const validateEql = async ({ signal, runtimeMappings, options, -}: Params): Promise<{ - valid: boolean; - error?: { code: EQL_ERROR_CODES; messages?: string[]; error?: Error }; -}> => { +}: Params): Promise => { try { const { rawResponse: response } = await firstValueFrom( data.search.search( diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/eql_query_bar/validators.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/eql_query_bar/validators.ts index 04ea9bbc43356..8cd9a4d60745e 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/eql_query_bar/validators.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/eql_query_bar/validators.ts @@ -12,6 +12,7 @@ import { isEqlRule } from '../../../../../common/detection_engine/utils'; import { KibanaServices } from '../../../../common/lib/kibana'; import type { DefineStepRule } from '../../../../detections/pages/detection_engine/rules/types'; import { DataSourceType } from '../../../../detections/pages/detection_engine/rules/types'; +import type { EqlResponseError } from '../../../../common/hooks/eql/api'; import { validateEql, EQL_ERROR_CODES } from '../../../../common/hooks/eql/api'; import type { FieldValueQueryBar } from '../query_bar'; import * as i18n from './translations'; @@ -47,6 +48,23 @@ export const debounceAsync = => { + if (responseError.error) { + return { + code: EQL_ERROR_CODES.FAILED_REQUEST, + message: i18n.EQL_VALIDATION_REQUEST_ERROR, + error: responseError.error, + }; + } + return { + code: responseError.code, + message: '', + messages: responseError.messages, + }; +}; + export const eqlValidator = async ( ...args: Parameters ): Promise | void | undefined> => { @@ -86,13 +104,8 @@ export const eqlValidator = async ( options: eqlOptions, }); - if (response?.valid === false) { - return { - code: response.error?.code, - message: '', - messages: response.error?.messages, - error: response.error?.error, - }; + if (response?.valid === false && response.error) { + return transformEqlResponseErrorToValidationError(response.error); } } catch (error) { return { diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/save_with_errors_confirmation/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/save_with_errors_confirmation/index.tsx new file mode 100644 index 0000000000000..839513bf0e34c --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/save_with_errors_confirmation/index.tsx @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { EuiConfirmModal } from '@elastic/eui'; + +import * as i18n from './translations'; + +interface SaveWithErrorsModalProps { + errors: string[]; + onCancel: () => void; + onConfirm: () => void; +} + +const SaveWithErrorsModalComponent = ({ + errors, + onCancel, + onConfirm, +}: SaveWithErrorsModalProps) => { + return ( + + <>{i18n.SAVE_WITH_ERRORS_MODAL_MESSAGE(errors.length)} + + ); +}; + +export const SaveWithErrorsModal = React.memo(SaveWithErrorsModalComponent); +SaveWithErrorsModal.displayName = 'SaveWithErrorsModal'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/save_with_errors_confirmation/translations.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/save_with_errors_confirmation/translations.ts new file mode 100644 index 0000000000000..e470b06c7e829 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/save_with_errors_confirmation/translations.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const SAVE_WITH_ERRORS_MODAL_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.saveWithErrorsModalTitle', + { + defaultMessage: 'This rule has validation errors', + } +); + +export const SAVE_WITH_ERRORS_CANCEL_BUTTON = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.saveWithErrorsCancelButton', + { + defaultMessage: 'Cancel', + } +); + +export const SAVE_WITH_ERRORS_CONFIRM_BUTTON = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.saveWithErrorsConfirmButton', + { + defaultMessage: 'Confirm', + } +); + +export const SAVE_WITH_ERRORS_MODAL_MESSAGE = (errorsCount: number) => + i18n.translate('xpack.securitySolution.detectionEngine.createRule.saveWithErrorsModalMessage', { + defaultMessage: + 'This rule has {errorsCount} validation {errorsCount, plural, one {error} other {errors}} which can lead to failed rule executions, save anyway?', + values: { errorsCount }, + }); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/form.test.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/form.test.ts new file mode 100644 index 0000000000000..ca1e5042eac80 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/form.test.ts @@ -0,0 +1,291 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { renderHook } from '@testing-library/react-hooks'; + +import type { FormData, FormHook, ValidationError } from '../../../shared_imports'; +import { ERROR_CODES as ESQL_ERROR_CODES } from '../../rule_creation/logic/esql_validator'; +import { EQL_ERROR_CODES } from '../../../common/hooks/eql/api'; +import type { + AboutStepRule, + ActionsStepRule, + DefineStepRule, + ScheduleStepRule, +} from '../../../detections/pages/detection_engine/rules/types'; + +import { useRuleFormsErrors } from './form'; +import { transformEqlResponseErrorToValidationError } from '../components/eql_query_bar/validators'; + +const getFormWithErrorsMock = (fields: { + [key: string]: { errors: Array> }; +}) => { + return { + getFields: () => fields, + } as unknown as FormHook; +}; + +describe('useRuleFormsErrors', () => { + describe('EQL query validation errors', () => { + it('should return blocking error in case of syntax validation error', async () => { + const { result } = renderHook(() => useRuleFormsErrors()); + + const validationError = transformEqlResponseErrorToValidationError({ + code: EQL_ERROR_CODES.INVALID_SYNTAX, + messages: ["line 1:5: missing 'where' at 'demo'"], + }); + const defineStepForm = getFormWithErrorsMock({ + queryBar: { + errors: [validationError], + }, + }); + + const { getRuleFormsErrors } = result.current; + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ defineStepForm }); + + expect(blockingErrors).toEqual(["line 1:5: missing 'where' at 'demo'"]); + expect(nonBlockingErrors).toEqual([]); + }); + + it('should return non-blocking error in case of missing data source validation error', async () => { + const { result } = renderHook(() => useRuleFormsErrors()); + + const validationError = transformEqlResponseErrorToValidationError({ + code: EQL_ERROR_CODES.MISSING_DATA_SOURCE, + messages: ['index_not_found_exception Found 1 problem line -1:-1: Unknown index [*,-*]'], + }); + const defineStepForm = getFormWithErrorsMock({ + queryBar: { + errors: [validationError], + }, + }); + + const { getRuleFormsErrors } = result.current; + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ defineStepForm }); + + expect(blockingErrors).toEqual([]); + expect(nonBlockingErrors).toEqual([ + 'Query bar: index_not_found_exception Found 1 problem line -1:-1: Unknown index [*,-*]', + ]); + }); + + it('should return non-blocking error in case of missing data field validation error', async () => { + const { result } = renderHook(() => useRuleFormsErrors()); + + const validationError = transformEqlResponseErrorToValidationError({ + code: EQL_ERROR_CODES.INVALID_EQL, + messages: [ + 'Found 2 problems\nline 1:1: Unknown column [event.category]\nline 1:13: Unknown column [event.name]', + ], + }); + const defineStepForm = getFormWithErrorsMock({ + queryBar: { + errors: [validationError], + }, + }); + + const { getRuleFormsErrors } = result.current; + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ defineStepForm }); + + expect(blockingErrors).toEqual([]); + expect(nonBlockingErrors).toEqual([ + 'Query bar: Found 2 problems\nline 1:1: Unknown column [event.category]\nline 1:13: Unknown column [event.name]', + ]); + }); + + it('should return non-blocking error in case of failed request error', async () => { + const { result } = renderHook(() => useRuleFormsErrors()); + + const validationError = transformEqlResponseErrorToValidationError({ + code: EQL_ERROR_CODES.FAILED_REQUEST, + error: new Error('Some internal error'), + }); + const defineStepForm = getFormWithErrorsMock({ + queryBar: { + errors: [validationError], + }, + }); + + const { getRuleFormsErrors } = result.current; + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ defineStepForm }); + + expect(blockingErrors).toEqual([]); + expect(nonBlockingErrors).toEqual([ + 'Query bar: An error occurred while validating your EQL query', + ]); + }); + + it('should return blocking and non-blocking errors', async () => { + const { result } = renderHook(() => useRuleFormsErrors()); + + const validationError = transformEqlResponseErrorToValidationError({ + code: EQL_ERROR_CODES.MISSING_DATA_SOURCE, + messages: ['Missing data source'], + }); + const defineStepForm = getFormWithErrorsMock({ + queryBar: { + errors: [validationError], + }, + }); + const aboutStepForm = getFormWithErrorsMock({ + name: { + errors: [ + { + message: 'Required field', + }, + ], + }, + }); + + const { getRuleFormsErrors } = result.current; + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ + defineStepForm, + aboutStepForm, + }); + + expect(blockingErrors).toEqual(['Required field']); + expect(nonBlockingErrors).toEqual(['Query bar: Missing data source']); + }); + }); + + describe('ES|QL query validation errors', () => { + it('should return blocking error in case of syntax validation error', async () => { + const { result } = renderHook(() => useRuleFormsErrors()); + + const validationError = { + code: ESQL_ERROR_CODES.INVALID_SYNTAX, + message: 'Broken ES|QL syntax', + }; + const defineStepForm = getFormWithErrorsMock({ + queryBar: { + errors: [validationError], + }, + }); + + const { getRuleFormsErrors } = result.current; + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ defineStepForm }); + + expect(blockingErrors).toEqual(['Broken ES|QL syntax']); + expect(nonBlockingErrors).toEqual([]); + }); + + it('should return blocking error in case of missed ES|QL metadata validation error', async () => { + const { result } = renderHook(() => useRuleFormsErrors()); + + const validationError = { + code: ESQL_ERROR_CODES.ERR_MISSING_ID_FIELD_FROM_RESULT, + message: 'Metadata is missing', + }; + const defineStepForm = getFormWithErrorsMock({ + queryBar: { + errors: [validationError], + }, + }); + + const { getRuleFormsErrors } = result.current; + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ defineStepForm }); + + expect(blockingErrors).toEqual(['Metadata is missing']); + expect(nonBlockingErrors).toEqual([]); + }); + + it('should return non-blocking error in case of missing data field validation error', async () => { + const { result } = renderHook(() => useRuleFormsErrors()); + + const validationError = { + code: ESQL_ERROR_CODES.INVALID_ESQL, + message: 'Unknown column [hello.world]', + }; + const defineStepForm = getFormWithErrorsMock({ + queryBar: { + errors: [validationError], + }, + }); + + const { getRuleFormsErrors } = result.current; + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ defineStepForm }); + + expect(blockingErrors).toEqual([]); + expect(nonBlockingErrors).toEqual(['Query bar: Unknown column [hello.world]']); + }); + }); + + describe('general cases', () => { + it('should not return blocking and non-blocking errors in case there are none exist', async () => { + const { result } = renderHook(() => useRuleFormsErrors()); + + const defineStepForm = getFormWithErrorsMock({ queryBar: { errors: [] } }); + const aboutStepForm = getFormWithErrorsMock({ name: { errors: [] } }); + const scheduleStepForm = getFormWithErrorsMock({ + interval: { errors: [] }, + }); + const actionsStepForm = getFormWithErrorsMock({ actions: { errors: [] } }); + + const { getRuleFormsErrors } = result.current; + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ + defineStepForm, + aboutStepForm, + scheduleStepForm, + actionsStepForm, + }); + + expect(blockingErrors).toEqual([]); + expect(nonBlockingErrors).toEqual([]); + }); + + it('should not return all errors', async () => { + const { result } = renderHook(() => useRuleFormsErrors()); + + const esqlValidationError = { + code: ESQL_ERROR_CODES.INVALID_ESQL, + message: 'Missing index [logs*]', + }; + const groupByValidationError = { + message: 'Number of grouping fields must be at most 3', + }; + + const defineStepForm = getFormWithErrorsMock({ + queryBar: { errors: [esqlValidationError] }, + groupByFields: { errors: [groupByValidationError] }, + }); + const aboutStepForm = getFormWithErrorsMock({ + name: { + errors: [ + { + message: 'Required field', + }, + ], + }, + }); + const scheduleStepForm = getFormWithErrorsMock({ + interval: { errors: [] }, + }); + const actionsStepForm = getFormWithErrorsMock({ + actions: { + errors: [ + { + message: 'Missing webhook connector', + }, + ], + }, + }); + + const { getRuleFormsErrors } = result.current; + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ + defineStepForm, + aboutStepForm, + scheduleStepForm, + actionsStepForm, + }); + + expect(blockingErrors).toEqual([ + 'Number of grouping fields must be at most 3', + 'Required field', + 'Missing webhook connector', + ]); + expect(nonBlockingErrors).toEqual(['Query bar: Missing index [logs*]']); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/form.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/form.tsx index 690dedafaf852..90b302c3bc904 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/form.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/form.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useState, useMemo, useEffect } from 'react'; +import { useState, useMemo, useEffect, useCallback } from 'react'; import type { DataViewBase } from '@kbn/es-query'; import { isThreatMatchRule } from '../../../../common/detection_engine/utils'; import type { @@ -16,6 +16,7 @@ import type { } from '../../../detections/pages/detection_engine/rules/types'; import { DataSourceType } from '../../../detections/pages/detection_engine/rules/types'; import { useKibana } from '../../../common/lib/kibana'; +import type { FormHook, ValidationError } from '../../../shared_imports'; import { useForm, useFormData } from '../../../shared_imports'; import { schema as defineRuleSchema } from '../components/step_define_rule/schema'; import type { EqlOptionsSelected } from '../../../../common/search_strategy'; @@ -26,6 +27,9 @@ import { import { schema as scheduleRuleSchema } from '../components/step_schedule_rule/schema'; import { getSchema as getActionsRuleSchema } from '../../rule_creation/components/step_rule_actions/get_schema'; import { useFetchIndex } from '../../../common/containers/source'; +import { ERROR_CODES as ESQL_ERROR_CODES } from '../../rule_creation/logic/esql_validator'; +import { EQL_ERROR_CODES } from '../../../common/hooks/eql/api'; +import * as i18n from './translations'; export interface UseRuleFormsProps { defineStepDefault: DefineStepRule; @@ -156,3 +160,88 @@ export const useRuleIndexPattern = ({ }, [dataSourceType, isIndexPatternLoading, data, dataViewId, initIndexPattern]); return { indexPattern, isIndexPatternLoading, browserFields }; }; + +export interface UseRuleFormsErrors { + defineStepForm?: FormHook; + aboutStepForm?: FormHook; + scheduleStepForm?: FormHook; + actionsStepForm?: FormHook; +} + +const getFieldErrorMessages = (fieldError: ValidationError) => { + if (fieldError.message.length > 0) { + return [fieldError.message]; + } else if (Array.isArray(fieldError.messages)) { + // EQL validation can return multiple errors and thus we store them in a custom `messages` field on `ValidationError` object. + // Here we double check that `messages` is in fact an array and the content is of type `string`, otherwise we stringify it. + return fieldError.messages.map((message) => + typeof message === 'string' ? message : JSON.stringify(message) + ); + } + return []; +}; + +const NON_BLOCKING_QUERY_BAR_ERROR_CODES = [ + ESQL_ERROR_CODES.INVALID_ESQL, + EQL_ERROR_CODES.FAILED_REQUEST, + EQL_ERROR_CODES.INVALID_EQL, + EQL_ERROR_CODES.MISSING_DATA_SOURCE, +]; + +const isNonBlockingQueryBarErrorCode = (errorCode?: string) => { + return !!NON_BLOCKING_QUERY_BAR_ERROR_CODES.find((code) => code === errorCode); +}; + +const NON_BLOCKING_ERROR_CODES = [...NON_BLOCKING_QUERY_BAR_ERROR_CODES]; + +const isNonBlockingErrorCode = (errorCode?: string) => { + return !!NON_BLOCKING_ERROR_CODES.find((code) => code === errorCode); +}; + +const transformValidationError = ({ + errorCode, + errorMessage, +}: { + errorCode?: string; + errorMessage: string; +}) => { + if (isNonBlockingQueryBarErrorCode(errorCode)) { + return i18n.QUERY_BAR_VALIDATION_ERROR(errorMessage); + } + return errorMessage; +}; + +export const useRuleFormsErrors = () => { + const getRuleFormsErrors = useCallback( + ({ defineStepForm, aboutStepForm, scheduleStepForm, actionsStepForm }: UseRuleFormsErrors) => { + const blockingErrors: string[] = []; + const nonBlockingErrors: string[] = []; + + for (const [_, fieldHook] of Object.entries(defineStepForm?.getFields() ?? {})) { + fieldHook.errors.forEach((fieldError) => { + const messages = getFieldErrorMessages(fieldError); + if (isNonBlockingErrorCode(fieldError.code)) { + nonBlockingErrors.push( + ...messages.map((message) => + transformValidationError({ errorCode: fieldError.code, errorMessage: message }) + ) + ); + } else { + blockingErrors.push(...messages); + } + }); + } + + const blockingForms = [aboutStepForm, scheduleStepForm, actionsStepForm]; + blockingForms.forEach((form) => { + for (const [_, fieldHook] of Object.entries(form?.getFields() ?? {})) { + blockingErrors.push(...fieldHook.errors.map((fieldError) => fieldError.message)); + } + }); + return { blockingErrors, nonBlockingErrors }; + }, + [] + ); + + return { getRuleFormsErrors }; +}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/index.tsx index 6e93d6927b6be..500fedb4d0005 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/index.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/index.tsx @@ -80,8 +80,9 @@ import { RulePreview } from '../../components/rule_preview'; import { getIsRulePreviewDisabled } from '../../components/rule_preview/helpers'; import { useStartMlJobs } from '../../../rule_management/logic/use_start_ml_jobs'; import { NextStep } from '../../components/next_step'; -import { useRuleForms, useRuleIndexPattern } from '../form'; +import { useRuleForms, useRuleFormsErrors, useRuleIndexPattern } from '../form'; import { CustomHeaderPageMemo } from '..'; +import { SaveWithErrorsModal } from '../../components/save_with_errors_confirmation'; const MyEuiPanel = styled(EuiPanel)<{ zindex?: number; @@ -210,6 +211,12 @@ const CreateRulePageComponent: React.FC = () => { const [isQueryBarValid, setIsQueryBarValid] = useState(false); const [isThreatQueryBarValid, setIsThreatQueryBarValid] = useState(false); + const [isSaveWithErrorsModalVisible, setIsSaveWithErrorsModalVisible] = useState(false); + const [enableRuleAfterConfirmation, setEnableRuleAfterConfirmation] = useState(false); + const [nonBlockingRuleErrors, setNonBlockingRuleErrors] = useState([]); + + const { getRuleFormsErrors } = useRuleFormsErrors(); + const esqlQueryForAboutStep = useEsqlQueryForAboutStep({ defineStepData, activeStep }); const esqlIndex = useEsqlIndex(defineStepData.queryBar.query.query, ruleType); @@ -328,89 +335,165 @@ const CreateRulePageComponent: React.FC = () => { const validateStep = useCallback( async (step: RuleStep) => { switch (step) { - case RuleStep.defineRule: - return defineStepForm.validate(); - case RuleStep.aboutRule: - return aboutStepForm.validate(); - case RuleStep.scheduleRule: - return scheduleStepForm.validate(); - case RuleStep.ruleActions: - return actionsStepForm.validate(); + case RuleStep.defineRule: { + const valid = await defineStepForm.validate(); + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ defineStepForm }); + return { valid, blockingErrors, nonBlockingErrors }; + } + case RuleStep.aboutRule: { + const valid = await aboutStepForm.validate(); + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ aboutStepForm }); + return { valid, blockingErrors, nonBlockingErrors }; + } + case RuleStep.scheduleRule: { + const valid = await scheduleStepForm.validate(); + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ scheduleStepForm }); + return { valid, blockingErrors, nonBlockingErrors }; + } + case RuleStep.ruleActions: { + const valid = await actionsStepForm.validate(); + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ actionsStepForm }); + return { valid, blockingErrors, nonBlockingErrors }; + } } }, - [aboutStepForm, actionsStepForm, defineStepForm, scheduleStepForm] - ); + [aboutStepForm, actionsStepForm, defineStepForm, getRuleFormsErrors, scheduleStepForm] + ); + + const validateEachStep = useCallback(async () => { + const { + valid: defineStepFormValid, + blockingErrors: defineStepBlockingErrors, + nonBlockingErrors: defineStepNonBlockingErrors, + } = await validateStep(RuleStep.defineRule); + const { + valid: aboutStepFormValid, + blockingErrors: aboutStepBlockingErrors, + nonBlockingErrors: aboutStepNonBlockingErrors, + } = await validateStep(RuleStep.aboutRule); + const { + valid: scheduleStepFormValid, + blockingErrors: scheduleStepBlockingErrors, + nonBlockingErrors: scheduleStepNonBlockingErrors, + } = await validateStep(RuleStep.scheduleRule); + const { + valid: actionsStepFormValid, + blockingErrors: actionsStepBlockingErrors, + nonBlockingErrors: actionsStepNonBlockingErrors, + } = await validateStep(RuleStep.ruleActions); + const valid = + defineStepFormValid && aboutStepFormValid && scheduleStepFormValid && actionsStepFormValid; + + const blockingErrors = [ + ...defineStepBlockingErrors, + ...aboutStepBlockingErrors, + ...scheduleStepBlockingErrors, + ...actionsStepBlockingErrors, + ]; + const nonBlockingErrors = [ + ...defineStepNonBlockingErrors, + ...aboutStepNonBlockingErrors, + ...scheduleStepNonBlockingErrors, + ...actionsStepNonBlockingErrors, + ]; + + return { valid, blockingErrors, nonBlockingErrors }; + }, [validateStep]); const editStep = useCallback( async (step: RuleStep) => { - const valid = await validateStep(activeStep); - - if (valid) { + const { valid, blockingErrors } = await validateStep(activeStep); + if (valid || !blockingErrors.length) { goToStep(step); } }, - [activeStep, validateStep, goToStep] + [validateStep, activeStep, goToStep] ); - const submitRule = useCallback( - async (step: RuleStep, enabled: boolean) => { - const valid = await validateStep(step); - - if (valid) { - const localDefineStepData: DefineStepRule = defineFieldsTransform({ - ...defineStepForm.getFormData(), - eqlOptions: eqlOptionsSelected, - }); - const localAboutStepData = aboutStepForm.getFormData(); - const localScheduleStepData = scheduleStepForm.getFormData(); - const localActionsStepData = actionsStepForm.getFormData(); - const startMlJobsIfNeeded = async () => { - if (!isMlRule(ruleType) || !enabled) { - return; - } - await startMlJobs(localDefineStepData.machineLearningJobId); - }; - const [, createdRule] = await Promise.all([ - startMlJobsIfNeeded(), - createRule( - formatRule( - localDefineStepData, - localAboutStepData, - localScheduleStepData, - { - ...localActionsStepData, - enabled, - }, - triggersActionsUi.actionTypeRegistry - ) - ), - ]); - - addSuccess(i18n.SUCCESSFULLY_CREATED_RULES(createdRule.name)); - - navigateToApp(APP_UI_ID, { - deepLinkId: SecurityPageName.rules, - path: getRuleDetailsUrl(createdRule.id), - }); - } + const createRuleFromFormData = useCallback( + async (enabled: boolean) => { + const localDefineStepData: DefineStepRule = defineFieldsTransform({ + ...defineStepForm.getFormData(), + eqlOptions: eqlOptionsSelected, + }); + const localAboutStepData = aboutStepForm.getFormData(); + const localScheduleStepData = scheduleStepForm.getFormData(); + const localActionsStepData = actionsStepForm.getFormData(); + const startMlJobsIfNeeded = async () => { + if (!isMlRule(ruleType) || !enabled) { + return; + } + await startMlJobs(localDefineStepData.machineLearningJobId); + }; + const [, createdRule] = await Promise.all([ + startMlJobsIfNeeded(), + createRule( + formatRule( + localDefineStepData, + localAboutStepData, + localScheduleStepData, + { + ...localActionsStepData, + enabled, + }, + triggersActionsUi.actionTypeRegistry + ) + ), + ]); + + addSuccess(i18n.SUCCESSFULLY_CREATED_RULES(createdRule.name)); + + navigateToApp(APP_UI_ID, { + deepLinkId: SecurityPageName.rules, + path: getRuleDetailsUrl(createdRule.id), + }); }, [ - validateStep, - defineStepForm, - eqlOptionsSelected, aboutStepForm, - scheduleStepForm, actionsStepForm, - createRule, addSuccess, + createRule, + defineFieldsTransform, + defineStepForm, + eqlOptionsSelected, navigateToApp, ruleType, + scheduleStepForm, startMlJobs, - defineFieldsTransform, triggersActionsUi.actionTypeRegistry, ] ); + const showSaveWithErrorsModal = useCallback(() => setIsSaveWithErrorsModalVisible(true), []); + const closeSaveWithErrorsModal = useCallback(() => setIsSaveWithErrorsModalVisible(false), []); + const onConfirmSaveWithErrors = useCallback(async () => { + closeSaveWithErrorsModal(); + await createRuleFromFormData(enableRuleAfterConfirmation); + }, [closeSaveWithErrorsModal, createRuleFromFormData, enableRuleAfterConfirmation]); + + const submitRule = useCallback( + async (enabled: boolean) => { + const { valid, blockingErrors, nonBlockingErrors } = await validateEachStep(); + if (valid) { + // There are no validation errors, thus proceed to rule creation + await createRuleFromFormData(enabled); + return; + } + + if (blockingErrors.length > 0) { + // There are blocking validation errors, thus do not allow user to create a rule + return; + } + if (nonBlockingErrors.length > 0) { + // There are non-blocking validation errors, thus confirm that user understand that this can cause rule failures + setEnableRuleAfterConfirmation(enabled); + setNonBlockingRuleErrors(nonBlockingErrors); + showSaveWithErrorsModal(); + } + }, + [createRuleFromFormData, showSaveWithErrorsModal, validateEachStep] + ); + const defineRuleButtonType = activeStep === RuleStep.defineRule ? 'active' : defineStepForm.isValid ? 'valid' : 'passive'; const defineRuleButton = useMemo( @@ -418,14 +501,11 @@ const CreateRulePageComponent: React.FC = () => { [defineRuleButtonType] ); const defineRuleNextStep = useCallback(async () => { - const valid = await defineStepForm.validate(); - if (valid) { - const nextStep = getNextStep(RuleStep.defineRule); - if (nextStep) { - goToStep(nextStep); - } + const nextStep = getNextStep(RuleStep.defineRule); + if (nextStep) { + await editStep(nextStep); } - }, [defineStepForm, goToStep]); + }, [editStep]); const aboutRuleButtonType = activeStep === RuleStep.aboutRule ? 'active' : aboutStepForm.isValid ? 'valid' : 'passive'; @@ -434,14 +514,11 @@ const CreateRulePageComponent: React.FC = () => { [aboutRuleButtonType] ); const aboutRuleNextStep = useCallback(async () => { - const valid = await aboutStepForm.validate(); - if (valid) { - const nextStep = getNextStep(RuleStep.aboutRule); - if (nextStep) { - goToStep(nextStep); - } + const nextStep = getNextStep(RuleStep.aboutRule); + if (nextStep) { + await editStep(nextStep); } - }, [aboutStepForm, goToStep]); + }, [editStep]); const scheduleRuleButtonType = activeStep === RuleStep.scheduleRule @@ -454,14 +531,11 @@ const CreateRulePageComponent: React.FC = () => { [scheduleRuleButtonType] ); const scheduleRuleNextStep = useCallback(async () => { - const valid = await scheduleStepForm.validate(); - if (valid) { - const nextStep = getNextStep(RuleStep.scheduleRule); - if (nextStep) { - goToStep(nextStep); - } + const nextStep = getNextStep(RuleStep.scheduleRule); + if (nextStep) { + await editStep(nextStep); } - }, [scheduleStepForm, goToStep]); + }, [editStep]); const actionsRuleButtonType = activeStep === RuleStep.ruleActions ? 'active' : actionsStepForm.isValid ? 'valid' : 'passive'; @@ -470,10 +544,10 @@ const CreateRulePageComponent: React.FC = () => { [actionsRuleButtonType] ); const submitRuleDisabled = useCallback(() => { - submitRule(RuleStep.ruleActions, false); + submitRule(false); }, [submitRule]); const submitRuleEnabled = useCallback(() => { - submitRule(RuleStep.ruleActions, true); + submitRule(true); }, [submitRule]); const memoDefineStepReadOnly = useMemo( @@ -559,7 +633,11 @@ const CreateRulePageComponent: React.FC = () => { ); const memoDefineStepExtraAction = useMemo( () => - defineStepForm.isValid && ( + // During rule creation we would like to hide the edit button if user did not reach current step yet, + // thus we do `defineStepForm.isValid !== undefined` check which that the form validation has not been checked yet. + // Otherwise, we would like to show step edit button if user is currently at another step. + defineStepForm.isValid !== undefined && + activeStep !== RuleStep.defineRule && ( { {i18n.EDIT_RULE} ), - [defineStepForm.isValid, editStep] + [activeStep, defineStepForm.isValid, editStep] ); const memoAboutStepReadOnly = useMemo( @@ -629,7 +707,11 @@ const CreateRulePageComponent: React.FC = () => { ); const memoAboutStepExtraAction = useMemo( () => - aboutStepForm.isValid && ( + // During rule creation we would like to hide the edit button if user did not reach current step yet, + // thus we do `defineStepForm.isValid !== undefined` check which that the form validation has not been checked yet. + // Otherwise, we would like to show step edit button if user is currently at another step. + aboutStepForm.isValid !== undefined && + activeStep !== RuleStep.aboutRule && ( { {i18n.EDIT_RULE} ), - [aboutStepForm.isValid, editStep] + [aboutStepForm.isValid, activeStep, editStep] ); const memoStepScheduleRule = useMemo( @@ -682,12 +764,16 @@ const CreateRulePageComponent: React.FC = () => { ); const memoScheduleStepExtraAction = useMemo( () => - scheduleStepForm.isValid && ( + // During rule creation we would like to hide the edit button if user did not reach current step yet, + // thus we do `defineStepForm.isValid !== undefined` check which that the form validation has not been checked yet. + // Otherwise, we would like to show step edit button if user is currently at another step. + scheduleStepForm.isValid !== undefined && + activeStep !== RuleStep.scheduleRule && ( editStep(RuleStep.scheduleRule)}> {i18n.EDIT_RULE} ), - [editStep, scheduleStepForm.isValid] + [activeStep, editStep, scheduleStepForm.isValid] ); const memoStepRuleActions = useMemo( @@ -762,12 +848,16 @@ const CreateRulePageComponent: React.FC = () => { ); const memoActionsStepExtraAction = useMemo( () => - actionsStepForm.isValid && ( + // During rule creation we would like to hide the edit button if user did not reach current step yet, + // thus we do `defineStepForm.isValid !== undefined` check which that the form validation has not been checked yet. + // Otherwise, we would like to show step edit button if user is currently at another step. + actionsStepForm.isValid !== undefined && + activeStep !== RuleStep.ruleActions && ( editStep(RuleStep.ruleActions)}> {i18n.EDIT_RULE} ), - [actionsStepForm.isValid, editStep] + [actionsStepForm.isValid, activeStep, editStep] ); const onToggleCollapsedMemo = useCallback( @@ -798,6 +888,13 @@ const CreateRulePageComponent: React.FC = () => { return ( <> + {isSaveWithErrorsModalVisible && ( + + )} {(EuiResizablePanel, EuiResizableButton, { togglePanel }) => { diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx index deb58fbed49a3..1ecbde5b00d7b 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx @@ -67,9 +67,10 @@ import { import { useStartTransaction } from '../../../../common/lib/apm/use_start_transaction'; import { SINGLE_RULE_ACTIONS } from '../../../../common/lib/apm/user_actions'; import { useGetSavedQuery } from '../../../../detections/pages/detection_engine/rules/use_get_saved_query'; -import { useRuleForms, useRuleIndexPattern } from '../form'; +import { useRuleForms, useRuleFormsErrors, useRuleIndexPattern } from '../form'; import { useEsqlIndex, useEsqlQueryForAboutStep } from '../../hooks'; import { CustomHeaderPageMemo } from '..'; +import { SaveWithErrorsModal } from '../../components/save_with_errors_confirmation'; const EditRulePageComponent: FC<{ rule: RuleResponse }> = ({ rule }) => { const [, dispatchToaster] = useStateToaster(); @@ -99,6 +100,9 @@ const EditRulePageComponent: FC<{ rule: RuleResponse }> = ({ rule }) => { const [isQueryBarValid, setIsQueryBarValid] = useState(false); const [isThreatQueryBarValid, setIsThreatQueryBarValid] = useState(false); + const [isSaveWithErrorsModalVisible, setIsSaveWithErrorsModalVisible] = useState(false); + const [nonBlockingRuleErrors, setNonBlockingRuleErrors] = useState([]); + useEffect(() => { const fetchDataViews = async () => { const dataViewsRefs = await dataServices.dataViews.getIdsWithTitle(); @@ -149,6 +153,8 @@ const EditRulePageComponent: FC<{ rule: RuleResponse }> = ({ rule }) => { actionsStepDefault: ruleActionsData, }); + const { getRuleFormsErrors } = useRuleFormsErrors(); + const esqlQueryForAboutStep = useEsqlQueryForAboutStep({ defineStepData, activeStep }); const esqlIndex = useEsqlIndex(defineStepData.queryBar.query.query, defineStepData.ruleType); @@ -386,7 +392,50 @@ const EditRulePageComponent: FC<{ rule: RuleResponse }> = ({ rule }) => { const { startTransaction } = useStartTransaction(); + const saveChanges = useCallback(async () => { + startTransaction({ name: SINGLE_RULE_ACTIONS.SAVE }); + await updateRule({ + ...formatRule( + defineStepData, + aboutStepData, + scheduleStepData, + actionsStepData, + triggersActionsUi.actionTypeRegistry, + rule?.exceptions_list + ), + ...(ruleId ? { id: ruleId } : {}), + }); + + displaySuccessToast(i18n.SUCCESSFULLY_SAVED_RULE(rule?.name ?? ''), dispatchToaster); + navigateToApp(APP_UI_ID, { + deepLinkId: SecurityPageName.rules, + path: getRuleDetailsUrl(ruleId ?? ''), + }); + }, [ + aboutStepData, + actionsStepData, + defineStepData, + dispatchToaster, + navigateToApp, + rule?.exceptions_list, + rule?.name, + ruleId, + scheduleStepData, + startTransaction, + triggersActionsUi.actionTypeRegistry, + updateRule, + ]); + + const showSaveWithErrorsModal = useCallback(() => setIsSaveWithErrorsModalVisible(true), []); + const closeSaveWithErrorsModal = useCallback(() => setIsSaveWithErrorsModalVisible(false), []); + const onConfirmSaveWithErrors = useCallback(async () => { + closeSaveWithErrorsModal(); + await saveChanges(); + }, [closeSaveWithErrorsModal, saveChanges]); + const onSubmit = useCallback(async () => { + setNonBlockingRuleErrors([]); + const defineStepFormValid = await defineStepForm.validate(); const aboutStepFormValid = await aboutStepForm.validate(); const scheduleStepFormValid = await scheduleStepForm.validate(); @@ -398,41 +447,31 @@ const EditRulePageComponent: FC<{ rule: RuleResponse }> = ({ rule }) => { scheduleStepFormValid && actionsStepFormValid ) { - startTransaction({ name: SINGLE_RULE_ACTIONS.SAVE }); - await updateRule({ - ...formatRule( - defineStepData, - aboutStepData, - scheduleStepData, - actionsStepData, - triggersActionsUi.actionTypeRegistry, - rule?.exceptions_list - ), - ...(ruleId ? { id: ruleId } : {}), - }); + await saveChanges(); + return; + } - displaySuccessToast(i18n.SUCCESSFULLY_SAVED_RULE(rule?.name ?? ''), dispatchToaster); - navigateToApp(APP_UI_ID, { - deepLinkId: SecurityPageName.rules, - path: getRuleDetailsUrl(ruleId ?? ''), - }); + const { blockingErrors, nonBlockingErrors } = getRuleFormsErrors({ + defineStepForm, + aboutStepForm, + scheduleStepForm, + actionsStepForm, + }); + if (blockingErrors.length > 0) { + return; + } + if (nonBlockingErrors.length > 0) { + setNonBlockingRuleErrors(nonBlockingErrors); + showSaveWithErrorsModal(); } }, [ defineStepForm, aboutStepForm, scheduleStepForm, actionsStepForm, - startTransaction, - updateRule, - defineStepData, - aboutStepData, - scheduleStepData, - actionsStepData, - rule, - ruleId, - dispatchToaster, - navigateToApp, - triggersActionsUi.actionTypeRegistry, + getRuleFormsErrors, + saveChanges, + showSaveWithErrorsModal, ]); const onTabClick = useCallback(async (tab: EuiTabbedContentTab) => { @@ -488,6 +527,13 @@ const EditRulePageComponent: FC<{ rule: RuleResponse }> = ({ rule }) => { return ( <> + {isSaveWithErrorsModalVisible && ( + + )} {(EuiResizablePanel, EuiResizableButton, { togglePanel }) => { diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/translations.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/translations.ts index e602b8be712c2..77ea9438f66dc 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/translations.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/translations.ts @@ -13,3 +13,9 @@ export const RULE_PREVIEW_TITLE = i18n.translate( defaultMessage: 'Rule preview', } ); + +export const QUERY_BAR_VALIDATION_ERROR = (validationError: string) => + i18n.translate('xpack.securitySolution.detectionEngine.createRule.validationError', { + values: { validationError }, + defaultMessage: 'Query bar: {validationError}', + }); diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.tsx index afdab70202f12..173645eae203e 100644 --- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.tsx @@ -575,7 +575,10 @@ export const EventFiltersForm: React.FC { - setIsPopoverOpen(true); + const handlePopover = useCallback(() => { + setIsPopoverOpen((isOpen) => !isOpen); }, []); const handleKeyboardOpen: EuiFieldTextProps['onKeyDown'] = useCallback((event) => { @@ -69,7 +69,7 @@ const SearchTimelineSuperSelectComponent: React.FC ( > => { if (ids) { return initPromisePool({ @@ -43,7 +44,7 @@ export const fetchRulesByQueryOrIds = async ({ const { data, total } = await findRules({ rulesClient, - perPage: MAX_RULES_TO_PROCESS_TOTAL, + perPage: maxRules, filter: query, page: undefined, sortField: undefined, @@ -51,9 +52,9 @@ export const fetchRulesByQueryOrIds = async ({ fields: undefined, }); - if (total > MAX_RULES_TO_PROCESS_TOTAL) { + if (total > maxRules) { throw new BadRequestError( - `More than ${MAX_RULES_TO_PROCESS_TOTAL} rules matched the filter query. Try to narrow it down.` + `More than ${maxRules} rules matched the filter query. Try to narrow it down.` ); } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts index 7ac96312b793d..4d31bd457a3e9 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts @@ -9,6 +9,7 @@ import type { IKibanaResponse, Logger } from '@kbn/core/server'; import { AbortError } from '@kbn/kibana-utils-plugin/common'; import { transformError } from '@kbn/securitysolution-es-utils'; import { buildRouteValidationWithZod } from '@kbn/zod-helpers'; +import type { BulkActionSkipResult } from '@kbn/alerting-plugin/common'; import type { ConfigType } from '../../../../../../config'; import type { PerformRulesBulkActionResponse } from '../../../../../../../common/api/detection_engine/rule_management'; import { @@ -42,8 +43,12 @@ import { buildBulkResponse } from './bulk_actions_response'; import { bulkEnableDisableRules } from './bulk_enable_disable_rules'; import { fetchRulesByQueryOrIds } from './fetch_rules_by_query_or_ids'; import { bulkScheduleBackfill } from './bulk_schedule_rule_run'; +import { createPrebuiltRuleAssetsClient } from '../../../../prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_client'; -export const MAX_RULES_TO_PROCESS_TOTAL = 10000; +const MAX_RULES_TO_PROCESS_TOTAL = 10000; +// Set a lower limit for bulk edit as the rules client might fail with a "Query +// contains too many nested clauses" error +const MAX_RULES_TO_BULK_EDIT = 2000; const MAX_ROUTE_CONCURRENCY = 5; export const performBulkActionRoute = ( @@ -126,6 +131,7 @@ export const performBulkActionRoute = ( const savedObjectsClient = ctx.core.savedObjects.client; const actionsClient = ctx.actions.getActionsClient(); const detectionRulesClient = ctx.securitySolution.getDetectionRulesClient(); + const prebuiltRuleAssetClient = createPrebuiltRuleAssetsClient(savedObjectsClient); const { getExporter, getClient } = ctx.core.savedObjects; const client = getClient({ includedHiddenTypes: ['action'] }); @@ -141,31 +147,15 @@ export const performBulkActionRoute = ( const query = body.query !== '' ? body.query : undefined; - // handling this action before switch statement as bulkEditRules fetch rules within - // rulesClient method, hence there is no need to use fetchRulesByQueryOrIds utility - if (body.action === BulkActionTypeEnum.edit && !isDryRun) { - const { rules, errors, skipped } = await bulkEditRules({ - actionsClient, - rulesClient, - filter: query, - ids: body.ids, - actions: body.edit, - mlAuthz, - experimentalFeatures: config.experimentalFeatures, - }); - - return buildBulkResponse(response, { - updated: rules, - skipped, - errors, - }); - } - const fetchRulesOutcome = await fetchRulesByQueryOrIds({ rulesClient, query, ids: body.ids, abortSignal: abortController.signal, + maxRules: + body.action === BulkActionTypeEnum.edit + ? MAX_RULES_TO_BULK_EDIT + : MAX_RULES_TO_PROCESS_TOTAL, }); const rules = fetchRulesOutcome.results.map(({ result }) => result); @@ -173,6 +163,7 @@ export const performBulkActionRoute = ( let updated: RuleAlertType[] = []; let created: RuleAlertType[] = []; let deleted: RuleAlertType[] = []; + let skipped: BulkActionSkipResult[] = []; switch (body.action) { case BulkActionTypeEnum.enable: { @@ -307,25 +298,40 @@ export const performBulkActionRoute = ( // will be processed only when isDryRun === true // during dry run only validation is getting performed and rule is not saved in ES case BulkActionTypeEnum.edit: { - const bulkActionOutcome = await initPromisePool({ - concurrency: MAX_RULES_TO_UPDATE_IN_PARALLEL, - items: rules, - executor: async (rule) => { - await dryRunValidateBulkEditRule({ - mlAuthz, - rule, - edit: body.edit, - experimentalFeatures: config.experimentalFeatures, - }); + if (isDryRun) { + const bulkActionOutcome = await initPromisePool({ + concurrency: MAX_RULES_TO_UPDATE_IN_PARALLEL, + items: rules, + executor: async (rule) => { + await dryRunValidateBulkEditRule({ + mlAuthz, + rule, + edit: body.edit, + experimentalFeatures: config.experimentalFeatures, + }); - return rule; - }, - abortSignal: abortController.signal, - }); - errors.push(...bulkActionOutcome.errors); - updated = bulkActionOutcome.results - .map(({ result }) => result) - .filter((rule): rule is RuleAlertType => rule !== null); + return rule; + }, + abortSignal: abortController.signal, + }); + errors.push(...bulkActionOutcome.errors); + updated = bulkActionOutcome.results + .map(({ result }) => result) + .filter((rule): rule is RuleAlertType => rule !== null); + } else { + const bulkEditResult = await bulkEditRules({ + actionsClient, + rulesClient, + prebuiltRuleAssetClient, + rules, + actions: body.edit, + mlAuthz, + experimentalFeatures: config.experimentalFeatures, + }); + updated = bulkEditResult.rules; + skipped = bulkEditResult.skipped; + errors.push(...bulkEditResult.errors); + } break; } @@ -352,6 +358,7 @@ export const performBulkActionRoute = ( updated, deleted, created, + skipped, errors, isDryRun, }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/bulk_edit_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/bulk_edit_rules.ts index ab3a9f486d81b..bee44a3600f97 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/bulk_edit_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/bulk_edit_rules.ts @@ -5,28 +5,30 @@ * 2.0. */ -import type { RulesClient } from '@kbn/alerting-plugin/server'; import type { ActionsClient } from '@kbn/actions-plugin/server'; +import type { RulesClient } from '@kbn/alerting-plugin/server'; import type { ExperimentalFeatures } from '../../../../../../common'; import type { BulkActionEditPayload } from '../../../../../../common/api/detection_engine/rule_management'; import type { MlAuthz } from '../../../../machine_learning/authz'; -import { enrichFilterWithRuleTypeMapping } from '../search/enrich_filter_with_rule_type_mappings'; -import type { RuleAlertType } from '../../../rule_schema'; +import type { RuleAlertType, RuleParams } from '../../../rule_schema'; +import type { IPrebuiltRuleAssetsClient } from '../../../prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_client'; +import { convertAlertingRuleToRuleResponse } from '../detection_rules_client/converters/convert_alerting_rule_to_rule_response'; +import { calculateIsCustomized } from '../detection_rules_client/mergers/rule_source/calculate_is_customized'; +import { bulkEditActionToRulesClientOperation } from './action_to_rules_client_operation'; import { ruleParamsModifier } from './rule_params_modifier'; import { splitBulkEditActions } from './split_bulk_edit_actions'; import { validateBulkEditRule } from './validations'; -import { bulkEditActionToRulesClientOperation } from './action_to_rules_client_operation'; export interface BulkEditRulesArguments { actionsClient: ActionsClient; rulesClient: RulesClient; + prebuiltRuleAssetClient: IPrebuiltRuleAssetsClient; actions: BulkActionEditPayload[]; - filter?: string; - ids?: string[]; + rules: RuleAlertType[]; mlAuthz: MlAuthz; experimentalFeatures: ExperimentalFeatures; } @@ -41,27 +43,70 @@ export interface BulkEditRulesArguments { export const bulkEditRules = async ({ actionsClient, rulesClient, - ids, + prebuiltRuleAssetClient, + rules, actions, - filter, mlAuthz, experimentalFeatures, }: BulkEditRulesArguments) => { + // Split operations const { attributesActions, paramsActions } = splitBulkEditActions(actions); const operations = attributesActions .map((attribute) => bulkEditActionToRulesClientOperation(actionsClient, attribute)) .flat(); - const result = await rulesClient.bulkEdit({ - ...(ids ? { ids } : { filter: enrichFilterWithRuleTypeMapping(filter) }), + + // Check if there are any prebuilt rules and fetch their base versions + const prebuiltRules = rules.filter((rule) => rule.params.immutable); + const baseVersions = await prebuiltRuleAssetClient.fetchAssetsByVersion( + prebuiltRules.map((rule) => ({ + rule_id: rule.params.ruleId, + version: rule.params.version, + })) + ); + const baseVersionsMap = new Map( + baseVersions.map((baseVersion) => [baseVersion.rule_id, baseVersion]) + ); + + const result = await rulesClient.bulkEdit({ + ids: rules.map((rule) => rule.id), operations, - paramsModifier: async (ruleParams: RuleAlertType['params']) => { + paramsModifier: async (rule) => { + const ruleParams = rule.params; + await validateBulkEditRule({ mlAuthz, ruleType: ruleParams.type, edit: actions, immutable: ruleParams.immutable, + experimentalFeatures, }); - return ruleParamsModifier(ruleParams, paramsActions, experimentalFeatures); + const { modifiedParams, isParamsUpdateSkipped } = ruleParamsModifier( + ruleParams, + paramsActions, + experimentalFeatures + ); + + // Update rule source + const updatedRule = { + ...rule, + params: modifiedParams, + }; + const ruleResponse = convertAlertingRuleToRuleResponse(updatedRule); + const ruleSource = + ruleResponse.immutable === true + ? { + type: 'external' as const, + isCustomized: calculateIsCustomized( + baseVersionsMap.get(ruleResponse.rule_id), + ruleResponse + ), + } + : { + type: 'internal' as const, + }; + modifiedParams.ruleSource = ruleSource; + + return { modifiedParams, isParamsUpdateSkipped }; }, }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/validations.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/validations.ts index 591bcc0a18ec5..d89c78be6b846 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/validations.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/validations.ts @@ -32,6 +32,7 @@ interface BulkEditBulkActionsValidationArgs { mlAuthz: MlAuthz; edit: BulkActionEditPayload[]; immutable: boolean; + experimentalFeatures: ExperimentalFeatures; } interface DryRunBulkEditBulkActionsValidationArgs { @@ -110,15 +111,18 @@ export const validateBulkEditRule = async ({ mlAuthz, edit, immutable, + experimentalFeatures, }: BulkEditBulkActionsValidationArgs) => { await throwMlAuthError(mlAuthz, ruleType); - // if rule can't be edited error will be thrown - const canRuleBeEdited = !immutable || istEditApplicableToImmutableRule(edit); - await throwDryRunError( - () => invariant(canRuleBeEdited, "Elastic rule can't be edited"), - BulkActionsDryRunErrCode.IMMUTABLE - ); + if (!experimentalFeatures.prebuiltRulesCustomizationEnabled) { + // if rule can't be edited error will be thrown + const canRuleBeEdited = !immutable || istEditApplicableToImmutableRule(edit); + await throwDryRunError( + () => invariant(canRuleBeEdited, "Elastic rule can't be edited"), + BulkActionsDryRunErrCode.IMMUTABLE + ); + } }; /** @@ -140,12 +144,14 @@ export const dryRunValidateBulkEditRule = async ({ rule, edit, mlAuthz, + experimentalFeatures, }: DryRunBulkEditBulkActionsValidationArgs) => { await validateBulkEditRule({ ruleType: rule.params.type, mlAuthz, edit, immutable: rule.params.immutable, + experimentalFeatures, }); // if rule is machine_learning, index pattern action can't be applied to it diff --git a/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.test.tsx b/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.test.tsx index f169395688de1..ac60902920fa9 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.test.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.test.tsx @@ -98,6 +98,8 @@ describe('ManageSpacePage', () => { nameInput.simulate('change', { target: { value: 'New Space Name' } }); descriptionInput.simulate('change', { target: { value: 'some description' } }); + updateSpace(wrapper, false, 'oblt'); + const createButton = wrapper.find('button[data-test-subj="save-space-button"]'); createButton.simulate('click'); await Promise.resolve(); @@ -110,9 +112,78 @@ describe('ManageSpacePage', () => { color: '#AA6556', imageUrl: '', disabledFeatures: [], + solution: 'oblt', }); }); + it('validates the form (name, initials, solution view...)', async () => { + const spacesManager = spacesManagerMock.create(); + spacesManager.createSpace = jest.fn(spacesManager.createSpace); + spacesManager.getActiveSpace = jest.fn().mockResolvedValue(space); + + const wrapper = mountWithIntl( + + ); + + await waitFor(() => { + wrapper.update(); + expect(wrapper.find('input[name="name"]')).toHaveLength(1); + }); + + const createButton = wrapper.find('button[data-test-subj="save-space-button"]'); + createButton.simulate('click'); + await Promise.resolve(); + + { + const errors = wrapper.find('.euiFormErrorText').map((node) => node.text()); + expect(errors).toEqual([ + 'Enter a name.', + 'Enter a URL identifier.', + 'Enter initials.', + 'Select one solution.', + ]); + + expect(spacesManager.createSpace).not.toHaveBeenCalled(); + + const nameInput = wrapper.find('input[name="name"]'); + nameInput.simulate('change', { target: { value: 'New Space Name' } }); + } + + createButton.simulate('click'); + await Promise.resolve(); + + { + const errors = wrapper.find('.euiFormErrorText').map((node) => node.text()); + expect(errors).toEqual(['Select one solution.']); // requires solution view to be set + } + + updateSpace(wrapper, false, 'oblt'); + + createButton.simulate('click'); + await Promise.resolve(); + + { + const errors = wrapper.find('.euiFormErrorText').map((node) => node.text()); + expect(errors).toEqual([]); // no more errors + } + + expect(spacesManager.createSpace).toHaveBeenCalled(); + }); + it('shows solution view select when visible', async () => { const spacesManager = spacesManagerMock.create(); spacesManager.createSpace = jest.fn(spacesManager.createSpace); diff --git a/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.tsx b/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.tsx index cb81ae9304260..4f45b55fb1630 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.tsx @@ -206,6 +206,8 @@ export class ManageSpacePage extends Component { { const originalSpace: Space = this.state.originalSpace as Space; const space: Space = this.state.space as Space; const { haveDisabledFeaturesChanged, hasSolutionViewChanged } = this.state; - const result = this.validator.validateForSave(space); + const result = this.validator.validateForSave( + space, + this.editingExistingSpace(), + this.props.allowSolutionVisibility + ); if (result.isInvalid) { this.setState({ formError: result, diff --git a/x-pack/plugins/spaces/public/management/edit_space/solution_view/solution_view.tsx b/x-pack/plugins/spaces/public/management/edit_space/solution_view/solution_view.tsx index 608454a75600b..9d7ca7140956c 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/solution_view/solution_view.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/solution_view/solution_view.tsx @@ -24,6 +24,7 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import type { Space } from '../../../../common'; +import type { SpaceValidator } from '../../lib'; import { SectionPanel } from '../section_panel'; type SolutionView = Space['solution']; @@ -98,10 +99,18 @@ const getOptions = ({ size }: EuiThemeComputed): Array; onChange: (space: Partial) => void; + isEditing: boolean; + validator: SpaceValidator; sectionTitle?: string; } -export const SolutionView: FunctionComponent = ({ space, onChange, sectionTitle }) => { +export const SolutionView: FunctionComponent = ({ + space, + onChange, + validator, + isEditing, + sectionTitle, +}) => { const { euiTheme } = useEuiTheme(); return ( @@ -132,6 +141,7 @@ export const SolutionView: FunctionComponent = ({ space, onChange, sectio defaultMessage: 'Solution view', })} fullWidth + {...validator.validateSolutionView(space, isEditing)} > = ({ space, onChange, sectio onChange={(solution) => { onChange({ ...space, solution }); }} + placeholder={i18n.translate( + 'xpack.spaces.management.navigation.solutionViewDefaultValue', + { + defaultMessage: 'Classic (Default)', + } + )} + isInvalid={validator.validateSolutionView(space, isEditing).isInvalid} /> diff --git a/x-pack/plugins/spaces/public/management/lib/validate_space.ts b/x-pack/plugins/spaces/public/management/lib/validate_space.ts index a93d627f6e159..9a9ae0cbe98fd 100644 --- a/x-pack/plugins/spaces/public/management/lib/validate_space.ts +++ b/x-pack/plugins/spaces/public/management/lib/validate_space.ts @@ -169,11 +169,31 @@ export class SpaceValidator { return valid(); } + public validateSolutionView( + space: FormValues, + isEditing: boolean, + allowSolutionVisibility = true + ) { + if (!this.shouldValidate || isEditing || !allowSolutionVisibility) { + return valid(); + } + + if (!space.solution) { + return invalid( + i18n.translate('xpack.spaces.management.validateSpace.requiredSolutionViewErrorMessage', { + defaultMessage: 'Select one solution.', + }) + ); + } + + return valid(); + } + public validateEnabledFeatures(space: FormValues) { return valid(); } - public validateForSave(space: FormValues) { + public validateForSave(space: FormValues, isEditing: boolean, allowSolutionVisibility: boolean) { const { isInvalid: isNameInvalid } = this.validateSpaceName(space); const { isInvalid: isDescriptionInvalid } = this.validateSpaceDescription(space); const { isInvalid: isIdentifierInvalid } = this.validateURLIdentifier(space); @@ -181,6 +201,11 @@ export class SpaceValidator { const { isInvalid: isAvatarColorInvalid } = this.validateAvatarColor(space); const { isInvalid: isAvatarImageInvalid } = this.validateAvatarImage(space); const { isInvalid: areFeaturesInvalid } = this.validateEnabledFeatures(space); + const { isInvalid: isSolutionViewInvalid } = this.validateSolutionView( + space, + isEditing, + allowSolutionVisibility + ); if ( isNameInvalid || @@ -189,7 +214,8 @@ export class SpaceValidator { isAvatarInitialsInvalid || isAvatarColorInvalid || isAvatarImageInvalid || - areFeaturesInvalid + areFeaturesInvalid || + isSolutionViewInvalid ) { return invalid(); } diff --git a/x-pack/plugins/stack_connectors/common/bedrock/schema.ts b/x-pack/plugins/stack_connectors/common/bedrock/schema.ts index 093a5f9b11518..03f4f5cc01735 100644 --- a/x-pack/plugins/stack_connectors/common/bedrock/schema.ts +++ b/x-pack/plugins/stack_connectors/common/bedrock/schema.ts @@ -28,13 +28,30 @@ export const RunActionParamsSchema = schema.object({ raw: schema.maybe(schema.boolean()), }); +export const BedrockMessageSchema = schema.object( + { + role: schema.string(), + content: schema.maybe(schema.string()), + rawContent: schema.maybe(schema.arrayOf(schema.any())), + }, + { + validate: (value) => { + if (value.content === undefined && value.rawContent === undefined) { + return 'Must specify either content or rawContent'; + } else if (value.content !== undefined && value.rawContent !== undefined) { + return 'content and rawContent can not be used at the same time'; + } + }, + } +); + +export const BedrockToolChoiceSchema = schema.object({ + type: schema.oneOf([schema.literal('auto'), schema.literal('any'), schema.literal('tool')]), + name: schema.maybe(schema.string()), +}); + export const InvokeAIActionParamsSchema = schema.object({ - messages: schema.arrayOf( - schema.object({ - role: schema.string(), - content: schema.string(), - }) - ), + messages: schema.arrayOf(BedrockMessageSchema), model: schema.maybe(schema.string()), temperature: schema.maybe(schema.number()), stopSequences: schema.maybe(schema.arrayOf(schema.string())), @@ -53,6 +70,7 @@ export const InvokeAIActionParamsSchema = schema.object({ }) ) ), + toolChoice: schema.maybe(BedrockToolChoiceSchema), }); export const InvokeAIActionResponseSchema = schema.object({ @@ -60,12 +78,7 @@ export const InvokeAIActionResponseSchema = schema.object({ }); export const InvokeAIRawActionParamsSchema = schema.object({ - messages: schema.arrayOf( - schema.object({ - role: schema.string(), - content: schema.any(), - }) - ), + messages: schema.arrayOf(BedrockMessageSchema), model: schema.maybe(schema.string()), temperature: schema.maybe(schema.number()), stopSequences: schema.maybe(schema.arrayOf(schema.string())), @@ -84,6 +97,7 @@ export const InvokeAIRawActionParamsSchema = schema.object({ }) ) ), + toolChoice: schema.maybe(BedrockToolChoiceSchema), }); export const InvokeAIRawActionResponseSchema = schema.object({}, { unknowns: 'allow' }); diff --git a/x-pack/plugins/stack_connectors/common/bedrock/types.ts b/x-pack/plugins/stack_connectors/common/bedrock/types.ts index b144f78b91edd..3b02f40d2de62 100644 --- a/x-pack/plugins/stack_connectors/common/bedrock/types.ts +++ b/x-pack/plugins/stack_connectors/common/bedrock/types.ts @@ -19,6 +19,8 @@ import { InvokeAIRawActionResponseSchema, StreamingResponseSchema, RunApiLatestResponseSchema, + BedrockMessageSchema, + BedrockToolChoiceSchema, } from './schema'; export type Config = TypeOf; @@ -33,3 +35,5 @@ export type RunActionResponse = TypeOf; export type StreamingResponse = TypeOf; export type DashboardActionParams = TypeOf; export type DashboardActionResponse = TypeOf; +export type BedRockMessage = TypeOf; +export type BedrockToolChoice = TypeOf; diff --git a/x-pack/plugins/stack_connectors/server/connector_types/bedrock/bedrock.ts b/x-pack/plugins/stack_connectors/server/connector_types/bedrock/bedrock.ts index b5ec114a9c456..c2c773bdeaf87 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/bedrock/bedrock.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/bedrock/bedrock.ts @@ -22,7 +22,7 @@ import { RunActionResponseSchema, RunApiLatestResponseSchema, } from '../../../common/bedrock/schema'; -import { +import type { Config, Secrets, RunActionParams, @@ -32,6 +32,8 @@ import { InvokeAIRawActionParams, InvokeAIRawActionResponse, RunApiLatestResponse, + BedRockMessage, + BedrockToolChoice, } from '../../../common/bedrock/types'; import { SUB_ACTION, @@ -309,13 +311,14 @@ The Kibana Connector in use may need to be reconfigured with an updated Amazon B signal, timeout, tools, + toolChoice, }: InvokeAIActionParams | InvokeAIRawActionParams, connectorUsageCollector: ConnectorUsageCollector ): Promise { const res = (await this.streamApi( { body: JSON.stringify( - formatBedrockBody({ messages, stopSequences, system, temperature, tools }) + formatBedrockBody({ messages, stopSequences, system, temperature, tools, toolChoice }) ), model, signal, @@ -344,13 +347,23 @@ The Kibana Connector in use may need to be reconfigured with an updated Amazon B maxTokens, signal, timeout, + tools, + toolChoice, }: InvokeAIActionParams, connectorUsageCollector: ConnectorUsageCollector ): Promise { const res = (await this.runApi( { body: JSON.stringify( - formatBedrockBody({ messages, stopSequences, system, temperature, maxTokens }) + formatBedrockBody({ + messages, + stopSequences, + system, + temperature, + maxTokens, + tools, + toolChoice, + }) ), model, signal, @@ -372,6 +385,7 @@ The Kibana Connector in use may need to be reconfigured with an updated Amazon B signal, timeout, tools, + toolChoice, anthropicVersion, }: InvokeAIRawActionParams, connectorUsageCollector: ConnectorUsageCollector @@ -385,6 +399,7 @@ The Kibana Connector in use may need to be reconfigured with an updated Amazon B temperature, max_tokens: maxTokens, tools, + tool_choice: toolChoice, anthropic_version: anthropicVersion, }), model, @@ -405,14 +420,16 @@ const formatBedrockBody = ({ system, maxTokens = DEFAULT_TOKEN_LIMIT, tools, + toolChoice, }: { - messages: Array<{ role: string; content?: string }>; + messages: BedRockMessage[]; stopSequences?: string[]; temperature?: number; maxTokens?: number; // optional system message to be sent to the API system?: string; tools?: Array<{ name: string; description: string }>; + toolChoice?: BedrockToolChoice; }) => ({ anthropic_version: 'bedrock-2023-05-31', ...ensureMessageFormat(messages, system), @@ -420,8 +437,14 @@ const formatBedrockBody = ({ stop_sequences: stopSequences, temperature, tools, + tool_choice: toolChoice, }); +interface FormattedBedRockMessage { + role: string; + content: string | BedRockMessage['rawContent']; +} + /** * Ensures that the messages are in the correct format for the Bedrock API * If 2 user or 2 assistant messages are sent in a row, Bedrock throws an error @@ -429,19 +452,32 @@ const formatBedrockBody = ({ * @param messages */ const ensureMessageFormat = ( - messages: Array<{ role: string; content?: string }>, + messages: BedRockMessage[], systemPrompt?: string -): { messages: Array<{ role: string; content?: string }>; system?: string } => { +): { + messages: FormattedBedRockMessage[]; + system?: string; +} => { let system = systemPrompt ? systemPrompt : ''; - const newMessages = messages.reduce((acc: Array<{ role: string; content?: string }>, m) => { - const lastMessage = acc[acc.length - 1]; + const newMessages = messages.reduce((acc, m) => { if (m.role === 'system') { system = `${system.length ? `${system}\n` : ''}${m.content}`; return acc; } - if (lastMessage && lastMessage.role === m.role) { + const messageRole = () => (['assistant', 'ai'].includes(m.role) ? 'assistant' : 'user'); + + if (m.rawContent) { + acc.push({ + role: messageRole(), + content: m.rawContent, + }); + return acc; + } + + const lastMessage = acc[acc.length - 1]; + if (lastMessage && lastMessage.role === m.role && typeof lastMessage.content === 'string') { // Bedrock only accepts assistant and user roles. // If 2 user or 2 assistant messages are sent in a row, combine the messages into a single message return [ @@ -451,11 +487,9 @@ const ensureMessageFormat = ( } // force role outside of system to ensure it is either assistant or user - return [ - ...acc, - { content: m.content, role: ['assistant', 'ai'].includes(m.role) ? 'assistant' : 'user' }, - ]; + return [...acc, { content: m.content, role: messageRole() }]; }, []); + return system.length ? { system, messages: newMessages } : { messages: newMessages }; }; diff --git a/x-pack/plugins/task_manager/server/task_running/task_runner.test.ts b/x-pack/plugins/task_manager/server/task_running/task_runner.test.ts index 9274e0583547e..899586abcc9f7 100644 --- a/x-pack/plugins/task_manager/server/task_running/task_runner.test.ts +++ b/x-pack/plugins/task_manager/server/task_running/task_runner.test.ts @@ -2061,6 +2061,97 @@ describe('TaskManagerRunner', () => { ); expect(onTaskEvent).toHaveBeenCalledTimes(2); }); + + test('emits TaskEvent when failing to update a recurring task', async () => { + const id = _.random(1, 20).toString(); + const runAt = minutesFromNow(_.random(5)); + const onTaskEvent = jest.fn(); + const { runner, instance, store } = await readyToRunStageSetup({ + onTaskEvent, + instance: { + id, + schedule: { interval: '1m' }, + }, + definitions: { + bar: { + title: 'Bar!', + createTaskRunner: () => ({ + async run() { + return { runAt, state: {} }; + }, + }), + }, + }, + }); + + const error = new Error('fail'); + + store.update.mockImplementation(() => { + throw error; + }); + + await expect(runner.run()).rejects.toThrowError('fail'); + + expect(onTaskEvent).toHaveBeenCalledWith( + withAnyTiming( + asTaskRunEvent( + id, + asErr({ + task: instance, + persistence: TaskPersistence.Recurring, + result: TaskRunResult.Failed, + isExpired: false, + error, + }) + ) + ) + ); + }); + + test('emits TaskEvent when failing to update a non-recurring task', async () => { + const id = _.random(1, 20).toString(); + const runAt = minutesFromNow(_.random(5)); + const onTaskEvent = jest.fn(); + const { runner, instance, store } = await readyToRunStageSetup({ + onTaskEvent, + instance: { + id, + }, + definitions: { + bar: { + title: 'Bar!', + createTaskRunner: () => ({ + async run() { + return { runAt, state: {} }; + }, + }), + }, + }, + }); + + const error = new Error('fail'); + + store.update.mockImplementation(() => { + throw error; + }); + + await expect(runner.run()).rejects.toThrowError('fail'); + + expect(onTaskEvent).toHaveBeenCalledWith( + withAnyTiming( + asTaskRunEvent( + id, + asErr({ + task: instance, + persistence: TaskPersistence.NonRecurring, + result: TaskRunResult.Failed, + isExpired: false, + error, + }) + ) + ) + ); + }); }); test('does not update saved object if task expires', async () => { diff --git a/x-pack/plugins/task_manager/server/task_running/task_runner.ts b/x-pack/plugins/task_manager/server/task_running/task_runner.ts index 6eaaf2cd2881f..bfcabed9f6e45 100644 --- a/x-pack/plugins/task_manager/server/task_running/task_runner.ts +++ b/x-pack/plugins/task_manager/server/task_running/task_runner.ts @@ -719,40 +719,54 @@ export class TaskManagerRunner implements TaskRunner { await eitherAsync( result, async ({ runAt, schedule, taskRunError }: SuccessfulRunResult) => { - const processedResult = { - task, - persistence: - schedule || task.schedule ? TaskPersistence.Recurring : TaskPersistence.NonRecurring, - result: await (runAt || schedule || task.schedule - ? this.processResultForRecurringTask(result) - : this.processResultWhenDone()), - }; - - // Alerting task runner returns SuccessfulRunResult with taskRunError - // when the alerting task fails, so we check for this condition in order - // to emit the correct task run event for metrics collection - // taskRunError contains the "source" (TaskErrorSource) data - if (!!taskRunError) { - debugLogger.debug(`Emitting task run failed event for task ${this.taskType}`); + const taskPersistence = + schedule || task.schedule ? TaskPersistence.Recurring : TaskPersistence.NonRecurring; + try { + const processedResult = { + task, + persistence: taskPersistence, + result: await (runAt || schedule || task.schedule + ? this.processResultForRecurringTask(result) + : this.processResultWhenDone()), + }; + + // Alerting task runner returns SuccessfulRunResult with taskRunError + // when the alerting task fails, so we check for this condition in order + // to emit the correct task run event for metrics collection + // taskRunError contains the "source" (TaskErrorSource) data + if (!!taskRunError) { + debugLogger.debug(`Emitting task run failed event for task ${this.taskType}`); + this.onTaskEvent( + asTaskRunEvent( + this.id, + asErr({ ...processedResult, isExpired: taskHasExpired, error: taskRunError }), + taskTiming + ) + ); + } else { + this.onTaskEvent( + asTaskRunEvent( + this.id, + asOk({ ...processedResult, isExpired: taskHasExpired }), + taskTiming + ) + ); + } + } catch (err) { this.onTaskEvent( asTaskRunEvent( this.id, asErr({ - ...processedResult, + task, + persistence: taskPersistence, + result: TaskRunResult.Failed, isExpired: taskHasExpired, - error: taskRunError, + error: err, }), taskTiming ) ); - } else { - this.onTaskEvent( - asTaskRunEvent( - this.id, - asOk({ ...processedResult, isExpired: taskHasExpired }), - taskTiming - ) - ); + throw err; } }, async ({ error }: FailedRunResult) => { diff --git a/x-pack/plugins/transform/common/types/transform.ts b/x-pack/plugins/transform/common/types/transform.ts index 2e244e69b70fa..913b1541f2615 100644 --- a/x-pack/plugins/transform/common/types/transform.ts +++ b/x-pack/plugins/transform/common/types/transform.ts @@ -7,7 +7,10 @@ import type { EuiComboBoxOptionOption } from '@elastic/eui/src/components/combo_box/types'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; -import type { LatestFunctionConfig, PutTransformsRequestSchema } from '../api_schemas/transforms'; +import type { + LatestFunctionConfig, + PutTransformsRequestSchema, +} from '../../server/routes/api_schemas/transforms'; import type { PivotGroupByDict } from './pivot_group_by'; import type { PivotAggDict } from './pivot_aggs'; import type { TransformHealthAlertRule } from './alerting'; diff --git a/x-pack/plugins/transform/public/app/app.tsx b/x-pack/plugins/transform/public/app/app.tsx index c6481f7440425..d2d7af9e69b8a 100644 --- a/x-pack/plugins/transform/public/app/app.tsx +++ b/x-pack/plugins/transform/public/app/app.tsx @@ -14,7 +14,7 @@ import type { ScopedHistory } from '@kbn/core/public'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; -import type { ExperimentalFeatures } from '../../common/config'; +import type { ExperimentalFeatures } from '../../server/config'; import { SECTION_SLUG } from './common/constants'; import type { AppDependencies } from './app_dependencies'; import { CloneTransformSection } from './sections/clone_transform'; diff --git a/x-pack/plugins/transform/public/app/common/data_grid.ts b/x-pack/plugins/transform/public/app/common/data_grid.ts index cb7c048e765f1..9030b4df6ea5e 100644 --- a/x-pack/plugins/transform/public/app/common/data_grid.ts +++ b/x-pack/plugins/transform/public/app/common/data_grid.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { PostTransformsPreviewRequestSchema } from '../../../common/api_schemas/transforms'; +import type { PostTransformsPreviewRequestSchema } from '../../../server/routes/api_schemas/transforms'; import type { TransformConfigQuery } from './request'; diff --git a/x-pack/plugins/transform/public/app/common/request.ts b/x-pack/plugins/transform/public/app/common/request.ts index 432574270cb82..6d854d5c4e072 100644 --- a/x-pack/plugins/transform/public/app/common/request.ts +++ b/x-pack/plugins/transform/public/app/common/request.ts @@ -14,19 +14,19 @@ import { type SavedSearchQuery, } from '@kbn/ml-query-utils'; -import { - DEFAULT_CONTINUOUS_MODE_DELAY, - DEFAULT_TRANSFORM_FREQUENCY, - DEFAULT_TRANSFORM_SETTINGS_DOCS_PER_SECOND, - DEFAULT_TRANSFORM_SETTINGS_MAX_PAGE_SEARCH_SIZE, -} from '../../../common/constants'; import type { PivotTransformPreviewRequestSchema, PostTransformsPreviewRequestSchema, PutTransformsLatestRequestSchema, PutTransformsPivotRequestSchema, PutTransformsRequestSchema, -} from '../../../common/api_schemas/transforms'; +} from '../../../server/routes/api_schemas/transforms'; +import { + DEFAULT_CONTINUOUS_MODE_DELAY, + DEFAULT_TRANSFORM_FREQUENCY, + DEFAULT_TRANSFORM_SETTINGS_DOCS_PER_SECOND, + DEFAULT_TRANSFORM_SETTINGS_MAX_PAGE_SEARCH_SIZE, +} from '../../../common/constants'; import type { DateHistogramAgg, HistogramAgg, diff --git a/x-pack/plugins/transform/public/app/common/transform_stats.ts b/x-pack/plugins/transform/public/app/common/transform_stats.ts index 71103ad71f61f..901a87ca03d61 100644 --- a/x-pack/plugins/transform/public/app/common/transform_stats.ts +++ b/x-pack/plugins/transform/public/app/common/transform_stats.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { TRANSFORM_STATE } from '../../../common/constants'; - -import type { TransformListRow } from './transform_list'; import type { PutTransformsLatestRequestSchema, PutTransformsPivotRequestSchema, -} from '../../../common/api_schemas/transforms'; +} from '../../../server/routes/api_schemas/transforms'; +import { TRANSFORM_STATE } from '../../../common/constants'; + +import type { TransformListRow } from './transform_list'; type TransformItem = Omit & { config: diff --git a/x-pack/plugins/transform/public/app/hooks/use_create_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_create_transform.tsx index 53682db36c029..d943a7797ddfd 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_create_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_create_transform.tsx @@ -14,7 +14,7 @@ import { toMountPoint } from '@kbn/react-kibana-mount'; import type { PutTransformsRequestSchema, PutTransformsResponseSchema, -} from '../../../common/api_schemas/transforms'; +} from '../../../server/routes/api_schemas/transforms'; import { addInternalBasePath } from '../../../common/constants'; import type { TransformId } from '../../../common/types/transform'; import { getErrorMessage } from '../../../common/utils/errors'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx index 3a933dcc9e935..1f3dfd80a254a 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_delete_transform.tsx @@ -12,11 +12,11 @@ import { i18n } from '@kbn/i18n'; import { toMountPoint } from '@kbn/react-kibana-mount'; import { extractErrorMessage } from '@kbn/ml-error-utils'; -import { addInternalBasePath } from '../../../common/constants'; import type { DeleteTransformsRequestSchema, DeleteTransformsResponseSchema, -} from '../../../common/api_schemas/delete_transforms'; +} from '../../../server/routes/api_schemas/delete_transforms'; +import { addInternalBasePath } from '../../../common/constants'; import { getErrorMessage } from '../../../common/utils/errors'; import { useAppDependencies, useToastNotifications } from '../app_dependencies'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_get_histograms_for_fields.ts b/x-pack/plugins/transform/public/app/hooks/use_get_histograms_for_fields.ts index 5ed81888f4933..5d354aa1c7dc8 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_get_histograms_for_fields.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_get_histograms_for_fields.ts @@ -12,11 +12,11 @@ import type { KBN_FIELD_TYPES } from '@kbn/field-types'; import { DEFAULT_SAMPLER_SHARD_SIZE } from '@kbn/ml-agg-utils'; import type { SavedSearchQuery } from '@kbn/ml-query-utils'; -import { addInternalBasePath, TRANSFORM_REACT_QUERY_KEYS } from '../../../common/constants'; import type { FieldHistogramsRequestSchema, FieldHistogramsResponseSchema, -} from '../../../common/api_schemas/field_histograms'; +} from '../../../server/routes/api_schemas/field_histograms'; +import { addInternalBasePath, TRANSFORM_REACT_QUERY_KEYS } from '../../../common/constants'; import { useAppDependencies } from '../app_dependencies'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_get_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_get_transform.tsx index b9e3d977c71bd..56ffda74f122b 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_get_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_get_transform.tsx @@ -9,7 +9,7 @@ import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { GetTransformsResponseSchema } from '../../../common/api_schemas/transforms'; +import type { GetTransformsResponseSchema } from '../../../server/routes/api_schemas/transforms'; import { addInternalBasePath, TRANSFORM_REACT_QUERY_KEYS } from '../../../common/constants'; import type { TransformId } from '../../../common/types/transform'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_get_transform_audit_messages.ts b/x-pack/plugins/transform/public/app/hooks/use_get_transform_audit_messages.ts index 5332c0390e2af..2c25af1ebcbe6 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_get_transform_audit_messages.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_get_transform_audit_messages.ts @@ -9,7 +9,7 @@ import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { GetTransformsAuditMessagesResponseSchema } from '../../../common/api_schemas/audit_messages'; +import type { GetTransformsAuditMessagesResponseSchema } from '../../../server/routes/api_schemas/audit_messages'; import { addInternalBasePath, TRANSFORM_REACT_QUERY_KEYS } from '../../../common/constants'; import type { TransformMessage } from '../../../common/types/messages'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_get_transform_nodes.ts b/x-pack/plugins/transform/public/app/hooks/use_get_transform_nodes.ts index 60b31f9187fd6..08a400b1cfd78 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_get_transform_nodes.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_get_transform_nodes.ts @@ -9,7 +9,7 @@ import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { GetTransformNodesResponseSchema } from '../../../common/api_schemas/transforms'; +import type { GetTransformNodesResponseSchema } from '../../../server/routes/api_schemas/transforms'; import { addInternalBasePath, DEFAULT_REFRESH_INTERVAL_MS, diff --git a/x-pack/plugins/transform/public/app/hooks/use_get_transform_stats.ts b/x-pack/plugins/transform/public/app/hooks/use_get_transform_stats.ts index 9fa98429394a7..400ac5d295f7b 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_get_transform_stats.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_get_transform_stats.ts @@ -9,7 +9,7 @@ import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { GetTransformsStatsResponseSchema } from '../../../common/api_schemas/transforms_stats'; +import type { GetTransformsStatsResponseSchema } from '../../../server/routes/api_schemas/transforms_stats'; import { addInternalBasePath, TRANSFORM_REACT_QUERY_KEYS } from '../../../common/constants'; import type { TransformId } from '../../../common/types/transform'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_get_transforms.ts b/x-pack/plugins/transform/public/app/hooks/use_get_transforms.ts index f4afb03c4e4c0..51c46a2562db5 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_get_transforms.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_get_transforms.ts @@ -10,7 +10,7 @@ import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import { isDefined } from '@kbn/ml-is-defined'; -import type { GetTransformsResponseSchema } from '../../../common/api_schemas/transforms'; +import type { GetTransformsResponseSchema } from '../../../server/routes/api_schemas/transforms'; import { addInternalBasePath, DEFAULT_REFRESH_INTERVAL_MS, diff --git a/x-pack/plugins/transform/public/app/hooks/use_get_transforms_preview.ts b/x-pack/plugins/transform/public/app/hooks/use_get_transforms_preview.ts index ae671912b9267..fea299fe26d9e 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_get_transforms_preview.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_get_transforms_preview.ts @@ -12,7 +12,7 @@ import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { PostTransformsPreviewRequestSchema, PostTransformsPreviewResponseSchema, -} from '../../../common/api_schemas/transforms'; +} from '../../../server/routes/api_schemas/transforms'; import { addInternalBasePath, TRANSFORM_REACT_QUERY_KEYS } from '../../../common/constants'; import { useAppDependencies } from '../app_dependencies'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_reauthorize_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_reauthorize_transform.tsx index 65d98bbea0141..8d412d9b72a2b 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_reauthorize_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_reauthorize_transform.tsx @@ -12,12 +12,12 @@ import { i18n } from '@kbn/i18n'; import { toMountPoint } from '@kbn/react-kibana-mount'; -import { addInternalBasePath } from '../../../common/constants'; -import { getErrorMessage } from '../../../common/utils/errors'; import type { ReauthorizeTransformsRequestSchema, ReauthorizeTransformsResponseSchema, -} from '../../../common/api_schemas/reauthorize_transforms'; +} from '../../../server/routes/api_schemas/reauthorize_transforms'; +import { addInternalBasePath } from '../../../common/constants'; +import { getErrorMessage } from '../../../common/utils/errors'; import { useAppDependencies, useToastNotifications } from '../app_dependencies'; import { ToastNotificationText } from '../components'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_reset_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_reset_transform.tsx index 212cb2e9b629f..b2991b16dfdd4 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_reset_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_reset_transform.tsx @@ -14,7 +14,7 @@ import { toMountPoint } from '@kbn/react-kibana-mount'; import type { ResetTransformsRequestSchema, ResetTransformsResponseSchema, -} from '../../../common/api_schemas/reset_transforms'; +} from '../../../server/routes/api_schemas/reset_transforms'; import { addInternalBasePath } from '../../../common/constants'; import { getErrorMessage } from '../../../common/utils/errors'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_schedule_now_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_schedule_now_transform.tsx index 8511c2092e4ca..3cf175cba996c 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_schedule_now_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_schedule_now_transform.tsx @@ -11,11 +11,11 @@ import { useMutation } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { toMountPoint } from '@kbn/react-kibana-mount'; -import { addInternalBasePath } from '../../../common/constants'; import type { ScheduleNowTransformsRequestSchema, ScheduleNowTransformsResponseSchema, -} from '../../../common/api_schemas/schedule_now_transforms'; +} from '../../../server/routes/api_schemas/schedule_now_transforms'; +import { addInternalBasePath } from '../../../common/constants'; import { getErrorMessage } from '../../../common/utils/errors'; import { useAppDependencies, useToastNotifications } from '../app_dependencies'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_start_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_start_transform.tsx index 73790b09f3b1b..592518b5b84c6 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_start_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_start_transform.tsx @@ -11,11 +11,11 @@ import { useMutation } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { toMountPoint } from '@kbn/react-kibana-mount'; -import { addInternalBasePath } from '../../../common/constants'; import type { StartTransformsRequestSchema, StartTransformsResponseSchema, -} from '../../../common/api_schemas/start_transforms'; +} from '../../../server/routes/api_schemas/start_transforms'; +import { addInternalBasePath } from '../../../common/constants'; import { getErrorMessage } from '../../../common/utils/errors'; import { useAppDependencies, useToastNotifications } from '../app_dependencies'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_stop_transform.tsx b/x-pack/plugins/transform/public/app/hooks/use_stop_transform.tsx index 29939d9fcef7d..80290b2774e41 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_stop_transform.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_stop_transform.tsx @@ -12,11 +12,11 @@ import { i18n } from '@kbn/i18n'; import { toMountPoint } from '@kbn/react-kibana-mount'; -import { addInternalBasePath } from '../../../common/constants'; import type { StopTransformsRequestSchema, StopTransformsResponseSchema, -} from '../../../common/api_schemas/stop_transforms'; +} from '../../../server/routes/api_schemas/stop_transforms'; +import { addInternalBasePath } from '../../../common/constants'; import { getErrorMessage } from '../../../common/utils/errors'; import { useAppDependencies, useToastNotifications } from '../app_dependencies'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_transform_config_data.ts b/x-pack/plugins/transform/public/app/hooks/use_transform_config_data.ts index f18b3778d6af3..e5a9667f209b9 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_transform_config_data.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_transform_config_data.ts @@ -28,7 +28,7 @@ import { INDEX_STATUS, } from '@kbn/ml-data-grid'; -import type { PreviewMappingsProperties } from '../../../common/api_schemas/transforms'; +import type { PreviewMappingsProperties } from '../../../server/routes/api_schemas/transforms'; import { getErrorMessage } from '../../../common/utils/errors'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_update_transform.ts b/x-pack/plugins/transform/public/app/hooks/use_update_transform.ts index 3859f9a8353f0..2cc9a1409d3ee 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_update_transform.ts +++ b/x-pack/plugins/transform/public/app/hooks/use_update_transform.ts @@ -10,7 +10,7 @@ import { useMutation } from '@tanstack/react-query'; import type { PostTransformsUpdateRequestSchema, PostTransformsUpdateResponseSchema, -} from '../../../common/api_schemas/update_transforms'; +} from '../../../server/routes/api_schemas/update_transforms'; import { addInternalBasePath } from '../../../common/constants'; import type { TransformId } from '../../../common/types/transform'; diff --git a/x-pack/plugins/transform/public/app/mount_management_section.ts b/x-pack/plugins/transform/public/app/mount_management_section.ts index edde02eddac42..e28275d203990 100644 --- a/x-pack/plugins/transform/public/app/mount_management_section.ts +++ b/x-pack/plugins/transform/public/app/mount_management_section.ts @@ -13,7 +13,7 @@ import { type TransformEnabledFeatures } from './serverless_context'; import type { PluginsDependencies } from '../plugin'; import { getMlSharedImports } from '../shared_imports'; -import type { ExperimentalFeatures } from '../../common/config'; +import type { ExperimentalFeatures } from '../../server/config'; import type { AppDependencies } from './app_dependencies'; import { breadcrumbService } from './services/navigation'; import { docTitleService } from './services/navigation'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx index e15dec45908a4..61694124d1a89 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx @@ -28,6 +28,10 @@ import { toMountPoint } from '@kbn/react-kibana-mount'; import { DISCOVER_APP_LOCATOR } from '@kbn/discover-plugin/common'; +import type { + PutTransformsLatestRequestSchema, + PutTransformsPivotRequestSchema, +} from '../../../../../../server/routes/api_schemas/transforms'; import { PROGRESS_REFRESH_INTERVAL_MS } from '../../../../../../common/constants'; import { getErrorMessage } from '../../../../../../common/utils/errors'; @@ -37,10 +41,6 @@ import { useCreateTransform, useGetTransformStats, useStartTransforms } from '.. import { useAppDependencies, useToastNotifications } from '../../../../app_dependencies'; import { RedirectToTransformManagement } from '../../../../common/navigation'; import { ToastNotificationText } from '../../../../components'; -import type { - PutTransformsLatestRequestSchema, - PutTransformsPivotRequestSchema, -} from '../../../../../../common/api_schemas/transforms'; import { isContinuousTransform } from '../../../../../../common/types/transform'; import { TransformAlertFlyout } from '../../../../../alerting/transform_alerting_flyout'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/types.ts b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/types.ts index 3f6493664f0e2..db880fe915167 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/types.ts +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/types.ts @@ -13,6 +13,7 @@ import type { TimeRange as TimeRangeMs } from '@kbn/ml-date-picker'; import type { RuntimeMappings } from '@kbn/ml-runtime-field-utils'; import type { SavedSearchQuery } from '@kbn/ml-query-utils'; +import type { LatestFunctionConfig } from '../../../../../../../server/routes/api_schemas/transforms'; import type { EsFieldName } from '../../../../../../../common/types/fields'; import type { @@ -26,7 +27,6 @@ import type { LatestFunctionConfigUI, PivotConfigDefinition, } from '../../../../../../../common/types/transform'; -import type { LatestFunctionConfig } from '../../../../../../../common/api_schemas/transforms'; import type { QUERY_LANGUAGE } from './constants'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_pivot_editor.ts b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_pivot_editor.ts index a67f693446f93..7e7c9470704c2 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_pivot_editor.ts +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_pivot_editor.ts @@ -10,7 +10,7 @@ import { XJsonMode } from '@kbn/ace'; import { XJson } from '@kbn/es-ui-shared-plugin/public'; -import type { PostTransformsPreviewRequestSchema } from '../../../../../../../common/api_schemas/transforms'; +import type { PostTransformsPreviewRequestSchema } from '../../../../../../../server/routes/api_schemas/transforms'; import type { StepDefineExposedState } from '../common'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_source_editor.ts b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_source_editor.ts index 72ae6c951c692..792f2a4e38f9c 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_source_editor.ts +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_advanced_source_editor.ts @@ -7,7 +7,7 @@ import { useState } from 'react'; -import type { PostTransformsPreviewRequestSchema } from '../../../../../../../common/api_schemas/transforms'; +import type { PostTransformsPreviewRequestSchema } from '../../../../../../../server/routes/api_schemas/transforms'; import type { StepDefineExposedState } from '../common'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_latest_function_config.ts b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_latest_function_config.ts index 72a858231c7b3..f0530ee9afa70 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_latest_function_config.ts +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_latest_function_config.ts @@ -10,10 +10,10 @@ import { i18n } from '@kbn/i18n'; import type { EuiComboBoxOptionOption } from '@elastic/eui'; import type { AggConfigs, FieldParamType } from '@kbn/data-plugin/common'; import { isCounterTimeSeriesMetric } from '@kbn/ml-agg-utils'; +import type { LatestFunctionConfig } from '../../../../../../../server/routes/api_schemas/transforms'; import type { LatestFunctionConfigUI } from '../../../../../../../common/types/transform'; import type { StepDefineFormProps } from '../step_define_form'; import type { StepDefineExposedState } from '../common'; -import type { LatestFunctionConfig } from '../../../../../../../common/api_schemas/transforms'; import { useAppDependencies } from '../../../../../app_dependencies'; /** diff --git a/x-pack/plugins/transform/public/app/sections/edit_transform/components/edit_transform_retention_policy.tsx b/x-pack/plugins/transform/public/app/sections/edit_transform/components/edit_transform_retention_policy.tsx index b49eb67b0db08..119302cab7581 100644 --- a/x-pack/plugins/transform/public/app/sections/edit_transform/components/edit_transform_retention_policy.tsx +++ b/x-pack/plugins/transform/public/app/sections/edit_transform/components/edit_transform_retention_policy.tsx @@ -12,7 +12,7 @@ import { EuiFormRow, EuiSelect, EuiSpacer, EuiSwitch } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { toMountPoint } from '@kbn/react-kibana-mount'; -import type { PostTransformsPreviewRequestSchema } from '../../../../../common/api_schemas/transforms'; +import type { PostTransformsPreviewRequestSchema } from '../../../../../server/routes/api_schemas/transforms'; import { isLatestTransform, isPivotTransform } from '../../../../../common/types/transform'; import { getErrorMessage } from '../../../../../common/utils/errors'; diff --git a/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/apply_form_state_to_transform_config.ts b/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/apply_form_state_to_transform_config.ts index 2e0f7d05ad287..a4610b440bbf2 100644 --- a/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/apply_form_state_to_transform_config.ts +++ b/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/apply_form_state_to_transform_config.ts @@ -7,7 +7,7 @@ import { merge } from 'lodash'; -import type { PostTransformsUpdateRequestSchema } from '../../../../../common/api_schemas/update_transforms'; +import type { PostTransformsUpdateRequestSchema } from '../../../../../server/routes/api_schemas/update_transforms'; import type { TransformConfigUnion } from '../../../../../common/types/transform'; import { getUpdateValue } from './get_update_value'; diff --git a/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/get_update_value.ts b/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/get_update_value.ts index 82c6f012cdaf9..4a1164244aad0 100644 --- a/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/get_update_value.ts +++ b/x-pack/plugins/transform/public/app/sections/edit_transform/state_management/get_update_value.ts @@ -9,7 +9,7 @@ import { merge } from 'lodash'; import { getNestedProperty, setNestedProperty } from '@kbn/ml-nested-property'; -import type { PostTransformsUpdateRequestSchema } from '../../../../../common/api_schemas/update_transforms'; +import type { PostTransformsUpdateRequestSchema } from '../../../../../server/routes/api_schemas/update_transforms'; import type { TransformConfigUnion } from '../../../../../common/types/transform'; import type { FormFields, FormFieldsState } from './form_field'; diff --git a/x-pack/plugins/transform/public/app/serverless_context.tsx b/x-pack/plugins/transform/public/app/serverless_context.tsx index 9faa5e0946be1..f22051b93555f 100644 --- a/x-pack/plugins/transform/public/app/serverless_context.tsx +++ b/x-pack/plugins/transform/public/app/serverless_context.tsx @@ -7,7 +7,7 @@ import type { FC, PropsWithChildren } from 'react'; import React, { createContext, useContext, useMemo } from 'react'; -import type { ExperimentalFeatures } from '../../common/config'; +import type { ExperimentalFeatures } from '../../server/config'; export interface TransformEnabledFeatures { showNodeInfo: boolean; diff --git a/x-pack/plugins/transform/public/plugin.ts b/x-pack/plugins/transform/public/plugin.ts index 41e657481b59f..f1677bbcb7c78 100644 --- a/x-pack/plugins/transform/public/plugin.ts +++ b/x-pack/plugins/transform/public/plugin.ts @@ -25,7 +25,7 @@ import type { ContentManagementPublicStart } from '@kbn/content-management-plugi import type { SavedSearchPublicPluginStart } from '@kbn/saved-search-plugin/public'; import type { PluginInitializerContext } from '@kbn/core/public'; import type { DataViewEditorStart } from '@kbn/data-view-editor-plugin/public'; -import type { ConfigSchema } from '../common/config'; +import type { ConfigSchema } from '../server/config'; import { registerFeature } from './register_feature'; import { getTransformHealthRuleType } from './alerting'; diff --git a/x-pack/plugins/transform/common/config.ts b/x-pack/plugins/transform/server/config.ts similarity index 100% rename from x-pack/plugins/transform/common/config.ts rename to x-pack/plugins/transform/server/config.ts diff --git a/x-pack/plugins/transform/server/index.ts b/x-pack/plugins/transform/server/index.ts index 692593b0a0976..54dec8e6318a2 100644 --- a/x-pack/plugins/transform/server/index.ts +++ b/x-pack/plugins/transform/server/index.ts @@ -6,7 +6,7 @@ */ import type { PluginInitializerContext, PluginConfigDescriptor } from '@kbn/core/server'; -import { configSchema, type ConfigSchema } from '../common/config'; +import { configSchema, type ConfigSchema } from './config'; export const plugin = async (ctx: PluginInitializerContext) => { const { TransformServerPlugin } = await import('./plugin'); diff --git a/x-pack/plugins/transform/server/routes/api/audit_messages/register_route.ts b/x-pack/plugins/transform/server/routes/api/audit_messages/register_route.ts index be1c0ef34ccae..00dd124f1aa01 100644 --- a/x-pack/plugins/transform/server/routes/api/audit_messages/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/audit_messages/register_route.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { addInternalBasePath } from '../../../../common/constants'; -import type { TransformIdParamSchema } from '../../../../common/api_schemas/common'; -import { transformIdParamSchema } from '../../../../common/api_schemas/common'; +import type { TransformIdParamSchema } from '../../api_schemas/common'; +import { transformIdParamSchema } from '../../api_schemas/common'; import { getTransformAuditMessagesQuerySchema, type GetTransformAuditMessagesQuerySchema, -} from '../../../../common/api_schemas/audit_messages'; +} from '../../api_schemas/audit_messages'; +import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/audit_messages/route_handler.ts b/x-pack/plugins/transform/server/routes/api/audit_messages/route_handler.ts index defde2da54083..aeea12c881a46 100644 --- a/x-pack/plugins/transform/server/routes/api/audit_messages/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/audit_messages/route_handler.ts @@ -7,11 +7,11 @@ import type { RequestHandler } from '@kbn/core/server'; +import type { TransformIdParamSchema } from '../../api_schemas/common'; import { DEFAULT_MAX_AUDIT_MESSAGE_SIZE, TRANSFORM_NOTIFICATIONS_INDEX, } from '../../../../common/constants'; -import type { TransformIdParamSchema } from '../../../../common/api_schemas/common'; import type { AuditMessage } from '../../../../common/types/messages'; import { wrapError, wrapEsError } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/delete_transforms/delete_transforms.ts b/x-pack/plugins/transform/server/routes/api/delete_transforms/delete_transforms.ts index 3a5c2ffd89675..0a3cabba9b5d5 100644 --- a/x-pack/plugins/transform/server/routes/api/delete_transforms/delete_transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/delete_transforms/delete_transforms.ts @@ -10,13 +10,13 @@ import type { DataViewsService } from '@kbn/data-views-plugin/common'; import { deleteDataViewFn } from '@kbn/ml-data-view-utils/actions/delete'; import type { DeleteDataViewApiResponseSchema } from '@kbn/ml-data-view-utils/types/api_delete_response_schema'; +import type { ResponseStatus } from '../../api_schemas/common'; import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import { TRANSFORM_STATE } from '../../../../common/constants'; -import type { ResponseStatus } from '../../../../common/api_schemas/common'; import type { DeleteTransformsRequestSchema, DeleteTransformsResponseSchema, -} from '../../../../common/api_schemas/delete_transforms'; +} from '../../api_schemas/delete_transforms'; import { isRequestTimeout, fillResultsWithTimeouts } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/delete_transforms/register_route.ts b/x-pack/plugins/transform/server/routes/api/delete_transforms/register_route.ts index 3646889f2c005..20c169c79dda0 100644 --- a/x-pack/plugins/transform/server/routes/api/delete_transforms/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/delete_transforms/register_route.ts @@ -8,7 +8,7 @@ import { deleteTransformsRequestSchema, type DeleteTransformsRequestSchema, -} from '../../../../common/api_schemas/delete_transforms'; +} from '../../api_schemas/delete_transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/delete_transforms/route_handler_factory.ts b/x-pack/plugins/transform/server/routes/api/delete_transforms/route_handler_factory.ts index c55fa798d24eb..2fa071d014445 100644 --- a/x-pack/plugins/transform/server/routes/api/delete_transforms/route_handler_factory.ts +++ b/x-pack/plugins/transform/server/routes/api/delete_transforms/route_handler_factory.ts @@ -7,7 +7,7 @@ import type { RequestHandler } from '@kbn/core/server'; -import { type DeleteTransformsRequestSchema } from '../../../../common/api_schemas/delete_transforms'; +import { type DeleteTransformsRequestSchema } from '../../api_schemas/delete_transforms'; import type { TransformRequestHandlerContext } from '../../../services/license'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/field_histograms/register_route.ts b/x-pack/plugins/transform/server/routes/api/field_histograms/register_route.ts index d1949f06e1ca5..c3fe803ba2366 100644 --- a/x-pack/plugins/transform/server/routes/api/field_histograms/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/field_histograms/register_route.ts @@ -5,12 +5,11 @@ * 2.0. */ +import type { DataViewTitleSchema } from '../../api_schemas/common'; +import { dataViewTitleSchema } from '../../api_schemas/common'; +import type { FieldHistogramsRequestSchema } from '../../api_schemas/field_histograms'; +import { fieldHistogramsRequestSchema } from '../../api_schemas/field_histograms'; import { addInternalBasePath } from '../../../../common/constants'; - -import type { DataViewTitleSchema } from '../../../../common/api_schemas/common'; -import { dataViewTitleSchema } from '../../../../common/api_schemas/common'; -import type { FieldHistogramsRequestSchema } from '../../../../common/api_schemas/field_histograms'; -import { fieldHistogramsRequestSchema } from '../../../../common/api_schemas/field_histograms'; import type { RouteDependencies } from '../../../types'; import { routeHandler } from './route_handler'; diff --git a/x-pack/plugins/transform/server/routes/api/field_histograms/route_handler.ts b/x-pack/plugins/transform/server/routes/api/field_histograms/route_handler.ts index 1d3c8183840fb..443a67e73aabf 100644 --- a/x-pack/plugins/transform/server/routes/api/field_histograms/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/field_histograms/route_handler.ts @@ -8,8 +8,8 @@ import type { RequestHandler } from '@kbn/core/server'; import { fetchHistogramsForFields } from '@kbn/ml-agg-utils'; -import type { DataViewTitleSchema } from '../../../../common/api_schemas/common'; -import type { FieldHistogramsRequestSchema } from '../../../../common/api_schemas/field_histograms'; +import type { DataViewTitleSchema } from '../../api_schemas/common'; +import type { FieldHistogramsRequestSchema } from '../../api_schemas/field_histograms'; import { wrapError, wrapEsError } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/reauthorize_and_start_transforms.ts b/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/reauthorize_and_start_transforms.ts index 45d78999223a1..6a0bfe06d05ac 100644 --- a/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/reauthorize_and_start_transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/reauthorize_and_start_transforms.ts @@ -8,11 +8,11 @@ import type { ElasticsearchClient } from '@kbn/core/server'; import type { TransportRequestOptions } from '@elastic/elasticsearch'; -import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import type { ReauthorizeTransformsRequestSchema, ReauthorizeTransformsResponseSchema, -} from '../../../../common/api_schemas/reauthorize_transforms'; +} from '../../api_schemas/reauthorize_transforms'; +import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import { isRequestTimeout, fillResultsWithTimeouts } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/register_route.ts b/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/register_route.ts index fc5128e0971b6..2826820f8d232 100644 --- a/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/register_route.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { StartTransformsRequestSchema } from '../../../../common/api_schemas/start_transforms'; -import { reauthorizeTransformsRequestSchema } from '../../../../common/api_schemas/reauthorize_transforms'; +import type { StartTransformsRequestSchema } from '../../api_schemas/start_transforms'; +import { reauthorizeTransformsRequestSchema } from '../../api_schemas/reauthorize_transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/route_handler_factory.ts b/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/route_handler_factory.ts index aa63936a3f6e7..1b4dea70ba8e0 100644 --- a/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/route_handler_factory.ts +++ b/x-pack/plugins/transform/server/routes/api/reauthorize_transforms/route_handler_factory.ts @@ -7,8 +7,8 @@ import type { RequestHandler } from '@kbn/core/server'; +import type { StartTransformsRequestSchema } from '../../api_schemas/start_transforms'; import { generateTransformSecondaryAuthHeaders } from '../../../../common/utils/transform_api_key'; -import type { StartTransformsRequestSchema } from '../../../../common/api_schemas/start_transforms'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/server/routes/api/reset_transforms/register_route.ts b/x-pack/plugins/transform/server/routes/api/reset_transforms/register_route.ts index adbe55b8e828d..5a239f0767fa4 100644 --- a/x-pack/plugins/transform/server/routes/api/reset_transforms/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/reset_transforms/register_route.ts @@ -8,7 +8,7 @@ import { resetTransformsRequestSchema, type ResetTransformsRequestSchema, -} from '../../../../common/api_schemas/reset_transforms'; +} from '../../api_schemas/reset_transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/reset_transforms/reset_transforms.ts b/x-pack/plugins/transform/server/routes/api/reset_transforms/reset_transforms.ts index e9d2edd52f440..5af2dd2e3fece 100644 --- a/x-pack/plugins/transform/server/routes/api/reset_transforms/reset_transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/reset_transforms/reset_transforms.ts @@ -7,12 +7,12 @@ import type { KibanaResponseFactory, RequestHandlerContext } from '@kbn/core/server'; -import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; -import type { ResponseStatus } from '../../../../common/api_schemas/common'; +import type { ResponseStatus } from '../../api_schemas/common'; import type { ResetTransformsRequestSchema, ResetTransformsResponseSchema, -} from '../../../../common/api_schemas/reset_transforms'; +} from '../../api_schemas/reset_transforms'; +import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import { isRequestTimeout, fillResultsWithTimeouts } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/reset_transforms/route_handler.ts b/x-pack/plugins/transform/server/routes/api/reset_transforms/route_handler.ts index d10a093ae5ee2..b40f4801e4aab 100644 --- a/x-pack/plugins/transform/server/routes/api/reset_transforms/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/reset_transforms/route_handler.ts @@ -7,7 +7,7 @@ import type { RequestHandler } from '@kbn/core/server'; -import type { ResetTransformsRequestSchema } from '../../../../common/api_schemas/reset_transforms'; +import type { ResetTransformsRequestSchema } from '../../api_schemas/reset_transforms'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/register_route.ts b/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/register_route.ts index 0ec8808ae2ecf..75000050ddebb 100644 --- a/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/register_route.ts @@ -8,7 +8,7 @@ import { scheduleNowTransformsRequestSchema, type ScheduleNowTransformsRequestSchema, -} from '../../../../common/api_schemas/schedule_now_transforms'; +} from '../../api_schemas/schedule_now_transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/route_handler.ts b/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/route_handler.ts index 53099f7270b7a..26ba52f3fb948 100644 --- a/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/route_handler.ts @@ -7,7 +7,7 @@ import type { RequestHandler } from '@kbn/core/server'; -import type { ScheduleNowTransformsRequestSchema } from '../../../../common/api_schemas/schedule_now_transforms'; +import type { ScheduleNowTransformsRequestSchema } from '../../api_schemas/schedule_now_transforms'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/schedule_now_transforms.ts b/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/schedule_now_transforms.ts index bc09425e73e45..7d4cb843206ce 100644 --- a/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/schedule_now_transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/schedule_now_transforms/schedule_now_transforms.ts @@ -7,11 +7,11 @@ import type { ElasticsearchClient } from '@kbn/core/server'; -import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import type { ScheduleNowTransformsRequestSchema, ScheduleNowTransformsResponseSchema, -} from '../../../../common/api_schemas/schedule_now_transforms'; +} from '../../api_schemas/schedule_now_transforms'; +import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import { isRequestTimeout, fillResultsWithTimeouts } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/start_transforms/register_route.ts b/x-pack/plugins/transform/server/routes/api/start_transforms/register_route.ts index 5ce3de48e63a3..1ba1a0f098a78 100644 --- a/x-pack/plugins/transform/server/routes/api/start_transforms/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/start_transforms/register_route.ts @@ -8,7 +8,7 @@ import { startTransformsRequestSchema, type StartTransformsRequestSchema, -} from '../../../../common/api_schemas/start_transforms'; +} from '../../api_schemas/start_transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/start_transforms/route_handler.ts b/x-pack/plugins/transform/server/routes/api/start_transforms/route_handler.ts index 50bbf395a5ac7..a479f3b6bab68 100644 --- a/x-pack/plugins/transform/server/routes/api/start_transforms/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/start_transforms/route_handler.ts @@ -7,7 +7,7 @@ import type { RequestHandler } from '@kbn/core/server'; -import type { StartTransformsRequestSchema } from '../../../../common/api_schemas/start_transforms'; +import type { StartTransformsRequestSchema } from '../../api_schemas/start_transforms'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/server/routes/api/start_transforms/start_transforms.ts b/x-pack/plugins/transform/server/routes/api/start_transforms/start_transforms.ts index d8097001df9bb..dc9d4bfe247ed 100644 --- a/x-pack/plugins/transform/server/routes/api/start_transforms/start_transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/start_transforms/start_transforms.ts @@ -7,11 +7,11 @@ import type { ElasticsearchClient } from '@kbn/core/server'; -import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import type { StartTransformsRequestSchema, StartTransformsResponseSchema, -} from '../../../../common/api_schemas/start_transforms'; +} from '../../api_schemas/start_transforms'; +import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; import { isRequestTimeout, fillResultsWithTimeouts } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/stop_transforms/register_route.ts b/x-pack/plugins/transform/server/routes/api/stop_transforms/register_route.ts index b859ee4743c40..5fdc5a97dd55a 100644 --- a/x-pack/plugins/transform/server/routes/api/stop_transforms/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/stop_transforms/register_route.ts @@ -8,7 +8,7 @@ import { stopTransformsRequestSchema, type StopTransformsRequestSchema, -} from '../../../../common/api_schemas/stop_transforms'; +} from '../../api_schemas/stop_transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/stop_transforms/route_handler.ts b/x-pack/plugins/transform/server/routes/api/stop_transforms/route_handler.ts index 3ad753ec24c55..f004003202dd9 100644 --- a/x-pack/plugins/transform/server/routes/api/stop_transforms/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/stop_transforms/route_handler.ts @@ -7,7 +7,7 @@ import type { RequestHandler } from '@kbn/core/server'; -import type { StopTransformsRequestSchema } from '../../../../common/api_schemas/stop_transforms'; +import type { StopTransformsRequestSchema } from '../../api_schemas/stop_transforms'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/server/routes/api/stop_transforms/stop_transforms.ts b/x-pack/plugins/transform/server/routes/api/stop_transforms/stop_transforms.ts index 2096c9f9f0ca5..52263402e8ce8 100644 --- a/x-pack/plugins/transform/server/routes/api/stop_transforms/stop_transforms.ts +++ b/x-pack/plugins/transform/server/routes/api/stop_transforms/stop_transforms.ts @@ -7,12 +7,12 @@ import type { ElasticsearchClient } from '@kbn/core/server'; -import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; -import { TRANSFORM_STATE } from '../../../../common/constants'; import type { StopTransformsRequestSchema, StopTransformsResponseSchema, -} from '../../../../common/api_schemas/stop_transforms'; +} from '../../api_schemas/stop_transforms'; +import { TRANSFORM_ACTIONS } from '../../../../common/types/transform'; +import { TRANSFORM_STATE } from '../../../../common/constants'; import { isRequestTimeout, fillResultsWithTimeouts } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_create/register_route.ts b/x-pack/plugins/transform/server/routes/api/transforms_create/register_route.ts index 9237977118d05..7cfb0dc90a410 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_create/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_create/register_route.ts @@ -10,14 +10,11 @@ import { type DataViewCreateQuerySchema, } from '@kbn/ml-data-view-utils/schemas/api_create_query_schema'; -import { - transformIdParamSchema, - type TransformIdParamSchema, -} from '../../../../common/api_schemas/common'; +import { transformIdParamSchema, type TransformIdParamSchema } from '../../api_schemas/common'; import { putTransformsRequestSchema, type PutTransformsRequestSchema, -} from '../../../../common/api_schemas/transforms'; +} from '../../api_schemas/transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_create/route_handler_factory.ts b/x-pack/plugins/transform/server/routes/api/transforms_create/route_handler_factory.ts index 0baa019808e8b..d433901887e95 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_create/route_handler_factory.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_create/route_handler_factory.ts @@ -11,11 +11,11 @@ import type { DataViewCreateQuerySchema } from '@kbn/ml-data-view-utils/schemas/ import { createDataViewFn } from '@kbn/ml-data-view-utils/actions/create'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; -import type { TransformIdParamSchema } from '../../../../common/api_schemas/common'; +import type { TransformIdParamSchema } from '../../api_schemas/common'; import type { PutTransformsRequestSchema, PutTransformsResponseSchema, -} from '../../../../common/api_schemas/transforms'; +} from '../../api_schemas/transforms'; import { isLatestTransform } from '../../../../common/types/transform'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_preview/register_route.ts b/x-pack/plugins/transform/server/routes/api/transforms_preview/register_route.ts index 55e1446dfe5aa..21a902e575b04 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_preview/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_preview/register_route.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { PostTransformsPreviewRequestSchema } from '../../../../common/api_schemas/transforms'; -import { postTransformsPreviewRequestSchema } from '../../../../common/api_schemas/transforms'; +import type { PostTransformsPreviewRequestSchema } from '../../api_schemas/transforms'; +import { postTransformsPreviewRequestSchema } from '../../api_schemas/transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_preview/route_handler.ts b/x-pack/plugins/transform/server/routes/api/transforms_preview/route_handler.ts index 2ce611260836e..b6beb641f0b55 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_preview/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_preview/route_handler.ts @@ -9,7 +9,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { RequestHandler } from '@kbn/core/server'; -import type { PostTransformsPreviewRequestSchema } from '../../../../common/api_schemas/transforms'; +import type { PostTransformsPreviewRequestSchema } from '../../api_schemas/transforms'; import { isLatestTransform } from '../../../../common/types/transform'; import { isKeywordDuplicate } from '../../../../common/utils/field_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_single/register_route.ts b/x-pack/plugins/transform/server/routes/api/transforms_single/register_route.ts index c13c2b996dc7f..30b54b3847992 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_single/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_single/register_route.ts @@ -5,11 +5,8 @@ * 2.0. */ +import { transformIdParamSchema, type TransformIdParamSchema } from '../../api_schemas/common'; import { addInternalBasePath } from '../../../../common/constants'; -import { - transformIdParamSchema, - type TransformIdParamSchema, -} from '../../../../common/api_schemas/common'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_single/route_handler.ts b/x-pack/plugins/transform/server/routes/api/transforms_single/route_handler.ts index 623769707b0e2..7918efa2fff64 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_single/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_single/route_handler.ts @@ -7,7 +7,7 @@ import type { RequestHandler } from '@kbn/core/server'; -import type { TransformIdParamSchema } from '../../../../common/api_schemas/common'; +import type { TransformIdParamSchema } from '../../api_schemas/common'; import { wrapError, wrapEsError } from '../../utils/error_utils'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_stats_all/register_route.ts b/x-pack/plugins/transform/server/routes/api/transforms_stats_all/register_route.ts index 8aa59649af1d4..3136163cf99f5 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_stats_all/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_stats_all/register_route.ts @@ -10,7 +10,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { getTransformStatsQuerySchema, type GetTransformStatsQuerySchema, -} from '../../../../common/api_schemas/transforms_stats'; +} from '../../api_schemas/transforms_stats'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_stats_all/route_handler.ts b/x-pack/plugins/transform/server/routes/api/transforms_stats_all/route_handler.ts index 455dc6174dd53..5f44b2b732d21 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_stats_all/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_stats_all/route_handler.ts @@ -9,7 +9,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { RequestHandler } from '@kbn/core/server'; -import { type GetTransformStatsQuerySchema } from '../../../../common/api_schemas/transforms_stats'; +import { type GetTransformStatsQuerySchema } from '../../api_schemas/transforms_stats'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_stats_single/register_route.ts b/x-pack/plugins/transform/server/routes/api/transforms_stats_single/register_route.ts index 9f7424cd62acf..5e784506ae57a 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_stats_single/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_stats_single/register_route.ts @@ -5,14 +5,11 @@ * 2.0. */ -import { - transformIdParamSchema, - type TransformIdParamSchema, -} from '../../../../common/api_schemas/common'; +import { transformIdParamSchema, type TransformIdParamSchema } from '../../api_schemas/common'; import { getTransformStatsQuerySchema, type GetTransformStatsQuerySchema, -} from '../../../../common/api_schemas/transforms_stats'; +} from '../../api_schemas/transforms_stats'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_stats_single/route_handler.ts b/x-pack/plugins/transform/server/routes/api/transforms_stats_single/route_handler.ts index 50933b04dc205..5b55cdbb9b6ce 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_stats_single/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_stats_single/route_handler.ts @@ -7,8 +7,8 @@ import type { RequestHandler } from '@kbn/core/server'; -import type { TransformIdParamSchema } from '../../../../common/api_schemas/common'; -import type { GetTransformStatsQuerySchema } from '../../../../common/api_schemas/transforms_stats'; +import type { TransformIdParamSchema } from '../../api_schemas/common'; +import type { GetTransformStatsQuerySchema } from '../../api_schemas/transforms_stats'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_update/register_route.ts b/x-pack/plugins/transform/server/routes/api/transforms_update/register_route.ts index a90ce9395bfce..60719e68d596c 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_update/register_route.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_update/register_route.ts @@ -5,14 +5,11 @@ * 2.0. */ -import { - transformIdParamSchema, - type TransformIdParamSchema, -} from '../../../../common/api_schemas/common'; +import { transformIdParamSchema, type TransformIdParamSchema } from '../../api_schemas/common'; import { postTransformsUpdateRequestSchema, type PostTransformsUpdateRequestSchema, -} from '../../../../common/api_schemas/update_transforms'; +} from '../../api_schemas/update_transforms'; import { addInternalBasePath } from '../../../../common/constants'; import type { RouteDependencies } from '../../../types'; diff --git a/x-pack/plugins/transform/server/routes/api/transforms_update/route_handler.ts b/x-pack/plugins/transform/server/routes/api/transforms_update/route_handler.ts index 9a88c4da3d48a..b738b2a0898d5 100644 --- a/x-pack/plugins/transform/server/routes/api/transforms_update/route_handler.ts +++ b/x-pack/plugins/transform/server/routes/api/transforms_update/route_handler.ts @@ -7,8 +7,8 @@ import type { RequestHandler } from '@kbn/core/server'; -import type { TransformIdParamSchema } from '../../../../common/api_schemas/common'; -import type { PostTransformsUpdateRequestSchema } from '../../../../common/api_schemas/update_transforms'; +import type { TransformIdParamSchema } from '../../api_schemas/common'; +import type { PostTransformsUpdateRequestSchema } from '../../api_schemas/update_transforms'; import type { TransformRequestHandlerContext } from '../../../services/license'; diff --git a/x-pack/plugins/transform/common/api_schemas/audit_messages.ts b/x-pack/plugins/transform/server/routes/api_schemas/audit_messages.ts similarity index 91% rename from x-pack/plugins/transform/common/api_schemas/audit_messages.ts rename to x-pack/plugins/transform/server/routes/api_schemas/audit_messages.ts index cb97ba4042dc7..76fac4ce4a5ac 100644 --- a/x-pack/plugins/transform/common/api_schemas/audit_messages.ts +++ b/x-pack/plugins/transform/server/routes/api_schemas/audit_messages.ts @@ -8,7 +8,7 @@ import type { TypeOf } from '@kbn/config-schema'; import { schema } from '@kbn/config-schema'; -import type { TransformMessage } from '../types/messages'; +import type { TransformMessage } from '../../../common/types/messages'; export interface GetTransformsAuditMessagesResponseSchema { messages: TransformMessage[]; diff --git a/x-pack/plugins/transform/common/api_schemas/common.ts b/x-pack/plugins/transform/server/routes/api_schemas/common.ts similarity index 97% rename from x-pack/plugins/transform/common/api_schemas/common.ts rename to x-pack/plugins/transform/server/routes/api_schemas/common.ts index e2465379e1b3c..6eb068c192721 100644 --- a/x-pack/plugins/transform/common/api_schemas/common.ts +++ b/x-pack/plugins/transform/server/routes/api_schemas/common.ts @@ -9,7 +9,7 @@ import type { TypeOf } from '@kbn/config-schema'; import { schema } from '@kbn/config-schema'; import { i18n } from '@kbn/i18n'; import { isRuntimeField } from '@kbn/ml-runtime-field-utils'; -import { TRANSFORM_STATE } from '../constants'; +import { TRANSFORM_STATE } from '../../../common/constants'; export const transformIdsSchema = schema.arrayOf( schema.object({ diff --git a/x-pack/plugins/transform/common/api_schemas/delete_transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/delete_transforms.ts similarity index 100% rename from x-pack/plugins/transform/common/api_schemas/delete_transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/delete_transforms.ts diff --git a/x-pack/plugins/transform/common/api_schemas/field_histograms.ts b/x-pack/plugins/transform/server/routes/api_schemas/field_histograms.ts similarity index 100% rename from x-pack/plugins/transform/common/api_schemas/field_histograms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/field_histograms.ts diff --git a/x-pack/plugins/transform/common/api_schemas/reauthorize_transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/reauthorize_transforms.ts similarity index 100% rename from x-pack/plugins/transform/common/api_schemas/reauthorize_transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/reauthorize_transforms.ts diff --git a/x-pack/plugins/transform/common/api_schemas/reset_transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/reset_transforms.ts similarity index 100% rename from x-pack/plugins/transform/common/api_schemas/reset_transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/reset_transforms.ts diff --git a/x-pack/plugins/transform/common/api_schemas/schedule_now_transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/schedule_now_transforms.ts similarity index 100% rename from x-pack/plugins/transform/common/api_schemas/schedule_now_transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/schedule_now_transforms.ts diff --git a/x-pack/plugins/transform/common/api_schemas/start_transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/start_transforms.ts similarity index 100% rename from x-pack/plugins/transform/common/api_schemas/start_transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/start_transforms.ts diff --git a/x-pack/plugins/transform/common/api_schemas/stop_transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/stop_transforms.ts similarity index 100% rename from x-pack/plugins/transform/common/api_schemas/stop_transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/stop_transforms.ts diff --git a/x-pack/plugins/transform/common/api_schemas/transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/transforms.ts similarity index 95% rename from x-pack/plugins/transform/common/api_schemas/transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/transforms.ts index 2367e2a9eb2a0..a8e991a848552 100644 --- a/x-pack/plugins/transform/common/api_schemas/transforms.ts +++ b/x-pack/plugins/transform/server/routes/api_schemas/transforms.ts @@ -9,10 +9,10 @@ import { schema, type TypeOf } from '@kbn/config-schema'; import type { ES_FIELD_TYPES } from '@kbn/field-types'; import type { CreateDataViewApiResponseSchema } from '@kbn/ml-data-view-utils/types/api_create_response_schema'; -import type { Dictionary } from '../types/common'; -import type { PivotAggDict } from '../types/pivot_aggs'; -import type { PivotGroupByDict } from '../types/pivot_group_by'; -import type { TransformId, TransformConfigUnion } from '../types/transform'; +import type { Dictionary } from '../../../common/types/common'; +import type { PivotAggDict } from '../../../common/types/pivot_aggs'; +import type { PivotGroupByDict } from '../../../common/types/pivot_group_by'; +import type { TransformId, TransformConfigUnion } from '../../../common/types/transform'; import { transformStateSchema, runtimeMappingsSchema } from './common'; diff --git a/x-pack/plugins/transform/common/api_schemas/transforms_stats.ts b/x-pack/plugins/transform/server/routes/api_schemas/transforms_stats.ts similarity index 92% rename from x-pack/plugins/transform/common/api_schemas/transforms_stats.ts rename to x-pack/plugins/transform/server/routes/api_schemas/transforms_stats.ts index 137a0fe9a2048..9286842c1bb60 100644 --- a/x-pack/plugins/transform/common/api_schemas/transforms_stats.ts +++ b/x-pack/plugins/transform/server/routes/api_schemas/transforms_stats.ts @@ -8,7 +8,7 @@ import type { TypeOf } from '@kbn/config-schema'; import { schema } from '@kbn/config-schema'; -import type { TransformStats } from '../types/transform_stats'; +import type { TransformStats } from '../../../common/types/transform_stats'; import { getTransformsRequestSchema } from './transforms'; diff --git a/x-pack/plugins/transform/common/api_schemas/update_transforms.ts b/x-pack/plugins/transform/server/routes/api_schemas/update_transforms.ts similarity index 94% rename from x-pack/plugins/transform/common/api_schemas/update_transforms.ts rename to x-pack/plugins/transform/server/routes/api_schemas/update_transforms.ts index cce50167f0d1d..ce3afbf340da3 100644 --- a/x-pack/plugins/transform/common/api_schemas/update_transforms.ts +++ b/x-pack/plugins/transform/server/routes/api_schemas/update_transforms.ts @@ -8,7 +8,7 @@ import type { TypeOf } from '@kbn/config-schema'; import { schema } from '@kbn/config-schema'; -import type { TransformPivotConfig } from '../types/transform'; +import type { TransformPivotConfig } from '../../../common/types/transform'; import { retentionPolicySchema, settingsSchema, sourceSchema, syncSchema } from './transforms'; diff --git a/x-pack/plugins/transform/server/routes/utils/error_utils.ts b/x-pack/plugins/transform/server/routes/utils/error_utils.ts index 7a9743eea8cf3..0d3f05be45add 100644 --- a/x-pack/plugins/transform/server/routes/utils/error_utils.ts +++ b/x-pack/plugins/transform/server/routes/utils/error_utils.ts @@ -11,12 +11,9 @@ import { i18n } from '@kbn/i18n'; import type { ResponseError, CustomHttpResponseOptions } from '@kbn/core/server'; -import type { - CommonResponseStatusSchema, - TransformIdsSchema, -} from '../../../common/api_schemas/common'; -import type { DeleteTransformsResponseSchema } from '../../../common/api_schemas/delete_transforms'; -import type { ResetTransformsResponseSchema } from '../../../common/api_schemas/reset_transforms'; +import type { CommonResponseStatusSchema, TransformIdsSchema } from '../api_schemas/common'; +import type { DeleteTransformsResponseSchema } from '../api_schemas/delete_transforms'; +import type { ResetTransformsResponseSchema } from '../api_schemas/reset_transforms'; const REQUEST_TIMEOUT = 'RequestTimeout'; diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 03f883be484ba..ec2b9f9604691 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -7010,6 +7010,14 @@ "securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications": "Applications de confiance", "securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications.description": "Aide à atténuer les conflits avec d'autres logiciels, généralement d'autres applications d'antivirus ou de sécurité des points de terminaison.", "securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications.privilegesTooltip": "\"Tous les espaces\" est requis pour l'accès aux applications de confiance.", + "securitySolutionPackages.flyout.right.header.collapseDetailButtonAriaLabel": "Réduire les détails", + "securitySolutionPackages.flyout.right.header.collapseDetailButtonLabel": "Réduire les détails", + "securitySolutionPackages.flyout.right.header.expandDetailButtonAriaLabel": "Développer les détails", + "securitySolutionPackages.flyout.right.header.expandDetailButtonLabel": "Développer les détails", + "securitySolutionPackages.flyout.shared.errorDescription": "Une erreur est survenue lors de l'affichage de {message}.", + "securitySolutionPackages.flyout.shared.errorTitle": "Impossible d'afficher {title}.", + "securitySolutionPackages.flyout.shared.ExpandablePanelButtonIconAriaLabel": "Activer/Désactiver le panneau extensible", + "securitySolutionPackages.flyout.shared.expandablePanelLoadingAriaLabel": "panneau extensible", "securitySolutionPackages.markdown.insight.upsell": "Passez au niveau {requiredLicense} pour pouvoir utiliser les informations des guides d'investigation", "securitySolutionPackages.markdown.investigationGuideInteractions.upsell": "Passez au niveau {requiredLicense} pour pouvoir utiliser les interactions des guides d'investigation", "securitySolutionPackages.navigation.landingLinks": "Vues de sécurité", @@ -11081,8 +11089,8 @@ "xpack.apm.serviceIcons.service": "Service", "xpack.apm.serviceIcons.serviceDetails.cloud.architecture": "Architecture", "xpack.apm.serviceIcons.serviceDetails.cloud.availabilityZoneLabel": "{zones, plural, =0 {Zone de disponibilité} one {Zone de disponibilité} other {Zones de disponibilité}} ", - "xpack.apm.serviceIcons.serviceDetails.cloud.faasTriggerTypeLabel": "{triggerTypes, plural, =0 {Type de déclencheur} one {Type de déclencheur} other {Types de déclencheurs}} ", "xpack.apm.serviceIcons.serviceDetails.cloud.functionNameLabel": "{functionNames, plural, =0 {Nom de fonction} one {Nom de fonction} other {Noms de fonction}} ", + "xpack.apm.serviceIcons.serviceDetails.cloud.faasTriggerTypeLabel": "{triggerTypes, plural, =0 {Type de déclencheur} one {Type de déclencheur} other {Types de déclencheurs}} ", "xpack.apm.serviceIcons.serviceDetails.cloud.machineTypesLabel": "{machineTypes, plural, =0{Type de machine} one {Type de machine} other {Types de machines}} ", "xpack.apm.serviceIcons.serviceDetails.cloud.projectIdLabel": "ID de projet", "xpack.apm.serviceIcons.serviceDetails.cloud.providerLabel": "Fournisseur cloud", @@ -23163,7 +23171,6 @@ "xpack.infra.hostFlyout.explainProcessMessageTitle": "Quel est ce processus ?", "xpack.infra.hosts.searchPlaceholder": "Rechercher dans les hôtes (par ex. cloud.provider:gcp AND system.load.1 > 0.5)", "xpack.infra.hostsPage.goToMetricsSettings": "Vérifier les paramètres", - "xpack.infra.hostsViewPage.betaBadgeDescription": "Cette fonctionnalité est actuellement en version bêta. Nous aimerions beaucoup savoir si vous avez des commentaires ou si vous rencontrez des bugs. Veuillez ouvrir un ticket pour signaler votre problème et/ou partager vos commentaires grâce au bouton \"Dites-nous ce que vous en pensez !\".", "xpack.infra.hostsViewPage.error.detailsButton": "Détails de l'erreur", "xpack.infra.hostsViewPage.error.kqlErrorMessage": "Nous ne pouvons vous montrer aucun résultat car nous n’avons pas pu appliquer votre filtre.", "xpack.infra.hostsViewPage.error.kqlErrorTitle": "Expression KQL non valide", @@ -23242,7 +23249,6 @@ "xpack.infra.kibanaMetrics.cloudIdMissingErrorMessage": "Le modèle de {metricId} nécessite un cloudId, mais aucun n'a été attribué à {nodeId}.", "xpack.infra.kibanaMetrics.invalidInfraMetricErrorMessage": "{id} n'est pas une valeur inframétrique valide", "xpack.infra.kibanaMetrics.nodeDoesNotExistErrorMessage": "{nodeId} n'existe pas.", - "xpack.infra.layout.hostsLandingPageLink": "Présentation d'une nouvelle expérience d'analyse des hôtes", "xpack.infra.layout.tryIt": "Essayer", "xpack.infra.legendControls.applyButton": "Appliquer", "xpack.infra.legendControls.buttonLabel": "configurer la légende", @@ -25715,23 +25721,14 @@ "xpack.lens.metric.groupLabel": "Valeur d’objectif et unique", "xpack.lens.metric.headingLabel": "Valeur", "xpack.lens.metric.icon": "Décoration de l’icône", - "xpack.lens.metric.iconSelect.alertIconLabel": "Alerte", - "xpack.lens.metric.iconSelect.asteriskIconLabel": "Astérisque", - "xpack.lens.metric.iconSelect.bellIconLabel": "Cloche", - "xpack.lens.metric.iconSelect.boltIconLabel": "Éclair", - "xpack.lens.metric.iconSelect.bugIconLabel": "Bug", - "xpack.lens.metric.iconSelect.commentIconLabel": "Commentaire", "xpack.lens.metric.iconSelect.computeLabel": "Calcul", - "xpack.lens.metric.iconSelect.flagIconLabel": "Drapeau", "xpack.lens.metric.iconSelect.globeLabel": "Globe", "xpack.lens.metric.iconSelect.heartLabel": "Cœur", "xpack.lens.metric.iconSelect.mapMarkerLabel": "Repère", "xpack.lens.metric.iconSelect.mapPinLabel": "Punaise", - "xpack.lens.metric.iconSelect.noIconLabel": "Aucun", "xpack.lens.metric.iconSelect.sortDownLabel": "Tri décroissant", "xpack.lens.metric.iconSelect.sortUpLabel": "Tri croissant", "xpack.lens.metric.iconSelect.starLabel": "Étoile", - "xpack.lens.metric.iconSelect.tagIconLabel": "Balise", "xpack.lens.metric.iconSelect.temperatureLabel": "Température", "xpack.lens.metric.label": "Indicateur", "xpack.lens.metric.layerType.trendLine": "Courbe de tendance", @@ -26031,15 +26028,15 @@ "xpack.lens.xyChart.horizontalAxisLabel": "Axe horizontal", "xpack.lens.xyChart.horizontalLeftAxisLabel": "Axe supérieur horizontal", "xpack.lens.xyChart.horizontalRightAxisLabel": "Axe inférieur horizontal", - "xpack.lens.xyChart.iconSelect.alertIconLabel": "Alerte", - "xpack.lens.xyChart.iconSelect.asteriskIconLabel": "Astérisque", - "xpack.lens.xyChart.iconSelect.bellIconLabel": "Cloche", - "xpack.lens.xyChart.iconSelect.boltIconLabel": "Éclair", - "xpack.lens.xyChart.iconSelect.bugIconLabel": "Bug", - "xpack.lens.xyChart.iconSelect.commentIconLabel": "Commentaire", - "xpack.lens.xyChart.iconSelect.flagIconLabel": "Drapeau", - "xpack.lens.xyChart.iconSelect.noIconLabel": "Aucun", - "xpack.lens.xyChart.iconSelect.tagIconLabel": "Balise", + "visualizationUiComponents.iconSelect.alertIconLabel": "Alerte", + "visualizationUiComponents.iconSelect.asteriskIconLabel": "Astérisque", + "visualizationUiComponents.iconSelect.bellIconLabel": "Cloche", + "visualizationUiComponents.iconSelect.boltIconLabel": "Éclair", + "visualizationUiComponents.iconSelect.bugIconLabel": "Bug", + "visualizationUiComponents.iconSelect.commentIconLabel": "Commentaire", + "visualizationUiComponents.iconSelect.flagIconLabel": "Drapeau", + "visualizationUiComponents.iconSelect.noIconLabel": "Aucun", + "visualizationUiComponents.iconSelect.tagIconLabel": "Balise", "xpack.lens.xyChart.layerAnnotation": "Annotation", "xpack.lens.xyChart.layerAnnotationsIgnoreTitle": "Calques ignorant les filtres globaux", "xpack.lens.xyChart.layerAnnotationsLabel": "Annotations", @@ -26954,8 +26951,8 @@ "xpack.maps.source.esSearch.descendingLabel": "décroissant", "xpack.maps.source.esSearch.extentFilterLabel": "Filtre dynamique pour les données de la zone de carte visible", "xpack.maps.source.esSearch.fieldNotFoundMsg": "Impossible de trouver \"{fieldName}\" dans le modèle d'indexation \"{indexPatternName}\".", - "xpack.maps.source.esSearch.geofieldLabel": "Champ géospatial", "xpack.maps.source.esSearch.geoFieldLabel": "Champ géospatial", + "xpack.maps.source.esSearch.geofieldLabel": "Champ géospatial", "xpack.maps.source.esSearch.geoFieldTypeLabel": "Type de champ géospatial", "xpack.maps.source.esSearch.indexOverOneLengthEditError": "Votre vue de données pointe vers plusieurs index. Un seul index est autorisé par vue de données.", "xpack.maps.source.esSearch.indexZeroLengthEditError": "Votre vue de données ne pointe vers aucun index.", @@ -29605,13 +29602,12 @@ "xpack.ml.newJob.wizard.pickFieldsStep.influencers.title": "Influenceurs", "xpack.ml.newJob.wizard.pickFieldsStep.invalidCssVersionCallout.mesage": "Impossible de trouver d'exemples de catégories, cela peut provenir d'une version non prise en charge de l'un des clusters.", "xpack.ml.newJob.wizard.pickFieldsStep.invalidCssVersionCallout.title": "La vue de données semble être inter-clusters.", - "xpack.ml.newJob.wizard.pickFieldsStep.multiMetricView.addMetric": "Ajouter un indicateur", + "xpack.ml.newJob.wizard.pickFieldsStep.metricSelector.addMetric": "Ajouter un indicateur", "xpack.ml.newJob.wizard.pickFieldsStep.noDetectorsCallout.message": "Au moins un détecteur est nécessaire pour créer une tâche.", "xpack.ml.newJob.wizard.pickFieldsStep.noDetectorsCallout.title": "Aucun détecteur", "xpack.ml.newJob.wizard.pickFieldsStep.populationField.description": "Toutes les valeurs du champ sélectionné seront modélisées ensemble en tant que population.", "xpack.ml.newJob.wizard.pickFieldsStep.populationField.placeholder": "Diviser les données", "xpack.ml.newJob.wizard.pickFieldsStep.populationField.title": "Champ de population", - "xpack.ml.newJob.wizard.pickFieldsStep.populationView.addMetric": "Ajouter un indicateur", "xpack.ml.newJob.wizard.pickFieldsStep.populationView.splitFieldTitle": "Population divisée par {field}", "xpack.ml.newJob.wizard.pickFieldsStep.rareDetectorSelect.freqRareCard.description": "Recherchez les membres d'une population qui présentent fréquemment des valeurs rares.", "xpack.ml.newJob.wizard.pickFieldsStep.rareDetectorSelect.freqRareCard.title": "Fréquemment rare dans la population", @@ -33067,13 +33063,11 @@ "xpack.observabilityAiAssistantManagement.settingsPage.logIndexPatternDescription": "Modèle d'index utilisé par l'assistant d'IA lorsqu'il recherche des logs. Les logs sont classés par catégories et utilisés pour l'analyse des causes premières", "xpack.observabilityAiAssistantManagement.settingsPage.searchConnector": "Connecteurs Search", "xpack.observabilityAiAssistantManagement.settingsPage.searchConnectorIndexPatternDescription": "Modèle d'index utilisé par l’assistant d’IA lors de l'interrogation des index des connecteurs de recherche (une partie de la base de connaissances). L'index de chaque connecteur de recherche sera interrogé par défaut", - "xpack.observabilityAiAssistantManagement.settingsPage.selectYourLanguageLabel": "Sélectionnez la langue que vous souhaitez que l'assistant utilise pour générer des réponses.", "xpack.observabilityAiAssistantManagement.settingsPage.settingsLabel": "Paramètres", "xpack.observabilityAiAssistantManagement.settingsPage.showAIAssistantButtonLabel": "Afficher le bouton de l'Assistant d'IA et les informations contextuelles dans les applications d'Observability", "xpack.observabilityAiAssistantManagement.settingsPage.showAIAssistantDescriptionLabel": "Affichez/masquez le bouton de l'Assistant d'IA et les informations contextuelles dans les applications d'Observability en cochant ou en décochant la fonctionnalité Assistant d'IA dans Espaces > > Fonctionnalités.", "xpack.observabilityAiAssistantManagement.settingsPage.simulatedFunctionCallingDescription": "[version d'évaluation technique] Utilisez l'appel de fonction simulé. L’appel de fonction simulé ne nécessite pas la prise en charge de l'API pour les fonctions ou les outils, mais il peut réduire les performances. L'appel de fonction simulé est actuellement toujours activé pour les connecteurs non-OpenAI, indépendamment de ce paramètre.", "xpack.observabilityAiAssistantManagement.settingsPage.simulatedFunctionCallingLabel": "Simuler un appel de fonction", - "xpack.observabilityAiAssistantManagement.settingsPage.userPreferencesLabel": "Langue utilisée pour les réponses", "xpack.observabilityAiAssistantManagement.settingsTab.h3.logIndexPatternLabel": "Modèle d'indexation des logs", "xpack.observabilityAiAssistantManagement.settingsTab.h3.searchConnectorIndexPatternLabel": "Modèle d'indexation de connecteur de recherche", "xpack.observabilityAiAssistantManagement.span.expandRowLabel": "Développer la ligne", @@ -34449,7 +34443,6 @@ "xpack.searchInferenceEndpoints.deleteEndpoint.deleteSuccess": "Le point de terminaison d’inférence a été supprimé avec succès.", "xpack.searchInferenceEndpoints.deleteEndpoint.endpointDeletionFailed": "Échec de la suppression du point de terminaison", "xpack.searchInferenceEndpoints.deploymentStatus.tooltip.modelDeployed": "Le modèle est déployé", - "xpack.searchInferenceEndpoints.deploymentStatus.tooltip.modelFailedToBeDeployed": "Le modèle ne peut être déployé", "xpack.searchInferenceEndpoints.deploymentStatus.tooltip.modelNotDeployed": "Le modèle n’est pas déployé", "xpack.searchInferenceEndpoints.elasticsearch.allocations": "Allocations : {numAllocations}", "xpack.searchInferenceEndpoints.elasticsearch.threads": "Threads : {numThreads}", @@ -36411,8 +36404,8 @@ "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.maxAlertsFieldLessThanWarning": "Kibana ne permet qu'un maximum de {maxNumber} {maxNumber, plural, =1 {alerte} other {alertes}} par exécution de règle.", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.nameFieldRequiredError": "Nom obligatoire.", "xpack.securitySolution.detectionEngine.createRule.stepAboutrule.noteHelpText": "Ajouter un guide d'investigation sur les règles...", - "xpack.securitySolution.detectionEngine.createRule.stepAboutrule.setupHelpText": "Ajouter le guide de configuration de règle...", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.setupHelpText": "Fournissez des instructions sur les conditions préalables à la règle, telles que les intégrations requises, les étapes de configuration et tout ce qui est nécessaire au bon fonctionnement de la règle.", + "xpack.securitySolution.detectionEngine.createRule.stepAboutrule.setupHelpText": "Ajouter le guide de configuration de règle...", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.setupLabel": "Guide de configuration", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.tagFieldEmptyError": "Une balise ne doit pas être vide", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.threatIndicatorPathFieldEmptyError": "Le remplacement du préfixe d'indicateur ne peut pas être vide.", @@ -39220,10 +39213,6 @@ "xpack.securitySolution.flyout.right.alertPreview.ariaLabel": "Voir un aperçu de l'alerte avec l'id {id}", "xpack.securitySolution.flyout.right.eventCategoryText": "Catégorie d'événement", "xpack.securitySolution.flyout.right.header.assignedTitle": "Utilisateurs affectés", - "securitySolutionPackages.flyout.right.header.collapseDetailButtonAriaLabel": "Réduire les détails", - "securitySolutionPackages.flyout.right.header.collapseDetailButtonLabel": "Réduire les détails", - "securitySolutionPackages.flyout.right.header.expandDetailButtonAriaLabel": "Développer les détails", - "securitySolutionPackages.flyout.right.header.expandDetailButtonLabel": "Développer les détails", "xpack.securitySolution.flyout.right.header.headerTitle": "Détails des documents", "xpack.securitySolution.flyout.right.header.jsonTabLabel": "JSON", "xpack.securitySolution.flyout.right.header.overviewTabLabel": "Aperçu", @@ -39310,10 +39299,6 @@ "xpack.securitySolution.flyout.right.visualizations.sessionPreview.timeDescription": "à", "xpack.securitySolution.flyout.right.visualizations.sessionPreview.upsellDescription": "Cette fonctionnalité requiert un {subscription}", "xpack.securitySolution.flyout.right.visualizations.sessionPreview.upsellLinkText": "Abonnement Enterprise", - "securitySolutionPackages.flyout.shared.errorDescription": "Une erreur est survenue lors de l'affichage de {message}.", - "securitySolutionPackages.flyout.shared.errorTitle": "Impossible d'afficher {title}.", - "securitySolutionPackages.flyout.shared.ExpandablePanelButtonIconAriaLabel": "Activer/Désactiver le panneau extensible", - "securitySolutionPackages.flyout.shared.expandablePanelLoadingAriaLabel": "panneau extensible", "xpack.securitySolution.flyout.tour.entities.description": "Consultez la vue {entities} étendue pour en savoir plus sur les hôtes et les utilisateurs liés à l'alerte.", "xpack.securitySolution.flyout.tour.entities.text": "Entités", "xpack.securitySolution.flyout.tour.entities.title": "De nouvelles informations sur les hôtes et les utilisateurs sont disponibles", @@ -41676,7 +41661,6 @@ "xpack.slo.permissionsCallout.readIndexPermission": "Autorisations d'index 'read' ​​et 'view_index_metadata' sur tous les modèles d'index que vous souhaitez utiliser pour créer des SLO", "xpack.slo.permissionsCallout.readSloPermission": "Autorisation 'read' ​​sur le modèle d'index : .slo-*", "xpack.slo.permissionsCallout.title": "Permissions insuffisantes", - "xpack.slo.permissionsCallout.writeClusterPermission": "Autorisations de cluster 'manage_transform' et 'manage_ingest_pipelines'", "xpack.slo.permissionsCallout.writeSloPermission": "Autorisation 'all' sur le modèle d'index : .slo-*", "xpack.slo.queryBuilder.closeButtonLabel": "Fermer", "xpack.slo.queryBuilder.documentsButtonLabel": "Afficher les documents", @@ -42021,8 +42005,8 @@ "xpack.slo.sloEmbeddable.config.sloSelector.placeholder": "Sélectionner un SLO", "xpack.slo.sloEmbeddable.displayName": "Aperçu du SLO", "xpack.slo.sloEmbeddable.overview.sloNotFoundText": "Le SLO a été supprimé. Vous pouvez supprimer sans risque le widget du tableau de bord.", - "xpack.slo.sloGridItem.targetFlexItemLabel": "Cible {target}", "xpack.slo.sLOGridItem.targetFlexItemLabel": "Cible {target}", + "xpack.slo.sloGridItem.targetFlexItemLabel": "Cible {target}", "xpack.slo.sloGroupConfiguration.customFiltersLabel": "Personnaliser le filtre", "xpack.slo.sloGroupConfiguration.customFiltersOptional": "Facultatif", "xpack.slo.sloGroupConfiguration.customFilterText": "Personnaliser le filtre", @@ -43468,8 +43452,8 @@ "xpack.stackConnectors.components.casesWebhookxpack.stackConnectors.components.casesWebhook.connectorTypeTitle": "Webhook - Données de gestion des cas", "xpack.stackConnectors.components.d3security.bodyCodeEditorAriaLabel": "Éditeur de code", "xpack.stackConnectors.components.d3security.bodyFieldLabel": "Corps", - "xpack.stackConnectors.components.d3security.connectorTypeTitle": "Données D3", "xpack.stackConnectors.components.d3Security.connectorTypeTitle": "D3 Security", + "xpack.stackConnectors.components.d3security.connectorTypeTitle": "Données D3", "xpack.stackConnectors.components.d3security.eventTypeFieldLabel": "Type d'événement", "xpack.stackConnectors.components.d3security.invalidActionText": "Nom d'action non valide.", "xpack.stackConnectors.components.d3security.requiredActionText": "L'action est requise.", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 45af5394c90cf..a8a61778ee5b7 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -7006,6 +7006,14 @@ "securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications": "信頼できるアプリケーション", "securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications.description": "他のソフトウェア(通常は他のウイルス対策またはエンドポイントセキュリティアプリケーション)との競合を軽減することができます。", "securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications.privilegesTooltip": "信頼できるアプリケーションのアクセスには、すべてのスペースが必要です。", + "securitySolutionPackages.flyout.right.header.collapseDetailButtonAriaLabel": "詳細を折りたたむ", + "securitySolutionPackages.flyout.right.header.collapseDetailButtonLabel": "詳細を折りたたむ", + "securitySolutionPackages.flyout.right.header.expandDetailButtonAriaLabel": "詳細を展開", + "securitySolutionPackages.flyout.right.header.expandDetailButtonLabel": "詳細を展開", + "securitySolutionPackages.flyout.shared.errorDescription": "{message}の表示中にエラーが発生しました。", + "securitySolutionPackages.flyout.shared.errorTitle": "{title}を表示できません。", + "securitySolutionPackages.flyout.shared.ExpandablePanelButtonIconAriaLabel": "展開可能なパネルトグル", + "securitySolutionPackages.flyout.shared.expandablePanelLoadingAriaLabel": "展開可能なパネル", "securitySolutionPackages.markdown.investigationGuideInteractions.upsell": "{requiredLicense}にアップグレードして、調査ガイドのインタラクションを利用", "securitySolutionPackages.navigation.landingLinks": "セキュリティビュー", "securitySolutionPackages.sideNav.betaBadge.label": "ベータ", @@ -11071,8 +11079,8 @@ "xpack.apm.serviceIcons.service": "サービス", "xpack.apm.serviceIcons.serviceDetails.cloud.architecture": "アーキテクチャー", "xpack.apm.serviceIcons.serviceDetails.cloud.availabilityZoneLabel": "{zones, plural, other {可用性ゾーン}} ", - "xpack.apm.serviceIcons.serviceDetails.cloud.faasTriggerTypeLabel": "{triggerTypes, plural, other {トリガータイプ}} ", "xpack.apm.serviceIcons.serviceDetails.cloud.functionNameLabel": "{functionNames, plural, other {関数名}} ", + "xpack.apm.serviceIcons.serviceDetails.cloud.faasTriggerTypeLabel": "{triggerTypes, plural, other {トリガータイプ}} ", "xpack.apm.serviceIcons.serviceDetails.cloud.machineTypesLabel": "{machineTypes, plural, other {コンピュータータイプ} }\n ", "xpack.apm.serviceIcons.serviceDetails.cloud.projectIdLabel": "プロジェクト ID", "xpack.apm.serviceIcons.serviceDetails.cloud.providerLabel": "クラウドプロバイダー", @@ -23154,7 +23162,6 @@ "xpack.infra.hostFlyout.explainProcessMessageTitle": "このプロセスの概要", "xpack.infra.hosts.searchPlaceholder": "ホストを検索(例:cloud.provider:gcp AND system.load.1 > 0.5)", "xpack.infra.hostsPage.goToMetricsSettings": "設定を確認", - "xpack.infra.hostsViewPage.betaBadgeDescription": "現在、この機能はベータです。バグが発生した場合やフィードバックがある場合は、お問い合わせください。サポートの問題およびフィードバックについては、[ご意見をお聞かせください]フィードバックを使用して、お問い合わせください。", "xpack.infra.hostsViewPage.error.detailsButton": "詳細を入力", "xpack.infra.hostsViewPage.error.kqlErrorMessage": "フィルターを適用できなかったため、結果を表示できません。", "xpack.infra.hostsViewPage.error.kqlErrorTitle": "無効なKQL式", @@ -23233,7 +23240,6 @@ "xpack.infra.kibanaMetrics.cloudIdMissingErrorMessage": "{metricId} のモデルには cloudId が必要ですが、{nodeId} に cloudId が指定されていません。", "xpack.infra.kibanaMetrics.invalidInfraMetricErrorMessage": "{id} は有効な InfraMetric ではありません", "xpack.infra.kibanaMetrics.nodeDoesNotExistErrorMessage": "{nodeId} が存在しません。", - "xpack.infra.layout.hostsLandingPageLink": "新しいホスト分析エクスペリエンスの導入", "xpack.infra.layout.tryIt": "お試しください", "xpack.infra.legendControls.applyButton": "適用", "xpack.infra.legendControls.buttonLabel": "凡例を校正", @@ -25703,23 +25709,14 @@ "xpack.lens.metric.groupLabel": "目標値と単一の値", "xpack.lens.metric.headingLabel": "値", "xpack.lens.metric.icon": "アイコン装飾", - "xpack.lens.metric.iconSelect.alertIconLabel": "アラート", - "xpack.lens.metric.iconSelect.asteriskIconLabel": "アスタリスク", - "xpack.lens.metric.iconSelect.bellIconLabel": "ベル", - "xpack.lens.metric.iconSelect.boltIconLabel": "ボルト", - "xpack.lens.metric.iconSelect.bugIconLabel": "バグ", - "xpack.lens.metric.iconSelect.commentIconLabel": "コメント", "xpack.lens.metric.iconSelect.computeLabel": "演算", - "xpack.lens.metric.iconSelect.flagIconLabel": "旗", "xpack.lens.metric.iconSelect.globeLabel": "球", "xpack.lens.metric.iconSelect.heartLabel": "ハート", "xpack.lens.metric.iconSelect.mapMarkerLabel": "マップマーカー", "xpack.lens.metric.iconSelect.mapPinLabel": "マップピン", - "xpack.lens.metric.iconSelect.noIconLabel": "なし", "xpack.lens.metric.iconSelect.sortDownLabel": "降順で並べ替え", "xpack.lens.metric.iconSelect.sortUpLabel": "昇順で並べ替え", "xpack.lens.metric.iconSelect.starLabel": "星", - "xpack.lens.metric.iconSelect.tagIconLabel": "タグ", "xpack.lens.metric.iconSelect.temperatureLabel": "温度", "xpack.lens.metric.label": "メトリック", "xpack.lens.metric.layerType.trendLine": "トレンドライン", @@ -26020,15 +26017,15 @@ "xpack.lens.xyChart.horizontalAxisLabel": "横軸", "xpack.lens.xyChart.horizontalLeftAxisLabel": "横上軸", "xpack.lens.xyChart.horizontalRightAxisLabel": "横下軸", - "xpack.lens.xyChart.iconSelect.alertIconLabel": "アラート", - "xpack.lens.xyChart.iconSelect.asteriskIconLabel": "アスタリスク", - "xpack.lens.xyChart.iconSelect.bellIconLabel": "ベル", - "xpack.lens.xyChart.iconSelect.boltIconLabel": "ボルト", - "xpack.lens.xyChart.iconSelect.bugIconLabel": "バグ", - "xpack.lens.xyChart.iconSelect.commentIconLabel": "コメント", - "xpack.lens.xyChart.iconSelect.flagIconLabel": "旗", - "xpack.lens.xyChart.iconSelect.noIconLabel": "なし", - "xpack.lens.xyChart.iconSelect.tagIconLabel": "タグ", + "visualizationUiComponents.iconSelect.alertIconLabel": "アラート", + "visualizationUiComponents.iconSelect.asteriskIconLabel": "アスタリスク", + "visualizationUiComponents.iconSelect.bellIconLabel": "ベル", + "visualizationUiComponents.iconSelect.boltIconLabel": "ボルト", + "visualizationUiComponents.iconSelect.bugIconLabel": "バグ", + "visualizationUiComponents.iconSelect.commentIconLabel": "コメント", + "visualizationUiComponents.iconSelect.flagIconLabel": "旗", + "visualizationUiComponents.iconSelect.noIconLabel": "なし", + "visualizationUiComponents.iconSelect.tagIconLabel": "タグ", "xpack.lens.xyChart.layerAnnotation": "注釈", "xpack.lens.xyChart.layerAnnotationsIgnoreTitle": "グローバルフィルターを無視するレイヤー", "xpack.lens.xyChart.layerAnnotationsLabel": "注釈", @@ -26943,8 +26940,8 @@ "xpack.maps.source.esSearch.descendingLabel": "降順", "xpack.maps.source.esSearch.extentFilterLabel": "マップの表示範囲でデータを動的にフィルタリング", "xpack.maps.source.esSearch.fieldNotFoundMsg": "インデックスパターン''{indexPatternName}''に''{fieldName}''が見つかりません。", - "xpack.maps.source.esSearch.geofieldLabel": "地理空間フィールド", "xpack.maps.source.esSearch.geoFieldLabel": "地理空間フィールド", + "xpack.maps.source.esSearch.geofieldLabel": "地理空間フィールド", "xpack.maps.source.esSearch.geoFieldTypeLabel": "地理空間フィールドタイプ", "xpack.maps.source.esSearch.indexOverOneLengthEditError": "データビューは複数のインデックスを参照しています。データビューごとに1つのインデックスのみが許可されています。", "xpack.maps.source.esSearch.indexZeroLengthEditError": "データビューはどのインデックスも参照していません。", @@ -29594,13 +29591,12 @@ "xpack.ml.newJob.wizard.pickFieldsStep.influencers.title": "影響", "xpack.ml.newJob.wizard.pickFieldsStep.invalidCssVersionCallout.mesage": "カテゴリの例が見つかりませんでした。これはクラスターの1つがサポートされていないバージョンであることが原因です。", "xpack.ml.newJob.wizard.pickFieldsStep.invalidCssVersionCallout.title": "データビューがクロスクラスターである可能性があります", - "xpack.ml.newJob.wizard.pickFieldsStep.multiMetricView.addMetric": "メトリックを追加", + "xpack.ml.newJob.wizard.pickFieldsStep.metricSelector.addMetric": "メトリックを追加", "xpack.ml.newJob.wizard.pickFieldsStep.noDetectorsCallout.message": "ジョブを作成するには最低 1 つのディテクターが必要です。", "xpack.ml.newJob.wizard.pickFieldsStep.noDetectorsCallout.title": "ディテクターがありません", "xpack.ml.newJob.wizard.pickFieldsStep.populationField.description": "選択されたフィールドのすべての値が集団として一緒にモデリングされます。", "xpack.ml.newJob.wizard.pickFieldsStep.populationField.placeholder": "データを分割", "xpack.ml.newJob.wizard.pickFieldsStep.populationField.title": "集団フィールド", - "xpack.ml.newJob.wizard.pickFieldsStep.populationView.addMetric": "メトリックを追加", "xpack.ml.newJob.wizard.pickFieldsStep.populationView.splitFieldTitle": "{field} で分割された集団", "xpack.ml.newJob.wizard.pickFieldsStep.rareDetectorSelect.freqRareCard.description": "頻繁にまれな値になる母集団のメンバーを検索します。", "xpack.ml.newJob.wizard.pickFieldsStep.rareDetectorSelect.freqRareCard.title": "母集団で頻繁にまれ", @@ -33054,13 +33050,11 @@ "xpack.observabilityAiAssistantManagement.settingsPage.logIndexPatternDescription": "ログのクエリを実行するときにAI Assistantによって使用されるインデックスパターン。ログは分類され、根本原因分析で使用されます。", "xpack.observabilityAiAssistantManagement.settingsPage.searchConnector": "検索コネクター", "xpack.observabilityAiAssistantManagement.settingsPage.searchConnectorIndexPatternDescription": "検索コネクターインデックス(ナレッジベースの一部)をクエリするときに、AI Assistantによって使用されるインデックスパターン。デフォルトでは、すべての検索コネクターのインデックスに対してクエリが実行されます。", - "xpack.observabilityAiAssistantManagement.settingsPage.selectYourLanguageLabel": "応答を生成するときにアシスタントで使用する言語を選択してください。", "xpack.observabilityAiAssistantManagement.settingsPage.settingsLabel": "設定", "xpack.observabilityAiAssistantManagement.settingsPage.showAIAssistantButtonLabel": "オブザーバビリティアプリにAI Assistantボタンと状況に応じたインサイトを表示", "xpack.observabilityAiAssistantManagement.settingsPage.showAIAssistantDescriptionLabel": "オブザーバビリティアプリでAI Assistantボタンと状況に応じたインサイトのオン/オフを切り替えるには、[スペース]>[]>[機能]でAI Assistant機能のチェックをオンまたはオフにします。", "xpack.observabilityAiAssistantManagement.settingsPage.simulatedFunctionCallingDescription": "[technical preview] シミュレートされた関数呼び出しを使用します。シミュレートされた関数呼び出しでは、関数またはツールのAPIサポートは必要ありませんが、パフォーマンスが低下する可能性があります。現在、シミュレートされた関数呼び出しは、この設定に関係なく、非OpenAIコネクターで常に有効です。", "xpack.observabilityAiAssistantManagement.settingsPage.simulatedFunctionCallingLabel": "関数呼び出しをシミュレート", - "xpack.observabilityAiAssistantManagement.settingsPage.userPreferencesLabel": "応答言語", "xpack.observabilityAiAssistantManagement.settingsTab.h3.logIndexPatternLabel": "ログインデックスパターン", "xpack.observabilityAiAssistantManagement.settingsTab.h3.searchConnectorIndexPatternLabel": "検索コネクターインデックスパターン", "xpack.observabilityAiAssistantManagement.span.expandRowLabel": "行を展開", @@ -34434,7 +34428,6 @@ "xpack.searchInferenceEndpoints.deleteEndpoint.deleteSuccess": "推論エンドポイントは正常に削除されました。", "xpack.searchInferenceEndpoints.deleteEndpoint.endpointDeletionFailed": "エンドポイントの削除が失敗しました", "xpack.searchInferenceEndpoints.deploymentStatus.tooltip.modelDeployed": "モデルはデプロイされます", - "xpack.searchInferenceEndpoints.deploymentStatus.tooltip.modelFailedToBeDeployed": "モデルをデプロイできません", "xpack.searchInferenceEndpoints.deploymentStatus.tooltip.modelNotDeployed": "モデルはデプロイされません", "xpack.searchInferenceEndpoints.elasticsearch.allocations": "割り当て:{numAllocations}", "xpack.searchInferenceEndpoints.elasticsearch.threads": "スレッド:{numThreads}", @@ -36395,8 +36388,8 @@ "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.maxAlertsFieldLessThanWarning": "Kibanaで許可される最大数は、1回の実行につき、{maxNumber} {maxNumber, plural, other {アラート}}です。", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.nameFieldRequiredError": "名前が必要です。", "xpack.securitySolution.detectionEngine.createRule.stepAboutrule.noteHelpText": "ルール調査ガイドを追加...", - "xpack.securitySolution.detectionEngine.createRule.stepAboutrule.setupHelpText": "ルールセットアップガイドを追加...", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.setupHelpText": "必要な統合、構成ステップ、ルールが正常に動作するために必要な他のすべての項目といった、ルール前提条件に関する指示を入力します。", + "xpack.securitySolution.detectionEngine.createRule.stepAboutrule.setupHelpText": "ルールセットアップガイドを追加...", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.setupLabel": "セットアップガイド", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.tagFieldEmptyError": "タグを空にすることはできません", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.threatIndicatorPathFieldEmptyError": "インジケータープレフィックスの無効化を空にすることはできません", @@ -39203,10 +39196,6 @@ "xpack.securitySolution.flyout.right.alertPreview.ariaLabel": "ID {id}のアラートをプレビュー", "xpack.securitySolution.flyout.right.eventCategoryText": "イベントカテゴリ", "xpack.securitySolution.flyout.right.header.assignedTitle": "担当者", - "securitySolutionPackages.flyout.right.header.collapseDetailButtonAriaLabel": "詳細を折りたたむ", - "securitySolutionPackages.flyout.right.header.collapseDetailButtonLabel": "詳細を折りたたむ", - "securitySolutionPackages.flyout.right.header.expandDetailButtonAriaLabel": "詳細を展開", - "securitySolutionPackages.flyout.right.header.expandDetailButtonLabel": "詳細を展開", "xpack.securitySolution.flyout.right.header.headerTitle": "ドキュメント詳細", "xpack.securitySolution.flyout.right.header.jsonTabLabel": "JSON", "xpack.securitySolution.flyout.right.header.overviewTabLabel": "概要", @@ -39293,10 +39282,6 @@ "xpack.securitySolution.flyout.right.visualizations.sessionPreview.timeDescription": "に", "xpack.securitySolution.flyout.right.visualizations.sessionPreview.upsellDescription": "この機能には{subscription}が必要です", "xpack.securitySolution.flyout.right.visualizations.sessionPreview.upsellLinkText": "エンタープライズサブスクリプション", - "securitySolutionPackages.flyout.shared.errorDescription": "{message}の表示中にエラーが発生しました。", - "securitySolutionPackages.flyout.shared.errorTitle": "{title}を表示できません。", - "securitySolutionPackages.flyout.shared.ExpandablePanelButtonIconAriaLabel": "展開可能なパネルトグル", - "securitySolutionPackages.flyout.shared.expandablePanelLoadingAriaLabel": "展開可能なパネル", "xpack.securitySolution.flyout.tour.entities.description": "アラートに関連付けられたホストとユーザーの詳細については、展開された{entities}ビューを確認してください。", "xpack.securitySolution.flyout.tour.entities.text": "エンティティ", "xpack.securitySolution.flyout.tour.entities.title": "新しいホストとユーザーのインサイトがあります", @@ -41661,7 +41646,6 @@ "xpack.slo.permissionsCallout.readIndexPermission": "SLOの作成で使用するすべてのインデックスパターンのreadおよびview_index_metadataインデックス権限。", "xpack.slo.permissionsCallout.readSloPermission": "インデックスパターンのread権限:.slo-*", "xpack.slo.permissionsCallout.title": "不十分な権限", - "xpack.slo.permissionsCallout.writeClusterPermission": "manage_transformおよびmanage_ingest_pipelinesクラスター権限", "xpack.slo.permissionsCallout.writeSloPermission": "インデックスパターンでのall権限:.slo-*", "xpack.slo.queryBuilder.closeButtonLabel": "閉じる", "xpack.slo.queryBuilder.documentsButtonLabel": "ドキュメントを表示", @@ -42005,8 +41989,8 @@ "xpack.slo.sloEmbeddable.config.sloSelector.placeholder": "SLOを選択", "xpack.slo.sloEmbeddable.displayName": "SLO概要", "xpack.slo.sloEmbeddable.overview.sloNotFoundText": "SLOが削除されました。ウィジェットをダッシュボードから安全に削除できます。", - "xpack.slo.sloGridItem.targetFlexItemLabel": "目標{target}", "xpack.slo.sLOGridItem.targetFlexItemLabel": "目標{target}", + "xpack.slo.sloGridItem.targetFlexItemLabel": "目標{target}", "xpack.slo.sloGroupConfiguration.customFiltersLabel": "カスタムフィルター", "xpack.slo.sloGroupConfiguration.customFiltersOptional": "オプション", "xpack.slo.sloGroupConfiguration.customFilterText": "カスタムフィルター", @@ -43448,8 +43432,8 @@ "xpack.stackConnectors.components.casesWebhookxpack.stackConnectors.components.casesWebhook.connectorTypeTitle": "Webフック - ケース管理データ", "xpack.stackConnectors.components.d3security.bodyCodeEditorAriaLabel": "コードエディター", "xpack.stackConnectors.components.d3security.bodyFieldLabel": "本文", - "xpack.stackConnectors.components.d3security.connectorTypeTitle": "D3データ", "xpack.stackConnectors.components.d3Security.connectorTypeTitle": "D3セキュリティ", + "xpack.stackConnectors.components.d3security.connectorTypeTitle": "D3データ", "xpack.stackConnectors.components.d3security.eventTypeFieldLabel": "イベントタイプ", "xpack.stackConnectors.components.d3security.invalidActionText": "無効なアクション名です。", "xpack.stackConnectors.components.d3security.requiredActionText": "アクションが必要です。", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 87b7e30fc72f4..d6cac60911dfd 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -7017,6 +7017,14 @@ "securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications": "受信任的应用程序", "securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications.description": "帮助减少与其他软件(通常指其他防病毒或终端安全应用程序)的冲突。", "securitySolutionPackages.features.featureRegistry.subFeatures.trustedApplications.privilegesTooltip": "访问受信任的应用程序需要所有工作区。", + "securitySolutionPackages.flyout.right.header.collapseDetailButtonAriaLabel": "折叠详情", + "securitySolutionPackages.flyout.right.header.collapseDetailButtonLabel": "折叠详情", + "securitySolutionPackages.flyout.right.header.expandDetailButtonAriaLabel": "展开详情", + "securitySolutionPackages.flyout.right.header.expandDetailButtonLabel": "展开详情", + "securitySolutionPackages.flyout.shared.errorDescription": "显示 {message} 时出现错误。", + "securitySolutionPackages.flyout.shared.errorTitle": "无法显示 {title}。", + "securitySolutionPackages.flyout.shared.ExpandablePanelButtonIconAriaLabel": "可展开面板切换按钮", + "securitySolutionPackages.flyout.shared.expandablePanelLoadingAriaLabel": "可展开面板", "securitySolutionPackages.markdown.insight.upsell": "升级到{requiredLicense}以利用调查指南中的洞见", "securitySolutionPackages.markdown.investigationGuideInteractions.upsell": "升级到 {requiredLicense} 以利用调查指南交互", "securitySolutionPackages.navigation.landingLinks": "安全视图", @@ -11090,8 +11098,8 @@ "xpack.apm.serviceIcons.service": "服务", "xpack.apm.serviceIcons.serviceDetails.cloud.architecture": "架构", "xpack.apm.serviceIcons.serviceDetails.cloud.availabilityZoneLabel": "{zones, plural, other {可用性区域}} ", - "xpack.apm.serviceIcons.serviceDetails.cloud.faasTriggerTypeLabel": "{triggerTypes, plural, other {触发类型}} ", "xpack.apm.serviceIcons.serviceDetails.cloud.functionNameLabel": "{functionNames, plural, other {功能名称}} ", + "xpack.apm.serviceIcons.serviceDetails.cloud.faasTriggerTypeLabel": "{triggerTypes, plural, other {触发类型}} ", "xpack.apm.serviceIcons.serviceDetails.cloud.machineTypesLabel": "{machineTypes, plural, other {机器类型}} ", "xpack.apm.serviceIcons.serviceDetails.cloud.projectIdLabel": "项目 ID", "xpack.apm.serviceIcons.serviceDetails.cloud.providerLabel": "云服务提供商", @@ -23182,7 +23190,6 @@ "xpack.infra.hostFlyout.explainProcessMessageTitle": "此进程是什么?", "xpack.infra.hosts.searchPlaceholder": "搜索主机(例如,cloud.provider:gcp AND system.load.1 > 0.5)", "xpack.infra.hostsPage.goToMetricsSettings": "检查设置", - "xpack.infra.hostsViewPage.betaBadgeDescription": "此功能当前为公测版。如果遇到任何错误或有任何反馈,我们乐于倾听您的意见。请报告支持问题和/或通过“告诉我们您的看法!”反馈按钮分享您的反馈。", "xpack.infra.hostsViewPage.error.detailsButton": "错误详细信息", "xpack.infra.hostsViewPage.error.kqlErrorMessage": "无法显示任何结果,因为无法应用您的筛选。", "xpack.infra.hostsViewPage.error.kqlErrorTitle": "KQL 表达式无效", @@ -23261,7 +23268,6 @@ "xpack.infra.kibanaMetrics.cloudIdMissingErrorMessage": "{metricId} 的模型需要云 ID,但没有为 {nodeId} 提供。", "xpack.infra.kibanaMetrics.invalidInfraMetricErrorMessage": "{id} 不是有效的 InfraMetric", "xpack.infra.kibanaMetrics.nodeDoesNotExistErrorMessage": "{nodeId} 不存在。", - "xpack.infra.layout.hostsLandingPageLink": "引入新的主机分析体验", "xpack.infra.layout.tryIt": "试用", "xpack.infra.legendControls.applyButton": "应用", "xpack.infra.legendControls.buttonLabel": "配置图例", @@ -25735,23 +25741,14 @@ "xpack.lens.metric.groupLabel": "目标值和单值", "xpack.lens.metric.headingLabel": "值", "xpack.lens.metric.icon": "图标装饰", - "xpack.lens.metric.iconSelect.alertIconLabel": "告警", - "xpack.lens.metric.iconSelect.asteriskIconLabel": "星号", - "xpack.lens.metric.iconSelect.bellIconLabel": "钟铃", - "xpack.lens.metric.iconSelect.boltIconLabel": "闪电", - "xpack.lens.metric.iconSelect.bugIconLabel": "昆虫", - "xpack.lens.metric.iconSelect.commentIconLabel": "注释", "xpack.lens.metric.iconSelect.computeLabel": "计算", - "xpack.lens.metric.iconSelect.flagIconLabel": "旗帜", "xpack.lens.metric.iconSelect.globeLabel": "地球", "xpack.lens.metric.iconSelect.heartLabel": "心形", "xpack.lens.metric.iconSelect.mapMarkerLabel": "地图标记", "xpack.lens.metric.iconSelect.mapPinLabel": "地图图钉", - "xpack.lens.metric.iconSelect.noIconLabel": "无", "xpack.lens.metric.iconSelect.sortDownLabel": "向下排序", "xpack.lens.metric.iconSelect.sortUpLabel": "向上排序", "xpack.lens.metric.iconSelect.starLabel": "五角星", - "xpack.lens.metric.iconSelect.tagIconLabel": "标签", "xpack.lens.metric.iconSelect.temperatureLabel": "温度", "xpack.lens.metric.label": "指标", "xpack.lens.metric.layerType.trendLine": "趋势线", @@ -26052,15 +26049,15 @@ "xpack.lens.xyChart.horizontalAxisLabel": "水平轴", "xpack.lens.xyChart.horizontalLeftAxisLabel": "水平顶轴", "xpack.lens.xyChart.horizontalRightAxisLabel": "水平底轴", - "xpack.lens.xyChart.iconSelect.alertIconLabel": "告警", - "xpack.lens.xyChart.iconSelect.asteriskIconLabel": "星号", - "xpack.lens.xyChart.iconSelect.bellIconLabel": "钟铃", - "xpack.lens.xyChart.iconSelect.boltIconLabel": "闪电", - "xpack.lens.xyChart.iconSelect.bugIconLabel": "昆虫", - "xpack.lens.xyChart.iconSelect.commentIconLabel": "注释", - "xpack.lens.xyChart.iconSelect.flagIconLabel": "旗帜", - "xpack.lens.xyChart.iconSelect.noIconLabel": "无", - "xpack.lens.xyChart.iconSelect.tagIconLabel": "标签", + "visualizationUiComponents.iconSelect.alertIconLabel": "告警", + "visualizationUiComponents.iconSelect.asteriskIconLabel": "星号", + "visualizationUiComponents.iconSelect.bellIconLabel": "钟铃", + "visualizationUiComponents.iconSelect.boltIconLabel": "闪电", + "visualizationUiComponents.iconSelect.bugIconLabel": "昆虫", + "visualizationUiComponents.iconSelect.commentIconLabel": "注释", + "visualizationUiComponents.iconSelect.flagIconLabel": "旗帜", + "visualizationUiComponents.iconSelect.noIconLabel": "无", + "visualizationUiComponents.iconSelect.tagIconLabel": "标签", "xpack.lens.xyChart.layerAnnotation": "标注", "xpack.lens.xyChart.layerAnnotationsIgnoreTitle": "忽略全局筛选的图层", "xpack.lens.xyChart.layerAnnotationsLabel": "标注", @@ -26975,8 +26972,8 @@ "xpack.maps.source.esSearch.descendingLabel": "降序", "xpack.maps.source.esSearch.extentFilterLabel": "在可见地图区域中动态筛留数据", "xpack.maps.source.esSearch.fieldNotFoundMsg": "在索引模式“{indexPatternName}”中找不到“{fieldName}”。", - "xpack.maps.source.esSearch.geofieldLabel": "地理空间字段", "xpack.maps.source.esSearch.geoFieldLabel": "地理空间字段", + "xpack.maps.source.esSearch.geofieldLabel": "地理空间字段", "xpack.maps.source.esSearch.geoFieldTypeLabel": "地理空间字段类型", "xpack.maps.source.esSearch.indexOverOneLengthEditError": "您的数据视图指向多个索引。每个数据视图只允许一个索引。", "xpack.maps.source.esSearch.indexZeroLengthEditError": "您的数据视图未指向任何索引。", @@ -29629,13 +29626,12 @@ "xpack.ml.newJob.wizard.pickFieldsStep.influencers.title": "影响因素", "xpack.ml.newJob.wizard.pickFieldsStep.invalidCssVersionCallout.mesage": "找不到任何示例类别,这可能由于有一个集群的版本不受支持。", "xpack.ml.newJob.wizard.pickFieldsStep.invalidCssVersionCallout.title": "数据视图似乎跨集群", - "xpack.ml.newJob.wizard.pickFieldsStep.multiMetricView.addMetric": "添加指标", + "xpack.ml.newJob.wizard.pickFieldsStep.metricSelector.addMetric": "添加指标", "xpack.ml.newJob.wizard.pickFieldsStep.noDetectorsCallout.message": "至少需要一个检测工具,才能创建作业。", "xpack.ml.newJob.wizard.pickFieldsStep.noDetectorsCallout.title": "无检测工具", "xpack.ml.newJob.wizard.pickFieldsStep.populationField.description": "选定字段中的所有值将作为一个群体一起进行建模。", "xpack.ml.newJob.wizard.pickFieldsStep.populationField.placeholder": "分割数据", "xpack.ml.newJob.wizard.pickFieldsStep.populationField.title": "群体字段", - "xpack.ml.newJob.wizard.pickFieldsStep.populationView.addMetric": "添加指标", "xpack.ml.newJob.wizard.pickFieldsStep.populationView.splitFieldTitle": "群体由 {field} 分割", "xpack.ml.newJob.wizard.pickFieldsStep.rareDetectorSelect.freqRareCard.description": "查找群体中经常有罕见值的成员。", "xpack.ml.newJob.wizard.pickFieldsStep.rareDetectorSelect.freqRareCard.title": "群体中极罕见", @@ -33094,13 +33090,11 @@ "xpack.observabilityAiAssistantManagement.settingsPage.logIndexPatternDescription": "AI 助手查询日志时使用的索引模式。日志将进行归类并用于根本原因分析", "xpack.observabilityAiAssistantManagement.settingsPage.searchConnector": "搜索连接器", "xpack.observabilityAiAssistantManagement.settingsPage.searchConnectorIndexPatternDescription": "查询搜索连接器索引(知识库的一部分)时 AI 助手使用的索引模式。默认情况下,将查询每个搜索连接器的索引", - "xpack.observabilityAiAssistantManagement.settingsPage.selectYourLanguageLabel": "选择您希望助手在生成响应时使用的语言。", "xpack.observabilityAiAssistantManagement.settingsPage.settingsLabel": "设置", "xpack.observabilityAiAssistantManagement.settingsPage.showAIAssistantButtonLabel": "在 Observability 应用中显示 AI 助手按钮和上下文洞察", "xpack.observabilityAiAssistantManagement.settingsPage.showAIAssistantDescriptionLabel": "通过在“工作区 > > 功能”中选中或取消选中 AI 助手功能,在 Observability 应用中打开或关闭 AI 助手按钮和上下文洞察。", "xpack.observabilityAiAssistantManagement.settingsPage.simulatedFunctionCallingDescription": "[技术预览] 使用模拟函数调用。模拟函数调用不需要函数或工具的 API 支持,但可能会降低性能。无论此设置如何,当前会始终对非 OpenAI 连接器启用模拟函数调用。", "xpack.observabilityAiAssistantManagement.settingsPage.simulatedFunctionCallingLabel": "模拟函数调用", - "xpack.observabilityAiAssistantManagement.settingsPage.userPreferencesLabel": "响应语言", "xpack.observabilityAiAssistantManagement.settingsTab.h3.logIndexPatternLabel": "日志索引模式", "xpack.observabilityAiAssistantManagement.settingsTab.h3.searchConnectorIndexPatternLabel": "搜索连接器索引模式", "xpack.observabilityAiAssistantManagement.span.expandRowLabel": "展开行", @@ -34475,7 +34469,6 @@ "xpack.searchInferenceEndpoints.deleteEndpoint.deleteSuccess": "推理终端已成功删除。", "xpack.searchInferenceEndpoints.deleteEndpoint.endpointDeletionFailed": "终端删除失败", "xpack.searchInferenceEndpoints.deploymentStatus.tooltip.modelDeployed": "已部署模型", - "xpack.searchInferenceEndpoints.deploymentStatus.tooltip.modelFailedToBeDeployed": "无法部署模型", "xpack.searchInferenceEndpoints.deploymentStatus.tooltip.modelNotDeployed": "未部署模型", "xpack.searchInferenceEndpoints.elasticsearch.allocations": "分配:{numAllocations}", "xpack.searchInferenceEndpoints.elasticsearch.threads": "线程:{numThreads}", @@ -36437,8 +36430,8 @@ "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.maxAlertsFieldLessThanWarning": "每次规则运行时,Kibana 最多只允许 {maxNumber} 个{maxNumber, plural, other {告警}}。", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.nameFieldRequiredError": "名称必填。", "xpack.securitySolution.detectionEngine.createRule.stepAboutrule.noteHelpText": "添加规则调查指南......", - "xpack.securitySolution.detectionEngine.createRule.stepAboutrule.setupHelpText": "添加规则设置指南......", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.setupHelpText": "提供有关规则先决条件的说明,如所需集成、配置步骤,以及规则正常运行所需的任何其他内容。", + "xpack.securitySolution.detectionEngine.createRule.stepAboutrule.setupHelpText": "添加规则设置指南......", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.setupLabel": "设置指南", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.tagFieldEmptyError": "标签不得为空", "xpack.securitySolution.detectionEngine.createRule.stepAboutRule.threatIndicatorPathFieldEmptyError": "指标前缀覆盖不得为空", @@ -39247,10 +39240,6 @@ "xpack.securitySolution.flyout.right.alertPreview.ariaLabel": "预览 ID 为 {id} 的告警", "xpack.securitySolution.flyout.right.eventCategoryText": "事件类别", "xpack.securitySolution.flyout.right.header.assignedTitle": "被分配人", - "securitySolutionPackages.flyout.right.header.collapseDetailButtonAriaLabel": "折叠详情", - "securitySolutionPackages.flyout.right.header.collapseDetailButtonLabel": "折叠详情", - "securitySolutionPackages.flyout.right.header.expandDetailButtonAriaLabel": "展开详情", - "securitySolutionPackages.flyout.right.header.expandDetailButtonLabel": "展开详情", "xpack.securitySolution.flyout.right.header.headerTitle": "文档详情", "xpack.securitySolution.flyout.right.header.jsonTabLabel": "JSON", "xpack.securitySolution.flyout.right.header.overviewTabLabel": "概览", @@ -39336,10 +39325,6 @@ "xpack.securitySolution.flyout.right.visualizations.sessionPreview.timeDescription": "处于", "xpack.securitySolution.flyout.right.visualizations.sessionPreview.upsellDescription": "此功能需要{subscription}", "xpack.securitySolution.flyout.right.visualizations.sessionPreview.upsellLinkText": "企业级订阅", - "securitySolutionPackages.flyout.shared.errorDescription": "显示 {message} 时出现错误。", - "securitySolutionPackages.flyout.shared.errorTitle": "无法显示 {title}。", - "securitySolutionPackages.flyout.shared.ExpandablePanelButtonIconAriaLabel": "可展开面板切换按钮", - "securitySolutionPackages.flyout.shared.expandablePanelLoadingAriaLabel": "可展开面板", "xpack.securitySolution.flyout.tour.entities.description": "请查阅展开的 {entities} 视图以了解与该告警有关的主机和用户的更多信息。", "xpack.securitySolution.flyout.tour.entities.text": "实体", "xpack.securitySolution.flyout.tour.entities.title": "有新主机和用户洞见可用", @@ -41705,7 +41690,6 @@ "xpack.slo.permissionsCallout.readIndexPermission": "您要用于创建 SLO 的任何索引模式上的“read”和“view_index_metadata”索引权限", "xpack.slo.permissionsCallout.readSloPermission": "索引模式上的“read”权限:.slo-*", "xpack.slo.permissionsCallout.title": "权限不足", - "xpack.slo.permissionsCallout.writeClusterPermission": "“manage_transform”和“manage_ingest_pipelines”集群权限", "xpack.slo.permissionsCallout.writeSloPermission": "索引模式上的“all”权限:.slo-*", "xpack.slo.queryBuilder.closeButtonLabel": "关闭", "xpack.slo.queryBuilder.documentsButtonLabel": "查看文档", @@ -42049,8 +42033,8 @@ "xpack.slo.sloEmbeddable.config.sloSelector.placeholder": "选择 SLO", "xpack.slo.sloEmbeddable.displayName": "SLO 概览", "xpack.slo.sloEmbeddable.overview.sloNotFoundText": "SLO 已删除。您可以放心从仪表板中删除小组件。", - "xpack.slo.sloGridItem.targetFlexItemLabel": "目标 {target}", "xpack.slo.sLOGridItem.targetFlexItemLabel": "目标 {target}", + "xpack.slo.sloGridItem.targetFlexItemLabel": "目标 {target}", "xpack.slo.sloGroupConfiguration.customFiltersLabel": "定制筛选", "xpack.slo.sloGroupConfiguration.customFiltersOptional": "可选", "xpack.slo.sloGroupConfiguration.customFilterText": "定制筛选", @@ -43496,8 +43480,8 @@ "xpack.stackConnectors.components.casesWebhookxpack.stackConnectors.components.casesWebhook.connectorTypeTitle": "Webhook - 案例管理数据", "xpack.stackConnectors.components.d3security.bodyCodeEditorAriaLabel": "代码编辑器", "xpack.stackConnectors.components.d3security.bodyFieldLabel": "正文", - "xpack.stackConnectors.components.d3security.connectorTypeTitle": "D3 数据", "xpack.stackConnectors.components.d3Security.connectorTypeTitle": "D3 Security", + "xpack.stackConnectors.components.d3security.connectorTypeTitle": "D3 数据", "xpack.stackConnectors.components.d3security.eventTypeFieldLabel": "事件类型", "xpack.stackConnectors.components.d3security.invalidActionText": "操作名称无效。", "xpack.stackConnectors.components.d3security.requiredActionText": "“操作”必填。", diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/row_actions/default_alert_actions.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/row_actions/default_alert_actions.test.tsx new file mode 100644 index 0000000000000..cedc0eccfd68e --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/row_actions/default_alert_actions.test.tsx @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; +import DefaultAlertActions from './default_alert_actions'; +import { render, screen } from '@testing-library/react'; +import type { AlertActionsProps } from '../../../../types'; + +jest.mock('../../../hooks/use_load_rule_types_query', () => ({ + useLoadRuleTypesQuery: jest.fn(), +})); +jest.mock('./view_rule_details_alert_action', () => { + return { + ViewRuleDetailsAlertAction: () => ( +

    {'ViewRuleDetailsAlertAction'}
    + ), + }; +}); +jest.mock('./view_alert_details_alert_action', () => { + return { + ViewAlertDetailsAlertAction: () => ( +
    {'ViewAlertDetailsAlertAction'}
    + ), + }; +}); +jest.mock('./mute_alert_action', () => { + return { MuteAlertAction: () =>
    {'MuteAlertAction'}
    }; +}); +jest.mock('./mark_as_untracked_alert_action', () => { + return { + MarkAsUntrackedAlertAction: () => ( +
    {'MarkAsUntrackedAlertAction'}
    + ), + }; +}); + +const { useLoadRuleTypesQuery } = jest.requireMock('../../../hooks/use_load_rule_types_query'); +const props = { alert: {}, refresh: jest.fn() } as unknown as AlertActionsProps; + +describe('DefaultAlertActions component', () => { + it('should show "Mute" and "Marked as untracted" option', async () => { + useLoadRuleTypesQuery.mockReturnValue({ authorizedToCreateAnyRules: true }); + + render(); + + expect(await screen.findByText('MuteAlertAction')).toBeInTheDocument(); + expect(await screen.findByText('MarkAsUntrackedAlertAction')).toBeInTheDocument(); + }); + + it('should hide "Mute" and "Marked as untracted" option', async () => { + useLoadRuleTypesQuery.mockReturnValue({ authorizedToCreateAnyRules: false }); + + render(); + + expect(screen.queryByText('MuteAlertAction')).not.toBeInTheDocument(); + expect(screen.queryByText('MarkAsUntrackedAlertAction')).not.toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/row_actions/default_alert_actions.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/row_actions/default_alert_actions.tsx index e2bcec4a2b6d2..791eca7b2489a 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/row_actions/default_alert_actions.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/row_actions/default_alert_actions.tsx @@ -11,17 +11,22 @@ import type { AlertActionsProps } from '../../../../types'; import { ViewAlertDetailsAlertAction } from './view_alert_details_alert_action'; import { MuteAlertAction } from './mute_alert_action'; import { MarkAsUntrackedAlertAction } from './mark_as_untracked_alert_action'; +import { useLoadRuleTypesQuery } from '../../../hooks/use_load_rule_types_query'; /** * Common alerts table row actions */ export const DefaultAlertActions = (props: AlertActionsProps) => { + const { authorizedToCreateAnyRules } = useLoadRuleTypesQuery({ + filteredRuleTypes: [], + }); + return ( <> - - + {authorizedToCreateAnyRules && } + {authorizedToCreateAnyRules && } ); }; diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/transform_rule_types/transform_health/rule.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/transform_rule_types/transform_health/rule.ts index d3a3faacf7fdb..49a8abe7cf92a 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/transform_rule_types/transform_health/rule.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/transform_rule_types/transform_health/rule.ts @@ -6,7 +6,7 @@ */ import expect from '@kbn/expect'; -import { PutTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import { PutTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; import { ALERT_ACTION_GROUP, diff --git a/x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts b/x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts index 17890737c4e3d..f2497d08de913 100644 --- a/x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts +++ b/x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts @@ -9,7 +9,7 @@ import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; import type { CspBenchmarkRule, FindCspBenchmarkRuleResponse, -} from '@kbn/cloud-security-posture-plugin/common/types/rules/v3'; +} from '@kbn/cloud-security-posture-common/schema/rules/v3'; import { FtrProviderContext } from '../../ftr_provider_context'; import { createPackagePolicy } from './helper'; diff --git a/x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts b/x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts index 9e6b10f410545..4959c8998a5b3 100644 --- a/x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts +++ b/x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts @@ -9,7 +9,7 @@ import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; import type { CspBenchmarkRule, FindCspBenchmarkRuleResponse, -} from '@kbn/cloud-security-posture-plugin/common/types/rules/v3'; +} from '@kbn/cloud-security-posture-common/schema/rules/v3'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { createPackagePolicy } from '../helper'; diff --git a/x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts b/x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts index 45758f93362be..747e6d1d2bd5f 100644 --- a/x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts +++ b/x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts @@ -9,7 +9,7 @@ import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; import type { CspBenchmarkRule, FindCspBenchmarkRuleResponse, -} from '@kbn/cloud-security-posture-plugin/common/types/latest'; +} from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { createPackagePolicy } from '../helper'; diff --git a/x-pack/test/api_integration/apis/content_management/favorites.ts b/x-pack/test/api_integration/apis/content_management/favorites.ts index 0fed80620f219..42641f96f63e3 100644 --- a/x-pack/test/api_integration/apis/content_management/favorites.ts +++ b/x-pack/test/api_integration/apis/content_management/favorites.ts @@ -6,6 +6,11 @@ */ import expect from '@kbn/expect'; +import type { UnencryptedTelemetryPayload } from '@kbn/telemetry-plugin/common/types'; +import { + ELASTIC_HTTP_VERSION_HEADER, + X_ELASTIC_INTERNAL_ORIGIN_REQUEST, +} from '@kbn/core-http-common'; import { FtrProviderContext } from '../../ftr_provider_context'; import { @@ -163,6 +168,28 @@ export default function ({ getService }: FtrProviderContext) { response = await api.favorite({ dashboardId: 'fav1', user: interactiveUser3 }); expect(response.body.favoriteIds).to.eql(['fav1']); }); + + // depends on the state from previous test + it('reports favorites stats', async () => { + const { body }: { body: UnencryptedTelemetryPayload } = await getService('supertest') + .post('/internal/telemetry/clusters/_stats') + .set('kbn-xsrf', 'xxx') + .set(ELASTIC_HTTP_VERSION_HEADER, '2') + .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') + .send({ unencrypted: true, refreshCache: true }) + .expect(200); + + // @ts-ignore + const favoritesStats = body[0].stats.stack_stats.kibana.plugins.favorites; + expect(favoritesStats).to.eql({ + dashboard: { + total: 3, + total_users_spaces: 3, + avg_per_user_per_space: 1, + max_per_user_per_space: 1, + }, + }); + }); }); }); } diff --git a/x-pack/test/api_integration/apis/entity_manager/builtin_definitions.ts b/x-pack/test/api_integration/apis/entity_manager/builtin_definitions.ts index d5d92e75179fe..66ca29c10cc9d 100644 --- a/x-pack/test/api_integration/apis/entity_manager/builtin_definitions.ts +++ b/x-pack/test/api_integration/apis/entity_manager/builtin_definitions.ts @@ -73,10 +73,9 @@ export default function ({ getService }: FtrProviderContext) { const enableResponse = await enableEntityDiscovery(authorizedUser, 200); expect(enableResponse.success).to.eql(true, "authorized user can't enable EEM"); - const definitionsResponse = await getInstalledDefinitions( - supertestWithoutAuth, - authorizedUser - ); + const definitionsResponse = await getInstalledDefinitions(supertestWithoutAuth, { + auth: authorizedUser, + }); expect(definitionsResponse.definitions.length).to.eql(builtInDefinitions.length); expect( builtInDefinitions.every((builtin) => @@ -91,7 +90,7 @@ export default function ({ getService }: FtrProviderContext) { ); const disableResponse = await disableEntityDiscovery(authorizedUser, 200, { - deleteData: false, + deleteData: true, }); expect(disableResponse.success).to.eql( true, @@ -121,7 +120,9 @@ export default function ({ getService }: FtrProviderContext) { await disableEntityDiscovery(unauthorizedUser, 403); - const disableResponse = await disableEntityDiscovery(authorizedUser, 200); + const disableResponse = await disableEntityDiscovery(authorizedUser, 200, { + deleteData: true, + }); expect(disableResponse.success).to.eql(true, "authorized user can't disable EEM"); }); }); @@ -165,7 +166,7 @@ export default function ({ getService }: FtrProviderContext) { ) ).to.eql(true, 'all builtin definitions are not installed/running'); - await disableEntityDiscovery(authorizedUser, 200); + await disableEntityDiscovery(authorizedUser, 200, { deleteData: true }); }); }); @@ -186,7 +187,7 @@ export default function ({ getService }: FtrProviderContext) { isInstalledAndRunning(mockBuiltInEntityDefinition, definitionsResponse.definitions) ).to.ok(); - await disableEntityDiscovery(authorizedUser, 200); + await disableEntityDiscovery(authorizedUser, 200, { deleteData: true }); }); }); } diff --git a/x-pack/test/api_integration/apis/entity_manager/definitions.ts b/x-pack/test/api_integration/apis/entity_manager/definitions.ts index 0b901b1d6efbc..466b5e0232bf0 100644 --- a/x-pack/test/api_integration/apis/entity_manager/definitions.ts +++ b/x-pack/test/api_integration/apis/entity_manager/definitions.ts @@ -5,6 +5,7 @@ * 2.0. */ +import semver from 'semver'; import expect from '@kbn/expect'; import { entityLatestSchema } from '@kbn/entities-schema'; import { @@ -14,7 +15,12 @@ import { import { PartialConfig, cleanup, generate } from '@kbn/data-forge'; import { generateLatestIndexName } from '@kbn/entityManager-plugin/server/lib/entities/helpers/generate_component_id'; import { FtrProviderContext } from '../../ftr_provider_context'; -import { installDefinition, uninstallDefinition, getInstalledDefinitions } from './helpers/request'; +import { + installDefinition, + uninstallDefinition, + updateDefinition, + getInstalledDefinitions, +} from './helpers/request'; import { waitForDocumentInIndex } from '../../../alerting_api_integration/observability/helpers/alerting_wait_for_helpers'; export default function ({ getService }: FtrProviderContext) { @@ -27,43 +33,98 @@ export default function ({ getService }: FtrProviderContext) { describe('Entity definitions', () => { describe('definitions installations', () => { it('can install multiple definitions', async () => { - await installDefinition(supertest, mockDefinition); - await installDefinition(supertest, mockBackfillDefinition); + await installDefinition(supertest, { definition: mockDefinition }); + await installDefinition(supertest, { definition: mockBackfillDefinition }); const { definitions } = await getInstalledDefinitions(supertest); expect(definitions.length).to.eql(2); expect( - definitions.find( + definitions.some( (definition) => definition.id === mockDefinition.id && definition.state.installed === true && definition.state.running === true ) - ); + ).to.eql(true); expect( - definitions.find( + definitions.some( (definition) => definition.id === mockBackfillDefinition.id && definition.state.installed === true && definition.state.running === true ) - ); + ).to.eql(true); - await uninstallDefinition(supertest, mockDefinition.id); - await uninstallDefinition(supertest, mockBackfillDefinition.id); + await Promise.all([ + uninstallDefinition(supertest, { id: mockDefinition.id, deleteData: true }), + uninstallDefinition(supertest, { id: mockBackfillDefinition.id, deleteData: true }), + ]); }); it('does not start transforms when specified', async () => { - await installDefinition(supertest, mockDefinition, { installOnly: true }); + await installDefinition(supertest, { definition: mockDefinition, installOnly: true }); const { definitions } = await getInstalledDefinitions(supertest); expect(definitions.length).to.eql(1); expect(definitions[0].state.installed).to.eql(true); expect(definitions[0].state.running).to.eql(false); - await uninstallDefinition(supertest, mockDefinition.id); + await uninstallDefinition(supertest, { id: mockDefinition.id }); + }); + }); + + describe('definitions update', () => { + it('returns 404 if the definitions does not exist', async () => { + await updateDefinition(supertest, { + id: 'i-dont-exist', + update: { version: '1.0.0' }, + expectedCode: 404, + }); + }); + + it('accepts partial updates', async () => { + const incVersion = semver.inc(mockDefinition.version, 'major'); + await installDefinition(supertest, { definition: mockDefinition, installOnly: true }); + await updateDefinition(supertest, { + id: mockDefinition.id, + update: { + version: incVersion!, + history: { + timestampField: '@updatedTimestampField', + }, + }, + }); + + const { + definitions: [updatedDefinition], + } = await getInstalledDefinitions(supertest); + expect(updatedDefinition.version).to.eql(incVersion); + expect(updatedDefinition.history.timestampField).to.eql('@updatedTimestampField'); + + await uninstallDefinition(supertest, { id: mockDefinition.id }); + }); + + it('rejects updates to managed definitions', async () => { + await installDefinition(supertest, { + definition: { ...mockDefinition, managed: true }, + installOnly: true, + }); + + await updateDefinition(supertest, { + id: mockDefinition.id, + update: { + version: '1.0.0', + history: { + timestampField: '@updatedTimestampField', + }, + }, + expectedCode: 403, + }); + + await uninstallDefinition(supertest, { id: mockDefinition.id }); }); }); + describe('entity data', () => { let dataForgeConfig: PartialConfig; let dataForgeIndices: string[]; @@ -95,12 +156,12 @@ export default function ({ getService }: FtrProviderContext) { after(async () => { await esDeleteAllIndices(dataForgeIndices); - await uninstallDefinition(supertest, mockDefinition.id, true); + await uninstallDefinition(supertest, { id: mockDefinition.id, deleteData: true }); await cleanup({ client: esClient, config: dataForgeConfig, logger }); }); it('should create the proper entities in the latest index', async () => { - await installDefinition(supertest, mockDefinition); + await installDefinition(supertest, { definition: mockDefinition }); const sample = await waitForDocumentInIndex({ esClient, indexName: generateLatestIndexName(mockDefinition), @@ -108,6 +169,7 @@ export default function ({ getService }: FtrProviderContext) { retryService, logger, }); + const parsedSample = entityLatestSchema.safeParse(sample.hits.hits[0]._source); expect(parsedSample.success).to.be(true); }); diff --git a/x-pack/test/api_integration/apis/entity_manager/helpers/request.ts b/x-pack/test/api_integration/apis/entity_manager/helpers/request.ts index e69cb950afe42..822ab2e7ce24a 100644 --- a/x-pack/test/api_integration/apis/entity_manager/helpers/request.ts +++ b/x-pack/test/api_integration/apis/entity_manager/helpers/request.ts @@ -6,7 +6,7 @@ */ import { Agent } from 'supertest'; -import { EntityDefinition } from '@kbn/entities-schema'; +import { EntityDefinition, EntityDefinitionUpdate } from '@kbn/entities-schema'; import { EntityDefinitionWithState } from '@kbn/entityManager-plugin/server/lib/entities/types'; export interface Auth { @@ -16,9 +16,12 @@ export interface Auth { export const getInstalledDefinitions = async ( supertest: Agent, - auth?: Auth + params: { auth?: Auth; id?: string } = {} ): Promise<{ definitions: EntityDefinitionWithState[] }> => { - let req = supertest.get('/internal/entities/definition').set('kbn-xsrf', 'xxx'); + const { auth, id } = params; + let req = supertest + .get(`/internal/entities/definition${id ? `/${id}` : ''}`) + .set('kbn-xsrf', 'xxx'); if (auth) { req = req.auth(auth.username, auth.password); } @@ -28,18 +31,28 @@ export const getInstalledDefinitions = async ( export const installDefinition = async ( supertest: Agent, - definition: EntityDefinition, - query: Record = {} + params: { + definition: EntityDefinition; + installOnly?: boolean; + } ) => { + const { definition, installOnly = false } = params; return supertest .post('/internal/entities/definition') - .query(query) + .query({ installOnly }) .set('kbn-xsrf', 'xxx') .send(definition) .expect(200); }; -export const uninstallDefinition = (supertest: Agent, id: string, deleteData = false) => { +export const uninstallDefinition = ( + supertest: Agent, + params: { + id: string; + deleteData?: boolean; + } +) => { + const { id, deleteData = false } = params; return supertest .delete(`/internal/entities/definition/${id}`) .query({ deleteData }) @@ -48,6 +61,22 @@ export const uninstallDefinition = (supertest: Agent, id: string, deleteData = f .expect(200); }; +export const updateDefinition = ( + supertest: Agent, + params: { + id: string; + update: EntityDefinitionUpdate; + expectedCode?: number; + } +) => { + const { id, update, expectedCode = 200 } = params; + return supertest + .patch(`/internal/entities/definition/${id}`) + .set('kbn-xsrf', 'xxx') + .send(update) + .expect(expectedCode); +}; + export const upgradeBuiltinDefinitions = async ( supertest: Agent, definitions: EntityDefinition[] diff --git a/x-pack/test/api_integration/apis/slos/create_slo.ts b/x-pack/test/api_integration/apis/slos/create_slo.ts index 4b458558b233e..71ce8434a61f1 100644 --- a/x-pack/test/api_integration/apis/slos/create_slo.ts +++ b/x-pack/test/api_integration/apis/slos/create_slo.ts @@ -29,6 +29,7 @@ export default function ({ getService }: FtrProviderContext) { let createSLOInput: CreateSLOInput; before(async () => { + await slo.createUser(); await loadTestData(getService); await slo.deleteAllSLOs(); }); @@ -47,12 +48,7 @@ export default function ({ getService }: FtrProviderContext) { }); it('creates a new slo and transforms', async () => { - const apiResponse = await supertestAPI - .post('/api/observability/slos') - .set('kbn-xsrf', 'true') - .set('x-elastic-internal-origin', 'foo') - .send(createSLOInput) - .expect(200); + const apiResponse = await slo.create(createSLOInput); expect(apiResponse.body).property('id'); @@ -113,7 +109,7 @@ export default function ({ getService }: FtrProviderContext) { transforms: [ { id: `slo-${id}-1`, - authorization: { roles: ['superuser'] }, + authorization: { roles: ['slo_editor', 'editor'] }, version: '10.0.0', create_time: rollUpTransformResponse.body.transforms[0].create_time, source: { @@ -193,7 +189,7 @@ export default function ({ getService }: FtrProviderContext) { transforms: [ { id: `slo-summary-${id}-1`, - authorization: { roles: ['superuser'] }, + authorization: { roles: ['slo_editor', 'editor'] }, version: '10.0.0', create_time: summaryTransform.body.transforms[0].create_time, source: { @@ -372,12 +368,7 @@ export default function ({ getService }: FtrProviderContext) { it('creates instanceId for SLOs with multi groupBy', async () => { createSLOInput.groupBy = ['system.network.name', 'event.dataset']; - const apiResponse = await supertestAPI - .post('/api/observability/slos') - .set('kbn-xsrf', 'true') - .set('x-elastic-internal-origin', 'foo') - .send(createSLOInput) - .expect(200); + const apiResponse = await slo.create(createSLOInput); expect(apiResponse.body).property('id'); @@ -396,12 +387,7 @@ export default function ({ getService }: FtrProviderContext) { it('creates instanceId for SLOs with single groupBy', async () => { createSLOInput.groupBy = 'system.network.name'; - const apiResponse = await supertestAPI - .post('/api/observability/slos') - .set('kbn-xsrf', 'true') - .set('x-elastic-internal-origin', 'foo') - .send(createSLOInput) - .expect(200); + const apiResponse = await slo.create(createSLOInput); expect(apiResponse.body).property('id'); @@ -418,12 +404,7 @@ export default function ({ getService }: FtrProviderContext) { it('creates instanceId for SLOs without groupBy ([])', async () => { createSLOInput.groupBy = []; - const apiResponse = await supertestAPI - .post('/api/observability/slos') - .set('kbn-xsrf', 'true') - .set('x-elastic-internal-origin', 'foo') - .send(createSLOInput) - .expect(200); + const apiResponse = await slo.create(createSLOInput); expect(apiResponse.body).property('id'); @@ -440,12 +421,7 @@ export default function ({ getService }: FtrProviderContext) { it('creates instanceId for SLOs without groupBy (["*"])', async () => { createSLOInput.groupBy = ['*']; - const apiResponse = await supertestAPI - .post('/api/observability/slos') - .set('kbn-xsrf', 'true') - .set('x-elastic-internal-origin', 'foo') - .send(createSLOInput) - .expect(200); + const apiResponse = await slo.create(createSLOInput); expect(apiResponse.body).property('id'); @@ -462,12 +438,7 @@ export default function ({ getService }: FtrProviderContext) { it('creates instanceId for SLOs without groupBy ("")', async () => { createSLOInput.groupBy = ''; - const apiResponse = await supertestAPI - .post('/api/observability/slos') - .set('kbn-xsrf', 'true') - .set('x-elastic-internal-origin', 'foo') - .send(createSLOInput) - .expect(200); + const apiResponse = await slo.create(createSLOInput); expect(apiResponse.body).property('id'); diff --git a/x-pack/test/api_integration/apis/slos/delete_slo.ts b/x-pack/test/api_integration/apis/slos/delete_slo.ts index b27bb49b7042f..19480d568a37c 100644 --- a/x-pack/test/api_integration/apis/slos/delete_slo.ts +++ b/x-pack/test/api_integration/apis/slos/delete_slo.ts @@ -29,6 +29,7 @@ export default function ({ getService }: FtrProviderContext) { let createSLOInput: CreateSLOInput; before(async () => { + await slo.createUser(); await slo.deleteAllSLOs(); await sloEsClient.deleteTestSourceData(); await loadTestData(getService); @@ -48,7 +49,11 @@ export default function ({ getService }: FtrProviderContext) { }); it('deletes new slo saved object and transforms', async () => { - const id = await slo.create(createSLOInput); + const response = await slo.create(createSLOInput); + + expect(response.body).property('id'); + + const { id } = response.body; const savedObject = await kibanaServer.savedObjects.find({ type: SO_SLO_TYPE, @@ -86,11 +91,7 @@ export default function ({ getService }: FtrProviderContext) { // expect summary transform to be created expect(summaryTransform.body.transforms[0].id).eql(`slo-summary-${id}-1`); - await supertestAPI - .delete(`/api/observability/slos/${id}`) - .set('kbn-xsrf', 'true') - .send() - .expect(204); + await slo.delete(id); }); // await retry.tryForTime(150 * 1000, async () => { diff --git a/x-pack/test/api_integration/apis/slos/fetch_historical_summary.ts b/x-pack/test/api_integration/apis/slos/fetch_historical_summary.ts index b8ca6a03b3d8e..96f8e21c8c593 100644 --- a/x-pack/test/api_integration/apis/slos/fetch_historical_summary.ts +++ b/x-pack/test/api_integration/apis/slos/fetch_historical_summary.ts @@ -23,6 +23,7 @@ export default function ({ getService }: FtrProviderContext) { describe('fetch historical summary', () => { before(async () => { + await sloApi.createUser(); const now = moment().startOf('minute'); const curr = now.clone().subtract(30, 'days'); const end = now.clone().add(5, 'minutes'); diff --git a/x-pack/test/api_integration/apis/slos/get_slo.ts b/x-pack/test/api_integration/apis/slos/get_slo.ts index b2cd64db05e71..274c2535a4630 100644 --- a/x-pack/test/api_integration/apis/slos/get_slo.ts +++ b/x-pack/test/api_integration/apis/slos/get_slo.ts @@ -35,6 +35,7 @@ export default function ({ getService }: FtrProviderContext) { }; before(async () => { + await slo.createUser(); await slo.deleteAllSLOs(); await sloEsClient.deleteTestSourceData(); await loadTestData(getService); @@ -55,10 +56,11 @@ export default function ({ getService }: FtrProviderContext) { await sloEsClient.deleteTestSourceData(); }); - it('gets slo by id and calculates SLI - occurances rolling', async () => { - const id = await createSLO({ + it('gets slo by id and calculates SLI - occurrences rolling', async () => { + const response = await createSLO({ groupBy: '*', }); + const id = response.body.id; await retry.tryForTime(300 * 1000, async () => { const getResponse = await supertestAPI @@ -87,7 +89,7 @@ export default function ({ getService }: FtrProviderContext) { groupBy: '*', groupings: {}, id, - settings: { syncDelay: '1m', frequency: '1m' }, + settings: { syncDelay: '1m', frequency: '1m', preventInitialBackfill: false }, revision: 1, enabled: true, createdAt: getResponse.body.createdAt, @@ -103,6 +105,9 @@ export default function ({ getService }: FtrProviderContext) { remaining: -49, isEstimated: false, }, + fiveMinuteBurnRate: 40, + oneDayBurnRate: 50, + oneHourBurnRate: 50, status: 'VIOLATED', }, }); @@ -110,13 +115,14 @@ export default function ({ getService }: FtrProviderContext) { }); it('gets slo by id and calculates SLI - occurences calendarAligned', async () => { - const id = await createSLO({ + const response = await createSLO({ groupBy: '*', timeWindow: { duration: '1w', type: 'calendarAligned', }, }); + const id = response.body.id; await retry.tryForTime(300 * 1000, async () => { const getResponse = await supertestAPI @@ -146,7 +152,7 @@ export default function ({ getService }: FtrProviderContext) { groupBy: '*', groupings: {}, id, - settings: { syncDelay: '1m', frequency: '1m' }, + settings: { syncDelay: '1m', frequency: '1m', preventInitialBackfill: false }, revision: 1, enabled: true, createdAt: getResponse.body.createdAt, @@ -162,6 +168,9 @@ export default function ({ getService }: FtrProviderContext) { remaining: -49, isEstimated: true, }, + fiveMinuteBurnRate: 40, + oneDayBurnRate: 50, + oneHourBurnRate: 50, status: 'VIOLATED', }, }); @@ -169,7 +178,7 @@ export default function ({ getService }: FtrProviderContext) { }); it('gets slo by id and calculates SLI - timeslices rolling', async () => { - const id = await createSLO({ + const response = await createSLO({ groupBy: '*', timeWindow: { duration: '7d', @@ -182,6 +191,7 @@ export default function ({ getService }: FtrProviderContext) { timesliceWindow: '1m', }, }); + const id = response.body.id; await retry.tryForTime(300 * 1000, async () => { const getResponse = await supertestAPI @@ -215,7 +225,7 @@ export default function ({ getService }: FtrProviderContext) { groupBy: '*', groupings: {}, id, - settings: { syncDelay: '1m', frequency: '1m' }, + settings: { syncDelay: '1m', frequency: '1m', preventInitialBackfill: false }, revision: 1, enabled: true, createdAt: getResponse.body.createdAt, @@ -223,7 +233,7 @@ export default function ({ getService }: FtrProviderContext) { version: 2, instanceId: '*', meta: {}, - summary: { + summary: expect.objectContaining({ sliValue: 0.5, errorBudget: { initial: 0.01, @@ -232,13 +242,13 @@ export default function ({ getService }: FtrProviderContext) { isEstimated: false, }, status: 'VIOLATED', - }, + }), }); }); }); it('gets slo by id and calculates SLI - timeslices calendarAligned', async () => { - const id = await createSLO({ + const response = await createSLO({ groupBy: '*', timeWindow: { duration: '1w', @@ -251,6 +261,7 @@ export default function ({ getService }: FtrProviderContext) { timesliceWindow: '10m', }, }); + const id = response.body.id; await retry.tryForTime(300 * 1000, async () => { const getResponse = await supertestAPI @@ -283,7 +294,7 @@ export default function ({ getService }: FtrProviderContext) { groupBy: '*', groupings: {}, id, - settings: { syncDelay: '1m', frequency: '1m' }, + settings: { syncDelay: '1m', frequency: '1m', preventInitialBackfill: false }, revision: 1, enabled: true, createdAt: getResponse.body.createdAt, @@ -299,6 +310,9 @@ export default function ({ getService }: FtrProviderContext) { remaining: 0.801587, isEstimated: false, }, + fiveMinuteBurnRate: 40, + oneDayBurnRate: 50, + oneHourBurnRate: 50, status: 'DEGRADING', }, }); @@ -353,7 +367,8 @@ export default function ({ getService }: FtrProviderContext) { }); it('gets slos instances', async () => { - const id = await createSLO(); + const createResponse = await createSLO(); + const id = createResponse.body.id; await retry.tryForTime(400 * 1000, async () => { const response = await supertestAPI @@ -381,13 +396,11 @@ export default function ({ getService }: FtrProviderContext) { }); it('gets slo definitions', async () => { - const id = await createSLO(); - const secondId = await createSLO({ name: 'test name int' }); - const response = await supertestAPI - .get(`/api/observability/slos/_definitions`) - .set('kbn-xsrf', 'true') - .send() - .expect(200); + const createResponse = await createSLO(); + const id = createResponse.body.id; + const secondCreateResponse = await createSLO({ name: 'test name int' }); + const secondId = secondCreateResponse.body.id; + const response = await slo.getDefinitions(); expect(response.body).toEqual({ page: 1, @@ -418,6 +431,7 @@ export default function ({ getService }: FtrProviderContext) { settings: { frequency: '1m', syncDelay: '1m', + preventInitialBackfill: false, }, tags: ['test'], timeWindow: { @@ -452,6 +466,7 @@ export default function ({ getService }: FtrProviderContext) { settings: { frequency: '1m', syncDelay: '1m', + preventInitialBackfill: false, }, tags: ['test'], timeWindow: { @@ -466,11 +481,7 @@ export default function ({ getService }: FtrProviderContext) { }); // can search by name - const searchResponse = await supertestAPI - .get(`/api/observability/slos/_definitions?search=api`) - .set('kbn-xsrf', 'true') - .send() - .expect(200); + const searchResponse = await slo.getDefinitions({ search: 'api' }); expect(searchResponse.body.total).toEqual(1); diff --git a/x-pack/test/api_integration/apis/slos/reset_slo.ts b/x-pack/test/api_integration/apis/slos/reset_slo.ts index 014e546b2b639..cccac8f1796be 100644 --- a/x-pack/test/api_integration/apis/slos/reset_slo.ts +++ b/x-pack/test/api_integration/apis/slos/reset_slo.ts @@ -16,7 +16,6 @@ export default function ({ getService }: FtrProviderContext) { describe('Reset SLOs', function () { this.tags('skipCloud'); - const supertestAPI = getService('supertest'); const kibanaServer = getService('kibanaServer'); const esClient = getService('es'); const logger = getService('log'); @@ -25,6 +24,7 @@ export default function ({ getService }: FtrProviderContext) { before(async () => { await sloEsClient.deleteTestSourceData(); + await slo.createUser(); await slo.deleteAllSLOs(); await loadTestData(getService); }); @@ -79,25 +79,13 @@ export default function ({ getService }: FtrProviderContext) { }, }); - const responseBeforeReset = await supertestAPI - .get(`/api/observability/slos/_definitions`) - .set('kbn-xsrf', 'true') - .send() - .expect(200); + const responseBeforeReset = await slo.getDefinitions(); expect(responseBeforeReset.body.results[0].version).eql(1); - await supertestAPI - .post(`/api/observability/slos/${id}/_reset`) - .set('kbn-xsrf', 'true') - .send() - .expect(200); + await slo.reset(id); - const responseAfterReset = await supertestAPI - .get(`/api/observability/slos/_definitions`) - .set('kbn-xsrf', 'true') - .send() - .expect(200); + const responseAfterReset = await slo.getDefinitions(); expect(responseAfterReset.body.results[0].version).eql(2); }); diff --git a/x-pack/test/api_integration/apis/slos/update_slo.ts b/x-pack/test/api_integration/apis/slos/update_slo.ts index 76e19d6ba20a0..7bf6967bd26a3 100644 --- a/x-pack/test/api_integration/apis/slos/update_slo.ts +++ b/x-pack/test/api_integration/apis/slos/update_slo.ts @@ -26,6 +26,7 @@ export default function ({ getService }: FtrProviderContext) { let createSLOInput: CreateSLOInput; before(async () => { + await slo.createUser(); await slo.deleteAllSLOs(); await loadTestData(getService); }); diff --git a/x-pack/test/api_integration/apis/telemetry/telemetry.ts b/x-pack/test/api_integration/apis/telemetry/telemetry.ts index 9c0a9b16bd835..bae5c5b8cdc44 100644 --- a/x-pack/test/api_integration/apis/telemetry/telemetry.ts +++ b/x-pack/test/api_integration/apis/telemetry/telemetry.ts @@ -14,6 +14,7 @@ import ossRootTelemetrySchema from '@kbn/telemetry-plugin/schema/oss_root.json'; import xpackRootTelemetrySchema from '@kbn/telemetry-collection-xpack-plugin/schema/xpack_root.json'; import monitoringRootTelemetrySchema from '@kbn/telemetry-collection-xpack-plugin/schema/xpack_monitoring.json'; import ossPluginsTelemetrySchema from '@kbn/telemetry-plugin/schema/oss_plugins.json'; +import ossPackagesTelemetrySchema from '@kbn/telemetry-plugin/schema/kbn_packages.json'; import xpackPluginsTelemetrySchema from '@kbn/telemetry-collection-xpack-plugin/schema/xpack_plugins.json'; import type { UnencryptedTelemetryPayload } from '@kbn/telemetry-plugin/common/types'; import type { @@ -160,7 +161,10 @@ export default function ({ getService }: FtrProviderContext) { // It's nested because of the way it's collected and declared monitoringRootTelemetrySchema.properties.monitoringTelemetry.properties.stats.items ); - const plugins = deepmerge(ossPluginsTelemetrySchema, xpackPluginsTelemetrySchema); + const plugins = deepmerge( + deepmerge(ossPluginsTelemetrySchema, ossPackagesTelemetrySchema), + xpackPluginsTelemetrySchema + ); try { assertTelemetryPayload({ root, plugins }, localXPack); diff --git a/x-pack/test/api_integration/apis/telemetry/telemetry_local.ts b/x-pack/test/api_integration/apis/telemetry/telemetry_local.ts index bc59b02955ba0..ffd37240303fc 100644 --- a/x-pack/test/api_integration/apis/telemetry/telemetry_local.ts +++ b/x-pack/test/api_integration/apis/telemetry/telemetry_local.ts @@ -9,6 +9,7 @@ import expect from '@kbn/expect'; import deepmerge from 'deepmerge'; import ossRootTelemetrySchema from '@kbn/telemetry-plugin/schema/oss_root.json'; import ossPluginsTelemetrySchema from '@kbn/telemetry-plugin/schema/oss_plugins.json'; +import ossPackagesTelemetrySchema from '@kbn/telemetry-plugin/schema/kbn_packages.json'; import xpackRootTelemetrySchema from '@kbn/telemetry-collection-xpack-plugin/schema/xpack_root.json'; import xpackPluginsTelemetrySchema from '@kbn/telemetry-collection-xpack-plugin/schema/xpack_plugins.json'; import { assertTelemetryPayload } from '@kbn/telemetry-tools'; @@ -56,7 +57,10 @@ export default function ({ getService }: FtrProviderContext) { it('should pass the schema validation', () => { const root = deepmerge(ossRootTelemetrySchema, xpackRootTelemetrySchema); - const plugins = deepmerge(ossPluginsTelemetrySchema, xpackPluginsTelemetrySchema); + const plugins = deepmerge( + deepmerge(ossPluginsTelemetrySchema, ossPackagesTelemetrySchema), + xpackPluginsTelemetrySchema + ); try { assertTelemetryPayload({ root, plugins }, stats); diff --git a/x-pack/test/api_integration/apis/transform/common.ts b/x-pack/test/api_integration/apis/transform/common.ts index e9d2b37e2f4f3..e56afe0749e80 100644 --- a/x-pack/test/api_integration/apis/transform/common.ts +++ b/x-pack/test/api_integration/apis/transform/common.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; export async function asyncForEach(array: any[], callback: Function) { for (let index = 0; index < array.length; index++) { diff --git a/x-pack/test/api_integration/apis/transform/delete_transforms.ts b/x-pack/test/api_integration/apis/transform/delete_transforms.ts index a064fd28b214b..ecf3b03d84840 100644 --- a/x-pack/test/api_integration/apis/transform/delete_transforms.ts +++ b/x-pack/test/api_integration/apis/transform/delete_transforms.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import { DeleteTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/delete_transforms'; +import { DeleteTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/delete_transforms'; import { TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; diff --git a/x-pack/test/api_integration/apis/transform/reauthorize_transforms.ts b/x-pack/test/api_integration/apis/transform/reauthorize_transforms.ts index 1b39c99275cef..acdba779e6566 100644 --- a/x-pack/test/api_integration/apis/transform/reauthorize_transforms.ts +++ b/x-pack/test/api_integration/apis/transform/reauthorize_transforms.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ReauthorizeTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/reauthorize_transforms'; +import { ReauthorizeTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/reauthorize_transforms'; import expect from '@kbn/expect'; import { TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; import type { SecurityCreateApiKeyResponse } from '@elastic/elasticsearch/lib/api/types'; diff --git a/x-pack/test/api_integration/apis/transform/reset_transforms.ts b/x-pack/test/api_integration/apis/transform/reset_transforms.ts index 4b42281fb6d7d..5a805d148d9a4 100644 --- a/x-pack/test/api_integration/apis/transform/reset_transforms.ts +++ b/x-pack/test/api_integration/apis/transform/reset_transforms.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import { ResetTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/reset_transforms'; +import { ResetTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/reset_transforms'; import { TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; diff --git a/x-pack/test/api_integration/apis/transform/schedule_now_transforms.ts b/x-pack/test/api_integration/apis/transform/schedule_now_transforms.ts index 4f4ca51962c28..1579444c08bdf 100644 --- a/x-pack/test/api_integration/apis/transform/schedule_now_transforms.ts +++ b/x-pack/test/api_integration/apis/transform/schedule_now_transforms.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import { ScheduleNowTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/schedule_now_transforms'; +import { ScheduleNowTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/schedule_now_transforms'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; import { USER } from '../../../functional/services/transform/security_common'; diff --git a/x-pack/test/api_integration/apis/transform/start_transforms.ts b/x-pack/test/api_integration/apis/transform/start_transforms.ts index 7102ea90f27eb..f18163aa9f964 100644 --- a/x-pack/test/api_integration/apis/transform/start_transforms.ts +++ b/x-pack/test/api_integration/apis/transform/start_transforms.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import { StartTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/start_transforms'; +import { StartTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/start_transforms'; import { TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; diff --git a/x-pack/test/api_integration/apis/transform/stop_transforms.ts b/x-pack/test/api_integration/apis/transform/stop_transforms.ts index c982c6b45f1c9..a685dc77e61f7 100644 --- a/x-pack/test/api_integration/apis/transform/stop_transforms.ts +++ b/x-pack/test/api_integration/apis/transform/stop_transforms.ts @@ -7,8 +7,8 @@ import expect from '@kbn/expect'; -import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; -import type { StopTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/stop_transforms'; +import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; +import type { StopTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/stop_transforms'; import { TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; diff --git a/x-pack/test/api_integration/apis/transform/transforms.ts b/x-pack/test/api_integration/apis/transform/transforms.ts index 2016876ba93a6..d2ada2e4e7ce3 100644 --- a/x-pack/test/api_integration/apis/transform/transforms.ts +++ b/x-pack/test/api_integration/apis/transform/transforms.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; import { USER } from '../../../functional/services/transform/security_common'; diff --git a/x-pack/test/api_integration/apis/transform/transforms_nodes.ts b/x-pack/test/api_integration/apis/transform/transforms_nodes.ts index 10f4413a8f85f..80fc18300a93a 100644 --- a/x-pack/test/api_integration/apis/transform/transforms_nodes.ts +++ b/x-pack/test/api_integration/apis/transform/transforms_nodes.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import type { GetTransformNodesResponseSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import type { GetTransformNodesResponseSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; import { USER } from '../../../functional/services/transform/security_common'; diff --git a/x-pack/test/api_integration/apis/transform/transforms_preview.ts b/x-pack/test/api_integration/apis/transform/transforms_preview.ts index 56a1000e57ac2..d481f031be1e7 100644 --- a/x-pack/test/api_integration/apis/transform/transforms_preview.ts +++ b/x-pack/test/api_integration/apis/transform/transforms_preview.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import type { PostTransformsPreviewRequestSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import type { PostTransformsPreviewRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; import { FtrProviderContext } from '../../ftr_provider_context'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; diff --git a/x-pack/test/api_integration/apis/transform/transforms_stats.ts b/x-pack/test/api_integration/apis/transform/transforms_stats.ts index 2eec1f4e17b9a..e9063a5a12b68 100644 --- a/x-pack/test/api_integration/apis/transform/transforms_stats.ts +++ b/x-pack/test/api_integration/apis/transform/transforms_stats.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; -import type { GetTransformsStatsResponseSchema } from '@kbn/transform-plugin/common/api_schemas/transforms_stats'; +import type { GetTransformsStatsResponseSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms_stats'; import { TRANSFORM_STATE, type TransformState } from '@kbn/transform-plugin/common/constants'; import { getCommonRequestHeader } from '../../../functional/services/ml/common_api'; diff --git a/x-pack/test/api_integration/services/security_solution_osquery_api.gen.ts b/x-pack/test/api_integration/services/security_solution_osquery_api.gen.ts index 1093c30a5d357..c133ebce15c90 100644 --- a/x-pack/test/api_integration/services/security_solution_osquery_api.gen.ts +++ b/x-pack/test/api_integration/services/security_solution_osquery_api.gen.ts @@ -93,6 +93,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') .query(props.query); }, + /** + * Create and run a live query. + */ osqueryCreateLiveQuery(props: OsqueryCreateLiveQueryProps) { return supertest .post('/api/osquery/live_queries') @@ -101,6 +104,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') .send(props.body as object); }, + /** + * Create a query pack. + */ osqueryCreatePacks(props: OsqueryCreatePacksProps) { return supertest .post('/api/osquery/packs') @@ -109,6 +115,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') .send(props.body as object); }, + /** + * Create and run a saved query. + */ osqueryCreateSavedQuery(props: OsqueryCreateSavedQueryProps) { return supertest .post('/api/osquery/saved_queries') @@ -117,6 +126,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') .send(props.body as object); }, + /** + * Delete a query pack using the pack ID. + */ osqueryDeletePacks(props: OsqueryDeletePacksProps) { return supertest .delete(replaceParams('/api/osquery/packs/{id}', props.params)) @@ -124,6 +136,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) .set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31') .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana'); }, + /** + * Delete a saved query using the query ID. + */ osqueryDeleteSavedQuery(props: OsqueryDeleteSavedQueryProps) { return supertest .delete(replaceParams('/api/osquery/saved_queries/{id}', props.params)) @@ -131,6 +146,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) .set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31') .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana'); }, + /** + * Get a list of all live queries. + */ osqueryFindLiveQueries(props: OsqueryFindLiveQueriesProps) { return supertest .get('/api/osquery/live_queries') @@ -139,6 +157,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') .query(props.query); }, + /** + * Get a list of all query packs. + */ osqueryFindPacks(props: OsqueryFindPacksProps) { return supertest .get('/api/osquery/packs') @@ -147,6 +168,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') .query(props.query); }, + /** + * Get a list of all saved queries. + */ osqueryFindSavedQueries(props: OsqueryFindSavedQueriesProps) { return supertest .get('/api/osquery/saved_queries') @@ -155,6 +179,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') .query(props.query); }, + /** + * Get the details of a live query using the query ID. + */ osqueryGetLiveQueryDetails(props: OsqueryGetLiveQueryDetailsProps) { return supertest .get(replaceParams('/api/osquery/live_queries/{id}', props.params)) @@ -163,6 +190,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') .query(props.query); }, + /** + * Get the results of a live query using the query action ID. + */ osqueryGetLiveQueryResults(props: OsqueryGetLiveQueryResultsProps) { return supertest .get(replaceParams('/api/osquery/live_queries/{id}/results/{actionId}', props.params)) @@ -171,6 +201,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') .query(props.query); }, + /** + * Get the details of a query pack using the pack ID. + */ osqueryGetPacksDetails(props: OsqueryGetPacksDetailsProps) { return supertest .get(replaceParams('/api/osquery/packs/{id}', props.params)) @@ -178,6 +211,9 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) .set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31') .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana'); }, + /** + * Get the details of a saved query using the query ID. + */ osqueryGetSavedQueryDetails(props: OsqueryGetSavedQueryDetailsProps) { return supertest .get(replaceParams('/api/osquery/saved_queries/{id}', props.params)) @@ -185,6 +221,12 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) .set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31') .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana'); }, + /** + * Update a query pack using the pack ID. +> info +> You cannot update a prebuilt pack. + + */ osqueryUpdatePacks(props: OsqueryUpdatePacksProps) { return supertest .put(replaceParams('/api/osquery/packs/{id}', props.params)) @@ -193,6 +235,12 @@ export function SecuritySolutionApiProvider({ getService }: FtrProviderContext) .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') .send(props.body as object); }, + /** + * Update a saved query using the query ID. +> info +> You cannot update a prebuilt saved query. + + */ osqueryUpdateSavedQuery(props: OsqueryUpdateSavedQueryProps) { return supertest .put(replaceParams('/api/osquery/saved_queries/{id}', props.params)) diff --git a/x-pack/test/api_integration/services/slo.ts b/x-pack/test/api_integration/services/slo.ts index c7b765dddf613..d0d6cdc190e0e 100644 --- a/x-pack/test/api_integration/services/slo.ts +++ b/x-pack/test/api_integration/services/slo.ts @@ -4,8 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - import { SLO_SUMMARY_DESTINATION_INDEX_NAME } from '@kbn/slo-plugin/common/constants'; +import { TOTAL_INDEX_PRIVILEGE_SET_EDITOR } from '@kbn/slo-plugin/server/services/get_diagnosis'; import { CreateSLOInput, fetchHistoricalSummaryParamsSchema, @@ -21,39 +21,92 @@ type FetchHistoricalSummaryParams = t.OutputOf< >; export function SloApiProvider({ getService }: FtrProviderContext) { - const supertest = getService('supertest'); + const supertest = getService('supertestWithoutAuth'); const esClient = getService('es'); + const security = getService('security'); return { + async createUser() { + const username = 'slo_editor'; + const roleName = 'slo_editor'; + try { + await security.user.delete(username); + await security.role.delete(roleName); + } catch (error) { + const status = error.response.status; + if (status !== 404) { + throw error; + } + } + const password = 'changeme'; + + await security.role.create(roleName, { + elasticsearch: { + indices: [ + { + names: ['.slo-observability.*'], + privileges: TOTAL_INDEX_PRIVILEGE_SET_EDITOR, + }, + ], + }, + }); + + await security.user.create(username, { + password, + roles: [roleName, 'editor'], + }); + }, async create(params: CreateSLOInput) { const slo = await supertest .post('/api/observability/slos') .set('kbn-xsrf', 'true') + .auth('slo_editor', 'changeme') .send(params) .expect(200); - const { id } = slo.body; + return slo; + }, + async reset(id: string) { + const response = supertest + .post(`/api/observability/slos/${id}/_reset`) + .auth('slo_editor', 'changeme') + .set('kbn-xsrf', 'true') + .send() + .expect(200); - const reqBody = [{ id: `slo-${id}-1` }, { id: `slo-summary-${id}-1` }]; - await supertest - .post(`/internal/transform/schedule_now_transforms`) + return response; + }, + async getDefinitions({ search }: { search?: string } = {}) { + const url = `/api/observability/slos/_definitions${search ? `?search=${search}` : ''}`; + const response = await supertest + .get(url) .set('kbn-xsrf', 'true') - .set('elastic-api-version', '1') - .send(reqBody) + .auth('slo_editor', 'changeme') + .send() .expect(200); - return id; + return response; + }, + async delete(id: string) { + await supertest + .delete(`/api/observability/slos/${id}`) + .set('kbn-xsrf', 'true') + .auth('slo_editor', 'changeme') + .send() + .expect(204); }, async deleteAllSLOs() { const response = await supertest .get(`/api/observability/slos/_definitions`) .set('kbn-xsrf', 'true') + .auth('slo_editor', 'changeme') .send() .expect(200); for (const { id } of (response.body as FindSLODefinitionsResponse).results) { await supertest .delete(`/api/observability/slos/${id}`) .set('kbn-xsrf', 'true') + .auth('slo_editor', 'changeme') .send() .expect(204); } @@ -65,6 +118,7 @@ export function SloApiProvider({ getService }: FtrProviderContext) { const { body } = await supertest .post(`/internal/observability/slos/_historical_summary`) .set('kbn-xsrf', 'foo') + .auth('slo_editor', 'changeme') .set('elastic-api-version', '1') .send(params); diff --git a/x-pack/test/cloud_security_posture_api/routes/benchmarks.ts b/x-pack/test/cloud_security_posture_api/routes/benchmarks.ts index a8b94a9f36799..93ee947cef4a5 100644 --- a/x-pack/test/cloud_security_posture_api/routes/benchmarks.ts +++ b/x-pack/test/cloud_security_posture_api/routes/benchmarks.ts @@ -15,7 +15,7 @@ import { } from '@kbn/cloud-security-posture-plugin/common/constants'; import expect from '@kbn/expect'; import Chance from 'chance'; -import { CspBenchmarkRule } from '@kbn/cloud-security-posture-plugin/common/types/latest'; +import { CspBenchmarkRule } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { FtrProviderContext } from '../ftr_provider_context'; import { CspSecurityCommonProvider } from './helper/user_roles_utilites'; diff --git a/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts b/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts index 5b80b5c7bc99d..b46ecd1ef2943 100644 --- a/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts +++ b/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts @@ -17,7 +17,7 @@ import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE, DETECTION_RULE_RULES_API_CURRENT_VERSION, } from '@kbn/cloud-security-posture-plugin/common/constants'; -import type { CspBenchmarkRule } from '@kbn/cloud-security-posture-plugin/common/types/latest'; +import type { CspBenchmarkRule } from '@kbn/cloud-security-posture-common/schema/rules/latest'; // eslint-disable @kbn/imports/no_boundary_crossing import { generateBenchmarkRuleTags } from '@kbn/cloud-security-posture-plugin/common/utils/detection_rules'; import type { FtrProviderContext } from '../ftr_provider_context'; diff --git a/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_get_states.ts b/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_get_states.ts index 3b023ca4d352b..61a22a234b6d0 100644 --- a/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_get_states.ts +++ b/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_get_states.ts @@ -13,7 +13,7 @@ import { X_ELASTIC_INTERNAL_ORIGIN_REQUEST, } from '@kbn/core-http-common'; import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '@kbn/cloud-security-posture-plugin/common/constants'; -import type { CspBenchmarkRule } from '@kbn/cloud-security-posture-plugin/common/types/latest'; +import type { CspBenchmarkRule } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import type { FtrProviderContext } from '../ftr_provider_context'; import { CspSecurityCommonProvider } from './helper/user_roles_utilites'; diff --git a/x-pack/test/cloud_security_posture_functional/pages/findings.ts b/x-pack/test/cloud_security_posture_functional/pages/findings.ts index 35f1f0b5cbff4..9b5460f3141d6 100644 --- a/x-pack/test/cloud_security_posture_functional/pages/findings.ts +++ b/x-pack/test/cloud_security_posture_functional/pages/findings.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import Chance from 'chance'; -import { CspBenchmarkRule } from '@kbn/cloud-security-posture-plugin/common/types/latest'; +import { CspBenchmarkRule } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '@kbn/cloud-security-posture-plugin/common/constants'; import { ELASTIC_HTTP_VERSION_HEADER, diff --git a/x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts b/x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts index acfd5918afe9f..1f3a95b81bd6f 100644 --- a/x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts +++ b/x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; import Chance from 'chance'; import { asyncForEach } from '@kbn/std'; -import { CspBenchmarkRule } from '@kbn/cloud-security-posture-plugin/common/types/latest'; +import { CspBenchmarkRule } from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '@kbn/cloud-security-posture-plugin/common/constants'; import { ELASTIC_HTTP_VERSION_HEADER, diff --git a/x-pack/test/fleet_api_integration/apis/fleet_setup.ts b/x-pack/test/fleet_api_integration/apis/fleet_setup.ts index 3f76f4594592f..ae196f13d9dc3 100644 --- a/x-pack/test/fleet_api_integration/apis/fleet_setup.ts +++ b/x-pack/test/fleet_api_integration/apis/fleet_setup.ts @@ -6,8 +6,15 @@ */ import expect from '@kbn/expect'; +import { v4 as uuidV4 } from 'uuid'; +import { INGEST_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; +import { LEGACY_PACKAGE_POLICY_SAVED_OBJECT_TYPE } from '@kbn/fleet-plugin/common/constants'; +import pRetry from 'p-retry'; +import { SearchTotalHits } from '@elastic/elasticsearch/lib/api/types'; + import { FtrProviderContext } from '../../api_integration/ftr_provider_context'; import { skipIfNoDockerRegistry } from '../helpers'; +import { SpaceTestApiClient } from './space_awareness/api_helper'; export default function (providerContext: FtrProviderContext) { const { getService } = providerContext; @@ -48,23 +55,6 @@ export default function (providerContext: FtrProviderContext) { } }); - it('should not create a fleet_enroll role if one does not already exist', async () => { - const { body: apiResponse } = await supertest - .post(`/api/fleet/setup`) - .set('kbn-xsrf', 'xxxx') - .expect(200); - - expect(apiResponse.isInitialized).to.be(true); - - try { - await es.security.getUser({ - username: 'fleet_enroll', - }); - } catch (e) { - expect(e.meta?.statusCode).to.eql(404); - } - }); - it('should install default packages', async () => { await supertest.post(`/api/fleet/setup`).set('kbn-xsrf', 'xxxx').expect(200); @@ -78,5 +68,92 @@ export default function (providerContext: FtrProviderContext) { expect(installedPackages).to.eql(['endpoint']); }); + + describe('upgrade managed package policies', () => { + const apiClient = new SpaceTestApiClient(supertest); + before(async () => { + const pkgRes = await apiClient.getPackage({ + pkgName: 'synthetics', + }); + await apiClient.installPackage({ + pkgName: 'synthetics', + pkgVersion: pkgRes.item.version, + force: true, + }); + await apiClient.updatePackage({ + pkgName: 'synthetics', + pkgVersion: pkgRes.item.version, + data: { + keepPoliciesUpToDate: true, + }, + }); + + const agentPolicyRes = await apiClient.createAgentPolicy(); + + await es.bulk({ + index: INGEST_SAVED_OBJECT_INDEX, + refresh: 'wait_for', + operations: [...new Array(10).keys()].flatMap((_, index) => [ + { + create: { + _id: `${LEGACY_PACKAGE_POLICY_SAVED_OBJECT_TYPE}:${uuidV4()}`, + }, + }, + { + type: LEGACY_PACKAGE_POLICY_SAVED_OBJECT_TYPE, + [LEGACY_PACKAGE_POLICY_SAVED_OBJECT_TYPE]: { + name: `test-${index}`, + policy_ids: [agentPolicyRes.item.id], + inputs: [], + package: { + name: 'synthetics', + version: '1.2.1', + }, + }, + }, + ]), + }); + + await apiClient.getPackage({ + pkgName: 'synthetics', + }); + }); + it('should upgrade managed package policies', async () => { + await apiClient.setup(); + + await pRetry( + async () => { + const res = await es.search({ + index: INGEST_SAVED_OBJECT_INDEX, + track_total_hits: true, + query: { + bool: { + must: { + term: { + [`${LEGACY_PACKAGE_POLICY_SAVED_OBJECT_TYPE}.package.version`]: '1.2.1', + }, + }, + filter: { + term: { + [`${LEGACY_PACKAGE_POLICY_SAVED_OBJECT_TYPE}.package.name`]: 'synthetics', + }, + }, + }, + }, + }); + if ((res.hits.total as SearchTotalHits).value > 0) { + throw new Error( + `Managed package policies not upgraded ${ + (res.hits.total as SearchTotalHits).value + }.` + ); + } + }, + { + maxRetryTime: 20 * 1000, + } + ); + }); + }); }); } diff --git a/x-pack/test/fleet_api_integration/apis/space_awareness/actions.ts b/x-pack/test/fleet_api_integration/apis/space_awareness/actions.ts index 14c3dff338955..59fb305387506 100644 --- a/x-pack/test/fleet_api_integration/apis/space_awareness/actions.ts +++ b/x-pack/test/fleet_api_integration/apis/space_awareness/actions.ts @@ -10,7 +10,12 @@ import { AGENT_POLICY_INDEX, CreateAgentPolicyResponse } from '@kbn/fleet-plugin import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; import { skipIfNoDockerRegistry } from '../../helpers'; import { SpaceTestApiClient } from './api_helper'; -import { cleanFleetActionIndices, cleanFleetIndices, createFleetAgent } from './helpers'; +import { + cleanFleetActionIndices, + cleanFleetAgentPolicies, + cleanFleetIndices, + createFleetAgent, +} from './helpers'; import { setupTestSpaces, TEST_SPACE_1 } from './space_helpers'; export default function (providerContext: FtrProviderContext) { @@ -33,6 +38,7 @@ export default function (providerContext: FtrProviderContext) { beforeEach(async () => { await cleanFleetActionIndices(esClient); + await cleanFleetAgentPolicies(esClient); }); after(async () => { @@ -100,6 +106,7 @@ export default function (providerContext: FtrProviderContext) { ); expect(actionStatusInDefaultSpace.items[0].type).to.eql('UPDATE_TAGS'); expect(actionStatusInDefaultSpace.items[0].nbAgentsActioned).to.eql(2); + expect(actionStatusInDefaultSpace.items[0].nbAgentsActionCreated).to.eql(2); expect(actionStatusInDefaultSpace.items[0].status).to.eql('COMPLETE'); const actionStatusInCustomSpace = await apiClient.getActionStatus(TEST_SPACE_1); @@ -132,6 +139,7 @@ export default function (providerContext: FtrProviderContext) { ); expect(actionStatusInCustomSpace.items[0].type).to.eql('UPDATE_TAGS'); expect(actionStatusInCustomSpace.items[0].nbAgentsActioned).to.eql(2); + expect(actionStatusInCustomSpace.items[0].nbAgentsActionCreated).to.eql(2); expect(actionStatusInCustomSpace.items[0].status).to.eql('COMPLETE'); }); @@ -174,6 +182,7 @@ export default function (providerContext: FtrProviderContext) { 'nbAgentsFailed' ); expect(actionStatusInDefaultSpace.items[0].type).to.eql('POLICY_CHANGE'); + expect(actionStatusInDefaultSpace.items[0].nbAgentsActionCreated).to.eql(2); expect(actionStatusInDefaultSpace.items[0].nbAgentsActioned).to.eql(2); const actionStatusInCustomSpace = await apiClient.getActionStatus(TEST_SPACE_1); @@ -209,6 +218,7 @@ export default function (providerContext: FtrProviderContext) { 'nbAgentsFailed' ); expect(actionStatusInCustomSpace.items[0].type).to.eql('POLICY_CHANGE'); + expect(actionStatusInCustomSpace.items[0].nbAgentsActionCreated).to.eql(2); expect(actionStatusInCustomSpace.items[0].nbAgentsActioned).to.eql(2); }); }); @@ -251,7 +261,7 @@ export default function (providerContext: FtrProviderContext) { }); }); - describe('post /agents/actions/{actionId}/cancel', () => { + describe('POST /agents/actions/{actionId}/cancel', () => { it('should return 200 and a CANCEL action if the action is in the same space', async () => { // Create UPDATE_TAGS action for agents in custom space await apiClient.bulkUpdateAgentTags( diff --git a/x-pack/test/fleet_api_integration/apis/space_awareness/agents.ts b/x-pack/test/fleet_api_integration/apis/space_awareness/agents.ts index f41f83f71ccb7..851e8f44c0654 100644 --- a/x-pack/test/fleet_api_integration/apis/space_awareness/agents.ts +++ b/x-pack/test/fleet_api_integration/apis/space_awareness/agents.ts @@ -6,11 +6,16 @@ */ import expect from '@kbn/expect'; -import { CreateAgentPolicyResponse, GetAgentsResponse } from '@kbn/fleet-plugin/common'; +import { + AGENTS_INDEX, + CreateAgentPolicyResponse, + GetAgentsResponse, +} from '@kbn/fleet-plugin/common'; import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; import { skipIfNoDockerRegistry } from '../../helpers'; import { SpaceTestApiClient } from './api_helper'; import { + cleanFleetActionIndices, cleanFleetAgents, cleanFleetIndices, createFleetAgent, @@ -45,6 +50,7 @@ export default function (providerContext: FtrProviderContext) { }); setupTestSpaces(providerContext); + let defaultSpacePolicy1: CreateAgentPolicyResponse; let defaultSpacePolicy2: CreateAgentPolicyResponse; let spaceTest1Policy1: CreateAgentPolicyResponse; @@ -79,6 +85,7 @@ export default function (providerContext: FtrProviderContext) { before(async () => { await apiClient.postEnableSpaceAwareness(); + const [_defaultSpacePolicy1, _defaultSpacePolicy2, _spaceTest1Policy1, _spaceTest1Policy2] = await Promise.all([ apiClient.createAgentPolicy(), @@ -94,7 +101,16 @@ export default function (providerContext: FtrProviderContext) { await createAgents(); }); - describe('GET /agent', () => { + beforeEach(async () => { + await cleanFleetActionIndices(esClient); + }); + + async function verifyNoAgentActions(spaceId?: string) { + const actionStatus = await apiClient.getActionStatus(spaceId); + expect(actionStatus.items.length).to.eql(0); + } + + describe('GET /agents', () => { it('should return agents in a specific space', async () => { const agents = await apiClient.getAgents(TEST_SPACE_1); expect(agents.total).to.eql(3); @@ -133,7 +149,11 @@ export default function (providerContext: FtrProviderContext) { describe('PUT /agents/{agentId}', () => { it('should allow updating an agent in the same space', async () => { await apiClient.updateAgent(testSpaceAgent1, { tags: ['foo'] }, TEST_SPACE_1); + let agent = await apiClient.getAgent(testSpaceAgent1, TEST_SPACE_1); + expect(agent.item.tags).to.eql(['foo']); await apiClient.updateAgent(testSpaceAgent1, { tags: ['tag1'] }, TEST_SPACE_1); + agent = await apiClient.getAgent(testSpaceAgent1, TEST_SPACE_1); + expect(agent.item.tags).to.eql(['tag1']); }); it('should not allow updating an agent from a different space', async () => { @@ -150,13 +170,18 @@ export default function (providerContext: FtrProviderContext) { }); describe('DELETE /agents/{id}', () => { - it('should allow to delete an agent in the same space', async () => { + it('should allow deleting an agent in the same space', async () => { const testSpaceDeleteAgent = await createFleetAgent( esClient, spaceTest1Policy2.item.id, TEST_SPACE_1 ); await apiClient.deleteAgent(testSpaceDeleteAgent, TEST_SPACE_1); + await esClient.delete({ + index: AGENTS_INDEX, + id: testSpaceDeleteAgent, + refresh: 'wait_for', + }); }); it('should not allow deleting an agent from a different space', async () => { @@ -180,11 +205,28 @@ export default function (providerContext: FtrProviderContext) { }, {} as any); } + async function verifyAgentsTags(expected: any, spaceId?: string) { + const agents = await apiClient.getAgents(spaceId); + const agentTags = getAgentTags(agents); + expect(agentTags).to.eql(expected); + } + it('should only update tags of agents in the same space when passing a list of agent ids', async () => { - let agents = await apiClient.getAgents(TEST_SPACE_1); - let agentTags = getAgentTags(agents); - expect(agentTags[testSpaceAgent1]).to.eql(['tag1']); - expect(agentTags[testSpaceAgent2]).to.eql(['tag1']); + await verifyAgentsTags({ + [defaultSpaceAgent1]: ['tag1'], + [defaultSpaceAgent2]: ['tag1'], + }); + await verifyAgentsTags( + { + [testSpaceAgent1]: ['tag1'], + [testSpaceAgent2]: ['tag1'], + [testSpaceAgent3]: ['tag1'], + }, + TEST_SPACE_1 + ); + await verifyNoAgentActions(); + await verifyNoAgentActions(TEST_SPACE_1); + // Add tag await apiClient.bulkUpdateAgentTags( { @@ -193,11 +235,24 @@ export default function (providerContext: FtrProviderContext) { }, TEST_SPACE_1 ); - agents = await apiClient.getAgents(TEST_SPACE_1); - agentTags = getAgentTags(agents); - expect(agentTags[testSpaceAgent1]).to.eql(['tag1', 'space1']); - expect(agentTags[testSpaceAgent2]).to.eql(['tag1']); - // Reset tags + + await verifyAgentsTags({ + [defaultSpaceAgent1]: ['tag1'], + [defaultSpaceAgent2]: ['tag1'], + }); + await verifyAgentsTags( + { + [testSpaceAgent1]: ['tag1', 'space1'], + [testSpaceAgent2]: ['tag1'], + [testSpaceAgent3]: ['tag1'], + }, + TEST_SPACE_1 + ); + await verifyNoAgentActions(); + let actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(1); + + // Remove tag await apiClient.bulkUpdateAgentTags( { agents: [testSpaceAgent1], @@ -205,37 +260,71 @@ export default function (providerContext: FtrProviderContext) { }, TEST_SPACE_1 ); - agents = await apiClient.getAgents(TEST_SPACE_1); - agentTags = getAgentTags(agents); - expect(agentTags[testSpaceAgent1]).to.eql(['tag1']); + + await verifyAgentsTags({ + [defaultSpaceAgent1]: ['tag1'], + [defaultSpaceAgent2]: ['tag1'], + }); + await verifyAgentsTags( + { + [testSpaceAgent1]: ['tag1'], + [testSpaceAgent2]: ['tag1'], + [testSpaceAgent3]: ['tag1'], + }, + TEST_SPACE_1 + ); + await verifyNoAgentActions(); + actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(2); + actionStatus.items.forEach((item) => { + expect(item.nbAgentsActioned).to.eql(1); + expect(item.nbAgentsActionCreated).to.eql(1); + expect(item.type).to.eql('UPDATE_TAGS'); + }); }); it('should only update tags of agents in the same space when passing a kuery', async () => { - let agentsInDefaultSpace = await apiClient.getAgents(); - let agentInDefaultSpaceTags = getAgentTags(agentsInDefaultSpace); - let agentsInTestSpace = await apiClient.getAgents(TEST_SPACE_1); - let agentInTestSpaceTags = getAgentTags(agentsInTestSpace); - expect(agentInDefaultSpaceTags[defaultSpaceAgent1]).to.eql(['tag1']); - expect(agentInDefaultSpaceTags[defaultSpaceAgent2]).to.eql(['tag1']); - expect(agentInTestSpaceTags[testSpaceAgent1]).to.eql(['tag1']); - expect(agentInTestSpaceTags[testSpaceAgent2]).to.eql(['tag1']); + await verifyAgentsTags({ + [defaultSpaceAgent1]: ['tag1'], + [defaultSpaceAgent2]: ['tag1'], + }); + await verifyAgentsTags( + { + [testSpaceAgent1]: ['tag1'], + [testSpaceAgent2]: ['tag1'], + [testSpaceAgent3]: ['tag1'], + }, + TEST_SPACE_1 + ); + await verifyNoAgentActions(); + await verifyNoAgentActions(TEST_SPACE_1); + // Add tag await apiClient.bulkUpdateAgentTags( { - agents: '', + agents: '*', tagsToAdd: ['space1'], }, TEST_SPACE_1 ); - agentsInDefaultSpace = await apiClient.getAgents(); - agentInDefaultSpaceTags = getAgentTags(agentsInDefaultSpace); - agentsInTestSpace = await apiClient.getAgents(TEST_SPACE_1); - agentInTestSpaceTags = getAgentTags(agentsInTestSpace); - expect(agentInDefaultSpaceTags[defaultSpaceAgent1]).to.eql(['tag1']); - expect(agentInDefaultSpaceTags[defaultSpaceAgent2]).to.eql(['tag1']); - expect(agentInTestSpaceTags[testSpaceAgent1]).to.eql(['tag1', 'space1']); - expect(agentInTestSpaceTags[testSpaceAgent2]).to.eql(['tag1', 'space1']); - // Reset tags + + await verifyAgentsTags({ + [defaultSpaceAgent1]: ['tag1'], + [defaultSpaceAgent2]: ['tag1'], + }); + await verifyAgentsTags( + { + [testSpaceAgent1]: ['tag1', 'space1'], + [testSpaceAgent2]: ['tag1', 'space1'], + [testSpaceAgent3]: ['tag1', 'space1'], + }, + TEST_SPACE_1 + ); + await verifyNoAgentActions(); + let actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(1); + + // Remove tag await apiClient.bulkUpdateAgentTags( { agents: '', @@ -243,10 +332,27 @@ export default function (providerContext: FtrProviderContext) { }, TEST_SPACE_1 ); - agentsInTestSpace = await apiClient.getAgents(TEST_SPACE_1); - agentInTestSpaceTags = getAgentTags(agentsInTestSpace); - expect(agentInTestSpaceTags[testSpaceAgent1]).to.eql(['tag1']); - expect(agentInTestSpaceTags[testSpaceAgent2]).to.eql(['tag1']); + + await verifyAgentsTags({ + [defaultSpaceAgent1]: ['tag1'], + [defaultSpaceAgent2]: ['tag1'], + }); + await verifyAgentsTags( + { + [testSpaceAgent1]: ['tag1'], + [testSpaceAgent2]: ['tag1'], + [testSpaceAgent3]: ['tag1'], + }, + TEST_SPACE_1 + ); + await verifyNoAgentActions(); + actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(2); + actionStatus.items.forEach((item) => { + expect(item.nbAgentsActioned).to.eql(3); + expect(item.nbAgentsActionCreated).to.eql(3); + expect(item.type).to.eql('UPDATE_TAGS'); + }); }); }); @@ -258,7 +364,18 @@ export default function (providerContext: FtrProviderContext) { it('should allow upgrading an agent in the same space', async () => { await makeAgentsUpgradeable(esClient, [testSpaceAgent1], '8.14.0'); + + await verifyNoAgentActions(); + await verifyNoAgentActions(TEST_SPACE_1); + await apiClient.upgradeAgent(testSpaceAgent1, { version: '8.15.0' }, TEST_SPACE_1); + + await verifyNoAgentActions(); + const actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(1); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(1); + expect(actionStatus.items[0].type).to.eql('UPGRADE'); }); it('should forbid upgrading an agent from a different space', async () => { @@ -276,6 +393,17 @@ export default function (providerContext: FtrProviderContext) { beforeEach(async () => { await cleanFleetAgents(esClient); await createAgents(); + await makeAgentsUpgradeable( + esClient, + [ + defaultSpaceAgent1, + defaultSpaceAgent2, + testSpaceAgent1, + testSpaceAgent2, + testSpaceAgent3, + ], + '8.14.0' + ); }); function getAgentStatus(agents: GetAgentsResponse) { @@ -285,27 +413,27 @@ export default function (providerContext: FtrProviderContext) { }, {} as any); } - it('should only upgrade agents in the same space when passing a list of agent ids', async () => { - await makeAgentsUpgradeable( - esClient, - [defaultSpaceAgent1, defaultSpaceAgent2, testSpaceAgent1, testSpaceAgent2], - '8.14.0' - ); + async function verifyAgentsStatus(expected: any, spaceId?: string) { + const agents = await apiClient.getAgents(spaceId); + const agentStatus = getAgentStatus(agents); + expect(agentStatus).to.eql(expected); + } - let agents = await apiClient.getAgents(); - let agentStatus = getAgentStatus(agents); - expect(agentStatus).to.eql({ + it('should only upgrade agents in the same space when passing a list of agent ids', async () => { + await verifyAgentsStatus({ [defaultSpaceAgent1]: 'online', [defaultSpaceAgent2]: 'online', }); - - agents = await apiClient.getAgents(TEST_SPACE_1); - agentStatus = getAgentStatus(agents); - expect(agentStatus).to.eql({ - [testSpaceAgent1]: 'online', - [testSpaceAgent2]: 'online', - [testSpaceAgent3]: 'online', - }); + await verifyAgentsStatus( + { + [testSpaceAgent1]: 'online', + [testSpaceAgent2]: 'online', + [testSpaceAgent3]: 'online', + }, + TEST_SPACE_1 + ); + await verifyNoAgentActions(); + await verifyNoAgentActions(TEST_SPACE_1); await apiClient.bulkUpgradeAgents( { @@ -316,43 +444,41 @@ export default function (providerContext: FtrProviderContext) { TEST_SPACE_1 ); - agents = await apiClient.getAgents(); - agentStatus = getAgentStatus(agents); - expect(agentStatus).to.eql({ + await verifyAgentsStatus({ [defaultSpaceAgent1]: 'online', [defaultSpaceAgent2]: 'online', }); - - agents = await apiClient.getAgents(TEST_SPACE_1); - agentStatus = getAgentStatus(agents); - expect(agentStatus).to.eql({ - [testSpaceAgent1]: 'updating', - [testSpaceAgent2]: 'online', - [testSpaceAgent3]: 'online', - }); + await verifyAgentsStatus( + { + [testSpaceAgent1]: 'updating', + [testSpaceAgent2]: 'online', + [testSpaceAgent3]: 'online', + }, + TEST_SPACE_1 + ); + await verifyNoAgentActions(); + const actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(1); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(1); + expect(actionStatus.items[0].type).to.eql('UPGRADE'); }); it('should only upgrade agents in the same space when passing a kuery', async () => { - await makeAgentsUpgradeable( - esClient, - [defaultSpaceAgent1, defaultSpaceAgent2, testSpaceAgent1, testSpaceAgent2], - '8.14.0' - ); - - let agents = await apiClient.getAgents(); - let agentStatus = getAgentStatus(agents); - expect(agentStatus).to.eql({ + await verifyAgentsStatus({ [defaultSpaceAgent1]: 'online', [defaultSpaceAgent2]: 'online', }); - - agents = await apiClient.getAgents(TEST_SPACE_1); - agentStatus = getAgentStatus(agents); - expect(agentStatus).to.eql({ - [testSpaceAgent1]: 'online', - [testSpaceAgent2]: 'online', - [testSpaceAgent3]: 'online', - }); + await verifyAgentsStatus( + { + [testSpaceAgent1]: 'online', + [testSpaceAgent2]: 'online', + [testSpaceAgent3]: 'online', + }, + TEST_SPACE_1 + ); + await verifyNoAgentActions(); + await verifyNoAgentActions(TEST_SPACE_1); await apiClient.bulkUpgradeAgents( { @@ -363,40 +489,58 @@ export default function (providerContext: FtrProviderContext) { TEST_SPACE_1 ); - agents = await apiClient.getAgents(); - agentStatus = getAgentStatus(agents); - expect(agentStatus).to.eql({ + await verifyAgentsStatus({ [defaultSpaceAgent1]: 'online', [defaultSpaceAgent2]: 'online', }); - - agents = await apiClient.getAgents(TEST_SPACE_1); - agentStatus = getAgentStatus(agents); - expect(agentStatus).to.eql({ - [testSpaceAgent1]: 'updating', - [testSpaceAgent2]: 'updating', - [testSpaceAgent3]: 'updating', - }); + await verifyAgentsStatus( + { + [testSpaceAgent1]: 'updating', + [testSpaceAgent2]: 'updating', + [testSpaceAgent3]: 'updating', + }, + TEST_SPACE_1 + ); + await verifyNoAgentActions(); + const actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(3); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(3); + expect(actionStatus.items[0].type).to.eql('UPGRADE'); }); }); describe('POST /agents/{agentId}/reassign', () => { - beforeEach(async () => { - await cleanFleetAgents(esClient); - await createAgents(); - }); it('should allow reassigning an agent in the current space to a policy in the current space', async () => { + // Default space let agent = await apiClient.getAgent(defaultSpaceAgent1); expect(agent.item.policy_id).to.eql(defaultSpacePolicy1.item.id); + await verifyNoAgentActions(); + await apiClient.reassignAgent(defaultSpaceAgent1, defaultSpacePolicy2.item.id); + agent = await apiClient.getAgent(defaultSpaceAgent1); expect(agent.item.policy_id).to.eql(defaultSpacePolicy2.item.id); + let actionStatus = await apiClient.getActionStatus(); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(1); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(1); + expect(actionStatus.items[0].type).to.eql('POLICY_REASSIGN'); + // Test space agent = await apiClient.getAgent(testSpaceAgent1, TEST_SPACE_1); expect(agent.item.policy_id).to.eql(spaceTest1Policy1.item.id); + await verifyNoAgentActions(TEST_SPACE_1); + await apiClient.reassignAgent(testSpaceAgent1, spaceTest1Policy2.item.id, TEST_SPACE_1); + agent = await apiClient.getAgent(testSpaceAgent1, TEST_SPACE_1); expect(agent.item.policy_id).to.eql(spaceTest1Policy2.item.id); + actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(1); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(1); + expect(actionStatus.items[0].type).to.eql('POLICY_REASSIGN'); await apiClient.reassignAgent(defaultSpaceAgent1, defaultSpacePolicy1.item.id); await apiClient.reassignAgent(testSpaceAgent1, spaceTest1Policy1.item.id, TEST_SPACE_1); @@ -428,10 +572,6 @@ export default function (providerContext: FtrProviderContext) { }); describe('POST /agents/bulk_reassign', () => { - beforeEach(async () => { - await cleanFleetAgents(esClient); - await createAgents(); - }); function getAgentPolicyIds(agents: GetAgentsResponse) { return agents.items?.reduce((acc, item) => { acc[item.id] = item.policy_id; @@ -460,6 +600,9 @@ export default function (providerContext: FtrProviderContext) { agent = await apiClient.getAgent(testSpaceAgent1, TEST_SPACE_1); expect(agent.item.policy_id).to.eql(spaceTest1Policy1.item.id); + await verifyNoAgentActions(); + await verifyNoAgentActions(TEST_SPACE_1); + await apiClient.bulkReassignAgents( { agents: [defaultSpaceAgent1, testSpaceAgent1], @@ -473,23 +616,38 @@ export default function (providerContext: FtrProviderContext) { agent = await apiClient.getAgent(testSpaceAgent1, TEST_SPACE_1); expect(agent.item.policy_id).to.eql(spaceTest1Policy2.item.id); + await verifyNoAgentActions(); + const actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(1); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(1); + expect(actionStatus.items[0].type).to.eql('POLICY_REASSIGN'); + await apiClient.reassignAgent(testSpaceAgent1, spaceTest1Policy1.item.id, TEST_SPACE_1); }); it('should only reassign agents in the same space when passing a kuery', async () => { - let agents = await apiClient.getAgents(); - let agentPolicyIds = getAgentPolicyIds(agents); - expect(agentPolicyIds).to.eql({ + async function verifyAgentsPolicies(expected: any, spaceId?: string) { + const agents = await apiClient.getAgents(spaceId); + const agentPolicyIds = getAgentPolicyIds(agents); + expect(agentPolicyIds).to.eql(expected); + } + + await verifyAgentsPolicies({ [defaultSpaceAgent1]: defaultSpacePolicy1.item.id, [defaultSpaceAgent2]: defaultSpacePolicy2.item.id, }); - agents = await apiClient.getAgents(TEST_SPACE_1); - agentPolicyIds = getAgentPolicyIds(agents); - expect(agentPolicyIds).to.eql({ - [testSpaceAgent1]: spaceTest1Policy1.item.id, - [testSpaceAgent2]: spaceTest1Policy2.item.id, - [testSpaceAgent3]: spaceTest1Policy1.item.id, - }); + await verifyAgentsPolicies( + { + [testSpaceAgent1]: spaceTest1Policy1.item.id, + [testSpaceAgent2]: spaceTest1Policy2.item.id, + [testSpaceAgent3]: spaceTest1Policy1.item.id, + }, + TEST_SPACE_1 + ); + + await verifyNoAgentActions(); + await verifyNoAgentActions(TEST_SPACE_1); await apiClient.bulkReassignAgents( { @@ -499,82 +657,219 @@ export default function (providerContext: FtrProviderContext) { TEST_SPACE_1 ); - agents = await apiClient.getAgents(); - agentPolicyIds = getAgentPolicyIds(agents); - expect(agentPolicyIds).to.eql({ + await verifyAgentsPolicies({ [defaultSpaceAgent1]: defaultSpacePolicy1.item.id, [defaultSpaceAgent2]: defaultSpacePolicy2.item.id, }); - agents = await apiClient.getAgents(TEST_SPACE_1); - agentPolicyIds = getAgentPolicyIds(agents); - expect(agentPolicyIds).to.eql({ - [testSpaceAgent1]: spaceTest1Policy2.item.id, - [testSpaceAgent2]: spaceTest1Policy2.item.id, - [testSpaceAgent3]: spaceTest1Policy2.item.id, - }); + await verifyAgentsPolicies( + { + [testSpaceAgent1]: spaceTest1Policy2.item.id, + [testSpaceAgent2]: spaceTest1Policy2.item.id, + [testSpaceAgent3]: spaceTest1Policy2.item.id, + }, + TEST_SPACE_1 + ); + + await verifyNoAgentActions(); + const actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(3); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(2); + expect(actionStatus.items[0].type).to.eql('POLICY_REASSIGN'); await apiClient.reassignAgent(testSpaceAgent1, spaceTest1Policy1.item.id, TEST_SPACE_1); - await apiClient.reassignAgent(testSpaceAgent2, spaceTest1Policy1.item.id, TEST_SPACE_1); + await apiClient.reassignAgent(testSpaceAgent3, spaceTest1Policy1.item.id, TEST_SPACE_1); }); + }); - it('should reassign agents in the same space by kuery in batches', async () => { - let agents = await apiClient.getAgents(); - let agentPolicyIds = getAgentPolicyIds(agents); - expect(agentPolicyIds).to.eql({ - [defaultSpaceAgent1]: defaultSpacePolicy1.item.id, - [defaultSpaceAgent2]: defaultSpacePolicy2.item.id, - }); - agents = await apiClient.getAgents(TEST_SPACE_1); - agentPolicyIds = getAgentPolicyIds(agents); - expect(agentPolicyIds).to.eql({ - [testSpaceAgent1]: spaceTest1Policy1.item.id, - [testSpaceAgent2]: spaceTest1Policy2.item.id, - [testSpaceAgent3]: spaceTest1Policy1.item.id, - }); + describe('POST /agents/{agentId}/request_diagnostics', () => { + it('should allow requesting diagnostics for an agent in the current space', async () => { + // Default space + await verifyNoAgentActions(); + await apiClient.requestAgentDiagnostics(defaultSpaceAgent1); + let actionStatus = await apiClient.getActionStatus(); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(1); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(1); + expect(actionStatus.items[0].type).to.eql('REQUEST_DIAGNOSTICS'); + + // Test space + await verifyNoAgentActions(TEST_SPACE_1); + await apiClient.requestAgentDiagnostics(testSpaceAgent1, TEST_SPACE_1); + actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(1); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(1); + expect(actionStatus.items[0].type).to.eql('REQUEST_DIAGNOSTICS'); + }); - const res = await apiClient.bulkReassignAgents( + it('should forbid requesting diagnostics for an agent a different space', async () => { + let err: Error | undefined; + try { + await apiClient.requestAgentDiagnostics(testSpaceAgent1); + } catch (_err) { + err = _err; + } + + expect(err).to.be.an(Error); + expect(err?.message).to.match(/404 "Not Found"/); + }); + }); + + describe('POST /agents/bulk_request_diagnostics', () => { + it('should only request diagnostics for agents in the current space when passing a list of agent ids', async () => { + await verifyNoAgentActions(); + await verifyNoAgentActions(TEST_SPACE_1); + + await apiClient.bulkRequestDiagnostics( { - agents: `not fleet-agents.policy_id:"${spaceTest1Policy2.item.id}"`, - policy_id: spaceTest1Policy2.item.id, - batchSize: 1, + agents: [defaultSpaceAgent1, testSpaceAgent1], + }, + TEST_SPACE_1 + ); + + await verifyNoAgentActions(); + const actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(1); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(1); + expect(actionStatus.items[0].type).to.eql('REQUEST_DIAGNOSTICS'); + }); + + it('should only request diagnostics for agents in the current space when passing a kuery', async () => { + await verifyNoAgentActions(); + await verifyNoAgentActions(TEST_SPACE_1); + + await apiClient.bulkRequestDiagnostics( + { + agents: '*', }, TEST_SPACE_1 ); - const verifyActionResult = async () => { - const { body: result } = await supertest - .get(`/s/${TEST_SPACE_1}/api/fleet/agents`) - .set('kbn-xsrf', 'xxx'); - expect(result.total).to.eql(3); - result.items.forEach((agent: any) => { - expect(agent.policy_id).to.eql(spaceTest1Policy2.item.id); + await verifyNoAgentActions(); + const actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(3); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(3); + expect(actionStatus.items[0].type).to.eql('REQUEST_DIAGNOSTICS'); + }); + }); + + describe('POST /agents/{agentId}/unenroll', () => { + beforeEach(async () => { + await cleanFleetAgents(esClient); + await createAgents(); + }); + + it('should allow unenrolling an agent in the current space', async () => { + // Default space + let agent = await apiClient.getAgent(defaultSpaceAgent1); + expect(typeof agent.item.unenrollment_started_at).to.be('undefined'); + await verifyNoAgentActions(); + + await apiClient.unenrollAgent(defaultSpaceAgent1); + + agent = await apiClient.getAgent(defaultSpaceAgent1); + expect(typeof agent.item.unenrollment_started_at).to.eql('string'); + let actionStatus = await apiClient.getActionStatus(); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(1); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(1); + expect(actionStatus.items[0].type).to.eql('UNENROLL'); + + // Test space + agent = await apiClient.getAgent(testSpaceAgent1, TEST_SPACE_1); + expect(typeof agent.item.unenrollment_started_at).to.be('undefined'); + await verifyNoAgentActions(TEST_SPACE_1); + + await apiClient.unenrollAgent(testSpaceAgent1, TEST_SPACE_1); + + agent = await apiClient.getAgent(testSpaceAgent1, TEST_SPACE_1); + expect(typeof agent.item.unenrollment_started_at).to.eql('string'); + actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(1); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(1); + expect(actionStatus.items[0].type).to.eql('UNENROLL'); + }); + + it('should forbid unenrolling an agent in a different space', async () => { + let err: Error | undefined; + try { + await apiClient.unenrollAgent(testSpaceAgent1); + } catch (_err) { + err = _err; + } + + expect(err).to.be.an(Error); + expect(err?.message).to.match(/404 "Not Found"/); + }); + }); + + describe('POST /agents/bulk_unenroll', () => { + beforeEach(async () => { + await cleanFleetAgents(esClient); + await createAgents(); + }); + + it('should only unenroll agents in the current space when passing a list of agent ids', async () => { + let agent = await apiClient.getAgent(defaultSpaceAgent1); + expect(typeof agent.item.unenrollment_started_at).to.be('undefined'); + agent = await apiClient.getAgent(testSpaceAgent1, TEST_SPACE_1); + expect(typeof agent.item.unenrollment_started_at).to.be('undefined'); + + await verifyNoAgentActions(); + await verifyNoAgentActions(TEST_SPACE_1); + + await apiClient.bulkUnenrollAgents( + { + agents: [defaultSpaceAgent1, testSpaceAgent1], + }, + TEST_SPACE_1 + ); + + agent = await apiClient.getAgent(defaultSpaceAgent1); + expect(typeof agent.item.unenrollment_started_at).to.be('undefined'); + agent = await apiClient.getAgent(testSpaceAgent1, TEST_SPACE_1); + expect(typeof agent.item.unenrollment_started_at).to.be('string'); + + await verifyNoAgentActions(); + const actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(1); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(1); + expect(actionStatus.items[0].type).to.eql('UNENROLL'); + }); + + it('should only unenroll agents in the current space when passing a kuery', async () => { + async function verifyAgentsUnenrollment(type: string, spaceId?: string) { + const agents = await apiClient.getAgents(spaceId); + agents.items.forEach((agent) => { + expect(typeof agent.unenrollment_started_at).to.be(type); }); - }; - - await new Promise((resolve, reject) => { - let attempts = 0; - const intervalId = setInterval(async () => { - if (attempts > 20) { - clearInterval(intervalId); - reject(new Error('action timed out')); - } - ++attempts; - const { - body: { items: actionStatuses }, - } = await supertest - .get(`/s/${TEST_SPACE_1}/api/fleet/agents/action_status`) - .set('kbn-xsrf', 'xxx'); - - const action = actionStatuses.find((a: any) => a.actionId === res.actionId); - if (action && action.nbAgentsActioned === action.nbAgentsActionCreated) { - clearInterval(intervalId); - await verifyActionResult(); - resolve({}); - } - }, 1000); - }).catch((e) => { - throw e; - }); + } + + await verifyAgentsUnenrollment('undefined'); + await verifyAgentsUnenrollment('undefined', TEST_SPACE_1); + await verifyNoAgentActions(); + await verifyNoAgentActions(TEST_SPACE_1); + + await apiClient.bulkUnenrollAgents( + { + agents: '*', + }, + TEST_SPACE_1 + ); + + await verifyAgentsUnenrollment('undefined'); + await verifyAgentsUnenrollment('string', TEST_SPACE_1); + await verifyNoAgentActions(); + const actionStatus = await apiClient.getActionStatus(TEST_SPACE_1); + expect(actionStatus.items.length).to.eql(1); + expect(actionStatus.items[0].nbAgentsActioned).to.eql(3); + expect(actionStatus.items[0].nbAgentsActionCreated).to.eql(3); + expect(actionStatus.items[0].type).to.eql('UNENROLL'); }); }); }); diff --git a/x-pack/test/fleet_api_integration/apis/space_awareness/api_helper.ts b/x-pack/test/fleet_api_integration/apis/space_awareness/api_helper.ts index 0695dd8868d4a..e7863e7c46d2c 100644 --- a/x-pack/test/fleet_api_integration/apis/space_awareness/api_helper.ts +++ b/x-pack/test/fleet_api_integration/apis/space_awareness/api_helper.ts @@ -31,6 +31,8 @@ import { PostNewAgentActionResponse, UpdateAgentPolicyResponse, UpdateAgentPolicyRequest, + UpdatePackageResponse, + UpdatePackageRequest, } from '@kbn/fleet-plugin/common/types'; import { GetUninstallTokenResponse, @@ -57,7 +59,6 @@ export class SpaceTestApiClient { return res; } - // Agent policies async createAgentPolicy( spaceId?: string, @@ -90,7 +91,6 @@ export class SpaceTestApiClient { return res; } - async getPackagePolicy( packagePolicyId: string, spaceId?: string @@ -101,7 +101,6 @@ export class SpaceTestApiClient { return res; } - async getPackagePolicies(spaceId?: string): Promise { const { body: res } = await this.supertest .get(`${this.getBaseUrl(spaceId)}/api/fleet/package_policies`) @@ -109,7 +108,6 @@ export class SpaceTestApiClient { return res; } - async createFleetServerPolicy(spaceId?: string): Promise { const { body: res } = await this.supertest .post(`${this.getBaseUrl(spaceId)}/api/fleet/agent_policies`) @@ -261,13 +259,15 @@ export class SpaceTestApiClient { return res; } async reassignAgent(agentId: string, policyId: string, spaceId?: string) { - await this.supertest + const { body: res } = await this.supertest .post(`${this.getBaseUrl(spaceId)}/api/fleet/agents/${agentId}/reassign`) .set('kbn-xsrf', 'xxx') .send({ policy_id: policyId, }) .expect(200); + + return res; } async bulkReassignAgents(data: any, spaceId?: string) { const { body: res } = await this.supertest @@ -279,18 +279,56 @@ export class SpaceTestApiClient { return res; } async upgradeAgent(agentId: string, data: any, spaceId?: string) { - await this.supertest + const { body: res } = await this.supertest .post(`${this.getBaseUrl(spaceId)}/api/fleet/agents/${agentId}/upgrade`) .set('kbn-xsrf', 'xxxx') .send(data) .expect(200); + + return res; } async bulkUpgradeAgents(data: any, spaceId?: string) { - await this.supertest + const { body: res } = await this.supertest .post(`${this.getBaseUrl(spaceId)}/api/fleet/agents/bulk_upgrade`) .set('kbn-xsrf', 'xxxx') .send(data) .expect(200); + + return res; + } + async requestAgentDiagnostics(agentId: string, spaceId?: string) { + const { body: res } = await this.supertest + .post(`${this.getBaseUrl(spaceId)}/api/fleet/agents/${agentId}/request_diagnostics`) + .set('kbn-xsrf', 'xxxx') + .expect(200); + + return res; + } + async bulkRequestDiagnostics(data: any, spaceId?: string) { + const { body: res } = await this.supertest + .post(`${this.getBaseUrl(spaceId)}/api/fleet/agents/bulk_request_diagnostics`) + .set('kbn-xsrf', 'xxxx') + .send(data) + .expect(200); + + return res; + } + async unenrollAgent(agentId: string, spaceId?: string) { + const { body: res } = await this.supertest + .post(`${this.getBaseUrl(spaceId)}/api/fleet/agents/${agentId}/unenroll`) + .set('kbn-xsrf', 'xxxx') + .expect(200); + + return res; + } + async bulkUnenrollAgents(data: any, spaceId?: string) { + const { body: res } = await this.supertest + .post(`${this.getBaseUrl(spaceId)}/api/fleet/agents/bulk_unenroll`) + .set('kbn-xsrf', 'xxxx') + .send(data) + .expect(200); + + return res; } async bulkUpdateAgentTags(data: any, spaceId?: string) { const { body: res } = await this.supertest @@ -331,11 +369,31 @@ export class SpaceTestApiClient { } // Package install async getPackage( - { pkgName, pkgVersion }: { pkgName: string; pkgVersion: string }, + { pkgName, pkgVersion }: { pkgName: string; pkgVersion?: string }, spaceId?: string ): Promise { const { body: res } = await this.supertest - .get(`${this.getBaseUrl(spaceId)}/api/fleet/epm/packages/${pkgName}/${pkgVersion}`) + .get( + pkgVersion + ? `${this.getBaseUrl(spaceId)}/api/fleet/epm/packages/${pkgName}/${pkgVersion}` + : `${this.getBaseUrl(spaceId)}/api/fleet/epm/packages/${pkgName}` + ) + .expect(200); + + return res; + } + async updatePackage( + { + pkgName, + pkgVersion, + data, + }: { pkgName: string; pkgVersion: string; data: UpdatePackageRequest['body'] }, + spaceId?: string + ): Promise { + const { body: res } = await this.supertest + .put(`${this.getBaseUrl(spaceId)}/api/fleet/epm/packages/${pkgName}/${pkgVersion}`) + .set('kbn-xsrf', 'xxxx') + .send({ ...data }) .expect(200); return res; @@ -407,7 +465,6 @@ export class SpaceTestApiClient { return res; } - async cancelAction(actionId: string, spaceId?: string): Promise { const { body: res } = await this.supertest .post(`${this.getBaseUrl(spaceId)}/api/fleet/agents/actions/${actionId}/cancel`) diff --git a/x-pack/test/fleet_api_integration/apis/space_awareness/helpers.ts b/x-pack/test/fleet_api_integration/apis/space_awareness/helpers.ts index a82bf55c352a0..a757bdfdeae65 100644 --- a/x-pack/test/fleet_api_integration/apis/space_awareness/helpers.ts +++ b/x-pack/test/fleet_api_integration/apis/space_awareness/helpers.ts @@ -11,8 +11,8 @@ import expect from '@kbn/expect'; import { AGENT_ACTIONS_INDEX, AGENT_ACTIONS_RESULTS_INDEX, - AGENTS_INDEX, AGENT_POLICY_INDEX, + AGENTS_INDEX, } from '@kbn/fleet-plugin/common'; import { ENROLLMENT_API_KEYS_INDEX } from '@kbn/fleet-plugin/common/constants'; import { asyncForEach } from '@kbn/std'; @@ -60,14 +60,17 @@ export async function cleanFleetAgents(esClient: Client) { }); } +export async function cleanFleetAgentPolicies(esClient: Client) { + await esClient.deleteByQuery({ + index: AGENT_POLICY_INDEX, + q: '*', + refresh: true, + }); +} + export async function cleanFleetActionIndices(esClient: Client) { try { await Promise.all([ - esClient.deleteByQuery({ - index: AGENT_POLICY_INDEX, - q: '*', - refresh: true, - }), esClient.deleteByQuery({ index: AGENT_ACTIONS_INDEX, q: '*', diff --git a/x-pack/test/functional/apps/infra/hosts_view.ts b/x-pack/test/functional/apps/infra/hosts_view.ts index 06464b0f962f8..5f2dd01bb980e 100644 --- a/x-pack/test/functional/apps/infra/hosts_view.ts +++ b/x-pack/test/functional/apps/infra/hosts_view.ts @@ -298,7 +298,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { (await pageObjects.infraHostsView.isKPIChartsLoaded()) ); - describe('Hosts View', function () { + // Failing: See https://github.com/elastic/kibana/issues/191806 + describe.skip('Hosts View', function () { let synthEsInfraClient: InfraSynthtraceEsClient; let syntEsLogsClient: LogsSynthtraceEsClient; @@ -371,18 +372,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { ]); }); - it('should be accessible from the Inventory page', async () => { - await pageObjects.common.navigateToApp('infraOps'); - - await pageObjects.infraHome.clickDismissKubernetesTourButton(); - await pageObjects.infraHostsView.getBetaBadgeExists(); - await pageObjects.infraHostsView.clickTryHostViewBadge(); - - const pageUrl = await browser.getCurrentUrl(); - - expect(pageUrl).to.contain(HOSTS_VIEW_PATH); - }); - describe('#Single Host Flyout', () => { before(async () => { await setCustomDashboardsEnabled(true); @@ -573,10 +562,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { expect(documentTitle).to.contain('Hosts - Infrastructure - Observability - Elastic'); }); - it('should render the title beta badge', async () => { - await pageObjects.infraHostsView.getBetaBadgeExists(); - }); - describe('Hosts table', () => { let hostRows: WebElementWrapper[] = []; diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_result_views/single_metric_viewer.ts b/x-pack/test/functional/apps/ml/anomaly_detection_result_views/single_metric_viewer.ts index c9ceb71459e4a..7667b0896cfce 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_result_views/single_metric_viewer.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_result_views/single_metric_viewer.ts @@ -162,6 +162,13 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobTable.clickOpenJobInSingleMetricViewerButton(jobConfig.job_id); await ml.commonUI.waitForMlLoadingIndicatorToDisappear(); + + // assert that the results view is not displayed when no entity is selected + await ml.testExecution.logTestStep('does not display the chart'); + await ml.singleMetricViewer.assertChartNotExist(); + + await ml.testExecution.logTestStep('does not display the anomalies table'); + await ml.anomaliesTable.assertTableNotExists(); }); it('render entity control', async () => { diff --git a/x-pack/test/functional/apps/ml/data_frame_analytics/index.ts b/x-pack/test/functional/apps/ml/data_frame_analytics/index.ts index 8a2bc1449cd7e..53b21e013c06a 100644 --- a/x-pack/test/functional/apps/ml/data_frame_analytics/index.ts +++ b/x-pack/test/functional/apps/ml/data_frame_analytics/index.ts @@ -12,7 +12,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { const ml = getService('ml'); describe('machine learning - data frame analytics', function () { - this.tags(['ml', 'skipFirefox']); + this.tags(['ml']); before(async () => { await ml.securityCommon.createMlRoles(); diff --git a/x-pack/test/functional/apps/ml/permissions/index.ts b/x-pack/test/functional/apps/ml/permissions/index.ts index 8b28c9e6ccda4..224544a015d8a 100644 --- a/x-pack/test/functional/apps/ml/permissions/index.ts +++ b/x-pack/test/functional/apps/ml/permissions/index.ts @@ -12,7 +12,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { const ml = getService('ml'); describe('machine learning - permissions', function () { - this.tags(['ml', 'skipFirefox']); + this.tags(['ml']); before(async () => { await ml.securityCommon.createMlRoles(); diff --git a/x-pack/test/functional/apps/ml/short_tests/model_management/index.ts b/x-pack/test/functional/apps/ml/short_tests/model_management/index.ts index c20957beb1ea5..55cb854c69efd 100644 --- a/x-pack/test/functional/apps/ml/short_tests/model_management/index.ts +++ b/x-pack/test/functional/apps/ml/short_tests/model_management/index.ts @@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: FtrProviderContext) { describe('model management', function () { - this.tags(['ml', 'skipFirefox']); + this.tags(['ml']); loadTestFile(require.resolve('./model_list')); }); diff --git a/x-pack/test/functional/apps/ml/short_tests/notifications/index.ts b/x-pack/test/functional/apps/ml/short_tests/notifications/index.ts index e026d44a67af2..d7756a75a66de 100644 --- a/x-pack/test/functional/apps/ml/short_tests/notifications/index.ts +++ b/x-pack/test/functional/apps/ml/short_tests/notifications/index.ts @@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: FtrProviderContext) { describe('Notifcations', function () { - this.tags(['ml', 'skipFirefox']); + this.tags(['ml']); loadTestFile(require.resolve('./notification_list')); }); diff --git a/x-pack/test/functional/apps/ml/short_tests/settings/index.ts b/x-pack/test/functional/apps/ml/short_tests/settings/index.ts index d3f7000918a8e..2f46e75038ff9 100644 --- a/x-pack/test/functional/apps/ml/short_tests/settings/index.ts +++ b/x-pack/test/functional/apps/ml/short_tests/settings/index.ts @@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../../../ftr_provider_context'; export default function ({ loadTestFile }: FtrProviderContext) { describe('settings', function () { - this.tags(['ml', 'skipFirefox']); + this.tags(['ml']); loadTestFile(require.resolve('./calendar_creation')); loadTestFile(require.resolve('./calendar_edit')); diff --git a/x-pack/test/functional/apps/ml/stack_management_jobs/index.ts b/x-pack/test/functional/apps/ml/stack_management_jobs/index.ts index 37f238dbeecc9..53f4b7cbf943e 100644 --- a/x-pack/test/functional/apps/ml/stack_management_jobs/index.ts +++ b/x-pack/test/functional/apps/ml/stack_management_jobs/index.ts @@ -12,7 +12,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { const ml = getService('ml'); describe('machine learning - stack management jobs', function () { - this.tags(['ml', 'skipFirefox']); + this.tags(['ml']); before(async () => { await ml.securityCommon.createMlRoles(); await ml.securityCommon.createMlUsers(); diff --git a/x-pack/test/functional/apps/slo/embeddables/overview_embeddable.ts b/x-pack/test/functional/apps/slo/embeddables/overview_embeddable.ts index 5a531d6cf5bb5..3624513b7cbb7 100644 --- a/x-pack/test/functional/apps/slo/embeddables/overview_embeddable.ts +++ b/x-pack/test/functional/apps/slo/embeddables/overview_embeddable.ts @@ -23,6 +23,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('overview embeddable', function () { before(async () => { await loadTestData(getService); + await slo.createUser(); await slo.deleteAllSLOs(); await slo.create(sloData); await PageObjects.dashboard.navigateToApp(); diff --git a/x-pack/test/functional/page_objects/asset_details.ts b/x-pack/test/functional/page_objects/asset_details.ts index 95a7819fb11a6..7ce90d213d234 100644 --- a/x-pack/test/functional/page_objects/asset_details.ts +++ b/x-pack/test/functional/page_objects/asset_details.ts @@ -180,7 +180,9 @@ export function AssetDetailsProvider({ getService }: FtrProviderContext) { }, async clickAddMetadataFilter() { - return testSubjects.click('infraAssetDetailsMetadataAddFilterButton'); + // Make this selector tied to the field to avoid flakiness + // https://github.com/elastic/kibana/issues/191565 + return testSubjects.click('infraAssetDetailsMetadataField.host.name'); }, async clickRemoveMetadataFilter() { diff --git a/x-pack/test/functional/page_objects/infra_hosts_view.ts b/x-pack/test/functional/page_objects/infra_hosts_view.ts index 86c7f330e081c..2f23af9ddf500 100644 --- a/x-pack/test/functional/page_objects/infra_hosts_view.ts +++ b/x-pack/test/functional/page_objects/infra_hosts_view.ts @@ -29,19 +29,6 @@ export function InfraHostsViewProvider({ getService }: FtrProviderContext) { return testSubjects.click('hostsViewTableAddFilterButton'); }, - async getBetaBadgeExists() { - return testSubjects.exists('infra-beta-badge'); - }, - - // Inventory UI - async clickTryHostViewLink() { - return testSubjects.click('inventory-hostsView-link'); - }, - - async clickTryHostViewBadge() { - return testSubjects.click('inventory-hostsView-link-badge'); - }, - // Table async getHostsTable() { diff --git a/x-pack/test/functional/services/ml/anomalies_table.ts b/x-pack/test/functional/services/ml/anomalies_table.ts index 35a53d90f6b9c..4d023a7ccc5a5 100644 --- a/x-pack/test/functional/services/ml/anomalies_table.ts +++ b/x-pack/test/functional/services/ml/anomalies_table.ts @@ -18,6 +18,10 @@ export function MachineLearningAnomaliesTableProvider({ getService }: FtrProvide await testSubjects.existOrFail('mlAnomaliesTable'); }, + async assertTableNotExists() { + await testSubjects.missingOrFail('mlAnomaliesTable'); + }, + async getTableRows() { return await testSubjects.findAll('mlAnomaliesTable > ~mlAnomaliesListRow'); }, diff --git a/x-pack/test/functional/services/ml/single_metric_viewer.ts b/x-pack/test/functional/services/ml/single_metric_viewer.ts index 753d5384b80af..3dede4734a47e 100644 --- a/x-pack/test/functional/services/ml/single_metric_viewer.ts +++ b/x-pack/test/functional/services/ml/single_metric_viewer.ts @@ -74,6 +74,10 @@ export function MachineLearningSingleMetricViewerProvider( await testSubjects.existOrFail('mlSingleMetricViewerChart'); }, + async assertChartNotExist() { + await testSubjects.missingOrFail('mlSingleMetricViewerChart'); + }, + async assertAnomalyMarkerExist() { await testSubjects.existOrFail('mlAnomalyMarker'); }, @@ -181,7 +185,10 @@ export function MachineLearningSingleMetricViewerProvider( `mlSingleMetricViewerEntitySelectionConfigOrder_${entityFieldName}`, order ); - await this.assertEntityConfig(entityFieldName, anomalousOnly, sortBy, order); + + await retry.tryForTime(30 * 1000, async () => { + await this.assertEntityConfig(entityFieldName, anomalousOnly, sortBy, order); + }); }, async assertToastMessageExists(dataTestSubj: string) { diff --git a/x-pack/test/functional/services/transform/api.ts b/x-pack/test/functional/services/transform/api.ts index 15751c91253ec..89eb65df40ec0 100644 --- a/x-pack/test/functional/services/transform/api.ts +++ b/x-pack/test/functional/services/transform/api.ts @@ -7,12 +7,12 @@ import expect from '@kbn/expect'; -import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; import { TransformState, TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; import type { TransformStats } from '@kbn/transform-plugin/common/types/transform_stats'; -import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; -import type { PostTransformsUpdateRequestSchema } from '@kbn/transform-plugin/common/api_schemas/update_transforms'; +import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; +import type { PostTransformsUpdateRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/update_transforms'; import type { TransformPivotConfig } from '@kbn/transform-plugin/common/types/transform'; import type { IndicesCreateRequest } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { FtrProviderContext } from '../../ftr_provider_context'; diff --git a/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/ml/index.ts b/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/ml/index.ts index 7a898b63c3f22..ea21b37e86a66 100644 --- a/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/ml/index.ts +++ b/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/ml/index.ts @@ -12,7 +12,7 @@ export default ({ loadTestFile, getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); describe('ML app', function () { - this.tags(['ml', 'skipFirefox']); + this.tags(['ml']); before(async () => { await ml.securityCommon.createMlRoles(); diff --git a/x-pack/test/observability_ai_assistant_functional/tests/conversations/index.spec.ts b/x-pack/test/observability_ai_assistant_functional/tests/conversations/index.spec.ts index ff20297efdeca..68b1d97d531dc 100644 --- a/x-pack/test/observability_ai_assistant_functional/tests/conversations/index.spec.ts +++ b/x-pack/test/observability_ai_assistant_functional/tests/conversations/index.spec.ts @@ -77,7 +77,7 @@ export default function ApiTest({ getService, getPageObjects }: FtrProviderConte message: { role: MessageRole.System, content: - 'You are a helpful assistant for Elastic Observability. Your goal is to help the Elastic Observability users to quickly assess what is happening in their observed systems. You can help them visualise and analyze data, investigate their systems, perform root cause analysis or identify optimisation opportunities.\n\nIt\'s very important to not assume what the user is meaning. Ask them for clarification if needed.\n\nIf you are unsure about which function should be used and with what arguments, ask the user for clarification or confirmation.\n\nIn KQL ("kqlFilter")) escaping happens with double quotes, not single quotes. Some characters that need escaping are: \':()\\ /". Always put a field value in double quotes. Best: service.name:"opbeans-go". Wrong: service.name:opbeans-go. This is very important!\n\nYou can use Github-flavored Markdown in your responses. If a function returns an array, consider using a Markdown table to format the response.\n\nNote that ES|QL (the Elasticsearch Query Language which is a new piped language) is the preferred query language.\n\nYou MUST use the "query" function when the user wants to:\n- visualize data\n- run any arbitrary query\n- breakdown or filter ES|QL queries that are displayed on the current page\n- convert queries from another language to ES|QL\n- asks general questions about ES|QL\n\nDO NOT UNDER ANY CIRCUMSTANCES generate ES|QL queries or explain anything about the ES|QL query language yourself.\nDO NOT UNDER ANY CIRCUMSTANCES try to correct an ES|QL query yourself - always use the "query" function for this.\n\nDO NOT UNDER ANY CIRCUMSTANCES USE ES|QL syntax (`service.name == "foo"`) with "kqlFilter" (`service.name:"foo"`).\n\nEven if the "context" function was used before that, follow it up with the "query" function. If a query fails, do not attempt to correct it yourself. Again you should call the "query" function,\neven if it has been called before.\n\nWhen the "visualize_query" function has been called, a visualization has been displayed to the user. DO NOT UNDER ANY CIRCUMSTANCES follow up a "visualize_query" function call with your own visualization attempt.\nIf the "execute_query" function has been called, summarize these results for the user. The user does not see a visualization in this case.\n\nYou MUST use the get_dataset_info function function before calling the "query" or "changes" function.\n\nIf a function requires an index, you MUST use the results from the dataset info functions.\n\n\n\nThe user is able to change the language which they want you to reply in on the settings page of the AI Assistant for Observability, which can be found in the Stack Management app under the option AI Assistants.\nIf the user asks how to change the language, reply in the same language the user asked in.You do not have a working memory. If the user expects you to remember the previous conversations, tell them they can set up the knowledge base.\n\nYou MUST respond in the users preferred language which is: English.', + 'You are a helpful assistant for Elastic Observability. Your goal is to help the Elastic Observability users to quickly assess what is happening in their observed systems. You can help them visualise and analyze data, investigate their systems, perform root cause analysis or identify optimisation opportunities.\n\nIt\'s very important to not assume what the user is meaning. Ask them for clarification if needed.\n\nIf you are unsure about which function should be used and with what arguments, ask the user for clarification or confirmation.\n\nIn KQL ("kqlFilter")) escaping happens with double quotes, not single quotes. Some characters that need escaping are: \':()\\ /". Always put a field value in double quotes. Best: service.name:"opbeans-go". Wrong: service.name:opbeans-go. This is very important!\n\nYou can use Github-flavored Markdown in your responses. If a function returns an array, consider using a Markdown table to format the response.\n\nNote that ES|QL (the Elasticsearch Query Language which is a new piped language) is the preferred query language.\n\nYou MUST use the "query" function when the user wants to:\n- visualize data\n- run any arbitrary query\n- breakdown or filter ES|QL queries that are displayed on the current page\n- convert queries from another language to ES|QL\n- asks general questions about ES|QL\n\nDO NOT UNDER ANY CIRCUMSTANCES generate ES|QL queries or explain anything about the ES|QL query language yourself.\nDO NOT UNDER ANY CIRCUMSTANCES try to correct an ES|QL query yourself - always use the "query" function for this.\n\nDO NOT UNDER ANY CIRCUMSTANCES USE ES|QL syntax (`service.name == "foo"`) with "kqlFilter" (`service.name:"foo"`).\n\nEven if the "context" function was used before that, follow it up with the "query" function. If a query fails, do not attempt to correct it yourself. Again you should call the "query" function,\neven if it has been called before.\n\nWhen the "visualize_query" function has been called, a visualization has been displayed to the user. DO NOT UNDER ANY CIRCUMSTANCES follow up a "visualize_query" function call with your own visualization attempt.\nIf the "execute_query" function has been called, summarize these results for the user. The user does not see a visualization in this case.\n\nYou MUST use the get_dataset_info function function before calling the "query" or "changes" function.\n\nIf a function requires an index, you MUST use the results from the dataset info functions.\n\n\n\nThe user is able to change the language which they want you to reply in on the settings page of the AI Assistant for Observability, which can be found in the Stack Management app under the option AI Assistants.\nIf the user asks how to change the language, reply in the same language the user asked in.You do not have a working memory. If the user expects you to remember the previous conversations, tell them they can set up the knowledge base.', }, }, { @@ -398,10 +398,6 @@ export default function ApiTest({ getService, getPageObjects }: FtrProviderConte expect(messages.length).to.eql(9); expect(messages[0].message.role).to.eql('system'); - // Verify that system message extension that happen on the server are captured in the telemetry - expect(messages[0].message.content).to.contain( - 'You MUST respond in the users preferred language which is: English.' - ); }); }); }); diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts b/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts index 810db7295a79f..a488cd1a47171 100644 --- a/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts @@ -140,6 +140,7 @@ export default function ({ getService }: FtrProviderContext) { 'fleet:check-deleted-files-task', 'fleet:reassign_action:retry', 'fleet:request_diagnostics:retry', + 'fleet:setup:upgrade_managed_package_policies', 'fleet:unenroll-inactive-agents-task', 'fleet:unenroll_action:retry', 'fleet:update_agent_tags:retry', diff --git a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/cases_webhook_connector.ts b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/cases_webhook_connector.ts index eda3c67967285..2b64985d90a76 100644 --- a/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/cases_webhook_connector.ts +++ b/x-pack/test/screenshot_creation/apps/response_ops_docs/stack_connectors/cases_webhook_connector.ts @@ -82,6 +82,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 1920, 1400 ); + const saveTestButton = await testSubjects.find('create-connector-flyout-save-test-btn'); + await saveTestButton.click(); + await pageObjects.header.waitUntilLoadingHasFinished(); + await testSubjects.setValue('titleInput', 'Example case'); + await commonScreenshots.takeScreenshot('cases-webhook-test', screenshotDirectories); await testSubjects.click('euiFlyoutCloseButton'); }); }); diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/configs/ess.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/configs/ess.config.ts new file mode 100644 index 0000000000000..eee14323c9b98 --- /dev/null +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/configs/ess.config.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrConfigProviderContext } from '@kbn/test'; + +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const functionalConfig = await readConfigFile( + require.resolve('../../../../../../../config/ess/config.base.trial') + ); + + const testConfig = { + ...functionalConfig.getAll(), + testFiles: [require.resolve('..')], + junit: { + reportName: + 'Rules Management - Prebuilt Rule Customization Integration Tests - ESS Env - Trial License', + }, + }; + testConfig.kbnTestServer.serverArgs = testConfig.kbnTestServer.serverArgs.map((arg: string) => { + // Override the default value of `--xpack.securitySolution.enableExperimental` to enable the prebuilt rules customization feature + if (arg.includes('--xpack.securitySolution.enableExperimental')) { + return `--xpack.securitySolution.enableExperimental=${JSON.stringify([ + 'prebuiltRulesCustomizationEnabled', + ])}`; + } + return arg; + }); + + return testConfig; +} diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/configs/serverless.config.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/configs/serverless.config.ts new file mode 100644 index 0000000000000..79a23c85d2279 --- /dev/null +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/configs/serverless.config.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { createTestConfig } from '../../../../../../../config/serverless/config.base'; + +export default createTestConfig({ + testFiles: [require.resolve('..')], + junit: { + reportName: + 'Rules Management - Prebuilt Rule Customization Integration Tests - Serverless Env - Complete Tier', + }, + kbnTestServerArgs: [ + `--xpack.securitySolution.enableExperimental=${JSON.stringify([ + 'prebuiltRulesCustomizationEnabled', + ])}`, + ], +}); diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/index.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/index.ts new file mode 100644 index 0000000000000..76a461d438463 --- /dev/null +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/index.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrProviderContext } from '../../../../../../ftr_provider_context'; + +export default ({ loadTestFile }: FtrProviderContext): void => { + describe('Rules Management - Prebuilt Rules - Update Prebuilt Rules Package', function () { + loadTestFile(require.resolve('./is_customized_calculation')); + }); +}; diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/is_customized_calculation.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/is_customized_calculation.ts new file mode 100644 index 0000000000000..72f9062f66ca1 --- /dev/null +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/trial_license_complete_tier/is_customized_calculation.ts @@ -0,0 +1,200 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { + BulkActionEditTypeEnum, + BulkActionTypeEnum, +} from '@kbn/security-solution-plugin/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.gen'; +import expect from 'expect'; +import { deleteAllRules } from '../../../../../../../common/utils/security_solution'; +import { FtrProviderContext } from '../../../../../../ftr_provider_context'; +import { + createPrebuiltRuleAssetSavedObjects, + createRuleAssetSavedObject, + deleteAllPrebuiltRuleAssets, + installPrebuiltRules, +} from '../../../../utils'; + +export default ({ getService }: FtrProviderContext): void => { + const es = getService('es'); + const supertest = getService('supertest'); + const securitySolutionApi = getService('securitySolutionApi'); + const log = getService('log'); + + const ruleAsset = createRuleAssetSavedObject({ + rule_id: '000047bb-b27a-47ec-8b62-ef1a5d2c9e19', + tags: ['test-tag'], + }); + + describe('@ess @serverless @skipInServerlessMKI is_customized calculation', () => { + beforeEach(async () => { + await deleteAllRules(supertest, log); + await deleteAllPrebuiltRuleAssets(es, log); + }); + + describe('prebuilt rules', () => { + it('should set is_customized to true on bulk rule modification', async () => { + await createPrebuiltRuleAssetSavedObjects(es, [ruleAsset]); + await installPrebuiltRules(es, supertest); + + const { body: findResult } = await securitySolutionApi + .findRules({ + query: { + per_page: 1, + filter: `alert.attributes.params.immutable: true`, + }, + }) + .expect(200); + const prebuiltRule = findResult.data[0]; + expect(prebuiltRule).not.toBeNull(); + expect(prebuiltRule.rule_source.is_customized).toEqual(false); + + const { body: bulkResult } = await securitySolutionApi + .performRulesBulkAction({ + query: {}, + body: { + ids: [prebuiltRule.id], + action: BulkActionTypeEnum.edit, + [BulkActionTypeEnum.edit]: [ + { + type: BulkActionEditTypeEnum.add_tags, + value: ['new-tag'], + }, + ], + }, + }) + .expect(200); + + expect(bulkResult.attributes.summary).toEqual({ + failed: 0, + skipped: 0, + succeeded: 1, + total: 1, + }); + expect(bulkResult.attributes.results.updated[0].rule_source.is_customized).toEqual(true); + }); + + it('should leave is_customized intact if the change has been skipped', async () => { + await createPrebuiltRuleAssetSavedObjects(es, [ruleAsset]); + await installPrebuiltRules(es, supertest); + + const { body: findResult } = await securitySolutionApi + .findRules({ + query: { + per_page: 1, + filter: `alert.attributes.params.immutable: true`, + }, + }) + .expect(200); + const prebuiltRule = findResult.data[0]; + expect(prebuiltRule).not.toBeNull(); + expect(prebuiltRule.rule_source.is_customized).toEqual(false); + + const { body: bulkResult } = await securitySolutionApi + .performRulesBulkAction({ + query: {}, + body: { + ids: [prebuiltRule.id], + action: BulkActionTypeEnum.edit, + [BulkActionTypeEnum.edit]: [ + { + type: BulkActionEditTypeEnum.add_tags, + // This tag is already present on the rule, so the change will be skipped + value: [prebuiltRule.tags[0]], + }, + ], + }, + }) + .expect(200); + + expect(bulkResult.attributes.summary).toEqual({ + failed: 0, + skipped: 1, + succeeded: 0, + total: 1, + }); + + // Check that the rule has not been customized + const { body: findResultAfter } = await securitySolutionApi + .findRules({ + query: { + per_page: 1, + filter: `alert.attributes.params.immutable: true`, + }, + }) + .expect(200); + expect(findResultAfter.data[0].rule_source.is_customized).toEqual(false); + }); + + it('should set is_customized to false if the change has been reverted', async () => { + await createPrebuiltRuleAssetSavedObjects(es, [ruleAsset]); + await installPrebuiltRules(es, supertest); + + const { body: findResult } = await securitySolutionApi + .findRules({ + query: { + per_page: 1, + filter: `alert.attributes.params.immutable: true`, + }, + }) + .expect(200); + const prebuiltRule = findResult.data[0]; + expect(prebuiltRule).not.toBeNull(); + expect(prebuiltRule.rule_source.is_customized).toEqual(false); + + // Add a tag to the rule + const { body: bulkResult } = await securitySolutionApi + .performRulesBulkAction({ + query: {}, + body: { + ids: [prebuiltRule.id], + action: BulkActionTypeEnum.edit, + [BulkActionTypeEnum.edit]: [ + { + type: BulkActionEditTypeEnum.add_tags, + value: ['new-tag'], + }, + ], + }, + }) + .expect(200); + + expect(bulkResult.attributes.summary).toEqual({ + failed: 0, + skipped: 0, + succeeded: 1, + total: 1, + }); + + // Remove the added tag + const { body: revertResult } = await securitySolutionApi + .performRulesBulkAction({ + query: {}, + body: { + ids: [prebuiltRule.id], + action: BulkActionTypeEnum.edit, + [BulkActionTypeEnum.edit]: [ + { + type: BulkActionEditTypeEnum.delete_tags, + value: ['new-tag'], + }, + ], + }, + }) + .expect(200); + + expect(revertResult.attributes.summary).toEqual({ + failed: 0, + skipped: 0, + succeeded: 1, + total: 1, + }); + + expect(revertResult.attributes.results.updated[0].rule_source.is_customized).toEqual(false); + }); + }); + }); +}; diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action.ts index 43afebc55decd..c6c85751593a4 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_bulk_actions/trial_license_complete_tier/perform_bulk_action.ts @@ -34,12 +34,7 @@ import { removeServerGeneratedProperties, updateUsername, } from '../../../utils'; -import { - createRule, - createAlertsIndex, - deleteAllRules, - deleteAllAlerts, -} from '../../../../../../common/utils/security_solution'; +import { createRule, deleteAllRules } from '../../../../../../common/utils/security_solution'; import { deleteAllExceptions } from '../../../../lists_and_exception_lists/utils'; import { FtrProviderContext } from '../../../../../ftr_provider_context'; @@ -90,14 +85,12 @@ export default ({ getService }: FtrProviderContext): void => { describe('@ess @serverless @skipInServerless perform_bulk_action', () => { beforeEach(async () => { - await createAlertsIndex(supertest, log); + await deleteAllRules(supertest, log); await esArchiver.load('x-pack/test/functional/es_archives/auditbeat/hosts'); }); afterEach(async () => { - await deleteAllAlerts(supertest, log, es); - await deleteAllRules(supertest, log); - await esArchiver.load('x-pack/test/functional/es_archives/auditbeat/hosts'); + await esArchiver.unload('x-pack/test/functional/es_archives/auditbeat/hosts'); }); it('should export rules', async () => { diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/init_and_status_apis.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/init_and_status_apis.ts index 48c208e99fc96..c72f8ddbcd7e0 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/init_and_status_apis.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/init_and_status_apis.ts @@ -27,7 +27,8 @@ export default ({ getService }: FtrProviderContext) => { const riskEngineRoutes = riskEngineRouteHelpersFactory(supertest); const log = getService('log'); - describe('@ess @serverless @serverlessQA init_and_status_apis', () => { + // Failing: See https://github.com/elastic/kibana/issues/191637 + describe.skip('@ess @serverless @serverlessQA init_and_status_apis', () => { beforeEach(async () => { await cleanRiskEngine({ kibanaServer, es, log }); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/ai_assistant_feature_complete.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/ai_assistant_feature_complete.cy.ts deleted file mode 100644 index 8f241dfe9d560..0000000000000 --- a/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/ai_assistant_feature_complete.cy.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { AI_ASSISTANT_BUTTON } from '../../screens/ai_assistant'; -import { login } from '../../tasks/login'; -import { visitGetStartedPage } from '../../tasks/navigation'; - -describe( - 'App Features for Security Complete', - { - tags: ['@serverless'], - env: { - ftrConfig: { - productTypes: [ - { product_line: 'security', product_tier: 'complete' }, - { product_line: 'endpoint', product_tier: 'complete' }, - ], - }, - }, - }, - () => { - beforeEach(() => { - login(); - }); - - it('should have have AI Assistant available', () => { - visitGetStartedPage(); - cy.get(AI_ASSISTANT_BUTTON).should('exist'); - }); - } -); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/conversations.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/conversations.cy.ts new file mode 100644 index 0000000000000..286627367c46e --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/conversations.cy.ts @@ -0,0 +1,173 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + EXPLAIN_THEN_SUMMARIZE_RULE_DETAILS, + RULE_MANAGEMENT_CONTEXT_DESCRIPTION, +} from '@kbn/security-solution-plugin/public/detections/pages/detection_engine/rules/translations'; +import { EXPLAIN_THEN_SUMMARIZE_SUGGEST_INVESTIGATION_GUIDE_NON_I18N } from '@kbn/security-solution-plugin/public/assistant/content/prompts/user/translations'; +import { + assertConnectorSelected, + assertNewConversation, + closeAssistant, + openAssistant, + selectConnector, + createNewChat, + selectConversation, + assertMessageSent, + typeAndSendMessage, + assertErrorResponse, + selectRule, + assertErrorToastShown, + updateConversationTitle, + assertSystemPrompt, +} from '../../tasks/assistant'; +import { deleteConversations } from '../../tasks/api_calls/assistant'; +import { + azureConnectorAPIPayload, + bedrockConnectorAPIPayload, + createAzureConnector, + createBedrockConnector, +} from '../../tasks/api_calls/connectors'; +import { expandFirstAlert } from '../../tasks/alerts'; +import { ALERTS_URL } from '../../urls/navigation'; +import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; +import { visitRulesManagementTable } from '../../tasks/rules_management'; +import { deleteAlertsAndRules, deleteConnectors } from '../../tasks/api_calls/common'; +import { createRule } from '../../tasks/api_calls/rules'; +import { getExistingRule, getNewRule } from '../../objects/rule'; +import { login } from '../../tasks/login'; +import { + CONNECTOR_MISSING_CALLOUT, + PROMPT_CONTEXT_BUTTON, + USER_PROMPT, +} from '../../screens/ai_assistant'; +import { visit, visitGetStartedPage } from '../../tasks/navigation'; + +describe('AI Assistant Conversations', { tags: ['@ess', '@serverless'] }, () => { + beforeEach(() => { + deleteConnectors(); + deleteConversations(); + deleteAlertsAndRules(); + login(); + }); + describe('No connectors or conversations exist', () => { + it('Shows welcome setup when no connectors or conversations exist', () => { + visitGetStartedPage(); + openAssistant(); + assertNewConversation(true, 'Welcome'); + }); + }); + describe('When no conversations exist but connectors do exist, show empty convo', () => { + beforeEach(() => { + createAzureConnector(); + }); + it('When invoked on AI Assistant click', () => { + visitGetStartedPage(); + openAssistant(); + assertNewConversation(false, 'Welcome'); + assertConnectorSelected(azureConnectorAPIPayload.name); + assertSystemPrompt('Default system prompt'); + cy.get(USER_PROMPT).should('not.have.text'); + }); + it('When invoked from rules page', () => { + createRule(getExistingRule({ rule_id: 'rule1', enabled: true })).then((createdRule) => { + visitRulesManagementTable(); + selectRule(createdRule?.body?.id); + openAssistant('rule'); + assertNewConversation(false, 'Detection Rules'); + assertConnectorSelected(azureConnectorAPIPayload.name); + assertSystemPrompt('Default system prompt'); + cy.get(USER_PROMPT).should('have.text', EXPLAIN_THEN_SUMMARIZE_RULE_DETAILS); + cy.get(PROMPT_CONTEXT_BUTTON(0)).should('have.text', RULE_MANAGEMENT_CONTEXT_DESCRIPTION); + }); + }); + it('When invoked from alert details', () => { + createRule(getNewRule()); + visit(ALERTS_URL); + waitForAlertsToPopulate(); + expandFirstAlert(); + openAssistant('alert'); + assertNewConversation(false, 'Alert summary'); + assertConnectorSelected(azureConnectorAPIPayload.name); + assertSystemPrompt('Default system prompt'); + cy.get(USER_PROMPT).should( + 'have.text', + EXPLAIN_THEN_SUMMARIZE_SUGGEST_INVESTIGATION_GUIDE_NON_I18N + ); + cy.get(PROMPT_CONTEXT_BUTTON(0)).should('have.text', 'Alert (from summary)'); + }); + it('Shows empty connector callout when a conversation that had a connector no longer does', () => { + visitGetStartedPage(); + openAssistant(); + assertConnectorSelected(azureConnectorAPIPayload.name); + closeAssistant(); + deleteConnectors(); + openAssistant(); + cy.get(CONNECTOR_MISSING_CALLOUT).should('be.visible'); + }); + }); + describe('Changing conversations', () => { + beforeEach(() => { + createAzureConnector(); + createBedrockConnector(); + }); + + it('Last conversation persists in memory from page to page', () => { + createRule(getNewRule()); + visit(ALERTS_URL); + waitForAlertsToPopulate(); + expandFirstAlert(); + openAssistant('alert'); + assertNewConversation(false, 'Alert summary'); + closeAssistant(); + visitGetStartedPage(); + openAssistant(); + assertNewConversation(false, 'Alert summary'); + }); + it('Properly switches back and forth between conversations', () => { + visitGetStartedPage(); + openAssistant(); + assertNewConversation(false, 'Welcome'); + assertConnectorSelected(azureConnectorAPIPayload.name); + typeAndSendMessage('hello'); + assertMessageSent('hello', true); + assertErrorResponse(); + selectConversation('Alert summary'); + selectConnector(bedrockConnectorAPIPayload.name); + typeAndSendMessage('goodbye'); + assertMessageSent('goodbye', true); + assertErrorResponse(); + selectConversation('Welcome'); + assertConnectorSelected(azureConnectorAPIPayload.name); + assertMessageSent('hello', true); + selectConversation('Alert summary'); + assertConnectorSelected(bedrockConnectorAPIPayload.name); + assertMessageSent('goodbye', true); + }); + // This test is flakey due to the issue linked below and will be skipped until it is fixed + it.skip('Only allows one conversation called "New chat" at a time', () => { + visitGetStartedPage(); + openAssistant(); + createNewChat(); + assertNewConversation(false, 'New chat'); + assertConnectorSelected(azureConnectorAPIPayload.name); + typeAndSendMessage('hello'); + // TODO fix bug with new chat and error message + // https://github.com/elastic/kibana/issues/191025 + // assertMessageSent('hello', true); + assertErrorResponse(); + selectConversation('Welcome'); + createNewChat(); + assertErrorToastShown('Error creating conversation with title New chat'); + selectConversation('New chat'); + updateConversationTitle('My other chat'); + createNewChat(); + assertNewConversation(false, 'New chat'); + }); + }); +}); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/ess_basic.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/ess_basic.cy.ts new file mode 100644 index 0000000000000..fea68e5f6b515 --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/ess_basic.cy.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { startBasicLicense } from '../../tasks/api_calls/licensing'; +import { UPGRADE_CTA } from '../../screens/ai_assistant'; +import { login } from '../../tasks/login'; +import { assertConversationReadOnly, openAssistant } from '../../tasks/assistant'; +import { visitGetStartedPage } from '../../tasks/navigation'; + +describe('AI Assistant - Basic License', { tags: ['@ess'] }, () => { + beforeEach(() => { + login(); + startBasicLicense(); + visitGetStartedPage(); + }); + + it('user with Basic license should not be able to use assistant', () => { + openAssistant(); + cy.get(UPGRADE_CTA).should('be.visible'); + assertConversationReadOnly(); + }); +}); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/feature_complete.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/feature_complete.cy.ts new file mode 100644 index 0000000000000..f086690e07146 --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/feature_complete.cy.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { AI_ASSISTANT_BUTTON } from '../../screens/ai_assistant'; +import { login } from '../../tasks/login'; +import { visitGetStartedPage } from '../../tasks/navigation'; + +describe('App Features for Security Complete', { tags: ['@serverless'] }, () => { + beforeEach(() => { + login(); + }); + + it('should have have AI Assistant available', () => { + visitGetStartedPage(); + cy.get(AI_ASSISTANT_BUTTON).should('be.visible'); + }); +}); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/ai_assistant_feature_essentials.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/feature_essentials.cy.ts similarity index 100% rename from x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/ai_assistant_feature_essentials.cy.ts rename to x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/feature_essentials.cy.ts diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/messages.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/messages.cy.ts new file mode 100644 index 0000000000000..233efb264ede7 --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/messages.cy.ts @@ -0,0 +1,72 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { MessageRole } from '@kbn/elastic-assistant-common'; +import { TIMELINE_QUERY } from '../../screens/timeline'; +import { CASES_URL } from '../../urls/navigation'; +import { SEND_TO_TIMELINE_BUTTON } from '../../screens/ai_assistant'; +import { openAssistant, selectConversation, sendQueryToTimeline } from '../../tasks/assistant'; +import { + deleteConversations, + deletePrompts, + waitForConversation, +} from '../../tasks/api_calls/assistant'; +import { createAzureConnector } from '../../tasks/api_calls/connectors'; +import { deleteConnectors } from '../../tasks/api_calls/common'; +import { login } from '../../tasks/login'; +import { visit, visitGetStartedPage } from '../../tasks/navigation'; + +describe( + 'AI Assistant Messages', + // TODO - Fix this test to work in serverless - https://github.com/elastic/kibana/pull/190152 + { tags: ['@ess', '@serverless', '@skipInServerless'] }, + () => { + const mockTimelineQuery = 'host.risk.keyword: "high"'; + const mockConvo = { + id: 'spooky', + title: 'Spooky convo', + messages: [ + { + timestamp: '2024-08-15T18:30:37.873Z', + content: + 'You are a helpful, expert assistant who answers questions about Elastic Security. Do not answer questions unrelated to Elastic Security.\nIf you answer a question related to KQL, EQL, or ES|QL, it should be immediately usable within an Elastic Security timeline; please always format the output correctly with back ticks. Any answer provided for Query DSL should also be usable in a security timeline. This means you should only ever include the "filter" portion of the query.\n\nGive a query I can run in the timeline', + role: 'user' as MessageRole, + }, + { + timestamp: '2024-08-15T18:31:24.008Z', + content: + 'To query events from a high-risk host in the Elastic Security timeline, you can use the following KQL query:\n\n```kql\n' + + mockTimelineQuery + + '\n```', + role: 'assistant' as MessageRole, + traceData: { + traceId: '74d2fac29753adebd5c479e3d9e45da3', + transactionId: 'e13d97d138b8a13c', + }, + }, + ], + }; + beforeEach(() => { + deleteConnectors(); + deleteConversations(); + deletePrompts(); + login(); + createAzureConnector(); + waitForConversation(mockConvo); + }); + it('A message with a kql query can be used in the timeline only from pages with timeline', () => { + visitGetStartedPage(); + openAssistant(); + selectConversation(mockConvo.title); + cy.get(SEND_TO_TIMELINE_BUTTON).should('be.disabled'); + visit(CASES_URL); + openAssistant(); + sendQueryToTimeline(); + cy.get(TIMELINE_QUERY).should('have.text', `${mockTimelineQuery}`); + }); + } +); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/prompts.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/prompts.cy.ts new file mode 100644 index 0000000000000..f31866d4ec9bf --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/prompts.cy.ts @@ -0,0 +1,132 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { SUPERHERO_SYSTEM_PROMPT_NON_I18N } from '@kbn/security-solution-plugin/public/assistant/content/prompts/system/translations'; +import { EXPLAIN_THEN_SUMMARIZE_SUGGEST_INVESTIGATION_GUIDE_NON_I18N } from '@kbn/security-solution-plugin/public/assistant/content/prompts/user/translations'; +import { QUICK_PROMPT_BADGE, USER_PROMPT } from '../../screens/ai_assistant'; +import { createRule } from '../../tasks/api_calls/rules'; +import { + assertErrorResponse, + assertMessageSent, + assertSystemPrompt, + clearSystemPrompt, + createQuickPrompt, + createSystemPrompt, + openAssistant, + resetConversation, + selectConversation, + selectSystemPrompt, + sendQuickPrompt, + typeAndSendMessage, +} from '../../tasks/assistant'; +import { deleteConversations, deletePrompts } from '../../tasks/api_calls/assistant'; +import { createAzureConnector } from '../../tasks/api_calls/connectors'; +import { deleteConnectors } from '../../tasks/api_calls/common'; +import { login } from '../../tasks/login'; +import { visit, visitGetStartedPage } from '../../tasks/navigation'; +import { getNewRule } from '../../objects/rule'; +import { ALERTS_URL } from '../../urls/navigation'; +import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; +import { expandFirstAlert } from '../../tasks/alerts'; + +const testPrompt = { + title: 'Cool prompt', + prompt: 'This is a super cool prompt.', +}; +describe('AI Assistant Prompts', { tags: ['@ess', '@serverless'] }, () => { + beforeEach(() => { + deleteConnectors(); + deleteConversations(); + deletePrompts(); + login(); + createAzureConnector(); + }); + + describe('System Prompts', () => { + it('Deselecting default system prompt prevents prompt from being sent. When conversation is then cleared, the prompt is reset.', () => { + visitGetStartedPage(); + openAssistant(); + clearSystemPrompt(); + typeAndSendMessage('hello'); + assertMessageSent('hello'); + // ensure response before clearing convo + assertErrorResponse(); + resetConversation(); + typeAndSendMessage('hello'); + assertMessageSent('hello', true); + }); + + it('Last selected system prompt persists in conversation', () => { + visitGetStartedPage(); + openAssistant(); + selectSystemPrompt('Enhanced system prompt'); + typeAndSendMessage('hello'); + assertMessageSent('hello', true, SUPERHERO_SYSTEM_PROMPT_NON_I18N); + resetConversation(); + assertSystemPrompt('Enhanced system prompt'); + selectConversation('Alert summary'); + assertSystemPrompt('Default system prompt'); + selectConversation('Welcome'); + assertSystemPrompt('Enhanced system prompt'); + }); + + it('Add prompt from system prompt selector without setting a default conversation', () => { + visitGetStartedPage(); + openAssistant(); + createSystemPrompt(testPrompt.title, testPrompt.prompt); + // we did not set a default conversation, so the prompt should not be set + assertSystemPrompt('Default system prompt'); + selectSystemPrompt(testPrompt.title); + typeAndSendMessage('hello'); + assertMessageSent('hello', true, testPrompt.prompt); + }); + + it('Add prompt from system prompt selector and set multiple conversations (including current) as default conversation', () => { + visitGetStartedPage(); + openAssistant(); + createSystemPrompt(testPrompt.title, testPrompt.prompt, ['Welcome', 'Alert summary']); + assertSystemPrompt(testPrompt.title); + typeAndSendMessage('hello'); + assertMessageSent('hello', true, testPrompt.prompt); + // ensure response before changing convo + assertErrorResponse(); + selectConversation('Alert summary'); + assertSystemPrompt(testPrompt.title); + typeAndSendMessage('hello'); + assertMessageSent('hello', true, testPrompt.prompt); + }); + }); + describe('User Prompts', () => { + it('Add a quick prompt and send it in the conversation', () => { + visitGetStartedPage(); + openAssistant(); + createQuickPrompt(testPrompt.title, testPrompt.prompt); + sendQuickPrompt(testPrompt.title); + assertMessageSent(testPrompt.prompt, true); + }); + it('Add a quick prompt with context and it is only available in the selected context', () => { + visitGetStartedPage(); + openAssistant(); + createQuickPrompt(testPrompt.title, testPrompt.prompt, ['Alert (from view)']); + cy.get(QUICK_PROMPT_BADGE(testPrompt.title)).should('not.exist'); + createRule(getNewRule()); + visit(ALERTS_URL); + waitForAlertsToPopulate(); + expandFirstAlert(); + openAssistant('alert'); + cy.get(QUICK_PROMPT_BADGE(testPrompt.title)).should('be.visible'); + cy.get(USER_PROMPT).should( + 'have.text', + EXPLAIN_THEN_SUMMARIZE_SUGGEST_INVESTIGATION_GUIDE_NON_I18N + ); + cy.get(QUICK_PROMPT_BADGE(testPrompt.title)).click(); + cy.get(USER_PROMPT).should('have.text', testPrompt.prompt); + }); + // TODO delete quick prompt + // I struggled to do this since the element is hidden with css and I cannot get it to show + }); +}); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/common_flows.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/common_flows.cy.ts index 0c4885ad35352..438743dd01a70 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/common_flows.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/common_flows.cy.ts @@ -8,7 +8,6 @@ import { ruleFields } from '../../../../data/detection_engine'; import { ABOUT_CONTINUE_BTN, - ABOUT_EDIT_BUTTON, CUSTOM_QUERY_INPUT, DEFINE_CONTINUE_BUTTON, DEFINE_EDIT_BUTTON, @@ -100,7 +99,6 @@ describe('Common rule creation flows', { tags: ['@ess', '@serverless'] }, () => cy.get(DEFINE_CONTINUE_BUTTON).should('exist').click(); // expect about step to populate - cy.get(ABOUT_EDIT_BUTTON).click(); cy.get(RULE_NAME_INPUT).invoke('val').should('eql', ruleFields.ruleName); cy.get(ABOUT_CONTINUE_BTN).should('exist').click(); cy.get(SCHEDULE_CONTINUE_BUTTON).click(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/eql_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/eql_rule.cy.ts index 2b0b9f3fdab61..a14218fcdda56 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/eql_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/eql_rule.cy.ts @@ -46,10 +46,13 @@ import { getDetails } from '../../../../tasks/rule_details'; import { expectNumberOfRules, goToRuleDetailsOf } from '../../../../tasks/alerts_detection_rules'; import { deleteAlertsAndRules } from '../../../../tasks/api_calls/common'; import { + continueFromDefineStep, createAndEnableRule, + createRuleWithNonBlockingErrors, fillAboutRuleAndContinue, fillDefineEqlRuleAndContinue, fillScheduleRuleAndContinue, + getDefineContinueButton, getIndexPatternClearButton, getRuleIndexInput, selectEqlRuleType, @@ -225,6 +228,8 @@ describe('EQL rules', { tags: ['@ess', '@serverless'] }, () => { }); describe('EQL query validation', () => { + const rule = getEqlRule(); + it('validates missing data source', () => { login(); visit(CREATE_RULE_URL); @@ -236,14 +241,20 @@ describe('EQL rules', { tags: ['@ess', '@serverless'] }, () => { cy.get(RULES_CREATION_FORM).find(EQL_QUERY_INPUT).should('be.visible'); cy.get(RULES_CREATION_FORM).find(EQL_QUERY_INPUT).type('any where true'); + const expectedValidationError = `index_not_found_exception\n\tCaused by:\n\t\tverification_exception: Found 1 problem\nline -1:-1: Unknown index [*,-*]\n\tRoot causes:\n\t\tverification_exception: Found 1 problem\nline -1:-1: Unknown index [*,-*]`; cy.get(EQL_QUERY_VALIDATION_ERROR).should('be.visible'); cy.get(EQL_QUERY_VALIDATION_ERROR).should('have.text', '1'); cy.get(EQL_QUERY_VALIDATION_ERROR).click(); cy.get(EQL_QUERY_VALIDATION_ERROR_CONTENT).should('be.visible'); cy.get(EQL_QUERY_VALIDATION_ERROR_CONTENT).should( 'have.text', - `EQL Validation Errorsindex_not_found_exception\n\tCaused by:\n\t\tverification_exception: Found 1 problem\nline -1:-1: Unknown index [*,-*]\n\tRoot causes:\n\t\tverification_exception: Found 1 problem\nline -1:-1: Unknown index [*,-*]` + `EQL Validation Errors${expectedValidationError}` ); + continueFromDefineStep(); + + fillAboutRuleAndContinue(rule); + fillScheduleRuleAndContinue(rule); + createRuleWithNonBlockingErrors(); }); it('validates missing data fields', () => { @@ -263,6 +274,11 @@ describe('EQL rules', { tags: ['@ess', '@serverless'] }, () => { 'have.text', 'EQL Validation ErrorsFound 1 problem\nline 1:11: Unknown column [field1]' ); + continueFromDefineStep(); + + fillAboutRuleAndContinue(rule); + fillScheduleRuleAndContinue(rule); + createRuleWithNonBlockingErrors(); }); it('validates syntax errors', () => { @@ -282,6 +298,8 @@ describe('EQL rules', { tags: ['@ess', '@serverless'] }, () => { 'have.text', `EQL Validation Errorsline 1:6: extraneous input 'any' expecting 'where'` ); + continueFromDefineStep(); + getDefineContinueButton().should('exist'); }); }); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/esql_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/esql_rule.cy.ts index 348133b1d2802..3727c2ccbd501 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/esql_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/esql_rule.cy.ts @@ -49,6 +49,7 @@ import { fillAboutRuleMinimumAndContinue, skipScheduleRuleAction, interceptEsqlQueryFieldsRequest, + createRuleWithNonBlockingErrors, } from '../../../../tasks/create_new_rule'; import { login } from '../../../../tasks/login'; import { visit } from '../../../../tasks/navigation'; @@ -191,6 +192,21 @@ describe( `Error validating ES|QL: "SyntaxError: extraneous input 'test' expecting "` ); }); + + it('shows confirmation modal about existing non-blocking validation errors', function () { + const nonExistingDataSourceQuery = 'from fake* metadata _id, _version, _index | limit 5'; + selectEsqlRuleType(); + fillEsqlQueryBar(nonExistingDataSourceQuery); + getDefineContinueButton().click(); + + fillRuleName(); + fillDescription(); + getAboutContinueButton().click(); + + fillScheduleRuleAndContinue(rule); + + createRuleWithNonBlockingErrors(); + }); }); describe('ES|QL investigation fields', () => { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_edit/eql_query_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_edit/eql_query_rule.cy.ts new file mode 100644 index 0000000000000..994dbb2eb8ce8 --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_edit/eql_query_rule.cy.ts @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getEqlRule } from '../../../../objects/rule'; + +import { createRule } from '../../../../tasks/api_calls/rules'; +import { deleteAlertsAndRules } from '../../../../tasks/api_calls/common'; +import { + saveEditedRuleWithNonBlockingErrors, + visitEditRulePage, +} from '../../../../tasks/edit_rule'; +import { login } from '../../../../tasks/login'; + +describe('EQL query rules', { tags: ['@ess', '@serverless'] }, () => { + context('Editing rule with non-blocking query validation errors', () => { + beforeEach(() => { + login(); + deleteAlertsAndRules(); + }); + + it('should allow user to save a rule and show confirmation modal when data source does not exist', () => { + const rule = { + ...getEqlRule(), + index: ['fake*'], + }; + createRule(rule).then((createdRule) => { + visitEditRulePage(createdRule.body.id); + saveEditedRuleWithNonBlockingErrors(); + }); + }); + + it('should allow user to save a rule and show confirmation modal when data field does not exist', () => { + const rule = { + ...getEqlRule(), + query: 'any where hello.world', + }; + createRule(rule).then((createdRule) => { + visitEditRulePage(createdRule.body.id); + saveEditedRuleWithNonBlockingErrors(); + }); + }); + }); +}); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_edit/esql_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_edit/esql_rule.cy.ts index 43655b1358b29..a180e1a0b50c2 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_edit/esql_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_edit/esql_rule.cy.ts @@ -43,7 +43,11 @@ import { login } from '../../../../tasks/login'; import { editFirstRule } from '../../../../tasks/alerts_detection_rules'; -import { saveEditedRule } from '../../../../tasks/edit_rule'; +import { + saveEditedRule, + saveEditedRuleWithNonBlockingErrors, + visitEditRulePage, +} from '../../../../tasks/edit_rule'; import { visit } from '../../../../tasks/navigation'; const rule = getEsqlRule(); @@ -192,5 +196,29 @@ describe( }); }); }); + + describe('Editing rule with non-blocking query validation errors', () => { + it('should allow user to save a rule and show confirmation modal when data source does not exist', () => { + const esqlRule = { + ...rule, + query: 'from fake-* metadata _id, _version, _index | keep agent.*,_id | eval test_id=_id', + }; + createRule(esqlRule).then((createdRule) => { + visitEditRulePage(createdRule.body.id); + saveEditedRuleWithNonBlockingErrors(); + }); + }); + + it('should allow user to save a rule and show confirmation modal when data field does not exist', () => { + const esqlRule = { + ...rule, + query: 'from auditbeat-* metadata _id, _version, _index | keep hello.world', + }; + createRule(esqlRule).then((createdRule) => { + visitEditRulePage(createdRule.body.id); + saveEditedRuleWithNonBlockingErrors(); + }); + }); + }); } ); diff --git a/x-pack/test/security_solution_cypress/cypress/objects/assistant.ts b/x-pack/test/security_solution_cypress/cypress/objects/assistant.ts new file mode 100644 index 0000000000000..7401a0ced2a49 --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/objects/assistant.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + ConversationCategory, + ConversationCreateProps, + ConversationResponse, + Provider, +} from '@kbn/elastic-assistant-common'; + +export const getMockConversation = (body?: Partial) => ({ + title: 'Test Conversation', + apiConfig: { + actionTypeId: '.gen-ai', + connectorId: '', + defaultSystemPromptId: 'default-system-prompt', + model: 'test-model', + provider: 'OpenAI' as Provider, + }, + excludeFromLastConversationStorage: false, + isDefault: false, + messages: [], + replacements: {}, + category: 'assistant' as ConversationCategory, + ...body, +}); + +export const getMockConversationResponse = ( + body?: Partial +): ConversationResponse => ({ + id: 'test-conversation-id', + createdAt: '2023-10-31T00:00:00.000Z', + users: [{ id: 'elastic', name: 'elastic@elastic.co' }], + namespace: 'default', + ...getMockConversation(body), +}); diff --git a/x-pack/test/security_solution_cypress/cypress/screens/ai_assistant.ts b/x-pack/test/security_solution_cypress/cypress/screens/ai_assistant.ts index 2abd9208dd070..341b65bf722e0 100644 --- a/x-pack/test/security_solution_cypress/cypress/screens/ai_assistant.ts +++ b/x-pack/test/security_solution_cypress/cypress/screens/ai_assistant.ts @@ -5,4 +5,49 @@ * 2.0. */ +export const ADD_NEW_CONNECTOR = '[data-test-subj="addNewConnectorButton"]'; +export const ADD_QUICK_PROMPT = '[data-test-subj="addQuickPrompt"]'; +export const ASSISTANT_SETTINGS_BUTTON = 'button[data-test-subj="settings"]'; export const AI_ASSISTANT_BUTTON = '[data-test-subj="assistantHeaderLink"]'; +export const ASSISTANT_CHAT_BODY = '[data-test-subj="assistantChat"]'; +export const CHAT_CONTEXT_MENU = '[data-test-subj="chat-context-menu"]'; +export const CHAT_ICON = '[data-test-subj="newChat"]'; +export const CHAT_ICON_SM = '[data-test-subj="newChatByTitle"]'; +export const CLEAR_CHAT = '[data-test-subj="clear-chat"]'; +export const CLEAR_SYSTEM_PROMPT = '[data-test-subj="clearSystemPrompt"]'; +export const CONFIRM_CLEAR_CHAT = '[data-test-subj="confirmModalConfirmButton"]'; +export const CONNECTOR_MISSING_CALLOUT = '[data-test-subj="connectorMissingCallout"]'; +export const CONNECTOR_SELECT = (c: string) => `[data-test-subj="connector-${c}"]`; +export const CONNECTOR_SELECTOR = '[data-test-subj="connector-selector"]'; +export const CONVERSATION_MESSAGE = '[data-test-subj="messageText"]'; +export const CONVERSATION_MESSAGE_ERROR = + '[data-test-subj="errorComment"] [data-test-subj="messageText"]'; +export const CONVERSATION_MULTI_SELECTOR = + '[data-test-subj="conversationMultiSelector"] [data-test-subj="comboBoxSearchInput"]'; +export const CONVERSATION_SELECT = (c: string) => `[data-test-subj="conversation-select-${c}"]`; +export const CONVERSATION_TITLE = '[data-test-subj="conversationTitle"]'; +export const CONVERSATION_TITLE_SAVE_BUTTON = '[data-test-subj="euiInlineEditModeSaveButton"]'; +export const CREATE_SYSTEM_PROMPT = '[data-test-subj="addSystemPrompt"]'; +export const EMPTY_CONVO = '[data-test-subj="emptyConvo"]'; +export const FLYOUT_NAV_TOGGLE = '[data-test-subj="aiAssistantFlyoutNavigationToggle"]'; +export const MODAL_SAVE_BUTTON = '[data-test-subj="save-button"]'; +export const NEW_CHAT = '[data-test-subj="newChatFromOverlay"]'; +export const PROMPT_CONTEXT_SELECTOR = + '[data-test-subj="promptContextSelector"] [data-test-subj="comboBoxSearchInput"]'; +export const PROMPT_CONTEXT_BUTTON = (i: string | number) => + `[data-test-subj="selectedPromptContext-${i}-button"]`; +export const QUICK_PROMPT_TITLE_INPUT = + '[data-test-subj="quickPromptSelector"] [data-test-subj="comboBoxSearchInput"]'; +export const QUICK_PROMPT_BADGE = (b: string) => `[data-test-subj="quickPrompt-${b}"]`; +export const QUICK_PROMPT_BODY_INPUT = '[data-test-subj="quick-prompt-prompt"]'; +export const SEND_TO_TIMELINE_BUTTON = '[data-test-subj="sendToTimelineEmptyButton"]'; +export const SHOW_ANONYMIZED_BUTTON = '[data-test-subj="showAnonymizedValues"]'; +export const SUBMIT_CHAT = '[data-test-subj="submit-chat"]'; +export const SYSTEM_PROMPT = '[data-test-subj="systemPromptText"]'; +export const SYSTEM_PROMPT_BODY_INPUT = '[data-test-subj="systemPromptModalPromptText"]'; +export const SYSTEM_PROMPT_TITLE_INPUT = + '[data-test-subj="systemPromptSelector"] [data-test-subj="comboBoxSearchInput"]'; +export const SYSTEM_PROMPT_SELECT = (c: string) => `[data-test-subj="systemPrompt-${c}"]`; +export const UPGRADE_CTA = '[data-test-subj="upgradeLicenseCallToAction"]'; +export const USER_PROMPT = '[data-test-subj="prompt-textarea"]'; +export const WELCOME_SETUP = '[data-test-subj="welcome-setup"]'; diff --git a/x-pack/test/security_solution_cypress/cypress/screens/create_new_rule.ts b/x-pack/test/security_solution_cypress/cypress/screens/create_new_rule.ts index 4e6df1ed3a750..72d1104985d77 100644 --- a/x-pack/test/security_solution_cypress/cypress/screens/create_new_rule.ts +++ b/x-pack/test/security_solution_cypress/cypress/screens/create_new_rule.ts @@ -56,6 +56,10 @@ export const CREATE_AND_ENABLE_BTN = '[data-test-subj="create-enable"]'; export const CREATE_WITHOUT_ENABLING_BTN = '[data-test-subj="create-enabled-false"]'; +export const SAVE_WITH_ERRORS_MODAL = '[data-test-subj="save-with-errors-confirmation-modal"]'; + +export const SAVE_WITH_ERRORS_MODAL_CONFIRM_BTN = '[data-test-subj="confirmModalConfirmButton"]'; + export const CUSTOM_QUERY_INPUT = '[data-test-subj="queryInput"]'; export const CUSTOM_QUERY_BAR = '[data-test-subj="detectionEngineStepDefineRuleQueryBar"]'; diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/assistant.ts b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/assistant.ts new file mode 100644 index 0000000000000..a8898f1652e1e --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/assistant.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 { ConversationCreateProps, ConversationResponse } from '@kbn/elastic-assistant-common'; +import { deleteAllDocuments } from './elasticsearch'; +import { getMockConversation } from '../../objects/assistant'; +import { getSpaceUrl } from '../space'; +import { rootRequest, waitForRootRequest } from './common'; + +const createConversation = ( + body?: Partial +): Cypress.Chainable> => + cy.currentSpace().then((spaceId) => + rootRequest({ + method: 'POST', + url: spaceId + ? getSpaceUrl(spaceId, `api/security_ai_assistant/current_user/conversations`) + : `api/security_ai_assistant/current_user/conversations`, + body: getMockConversation(body), + }) + ); + +export const waitForConversation = (body?: Partial) => + waitForRootRequest(createConversation(body)); + +export const deleteConversations = () => { + cy.log('Delete all conversations'); + deleteAllDocuments(`.kibana-elastic-ai-assistant-conversations-*`); +}; + +export const deletePrompts = () => { + cy.log('Delete all prompts'); + deleteAllDocuments(`.kibana-elastic-ai-assistant-prompts-*`); +}; diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts index e25b15b9b4439..7c78858070a20 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/common.ts @@ -40,6 +40,19 @@ export const rootRequest = ({ ...restOptions, }); +// a helper function to wait for the root request to be successful +// defaults to 5 second intervals for 3 attempts +// can be helpful when waiting for a resource to be created before proceeding +export const waitForRootRequest = ( + fn: Cypress.Chainable>, + interval = 5000, + timeout = 15000 +) => + cy.waitUntil(() => fn.then((response) => cy.wrap(response.status === 200)), { + interval, + timeout, + }); + export const deleteAlertsAndRules = () => { cy.log('Delete all alerts and rules'); diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/connectors.ts b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/connectors.ts index 38936d78cc360..58b679d6ebe01 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/connectors.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/api_calls/connectors.ts @@ -21,4 +21,31 @@ const slackConnectorAPIPayload = { name: 'Slack cypress test e2e connector', }; +export const azureConnectorAPIPayload = { + actionTypeId: '.gen-ai', + secrets: { + apiKey: '123', + }, + config: { + apiUrl: + 'https://goodurl.com/openai/deployments/good-gpt4o/chat/completions?api-version=2024-02-15-preview', + apiProvider: 'Azure OpenAI', + }, + name: 'Azure OpenAI cypress test e2e connector', +}; + +export const bedrockConnectorAPIPayload = { + actionTypeId: '.bedrock', + secrets: { + accessKey: '123', + secret: '123', + }, + config: { + apiUrl: 'https://bedrock.com', + }, + name: 'Bedrock cypress test e2e connector', +}; + export const createSlackConnector = () => createConnector(slackConnectorAPIPayload); +export const createAzureConnector = () => createConnector(azureConnectorAPIPayload); +export const createBedrockConnector = () => createConnector(bedrockConnectorAPIPayload); diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/assistant.ts b/x-pack/test/security_solution_cypress/cypress/tasks/assistant.ts new file mode 100644 index 0000000000000..c3f4f0cc970e0 --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/tasks/assistant.ts @@ -0,0 +1,218 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { DEFAULT_SYSTEM_PROMPT_NON_I18N } from '@kbn/security-solution-plugin/public/assistant/content/prompts/system/translations'; +import { TIMELINE_CHECKBOX } from '../screens/timelines'; +import { CLOSE_FLYOUT } from '../screens/alerts'; +import { + AI_ASSISTANT_BUTTON, + ASSISTANT_CHAT_BODY, + CHAT_ICON, + CHAT_ICON_SM, + CONNECTOR_SELECT, + CONNECTOR_SELECTOR, + CONVERSATION_TITLE, + EMPTY_CONVO, + WELCOME_SETUP, + NEW_CHAT, + CONVERSATION_SELECT, + FLYOUT_NAV_TOGGLE, + CONVERSATION_MESSAGE, + USER_PROMPT, + SUBMIT_CHAT, + CONVERSATION_MESSAGE_ERROR, + CLEAR_SYSTEM_PROMPT, + CHAT_CONTEXT_MENU, + CLEAR_CHAT, + CONFIRM_CLEAR_CHAT, + SYSTEM_PROMPT_SELECT, + SYSTEM_PROMPT, + CREATE_SYSTEM_PROMPT, + SYSTEM_PROMPT_TITLE_INPUT, + SYSTEM_PROMPT_BODY_INPUT, + CONVERSATION_MULTI_SELECTOR, + MODAL_SAVE_BUTTON, + ADD_QUICK_PROMPT, + QUICK_PROMPT_TITLE_INPUT, + QUICK_PROMPT_BODY_INPUT, + PROMPT_CONTEXT_SELECTOR, + QUICK_PROMPT_BADGE, + ADD_NEW_CONNECTOR, + SHOW_ANONYMIZED_BUTTON, + ASSISTANT_SETTINGS_BUTTON, + SEND_TO_TIMELINE_BUTTON, +} from '../screens/ai_assistant'; +import { TOASTER } from '../screens/alerts_detection_rules'; + +export const openAssistant = (context?: 'rule' | 'alert') => { + if (!context) { + cy.get(AI_ASSISTANT_BUTTON).click(); + return; + } + if (context === 'rule') { + cy.get(CHAT_ICON).should('be.visible'); + cy.get(CHAT_ICON).click(); + return; + } + if (context === 'alert') { + cy.get(CHAT_ICON_SM).should('be.visible'); + cy.get(CHAT_ICON_SM).click(); + return; + } +}; + +export const closeAssistant = () => { + cy.get(`${ASSISTANT_CHAT_BODY} ${CLOSE_FLYOUT}`).click(); +}; + +export const createNewChat = () => { + cy.get(`${NEW_CHAT}`).click(); +}; + +export const selectConnector = (connectorName: string) => { + cy.get(CONNECTOR_SELECTOR).click(); + cy.get(CONNECTOR_SELECT(connectorName)).click(); + assertConnectorSelected(connectorName); +}; +export const resetConversation = () => { + cy.get(CHAT_CONTEXT_MENU).click(); + cy.get(CLEAR_CHAT).click(); + cy.get(CONFIRM_CLEAR_CHAT).click(); + cy.get(EMPTY_CONVO).should('be.visible'); +}; +export const selectConversation = (conversationName: string) => { + cy.get(FLYOUT_NAV_TOGGLE).click(); + cy.get(CONVERSATION_SELECT(conversationName)).click(); + cy.get(CONVERSATION_TITLE + ' h2').should('have.text', conversationName); + cy.get(FLYOUT_NAV_TOGGLE).click(); +}; + +export const updateConversationTitle = (newTitle: string) => { + cy.get(CONVERSATION_TITLE + ' h2').click(); + cy.get(CONVERSATION_TITLE + ' input').clear(); + cy.get(CONVERSATION_TITLE + ' input').type(newTitle); + cy.get(CONVERSATION_TITLE + ' input').type('{enter}'); + cy.get(CONVERSATION_TITLE + ' h2').should('have.text', newTitle); +}; + +export const typeAndSendMessage = (message: string) => { + cy.get(USER_PROMPT).type(message); + cy.get(SUBMIT_CHAT).click(); +}; + +export const sendQueryToTimeline = () => { + cy.get(SEND_TO_TIMELINE_BUTTON).click(); +}; + +export const clearSystemPrompt = () => { + cy.get(CLEAR_SYSTEM_PROMPT).click(); +}; + +export const sendQuickPrompt = (prompt: string) => { + cy.get(QUICK_PROMPT_BADGE(prompt)).click(); + cy.get(SUBMIT_CHAT).click(); +}; + +export const selectSystemPrompt = (systemPrompt: string) => { + cy.get(SYSTEM_PROMPT).click(); + cy.get(SYSTEM_PROMPT_SELECT(systemPrompt)).click(); + assertSystemPrompt(systemPrompt); +}; + +export const createSystemPrompt = ( + title: string, + prompt: string, + defaultConversations?: string[] +) => { + cy.get(SYSTEM_PROMPT).click(); + cy.get(CREATE_SYSTEM_PROMPT).click(); + cy.get(SYSTEM_PROMPT_TITLE_INPUT).type(`${title}{enter}`); + cy.get(SYSTEM_PROMPT_BODY_INPUT).type(prompt); + if (defaultConversations && defaultConversations.length) { + defaultConversations.forEach((conversation) => { + cy.get(CONVERSATION_MULTI_SELECTOR).type(`${conversation}{enter}`); + }); + } + cy.get(MODAL_SAVE_BUTTON).click(); +}; + +export const createQuickPrompt = ( + title: string, + prompt: string, + defaultConversations?: string[] +) => { + cy.get(ADD_QUICK_PROMPT).click(); + cy.get(QUICK_PROMPT_TITLE_INPUT).type(`${title}{enter}`); + cy.get(QUICK_PROMPT_BODY_INPUT).type(prompt); + if (defaultConversations && defaultConversations.length) { + defaultConversations.forEach((conversation) => { + cy.get(PROMPT_CONTEXT_SELECTOR).type(`${conversation}{enter}`); + }); + } + cy.get(MODAL_SAVE_BUTTON).click(); +}; + +export const selectRule = (ruleId: string) => { + // not be.visible because of eui css + cy.get(TIMELINE_CHECKBOX(ruleId)).should('exist'); + cy.get(TIMELINE_CHECKBOX(ruleId)).click(); +}; + +/** + * Assertions + */ +export const assertNewConversation = (isWelcome: boolean, title: string) => { + if (isWelcome) { + cy.get(WELCOME_SETUP).should('be.visible'); + } else { + cy.get(EMPTY_CONVO).should('be.visible'); + } + cy.get(CONVERSATION_TITLE + ' h2').should('have.text', title); +}; + +export const assertMessageSent = (message: string, hasDefaultPrompt = false, prompt?: string) => { + cy.get(CONVERSATION_MESSAGE) + .first() + .should( + 'contain', + hasDefaultPrompt ? `${prompt ?? DEFAULT_SYSTEM_PROMPT_NON_I18N}\n${message}` : message + ); +}; + +export const assertErrorResponse = () => { + cy.get(CONVERSATION_MESSAGE_ERROR).should('be.visible'); +}; + +export const assertSystemPrompt = (systemPrompt: string) => { + cy.get(SYSTEM_PROMPT).should('have.text', systemPrompt); +}; + +export const assertConnectorSelected = (connectorName: string) => { + cy.get(CONNECTOR_SELECTOR).should('have.text', connectorName); +}; + +export const assertErrorToastShown = (message?: string) => { + cy.get(TOASTER).should('be.visible'); + if (message?.length) { + cy.get(TOASTER).should('contain', message); + } +}; + +const assertConversationTitleReadOnly = () => { + cy.get(CONVERSATION_TITLE + ' h2').click(); + cy.get(CONVERSATION_TITLE + ' input').should('not.exist'); +}; + +export const assertConversationReadOnly = () => { + assertConversationTitleReadOnly(); + cy.get(ADD_NEW_CONNECTOR).should('be.disabled'); + cy.get(SHOW_ANONYMIZED_BUTTON).should('be.disabled'); + cy.get(CHAT_CONTEXT_MENU).should('be.disabled'); + cy.get(FLYOUT_NAV_TOGGLE).should('be.disabled'); + cy.get(NEW_CHAT).should('be.disabled'); + cy.get(ASSISTANT_SETTINGS_BUTTON).should('be.disabled'); +}; diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/create_new_rule.ts b/x-pack/test/security_solution_cypress/cypress/tasks/create_new_rule.ts index 4251ef8ee0ec8..045c40da4b2cb 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/create_new_rule.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/create_new_rule.ts @@ -128,6 +128,8 @@ import { MAX_SIGNALS_INPUT, SETUP_GUIDE_TEXTAREA, RELATED_INTEGRATION_COMBO_BOX_INPUT, + SAVE_WITH_ERRORS_MODAL, + SAVE_WITH_ERRORS_MODAL_CONFIRM_BTN, } from '../screens/create_new_rule'; import { INDEX_SELECTOR, @@ -162,6 +164,14 @@ export const createRuleWithoutEnabling = () => { cy.get(CREATE_WITHOUT_ENABLING_BTN).should('not.exist'); }; +export const createRuleWithNonBlockingErrors = () => { + cy.get(CREATE_AND_ENABLE_BTN).click(); + cy.get(SAVE_WITH_ERRORS_MODAL).should('exist'); + cy.get(SAVE_WITH_ERRORS_MODAL_CONFIRM_BTN).first().click(); + cy.get(SAVE_WITH_ERRORS_MODAL).should('not.exist'); + cy.get(CREATE_AND_ENABLE_BTN).should('not.exist'); +}; + export const fillAboutRule = (rule: RuleCreateProps) => { cy.get(RULE_NAME_INPUT).clear({ force: true }); cy.get(RULE_NAME_INPUT).type(rule.name, { force: true }); diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/edit_rule.ts b/x-pack/test/security_solution_cypress/cypress/tasks/edit_rule.ts index 14c9ef05aa878..4ea919231e08f 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/edit_rule.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/edit_rule.ts @@ -5,6 +5,10 @@ * 2.0. */ +import { + SAVE_WITH_ERRORS_MODAL, + SAVE_WITH_ERRORS_MODAL_CONFIRM_BTN, +} from '../screens/create_new_rule'; import { BACK_TO_RULE_DETAILS, EDIT_SUBMIT_BUTTON } from '../screens/edit_rule'; import { editRuleUrl } from '../urls/edit_rule'; import { visit } from './navigation'; @@ -18,6 +22,14 @@ export const saveEditedRule = () => { cy.get(EDIT_SUBMIT_BUTTON).should('not.exist'); }; +export const saveEditedRuleWithNonBlockingErrors = () => { + cy.get(EDIT_SUBMIT_BUTTON).click(); + cy.get(SAVE_WITH_ERRORS_MODAL).should('exist'); + cy.get(SAVE_WITH_ERRORS_MODAL_CONFIRM_BTN).first().click(); + cy.get(SAVE_WITH_ERRORS_MODAL).should('not.exist'); + cy.get(EDIT_SUBMIT_BUTTON).should('not.exist'); +}; + export const goBackToRuleDetails = () => { cy.get(BACK_TO_RULE_DETAILS).should('exist').click(); cy.get(BACK_TO_RULE_DETAILS).should('not.exist'); diff --git a/x-pack/test/security_solution_cypress/cypress/tsconfig.json b/x-pack/test/security_solution_cypress/cypress/tsconfig.json index b7223115bbcb6..36ef2376ec1ad 100644 --- a/x-pack/test/security_solution_cypress/cypress/tsconfig.json +++ b/x-pack/test/security_solution_cypress/cypress/tsconfig.json @@ -43,5 +43,6 @@ "@kbn/alerts-ui-shared", "@kbn/securitysolution-endpoint-exceptions-common", "@kbn/repo-info", + "@kbn/elastic-assistant-common", ] } diff --git a/x-pack/test/stack_functional_integration/apps/ccs/ccs_console.js b/x-pack/test/stack_functional_integration/apps/ccs/ccs_console.js index 01205ed528a1c..e105ceecf6cf7 100644 --- a/x-pack/test/stack_functional_integration/apps/ccs/ccs_console.js +++ b/x-pack/test/stack_functional_integration/apps/ccs/ccs_console.js @@ -31,7 +31,7 @@ export default function ({ getService, getPageObjects }) { }); it('it should be able to access remote data', async () => { await PageObjects.console.monaco.enterText( - '\nGET ftr-remote:makelogs工程-*/_search\n {\n "query": {\n "bool": {\n "must": [\n {"match": {"extension" : "jpg"} \n}\n}\n}\n}\n}' + '\nGET ftr-remote:makelogs工程-*/_search\n {\n "query": {\n "bool": {\n "must": [\n {"match": {"extension" : "jpg"} \n}\n]\n}\n}\n}' ); await PageObjects.console.clickPlay(); await retry.try(async () => { diff --git a/x-pack/test_serverless/api_integration/services/transform/api.ts b/x-pack/test_serverless/api_integration/services/transform/api.ts index c865dcec6e8a0..b96f8aeca2ad9 100644 --- a/x-pack/test_serverless/api_integration/services/transform/api.ts +++ b/x-pack/test_serverless/api_integration/services/transform/api.ts @@ -9,10 +9,10 @@ import expect from '@kbn/expect'; import { TransformState, TRANSFORM_STATE } from '@kbn/transform-plugin/common/constants'; import type { TransformStats } from '@kbn/transform-plugin/common/types/transform_stats'; -import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; -import type { PostTransformsUpdateRequestSchema } from '@kbn/transform-plugin/common/api_schemas/update_transforms'; +import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; +import type { PostTransformsUpdateRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/update_transforms'; import type { TransformPivotConfig } from '@kbn/transform-plugin/common/types/transform'; -import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import type { PutTransformsRequestSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; import { FtrProviderContext } from '../../ftr_provider_context'; export async function asyncForEach(array: any[], callback: Function) { diff --git a/x-pack/test_serverless/api_integration/services/transform/security_common.ts b/x-pack/test_serverless/api_integration/services/transform/security_common.ts index 3b34bb5687925..8133af4b1f9db 100644 --- a/x-pack/test_serverless/api_integration/services/transform/security_common.ts +++ b/x-pack/test_serverless/api_integration/services/transform/security_common.ts @@ -8,6 +8,10 @@ import { ProvidedType } from '@kbn/test'; import { Client } from '@elastic/elasticsearch'; +import { + TOTAL_INDEX_PRIVILEGE_SET_EDITOR, + TOTAL_INDEX_PRIVILEGE_SET_VIEWER, +} from '@kbn/slo-plugin/server/services/get_diagnosis'; import { FtrProviderContext } from '../../ftr_provider_context'; export type TransformSecurityCommon = ProvidedType; @@ -33,14 +37,18 @@ export function TransformSecurityCommonProvider({ getService }: FtrProviderConte { name: 'transform_dest', elasticsearch: { - indices: [{ names: ['.slo-*'], privileges: ['read', 'index', 'manage', 'delete'] }], + indices: [ + { names: ['.slo-observability.*'], privileges: TOTAL_INDEX_PRIVILEGE_SET_EDITOR }, + ], }, kibana: [], }, { name: 'transform_dest_readonly', elasticsearch: { - indices: [{ names: ['.slo-*'], privileges: ['read'] }], + indices: [ + { names: ['.slo-observability.*'], privileges: TOTAL_INDEX_PRIVILEGE_SET_VIEWER }, + ], }, kibana: [], }, diff --git a/x-pack/test_serverless/api_integration/test_suites/common/telemetry/snapshot_telemetry.ts b/x-pack/test_serverless/api_integration/test_suites/common/telemetry/snapshot_telemetry.ts index 08a887e40cc73..b3d7f812de3e8 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/telemetry/snapshot_telemetry.ts +++ b/x-pack/test_serverless/api_integration/test_suites/common/telemetry/snapshot_telemetry.ts @@ -10,6 +10,7 @@ import deepmerge from 'deepmerge'; import ossRootTelemetrySchema from '@kbn/telemetry-plugin/schema/oss_root.json'; import xpackRootTelemetrySchema from '@kbn/telemetry-collection-xpack-plugin/schema/xpack_root.json'; import ossPluginsTelemetrySchema from '@kbn/telemetry-plugin/schema/oss_plugins.json'; +import ossPackagesTelemetrySchema from '@kbn/telemetry-plugin/schema/kbn_packages.json'; import xpackPluginsTelemetrySchema from '@kbn/telemetry-collection-xpack-plugin/schema/xpack_plugins.json'; import { assertTelemetryPayload } from '@kbn/telemetry-tools'; import type { UsageStatsPayloadTestFriendly } from '@kbn/test-suites-xpack/api_integration/services/usage_api'; @@ -41,7 +42,10 @@ export default function ({ getService }: FtrProviderContext) { it('should pass the schema validation (ensures BWC with Classic offering)', () => { const root = deepmerge(ossRootTelemetrySchema, xpackRootTelemetrySchema); - const plugins = deepmerge(ossPluginsTelemetrySchema, xpackPluginsTelemetrySchema); + const plugins = deepmerge( + deepmerge(ossPluginsTelemetrySchema, ossPackagesTelemetrySchema), + xpackPluginsTelemetrySchema + ); try { assertTelemetryPayload({ root, plugins }, stats); diff --git a/x-pack/test_serverless/api_integration/test_suites/observability/slos/create_slo.ts b/x-pack/test_serverless/api_integration/test_suites/observability/slos/create_slo.ts index 3f0686f175fc9..93aaa77e4e215 100644 --- a/x-pack/test_serverless/api_integration/test_suites/observability/slos/create_slo.ts +++ b/x-pack/test_serverless/api_integration/test_suites/observability/slos/create_slo.ts @@ -7,7 +7,7 @@ import { cleanup, generate } from '@kbn/infra-forge'; import expect from '@kbn/expect'; -import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/common/api_schemas/transforms'; +import type { GetTransformsResponseSchema } from '@kbn/transform-plugin/server/routes/api_schemas/transforms'; import { SO_SLO_TYPE } from '@kbn/slo-plugin/server/saved_objects'; import { ALL_VALUE } from '@kbn/slo-schema'; import { diff --git a/x-pack/test_serverless/api_integration/test_suites/search/platform_security/authorization.ts b/x-pack/test_serverless/api_integration/test_suites/search/platform_security/authorization.ts index 1b29665b1c2fe..472647f92382e 100644 --- a/x-pack/test_serverless/api_integration/test_suites/search/platform_security/authorization.ts +++ b/x-pack/test_serverless/api_integration/test_suites/search/platform_security/authorization.ts @@ -41,6 +41,7 @@ export default function ({ getService }: FtrProviderContext) { "all": Array [ "login:", "api:bulkGetUserProfiles", + "api:dashboardUsageStats", "api:store_search_session", "api:generateReport", "api:downloadCsv", @@ -223,6 +224,7 @@ export default function ({ getService }: FtrProviderContext) { "minimal_all": Array [ "login:", "api:bulkGetUserProfiles", + "api:dashboardUsageStats", "app:dashboards", "app:kibana", "ui:catalogue/dashboard", @@ -374,6 +376,7 @@ export default function ({ getService }: FtrProviderContext) { "minimal_read": Array [ "login:", "api:bulkGetUserProfiles", + "api:dashboardUsageStats", "app:dashboards", "app:kibana", "ui:catalogue/dashboard", @@ -472,6 +475,7 @@ export default function ({ getService }: FtrProviderContext) { "read": Array [ "login:", "api:bulkGetUserProfiles", + "api:dashboardUsageStats", "app:dashboards", "app:kibana", "ui:catalogue/dashboard", diff --git a/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts b/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts index b03ba641ddd10..cefe3dc598b40 100644 --- a/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts +++ b/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts @@ -9,7 +9,7 @@ import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; import type { CspBenchmarkRule, FindCspBenchmarkRuleResponse, -} from '@kbn/cloud-security-posture-plugin/common/types/latest'; +} from '@kbn/cloud-security-posture-common/schema/rules/latest'; import { createPackagePolicy } from '@kbn/test-suites-xpack/api_integration/apis/cloud_security_posture/helper'; import { FtrProviderContext } from '../../../ftr_provider_context'; diff --git a/x-pack/test_serverless/api_integration/test_suites/security/platform_security/authorization.ts b/x-pack/test_serverless/api_integration/test_suites/security/platform_security/authorization.ts index 146281fe6fe0f..14122b2d5e4da 100644 --- a/x-pack/test_serverless/api_integration/test_suites/security/platform_security/authorization.ts +++ b/x-pack/test_serverless/api_integration/test_suites/security/platform_security/authorization.ts @@ -775,6 +775,7 @@ export default function ({ getService }: FtrProviderContext) { "ui:discover/storeSearchSession", "ui:discover/generateCsv", "api:bulkGetUserProfiles", + "api:dashboardUsageStats", "api:downloadCsv", "app:dashboards", "ui:catalogue/dashboard", @@ -1605,6 +1606,7 @@ export default function ({ getService }: FtrProviderContext) { "ui:discover/storeSearchSession", "ui:discover/generateCsv", "api:bulkGetUserProfiles", + "api:dashboardUsageStats", "api:downloadCsv", "app:dashboards", "ui:catalogue/dashboard", @@ -1966,6 +1968,7 @@ export default function ({ getService }: FtrProviderContext) { "ui:discover/show", "ui:discover/createShortUrl", "api:bulkGetUserProfiles", + "api:dashboardUsageStats", "app:dashboards", "ui:catalogue/dashboard", "ui:navLinks/dashboards", @@ -2322,6 +2325,7 @@ export default function ({ getService }: FtrProviderContext) { "ui:discover/show", "ui:discover/createShortUrl", "api:bulkGetUserProfiles", + "api:dashboardUsageStats", "app:dashboards", "ui:catalogue/dashboard", "ui:navLinks/dashboards", diff --git a/x-pack/test_serverless/functional/test_suites/common/saved_objects_management/hidden_types.ts b/x-pack/test_serverless/functional/test_suites/common/saved_objects_management/hidden_types.ts index 9a48fd898d3c7..ffac914961061 100644 --- a/x-pack/test_serverless/functional/test_suites/common/saved_objects_management/hidden_types.ts +++ b/x-pack/test_serverless/functional/test_suites/common/saved_objects_management/hidden_types.ts @@ -7,6 +7,7 @@ import path from 'path'; import expect from '@kbn/expect'; +import { byIdAscComparator } from '@kbn/core-saved-objects-import-export-server-internal/src/export/utils'; import { FtrProviderContext } from '../../../ftr_provider_context'; const fixturePaths = { @@ -55,11 +56,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { .expect(200) .then((resp) => { expect( - resp.body.saved_objects.map((obj: any) => ({ - id: obj.id, - type: obj.type, - hidden: obj.meta.hiddenType, - })) + resp.body.saved_objects + .map((obj: any) => ({ + id: obj.id, + type: obj.type, + hidden: obj.meta.hiddenType, + })) + .sort(byIdAscComparator) ).to.eql([ { id: 'obj_1', diff --git a/x-pack/test_serverless/functional/test_suites/observability/infra/hosts_page.ts b/x-pack/test_serverless/functional/test_suites/observability/infra/hosts_page.ts index d04b8375fc578..6957fe3b8571c 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/infra/hosts_page.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/infra/hosts_page.ts @@ -154,10 +154,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { expect(documentTitle).to.contain('Hosts - Infrastructure - Observability - Elastic'); }); - it('should render the title beta badge', async () => { - await pageObjects.infraHostsView.getBetaBadgeExists(); - }); - describe('Hosts table', () => { let hostRows: WebElementWrapper[] = []; diff --git a/x-pack/test_serverless/tsconfig.json b/x-pack/test_serverless/tsconfig.json index 7a7747a964caa..1770916bbace2 100644 --- a/x-pack/test_serverless/tsconfig.json +++ b/x-pack/test_serverless/tsconfig.json @@ -98,5 +98,6 @@ "@kbn/test-suites-src", "@kbn/console-plugin", "@kbn/cloud-security-posture-common", + "@kbn/core-saved-objects-import-export-server-internal", ] } diff --git a/yarn.lock b/yarn.lock index 25bcf4d4d9253..4dba4ad97ba54 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5754,6 +5754,10 @@ version "0.0.0" uid "" +"@kbn/object-versioning-utils@link:packages/kbn-object-versioning-utils": + version "0.0.0" + uid "" + "@kbn/object-versioning@link:packages/kbn-object-versioning": version "0.0.0" uid "" @@ -8278,12 +8282,12 @@ require-from-string "^2.0.2" uri-js "^4.2.2" -"@redocly/cli@^1.19.0": - version "1.19.0" - resolved "https://registry.yarnpkg.com/@redocly/cli/-/cli-1.19.0.tgz#fa7ac88c50b8850c1358bb68a22a3330efe0e0b0" - integrity sha512-ev6J0eD+quprvW9PVCl9JmRFZbj6cuK+mnYPAjcrPvesy2RF752fflcpgQjGnyFaGb1Cj+DiwDi3dYr3EAp04A== +"@redocly/cli@^1.20.1": + version "1.21.1" + resolved "https://registry.yarnpkg.com/@redocly/cli/-/cli-1.21.1.tgz#92b3c878a571e4e89782ce13acb821222fd2bd0c" + integrity sha512-ES1UF7gk/+D0KA97lHEvL4HJZIuNlKe2FyWioxKsmWaqCMikF1cgHFOxr/3GlxtvWd4LaHkwPJBEobRQYOBK+Q== dependencies: - "@redocly/openapi-core" "1.19.0" + "@redocly/openapi-core" "1.21.1" abort-controller "^3.0.0" chokidar "^3.5.1" colorette "^1.2.0" @@ -8303,18 +8307,18 @@ styled-components "^6.0.7" yargs "17.0.1" -"@redocly/config@^0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@redocly/config/-/config-0.7.0.tgz#e8d06dc1f2d9cb9a4b5c5ce09afbf8536b32161c" - integrity sha512-6GKxTo/9df0654Mtivvr4lQnMOp+pRj9neVywmI5+BwfZLTtkJnj2qB3D6d8FHTr4apsNOf6zTa5FojX0Evh4g== +"@redocly/config@^0.10.0": + version "0.10.1" + resolved "https://registry.yarnpkg.com/@redocly/config/-/config-0.10.1.tgz#c7bcbab6cb3b82236c2f5c87aa44924a652d8e80" + integrity sha512-H3LnKVGzOaxskwJu8pmJYwBOWjP61qOK7TuTrbafqArDVckE06fhA6l0nO4KvBbjLPjy1Al7UnlxOu23V4Nl0w== -"@redocly/openapi-core@1.19.0", "@redocly/openapi-core@^1.4.0": - version "1.19.0" - resolved "https://registry.yarnpkg.com/@redocly/openapi-core/-/openapi-core-1.19.0.tgz#8c6db2f0286b7776d79e392335f89f702ea19432" - integrity sha512-ezK6qr80sXvjDgHNrk/zmRs9vwpIAeHa0T/qmo96S+ib4ThQ5a8f3qjwEqxMeVxkxCTbkaY9sYSJKOxv4ejg5w== +"@redocly/openapi-core@1.21.1", "@redocly/openapi-core@^1.4.0": + version "1.21.1" + resolved "https://registry.yarnpkg.com/@redocly/openapi-core/-/openapi-core-1.21.1.tgz#b9221f6effc96ad2210256061cd624648ddc1f1d" + integrity sha512-WTsie5b+Ohx2NsmEBVCS5WF24h4XqDpb834ZR4EeE7f+Zjwn34AgaC78HP2xGydi+gFfD4PiqDGgnDPtR5s1OA== dependencies: "@redocly/ajv" "^8.11.0" - "@redocly/config" "^0.7.0" + "@redocly/config" "^0.10.0" colorette "^1.2.0" https-proxy-agent "^7.0.4" js-levenshtein "^1.1.6" @@ -14096,10 +14100,10 @@ chrome-trace-event@^1.0.2: dependencies: tslib "^1.9.0" -chromedriver@^127.0.3: - version "127.0.3" - resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-127.0.3.tgz#33abca5924eb809e0e6ef2dd30eaa8cf7dba58d4" - integrity sha512-trUHkFt0n7jGzNOgkO1srOJfz50kKyAGJ016PyV0hrtyKNIGnOC9r3Jlssz19UoEjSzI/1g2shEiIFtDbBYVaw== +chromedriver@^128.0.0: + version "128.0.0" + resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-128.0.0.tgz#7f75a984101199e0bcc2c92fe9f91917fcd1f918" + integrity sha512-Ggo21z/dFQxTOTgU0vm0V59Mi79yyR+9AUk/KiVAsRfbDRdVZQYQWfgxnIvD/x8KOKn0oB7haRzDO/KfrKyvOA== dependencies: "@testim/chrome-version" "^1.1.4" axios "^1.7.4"