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/.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/.gitignore b/.gitignore index 02f11f9275184..c5c048f10d7d4 100644 --- a/.gitignore +++ b/.gitignore @@ -146,9 +146,9 @@ role_users.json .devcontainer/.env # Ignore temporary files in oas_docs -output/kibana.serverless.tmp1.yaml -output/kibana.serverless.tmp2.yaml -output/kibana.tmp1.yaml -output/kibana.tmp2.yaml -output/kibana.new.yaml -output/kibana.serverless.new.yaml +oas_docs/output/kibana.serverless.tmp1.yaml +oas_docs/output/kibana.serverless.tmp2.yaml +oas_docs/output/kibana.tmp1.yaml +oas_docs/output/kibana.tmp2.yaml +oas_docs/output/kibana.new.yaml +oas_docs/output/kibana.serverless.new.yaml diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index 4457571ce94f3..b8cbb98efa0c9 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-29 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..ba8f818c9b672 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-29 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..bb5e1729f30a5 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-29 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..592da097ffa0c 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-29 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..2563c97cb6dcb 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-29 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..f0872225f3ce0 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-29 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..2854ca2bbdaf0 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-29 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..e7c6e707f8e45 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-29 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..619365af1643d 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-29 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..1ab3eddd7b991 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-29 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..7fa08935f7142 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-29 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..e36836b67f4b3 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-29 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..633628f928786 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-29 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..9b167e45282a1 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-29 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..52f333202a58e 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-29 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..32b7228146223 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-29 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..8ece2af4ae732 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-29 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..b110b5f0b93ea 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-29 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..9285ce9d55573 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-29 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..c27608737678d 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-29 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..95c3d19fd414b 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-29 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..b0ad103707038 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-29 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..832f73db04e10 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-29 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..cdb9131d3e7c2 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-29 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..75a79d6bd9475 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-29 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..55c89861e67d1 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-29 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..388dfd43a359c 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-29 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..b5527231113c7 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-29 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..d8b1353e1060b 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-29 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..b3ca7699fce6b 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-29 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..d9d3ead614386 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-29 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..2b966b1f67d3c 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-29 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..a004742ecdb4f 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-29 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..042e262eebdfb 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 1fb9c771723b7..ff486f398a86f 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-29 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..ff84592761b61 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index 9e90bb566c549..416e31787c74c 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-29 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..071e5e688a0f2 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-29 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..c7c4032f0512e 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-29 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..7c573ebb8fdd1 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-29 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..37297441ca339 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-29 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..f417b757a472f 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-29 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..8d2e058404ec9 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-29 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..af76b2b9f51f3 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-29 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..48fe25d07357c 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-29 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..c672c9411cf31 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-29 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..47bd2cdb4f29b 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-29 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..789c49a7b6b78 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-29 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..06657f643de68 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-29 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..bd671f5ca74f8 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-29 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..123fa10f8aad9 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-29 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..711d4025d5653 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-29 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..cffa4a7a37623 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-29 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..1534b3b3f1730 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-29 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..cb40d975cd3b1 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-29 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..914fed24aff6a 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-29 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..0d2419e1eecad 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-29 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..b3db561e3d18a 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-29 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..5c1c5e907a715 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-29 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..29d3b842af38e 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-29 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..41ad0e8fc6bfd 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-29 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..5eed957cca3e1 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-29 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..04a1f127f3057 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-29 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..e501402fd044b 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-29 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..0013e9322c03b 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-29 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..5b534beca1c59 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-29 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..86858a80556e7 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-29 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..092bb02509863 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-29 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..512fc82b621d1 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-29 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..117718a0bb747 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-29 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..034cbdbcafa5d 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-29 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..e1e39ab378317 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-29 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..c347050e5ab7b 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-29 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..1859456f51b3e 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-29 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..f41ed80b4634c 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-29 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..c0bb90cf8793b 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-29 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..605a3827d95f4 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-29 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..32bda919f72b6 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-29 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..6183d6c23ce1d 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-29 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..2aeefa4708285 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-29 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..f0806320100da 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-29 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..251b67a03df88 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-29 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..76e50a67fabed 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-29 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..9999901b9f6c3 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-29 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..5e95bca75db21 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-29 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..d2b30a4b8aa61 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-29 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..682bd1b467bee 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-29 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..ca7d19c11c2d4 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-29 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..b70e93645437e 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-29 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..425c031088c32 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,16 +83,16 @@ "<{ 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?: ", "TypeC", @@ -148,7 +148,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 +162,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 +194,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..1a96a005cbad7 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-29 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..c2bec03adf02e 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-29 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..86aa210a61988 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-29 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..ec20c870397e4 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-29 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..1fb44a6ba2de5 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-29 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..9148cd56ee082 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-29 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..81d6969c574ed 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-29 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..f8183c0225b6a 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-29 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..4b6938882fb4c 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-29 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..85e0efabe824b 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-29 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..5ba4e8ccdb11f 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-29 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..ead5dbc68e9e9 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-29 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..2f4f06d62f2ec 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-29 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..871f9c2786434 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-29 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..ca10af2336113 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-29 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..27a71a2f9a74a 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-29 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..0cf3b6ec4242c 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-29 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..5c29e8fcdbcd2 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-29 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..6daa9485c935c 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-29 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..04e1465b5ecfd 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-29 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..bda841b9357f2 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-29 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..98cd4073f07f3 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-29 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..abd16eaf2bda0 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-29 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..856ac761d93ca 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-29 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..af7347e5f019c 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-29 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..1f1b428851c22 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-29 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..3127bd446582e 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-29 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..d3902c9dfc683 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-29 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..e40d6e271db55 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-29 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..c179d3f6fe721 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-29 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..1c798e4bfe695 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-29 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..eefbddd3fee38 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-29 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..a4831f5248c3b 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-29 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..ec7bb460d141e 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-29 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..1e899d11711d4 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-29 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..d45a101061453 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-29 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..08aac5b54cf57 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-29 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..c2ed421dc1c53 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-29 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..d7fa4bb3f7476 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-29 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..926f78a9e34ae 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-29 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..d3a065b8dc211 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-29 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..63a936f7e2366 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-29 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..989543bcf19f9 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-29 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..332adb157e365 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-29 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..e1bf511ecc5e4 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-29 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..92696453da6fa 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-29 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..9b5d0fd8e1024 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-29 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.mdx b/api_docs/kbn_content_management_favorites_public.mdx index f2b866913d784..e25533f713255 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-favorites-public'] --- import kbnContentManagementFavoritesPublicObj from './kbn_content_management_favorites_public.devdocs.json'; diff --git a/api_docs/kbn_content_management_favorites_server.mdx b/api_docs/kbn_content_management_favorites_server.mdx index ad6b103873fa2..e26262cee9b9c 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-favorites-server'] --- import kbnContentManagementFavoritesServerObj from './kbn_content_management_favorites_server.devdocs.json'; diff --git a/api_docs/kbn_content_management_tabbed_table_list_view.mdx b/api_docs/kbn_content_management_tabbed_table_list_view.mdx index 5d7a5e6b667d8..06d373073c96e 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-29 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..7b30566e188b2 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-29 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..d6b55f4c778ea 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-29 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..704e81d77e954 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-29 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..324af8596e167 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-29 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..fcff56097ad51 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", @@ -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..15b4b43713a02 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-29 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..56f247497ffda 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-29 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..ca63afd28d58e 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-29 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..9289e659e0218 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-29 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..f0728061ebdc4 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-29 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..5cb3b7a5d9602 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-29 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..7f88ab68074c3 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-29 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..7b3e3d50b1cd0 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-29 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..644ecf90dc402 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-29 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..cd545bdb88acb 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-29 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..2199d5cdbe7f6 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-29 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..b01ea07a6ccdc 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-29 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..02dd69d0b2538 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-29 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..f5dc067f67194 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-29 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..b898ca85db4f8 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-29 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..1a3ff723eb4e6 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-29 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..7fc314639e1b1 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-29 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..e59e47ccd1692 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-29 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..6cfcb6f94f6a4 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-29 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..6163030964d57 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-29 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..9ab5d917ef407 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-29 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..d9db907fadebe 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-29 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..f962a7241b4ca 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-29 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..1292119a1058d 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-29 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..25d7622d4863a 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-29 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..cf55fa92654e6 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-29 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..f98de8505e1f8 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-29 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..65939649fc33e 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-29 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..0080504544aee 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-29 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..db45503be1298 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-29 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..1a7320779ebca 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-29 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..2ba409ecbdc6d 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-29 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..31f59bfcad944 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-29 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..5f85d5883fe62 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-29 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..dbf6d4b8c9c0f 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-29 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..6905cc90e3c91 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-29 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..ce189d907b6b8 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-29 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..1586f020aca01 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-29 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..cf227eb174946 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-29 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..acce0aad66232 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-29 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..6920f677e82dc 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-29 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..2aecc91585752 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-29 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..57da52aa0718f 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-29 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..33333bc8a8ccd 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-29 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..2a121bf37e631 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-29 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..8362ef2eca044 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-29 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..d0cb51210fba1 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-29 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..37929f5bde93e 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-29 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..3904ae973f588 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-29 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..1eeb489f401bd 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-29 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..849afd32c7594 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-29 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..9687209d71c51 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-29 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..7e023b7c8e87f 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-29 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..2be170be56451 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-29 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..2b91d0dbbd1d2 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-29 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..eefdee2bed0df 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-29 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..435deacf6d7c2 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-29 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..a98faf2c038d7 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-29 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..05a44f46b0649 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-29 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..b142744f526d0 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-29 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..c29fb53cb87de 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-29 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..7ddf92f8670b3 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-29 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..c0e44f87fb8f6 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-29 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..b2f801695bd2f 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-29 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..8698e8700a9bf 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-29 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..4a9ffd9f5a486 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-29 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..dfe1b75f1d512 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-29 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..c14f8e640f5e5 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-29 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..267bef0eacf61 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-29 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..a86012081af4a 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-29 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..6f04acd9efdd4 100644 --- a/api_docs/kbn_core_http_server.devdocs.json +++ b/api_docs/kbn_core_http_server.devdocs.json @@ -15748,6 +15748,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..216b0f2650245 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server'] --- import kbnCoreHttpServerObj from './kbn_core_http_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index 6e3426b9afaec..15c40600aad85 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-29 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..6d79a75de9571 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-29 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..430909fbeb9b8 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-29 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..334e72f32f389 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-29 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..cb2ef3b21e97a 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-29 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..d0122640c3b4d 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-29 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..6ae5cd08528fe 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-29 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..2da1456d75879 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-29 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..f764c7ccd9401 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-29 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..8c327ce9b6b9f 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-29 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..91f4d4c2c1b90 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-29 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..fd1f4165f2df9 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-29 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..add3289086a37 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-29 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..70ef4c84dcea5 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-29 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..7751b8612805f 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-29 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..f0d55cd21685e 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-29 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..4610200ab7f4c 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-29 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..e70b9146fdc7b 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-29 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..8150eeb3b34dc 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-29 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..cd5f2e4f9a42c 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-29 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..10621cabbc820 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-29 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..a9681cc5819d3 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-29 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..94385934616e1 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-29 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..6ac70bdf8feb2 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-29 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..e9ba06110dee3 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-29 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..3ef9a2ba20764 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-29 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..462894e9225d3 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-29 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..d84e43e11cddb 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-29 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..29abf25a72a96 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-29 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..589145bfc6956 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-29 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..b3bedd4ff1ec9 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-29 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..856aa43772b0b 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-29 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..54a5f4877415f 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-29 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..356970549b5e8 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-29 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..41c71210a45aa 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-29 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..d5b270192baef 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-29 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..97afbbc2bc283 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-29 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..4247aa3eaefdb 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-29 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..1653daaeb963e 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-29 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..701f1f3a92ac3 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-29 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..18c0a7963f760 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-29 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..ef81a023363c8 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-29 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..dd5fe30a0f3f0 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-29 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..e9e82932bff9c 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-29 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..1626a9c40107f 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-29 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..53dd770b22454 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-29 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..56a716f94c073 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-29 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..e781f01a07a94 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-29 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..511f10dbafeec 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-29 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..2633d21c6e805 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-29 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..fbb848e78eff8 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-29 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..8f8553d6ffb0c 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-29 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..9530ba874caa8 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-29 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..36da011dc2c6d 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-29 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..8eba6577eb294 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-29 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..c5539cd067718 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-29 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..9a1ec59ae1b2b 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-29 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..00a946314aee1 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-29 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..751d35e01a656 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-29 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..35e42df96db25 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-29 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..a29a59ddaf646 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-29 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..6aac7635466f9 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-29 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..4cf16a777c894 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-29 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..e7c1ddade6b2d 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-29 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..4d2b0e5f58045 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-29 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..905322c2a4c53 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-29 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..ac169ab4025d0 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-29 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..9d7e275ead0b2 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-29 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..c9367aac121fc 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-29 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..c3186f03df986 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-29 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..b3b82c6d0bf70 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-29 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..94034fcf6bf98 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-29 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..b2c0fa67337d6 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-29 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..b817f6521fec5 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-29 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..40434b27e53d8 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-29 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..1d9f275eaa77e 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-29 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..8797e269cd2b4 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-29 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..9f3517e0e5ef1 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-29 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..68bae7d10f25f 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-29 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..4519a3967cf38 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-29 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..0bb70f1211527 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-29 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..e398e1802f7a5 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-29 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..e0b6017f619ba 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-29 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..2edc8360ea37a 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-29 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..5e55c418c8bd3 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-29 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..f87403775f0e8 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-29 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..b9639f10680fc 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-29 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..bc148124ff898 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-29 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..62f39e77143da 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-29 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..d77a7b0453bbf 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-29 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..39a2dfe21db4a 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-29 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..c408708fbc885 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-29 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..cca3346d6aa7a 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-29 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..25c456b828802 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-29 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..c3be4a1f1ec01 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-29 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..90b8bb4602bc3 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-29 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..82b70a57bd727 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-29 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..68185206cd22e 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-29 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..afe318c75ddd1 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-29 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..0ec76e40f86e6 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-29 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..7dce73b50b0e7 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-29 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..e44bfe3905db1 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-29 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..cb4af6014f825 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-29 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..d249a40ef932b 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-29 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..29fcff84d8b17 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-29 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..7336aeb870493 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-29 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..bf31146018ae3 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-29 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..3b2fdf8b10992 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-29 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..57e1a538f8bfc 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-29 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..e7382e3d09d2e 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-29 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..3d51cc8c8a260 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-29 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..887fec4110041 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-29 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..108ad531828ba 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-29 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..51e461117346d 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-29 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..2d7e104007316 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-29 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..6500dcff3976c 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-29 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..c87217e743f3a 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-29 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..e43a9e71f1294 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-29 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..c676b0d469ca3 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-29 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..ad19ad4ccae2c 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-29 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..3e527dacab04f 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-29 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..3c56b9505a43d 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-29 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..830d9e4f50878 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-29 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..102d2da6dd73e 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-29 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..4f2c606a3e8a0 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-29 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..f026f10630fda 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-29 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..2ff3b29a3dce7 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-29 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..6b07b6dc419d6 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-29 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..2f63945e9989b 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-29 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..05c729b9dff2d 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-29 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..6dd87a7d363e1 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-29 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..9d73c84cafacd 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-29 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..16a5f8adc7c0e 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-29 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.mdx b/api_docs/kbn_ebt_tools.mdx index 0a4a2b0f68df2..bd1dd6c8245a5 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ebt-tools'] --- import kbnEbtToolsObj from './kbn_ebt_tools.devdocs.json'; diff --git a/api_docs/kbn_ecs_data_quality_dashboard.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..7592132923708 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-29 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..14ee67b0a5cd2 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-29 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..a58f8d0928cdd 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-29 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..40b5a9737edde 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-29 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.mdx b/api_docs/kbn_entities_schema.mdx index b89d5148b988b..d061a4db5ef9a 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/entities-schema'] --- import kbnEntitiesSchemaObj from './kbn_entities_schema.devdocs.json'; diff --git a/api_docs/kbn_es.mdx b/api_docs/kbn_es.mdx index 245ea9bf73a0e..312883a2315b0 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-29 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..b83e432f2f7b9 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-29 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..5f3423c360629 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-29 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..f3338830a9d0b 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-29 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..13b5133e0c8ff 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-29 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..1d64199a22c57 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-29 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..f1c289674b475 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-29 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..54625dca73133 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-29 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..76ee11fd354c3 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-29 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..9aac9ed37881b 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-29 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..41fb91f43ba94 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-29 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..81fcd30e18036 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-29 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..f12664ef7e9d6 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-29 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..fa45be6f73663 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-29 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..0b77115186b5e 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-29 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..be551c8703ff6 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-29 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..1a37a1335b980 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-29 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..cfae6be4c1932 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-29 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..e0039da0d056f 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-29 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..b0eb1280b84df 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-29 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..04ae953662bd8 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-29 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..2648e8ad46c4a 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-29 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..77c8c2d539cf4 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-29 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..89b26dd3eeef2 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-29 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..3afc33ae99277 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-29 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..4f48d76871004 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-29 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..c8870bdafb45c 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-29 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..c4b79fb3d1f79 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-29 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..5172add4ca105 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-29 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..4b7e35cb370a0 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-29 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..1ce5b440b8938 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-29 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..230e9b73c3938 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-29 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..64189be5ce9f4 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-29 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..ef503c4f11836 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-29 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..711ad60964dc7 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-29 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..33b4ef4e63a51 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-29 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..154f2c342d7f2 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,21 @@ "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 } ], "objects": [ @@ -320,14 +365,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 +401,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 +577,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 +655,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 +761,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 +819,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 +971,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 +987,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 +1007,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 +1177,45 @@ "<{ 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 } ] } diff --git a/api_docs/kbn_investigation_shared.mdx b/api_docs/kbn_investigation_shared.mdx index bc725fc8ba945..38096d13d9bf2 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-29 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 | +| 44 | 0 | 44 | 0 | ## Common diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index b6b728142c185..6e35fb413f63d 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-29 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..a2484264bcc02 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-29 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..4ac4665e1810e 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-29 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..6aac219ecd6ff 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-29 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..fd0aa1074c2a5 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-29 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..eb029f92511cd 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-29 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..f4b80da9910ef 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-29 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..7e26a327a2491 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-29 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..9fcbc65b75935 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-29 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..786b29b546990 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-29 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..5f612b59fca0e 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-29 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..da39b938ca78b 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-29 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..c7aa445c0c585 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-29 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..a22bafb8698ac 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-29 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..1a4f05dfd6ef3 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-29 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..bdb39d72399d2 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-29 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..92c8b82597bda 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-29 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..c9c6d6cf6430d 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-29 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..5056d5af28e5e 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-29 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..decd973e6e0d2 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-29 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..a92a0487eb089 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-29 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..90bc63858011c 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-29 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..26f9bd5c39902 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-29 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..10393d78ee0b4 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-29 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..f3b6dd57105f9 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-29 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..7bf380e91cc7b 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-29 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..261b0172ddaf4 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-29 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..8c646c25cb3ff 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-29 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..3fc1e37fbe925 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-29 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..847b398ec3cb3 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-29 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..9ed2c18cc6ef6 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-29 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..51b814cf7a8dd 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-29 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..dfc1835a0c168 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-29 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..e12e56f7e1ffd 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-29 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..66e553b9b63be 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-29 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..1fc6ac99df933 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-29 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..5f01e8448d063 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-29 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..bb3e3320938b4 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-29 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..5a7f0c243cb27 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-29 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..6a453a82a5b2a 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-29 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..b109a87ebbfd8 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-29 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..ecc633f5a09c3 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-29 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..f11a95cbc0114 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-29 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..2e0063282349a 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-29 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..781a843de0663 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-29 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..d58c528713709 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-29 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..dd86793573528 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-29 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..c01fa8f45b8bf 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-29 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..e50ae41a97513 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-29 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..94b44d9e6afa4 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-29 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..0622698eb074b 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-time-buckets'] --- import kbnMlTimeBucketsObj from './kbn_ml_time_buckets.devdocs.json'; diff --git a/api_docs/kbn_ml_trained_models_utils.mdx b/api_docs/kbn_ml_trained_models_utils.mdx index f174c04706f87..3b67041a0000d 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-trained-models-utils'] --- import kbnMlTrainedModelsUtilsObj from './kbn_ml_trained_models_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_ui_actions.mdx b/api_docs/kbn_ml_ui_actions.mdx index a511bfb4b9557..d51e24f4da8b3 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-29 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..4501a64f31031 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-29 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..45dc4347a7198 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-29 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..b061d4c89f82c 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] --- import kbnMonacoObj from './kbn_monaco.devdocs.json'; diff --git a/api_docs/kbn_object_versioning.mdx b/api_docs/kbn_object_versioning.mdx index e53829eda2611..c20cbde4516e4 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/object-versioning'] --- import kbnObjectVersioningObj from './kbn_object_versioning.devdocs.json'; diff --git a/api_docs/kbn_observability_alert_details.mdx b/api_docs/kbn_observability_alert_details.mdx index 8245c9b225fb0..ffb5c6ef7bbbb 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-29 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..cf6367fa59d88 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-29 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..936795814ad7a 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-29 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..8590f019a303d 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-29 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..07add5a4da06d 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-29 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..fcc8468a531bf 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-29 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..35feb1923a817 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-29 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..06a26caf7f3cb 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-29 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..34002bfc45bdd 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-29 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..91a90d3fadbd5 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-29 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..0135893bb9d8b 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-29 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..564e6e759f403 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-29 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..5f99c4d37c974 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-29 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..7358cca85b376 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-29 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..3eefd985c6cb8 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-29 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..c7cc88a83203c 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-29 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..356e737bb41c3 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-29 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..f02397fd1b03a 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-29 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..9daf5a9531cce 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-29 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..f87fb2ff68eed 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-29 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..416fb1f972a6c 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-29 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..899fc3515fb5b 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-29 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..dc9a1e114a38d 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-29 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..e30b190449d88 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-29 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..57d8e88f75b90 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-29 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..694b7656dd42d 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-29 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..a907261cc9d4a 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-29 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..15757f00ac4ce 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-29 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..0a18a3eb773da 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-29 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..f0b05ed30f3f3 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-29 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..4551e5d8b7162 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-29 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..7b3e3f7e5b0c1 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-29 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..d71f19fbc4a14 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-29 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..1730b8aba0734 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-29 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..1dd6e8c0fa8ff 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-29 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..861933893658b 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-29 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..a7addd095fe23 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-29 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..9ee324b8b3402 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-29 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..cd09d6fc42e6d 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-29 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..7c2ff8ebf5b2b 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-29 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..bee38532dfbf6 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-29 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..ecf0978c05710 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-29 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..3ccaddda1f819 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-29 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..27e778cfcceac 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-29 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..748288eb14184 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-29 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..f2c82185226e0 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-29 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..48fbaeece164a 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-29 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..8b2aaf218d30f 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-29 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..0db75685a1c29 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-29 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..bc49d8f77b6c6 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-29 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..e6de3f110c023 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-29 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..6a1f75bcc8cc8 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-29 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..08967a289b716 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-29 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..39f72e1e8cb18 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-29 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..67a2361579689 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-29 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..80e09e4d6bbd8 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-29 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..9c0f4e16a03a6 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-29 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..3953007209662 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-29 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..8ead181dd4930 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-29 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..c51c75c3b5491 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-29 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..775cc4344712f 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-29 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..fb9b5e1ef9cb6 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-29 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..e628301da26df 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-29 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..1c721f890b421 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-29 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..27045f6d4b60f 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-29 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..ffe4ffe18eba6 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-29 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..662dd064bb58d 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-29 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..2833a865c42f0 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-29 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..dfe2677747d5f 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-29 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..c259e0c5d0630 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-29 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..c99a74eb197a6 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-29 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..0c9d855ea008c 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-29 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..b7070467e24c4 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-29 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..7e03a18016699 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-29 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..e7ef6cfe9ce94 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-29 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..ce67b54e18ba3 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-29 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..64ffb880b066e 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-29 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..61237e7aa1951 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-29 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..6f1227ed88e75 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-29 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..919429ebe2dfa 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-29 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..7e2037ab690a6 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-29 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..5f9c758f86ca6 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-29 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..29831dd98da6b 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-29 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..c00df870cd0b5 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-29 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..d06ae6b05210f 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-29 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..37a28104dee7e 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-29 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..db3290d407e4d 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-29 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..100f05e2ac102 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-29 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..d5ce15f435685 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-29 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..3b704edbc3942 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-utils'] --- import kbnSecuritysolutionUtilsObj from './kbn_securitysolution_utils.devdocs.json'; diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index 51a32a2ca88e5..89efb64226fd4 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] --- import kbnServerHttpToolsObj from './kbn_server_http_tools.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index bb5122f7abdf2..37c739b729532 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-29 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.mdx b/api_docs/kbn_server_route_repository_client.mdx index 9ffd326e5cfac..bc8a03e6c6ffa 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository-client'] --- import kbnServerRouteRepositoryClientObj from './kbn_server_route_repository_client.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository_utils.mdx b/api_docs/kbn_server_route_repository_utils.mdx index 9d11f7a675c2c..d8e21430895e9 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-29 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..910aea6d0acb7 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-29 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..d2a3e713f0254 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-29 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..59f8a1fa2543a 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-29 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..3b4a188a096ad 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-29 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..1d623c28cbf9a 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-29 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..d0efe18378255 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-29 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..6c4274c131c79 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-29 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..28bc0c39a6605 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-29 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..1d8f701bdebc0 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-29 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..2d66642d37ac3 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-29 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..2dd56b135b4c5 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-29 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..aa9b987e72f98 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-29 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..47c21b54c2e8c 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-29 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..a5168e16b5be1 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-29 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..c61c717657bd2 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-29 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..4a0a27cccc824 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-29 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..c3d7458252ee6 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-29 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..907696ae66f8f 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-29 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..6718522037261 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-29 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..7e2bb41331112 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-29 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..82fc89af90a54 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-29 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..61d0288b5328d 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-29 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..d7f4205a22426 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-29 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..38c81d78d3878 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-29 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..fcf77a278339a 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-29 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..4abbe8d05da72 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-29 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..5709a2d7c0def 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-29 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..ba5dc6db47fc0 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-29 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..8941a26a324d7 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-29 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..4b1c23b93a08e 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-29 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..3510e566a2386 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-29 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..c9e83d2f769e0 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-29 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..5698e15842920 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-29 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..a808ca5dce15f 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-29 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..1ea8b0b0c2098 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-29 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..09e617adeaeca 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-29 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..237312a0443c9 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-29 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..a08a7442e1267 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-29 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..6d3e8095360a0 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-29 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..f43bc4073d4e7 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-29 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..1805977c0c728 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-29 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..9d3af376a71c4 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-29 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..13be50b5d42b9 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-29 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..76049bbe16b05 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-29 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..91d15cb263b88 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-29 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..5be2f5ee7f539 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-29 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..c402df512a212 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-29 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..ab99cb5ae6400 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-29 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..b32d746d8b468 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-29 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..6884bc4e90033 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-29 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..b45c8eb5da0ea 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-29 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..6e674db183b6d 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-29 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..c208d67b3da9d 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-29 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..a1d83d0ac7773 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-29 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..7d1e9327fc8f3 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-29 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.mdx b/api_docs/kbn_telemetry_tools.mdx index 116f954cc7937..44c0386215ad4 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/telemetry-tools'] --- import kbnTelemetryToolsObj from './kbn_telemetry_tools.devdocs.json'; diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index 514df724c6a9b..09237dab27985 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-29 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..a232c83c23c3e 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-29 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..ff889ca1c4282 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-29 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..69d04133cc166 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-29 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..8adf93ce1c8de 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-29 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..652463023f2c9 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-29 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..3e9c62350d69a 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-29 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..eb871fb22f174 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-29 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..a04cf5d0c7bdc 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-29 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..1ab1f2f1a6cf8 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-29 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..39df983a6be2c 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-29 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..54fb7d2c63897 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-29 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.mdx b/api_docs/kbn_ui_shared_deps_src.mdx index 83fee146195a6..57c70570bee78 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-shared-deps-src'] --- import kbnUiSharedDepsSrcObj from './kbn_ui_shared_deps_src.devdocs.json'; diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index 9f0a70a4d90e4..fb8c5cd2c51a6 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-29 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..453cec4ce38f6 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-29 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..c0327ab3db776 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-29 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..eb4d919965710 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-29 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..5b0052e81fa67 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-29 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..4f22b51f9cb4f 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-29 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..ef237a66a07a3 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-29 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..cc11e11bd9702 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-29 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..3f62d6b90f2d1 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-29 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..a7630001fbdbe 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-29 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..75b3510c24715 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-29 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..684cd55d3dfae 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": [], @@ -824,39 +698,9 @@ "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" + "({\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, @@ -869,185 +713,13 @@ "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, - "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 - } - ] + "isRequired": true } ], "returnComment": [], @@ -2141,6 +1813,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", diff --git a/api_docs/kbn_visualization_ui_components.mdx b/api_docs/kbn_visualization_ui_components.mdx index 62937260ebc20..2dbb03ea87c5a 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-29 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 | +| 137 | 0 | 134 | 4 | ## Client diff --git a/api_docs/kbn_visualization_utils.mdx b/api_docs/kbn_visualization_utils.mdx index d2bf83d048f9a..84c424613c5d8 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-29 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..c8b7b2d6d98ee 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-29 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..640e5022cf891 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-29 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..0ca21f7c420ab 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-29 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..e721e4d5d9a55 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-29 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..5ccc8f599bb6f 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-29 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..758de17e062db 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-29 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..96293527505b3 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-29 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..4ebc3e8b3e5ef 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-29 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..3607a91693376 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-29 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..6bf76ab4b3fdd 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-29 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..c49a73ef8cd74 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-29 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..bea9a5807e6ac 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-29 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..b2394f649cbe4 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-29 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..7ac2612f89469 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-29 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..db7adb4c1753d 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-29 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..8e7882305bab1 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-29 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..e5d481908839f 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-29 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..c00d73cc44d76 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-29 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..2b129cee2a56d 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] --- import mapsObj from './maps.devdocs.json'; diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index e37260e03bb95..bdc4c5267b84c 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-29 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..0360707eb9fe4 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-29 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..4ac951d3fcf9d 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-29 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..bf6178562bf88 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-29 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..4857bbdd475f5 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-29 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..bb4c3c8a863be 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-29 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..6157119d10d6d 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-29 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..ace8fd60efdbc 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-29 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..635563244ce1d 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-29 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..71110305478bf 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-29 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..582d435eca404 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-29 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..4a7da59c69bcb 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-29 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..14baf68ab7485 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-29 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..8b9a2c32a5282 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-29 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..2c7b4a9e66168 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-29 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..5840bf8d71821 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-29 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..1a75342881719 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-29 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..3f8c919c8232f 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-29 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..eb9c1cf036374 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-29 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..a34bf2ec6cf3f 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-29 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 | +| 849 | 723 | 46 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 52848 | 243 | 39700 | 1939 | +| 52833 | 243 | 39672 | 1940 | ## 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 | @@ -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 | @@ -496,9 +496,9 @@ 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-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 57 | 0 | 30 | 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/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 | @@ -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) | - | 44 | 0 | 44 | 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 | @@ -771,7 +771,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) | - | 137 | 0 | 134 | 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..50676fdbb1a64 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-29 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..c9d34a56be7da 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-29 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..2f26ed770b75d 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-29 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..90728ec9714c1 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-29 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..2362fe42aeac6 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-29 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..b95daa83b6cda 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-29 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..5ca3cf1837623 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-29 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..a884d2bbc9dfd 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-29 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..a83bc675efcfc 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-29 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..04ba4249f63f2 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-29 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..b8e84dcd4e52c 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-29 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..c6a6ed4f277ee 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-29 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..1cda315a00d0e 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-29 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..8b1f6099ceda2 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-29 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..7dbbe8861c4ec 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-29 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..2095c96e19773 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-29 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..50e86072d25e9 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-29 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..383be7af8fc16 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-29 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..01875d782b57f 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-29 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..81c82c27a9176 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchHomepage'] --- import searchHomepageObj from './search_homepage.devdocs.json'; diff --git a/api_docs/search_indices.mdx b/api_docs/search_indices.mdx index 3d2f25a400883..34168f89362a6 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchIndices'] --- import searchIndicesObj from './search_indices.devdocs.json'; diff --git a/api_docs/search_inference_endpoints.mdx b/api_docs/search_inference_endpoints.mdx index f15f737461be9..880067105aa40 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-29 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..11f9d38b84f58 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-29 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..9a769f783a872 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-29 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..5ad06d1d871a2 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-29 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..a1ad9e8443082 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-29 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..7a7585d7f6cc8 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-29 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..ce13bb0c0f255 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-29 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..cc365736103c2 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-29 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..3a27fcc3ef778 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-29 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..c6bb6d935251c 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-29 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..24748178e20c7 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-29 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..0bd062c95b4fe 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-29 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..ca2de59b49cce 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-29 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..a36913156bfd6 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-29 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..a9ca9b751807b 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-29 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..ef2b059626944 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-29 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..1ee5237af92c0 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-29 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..81c96e40ae1ae 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-29 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..e21e0726714d7 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-29 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..ad8d152b80427 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-29 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..ddfd3254cd6a0 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-29 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..ae5bd1d8b8e7b 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-29 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..bbe2addd3235a 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-29 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..aadf2e54945fe 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-29 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..21ae7f2a0a8b9 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-29 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..c0fb56e2b4415 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-29 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..70ea44a5b54e1 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-29 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..ee682e771cd3e 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-29 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..aac22fcc3d72a 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-29 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..1d4f5be31e4d6 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-29 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..cf7b573376f24 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-29 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..47221077e8571 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-29 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..d53f7799ba24d 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-29 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..0ec70835ab6e6 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-29 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..7a113d4820f61 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-29 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..5dba909a8af17 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-29 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..298ed85fe74e0 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-29 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..ff8f002ad94c5 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-29 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..672856eb4ddd2 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-29 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..dfe12ab90299e 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-29 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..9080fa39b4721 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-29 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..d6d7c4b1112f4 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-29 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..e8481e89fad53 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-29 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..c49e00825f779 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-29 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..0de2af428ced6 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-29 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..5818791e9c649 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-29 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..e33967fce9626 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-29 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] --- import visualizationsObj from './visualizations.devdocs.json'; diff --git a/docs/developer/contributing/development-functional-tests.asciidoc b/docs/developer/contributing/development-functional-tests.asciidoc index 23d43480eb090..88163ebb6804b 100644 --- a/docs/developer/contributing/development-functional-tests.asciidoc +++ b/docs/developer/contributing/development-functional-tests.asciidoc @@ -203,7 +203,7 @@ Tests should run at the positive security boundary condition, meaning that they The functional UI tests now default to logging in with a user named `test_user` and the roles of this user can be changed dynamically without logging in and out. -In order to achieve this a new service was introduced called `createTestUserService` (see `test/common/services/security/test_user.ts`). The purpose of this test user service is to create roles defined in the test config files and setRoles() or restoreDefaults(). +In order to achieve this a new service was introduced called `createTestUserService` (see `packages/kbn-ftr-common-functional-ui-services/services/security/test_user.ts`). The purpose of this test user service is to create roles defined in the test config files and setRoles() or restoreDefaults(). An example of how to set the role like how its defined below: @@ -366,14 +366,14 @@ await testSubjects.click(‘containerButton’); ** `find.allByCssSelector()` **retry:**::: -// * Source: {kibana-blob}test/common/services/retry/retry.ts[test/common/services/retry/retry.ts] +// * Source: {kibana-blob}packages/kbn-ftr-common-functional-services/services/retry/retry.ts[packages/kbn-ftr-common-functional-services/services/retry/retry.ts] * Helpers for retrying operations * Popular methods: ** `retry.try(fn, onFailureBlock)` - Execute `fn` in a loop until it succeeds or the default timeout elapses. The optional `onFailureBlock` is executed before each retry attempt. ** `retry.tryForTime(ms, fn, onFailureBlock)` - Execute `fn` in a loop until it succeeds or `ms` milliseconds elapses. The optional `onFailureBlock` is executed before each retry attempt. **kibanaServer:**::: -// * Source: {kibana-blob}test/common/services/kibana_server/kibana_server.js[test/common/services/kibana_server/kibana_server.js] +// * Source: {kibana-blob}packages/kbn-ftr-common-functional-services/services/kibana_server/kibana_server.ts[packages/kbn-ftr-common-functional-services/services/kibana_server/kibana_server.ts] * Helpers for interacting with {kib}'s server * Commonly used methods: ** `kibanaServer.uiSettings.update()` @@ -381,7 +381,7 @@ await testSubjects.click(‘containerButton’); ** `kibanaServer.status.getOverallState()` **esArchiver:**::: -// * Source: {kibana-blob}test/common/services/es_archiver.ts[test/common/services/es_archiver.ts] +// * Source: {kibana-blob}packages/kbn-ftr-common-functional-services/services/es_archiver.ts[packages/kbn-ftr-common-functional-services/services/es_archiver.ts] * Load/unload archives created with the `esArchiver` * Popular methods: ** `esArchiver.load(path)` @@ -393,7 +393,7 @@ Full list of services that are used in functional tests can be found here: {kiba **Low-level utilities:**::: * es -// ** Source: {kibana-blob}test/common/services/es.ts[test/common/services/es.ts] +// ** Source: {kibana-blob}packages/kbn-ftr-common-functional-services/services/es.ts[packages/kbn-ftr-common-functional-services/services/es.ts] ** {es} client ** Higher level options: `kibanaServer.uiSettings` or `esArchiver` * remote 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/docs/setup/configuring-reporting.asciidoc b/docs/setup/configuring-reporting.asciidoc index 946ec1145d010..041012c8dba85 100644 --- a/docs/setup/configuring-reporting.asciidoc +++ b/docs/setup/configuring-reporting.asciidoc @@ -214,13 +214,13 @@ If using PNG/PDF {report-features}, make sure the {kib} server operating system If you are using RHEL operating systems, install the following packages: -* `ipa-gothic-fonts` * `xorg-x11-fonts-100dpi` * `xorg-x11-fonts-75dpi` * `xorg-x11-utils` * `xorg-x11-fonts-cyrillic` * `xorg-x11-fonts-Type1` * `xorg-x11-fonts-misc` +* `vlgothic-fonts` * `fontconfig` * `freetype` 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/kibana.info.serverless.yaml b/oas_docs/kibana.info.serverless.yaml index efc8955856de1..fca516d797f24 100644 --- a/oas_docs/kibana.info.serverless.yaml +++ b/oas_docs/kibana.info.serverless.yaml @@ -28,8 +28,8 @@ info: ``` version: "1.0.2" license: - name: Elastic License 2.0 - url: https://www.elastic.co/licensing/elastic-license + name: Attribution-NonCommercial-NoDerivatives 4.0 International + url: https://creativecommons.org/licenses/by-nc-nd/4.0/ contact: name: Kibana Team x-feedbackLink: diff --git a/oas_docs/kibana.info.yaml b/oas_docs/kibana.info.yaml index 13db5ef728833..40795333fcf44 100644 --- a/oas_docs/kibana.info.yaml +++ b/oas_docs/kibana.info.yaml @@ -26,8 +26,8 @@ info: For more information about the console, refer to [Run API requests](https://www.elastic.co/guide/en/kibana/current/console-kibana.html). version: '1.0.2' license: - name: Elastic License 2.0 - url: https://www.elastic.co/licensing/elastic-license + name: Attribution-NonCommercial-NoDerivatives 4.0 International + url: https://creativecommons.org/licenses/by-nc-nd/4.0/ contact: name: Kibana Team x-feedbackLink: 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 f7e0765267b29..8d81681f3789e 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -48,8 +48,8 @@ info: ``` license: - name: Elastic License 2.0 - url: 'https://www.elastic.co/licensing/elastic-license' + name: Attribution-NonCommercial-NoDerivatives 4.0 International + url: 'https://creativecommons.org/licenses/by-nc-nd/4.0/' title: Kibana Serverless APIs version: 1.0.2 x-feedbackLink: diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index a4bc05d9fb2e4..dfe69b9be3400 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -47,8 +47,8 @@ info: For more information about the console, refer to [Run API requests](https://www.elastic.co/guide/en/kibana/current/console-kibana.html). license: - name: Elastic License 2.0 - url: 'https://www.elastic.co/licensing/elastic-license' + name: Attribution-NonCommercial-NoDerivatives 4.0 International + url: 'https://creativecommons.org/licenses/by-nc-nd/4.0/' title: Kibana APIs version: 1.0.2 x-feedbackLink: diff --git a/package.json b/package.json index ce1f760416eb0..3bcbda6c44346 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", 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/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/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-ftr-common-functional-services/index.ts b/packages/kbn-ftr-common-functional-services/index.ts index 3cc6df44adf01..36d76c7e2ffd7 100644 --- a/packages/kbn-ftr-common-functional-services/index.ts +++ b/packages/kbn-ftr-common-functional-services/index.ts @@ -10,6 +10,7 @@ import { ProvidedType } from '@kbn/test'; export { services as commonFunctionalServices } from './services/all'; import { KibanaServerProvider } from './services/kibana_server'; +export { KibanaServerProvider } from './services/kibana_server'; export type KibanaServer = ProvidedType; export { RetryService } from './services/retry'; @@ -18,6 +19,7 @@ import { EsArchiverProvider } from './services/es_archiver'; export type EsArchiver = ProvidedType; import { EsProvider } from './services/es'; +export { EsProvider } from './services/es'; export type Es = ProvidedType; import { SupertestWithoutAuthProvider } from './services/supertest_without_auth'; @@ -29,3 +31,10 @@ import { SamlAuthProvider } from './services/saml_auth/saml_auth_provider'; export type SamlAuthProviderType = ProvidedType; export type { FtrProviderContext } from './services/ftr_provider_context'; +export { runSavedObjInfoSvc } from './services/saved_object_info'; + +export type { BsearchService, SendOptions } from './services/bsearch'; +export { SavedObjectInfoService } from './services/saved_object_info'; +export { DeploymentService } from './services/deployment'; +export { IndexPatternsService } from './services/index_patterns'; +export { RandomnessService } from './services/randomness'; diff --git a/packages/kbn-ftr-common-functional-services/services/all.ts b/packages/kbn-ftr-common-functional-services/services/all.ts index 49308faeb3dd0..c6c0fb792bb81 100644 --- a/packages/kbn-ftr-common-functional-services/services/all.ts +++ b/packages/kbn-ftr-common-functional-services/services/all.ts @@ -10,6 +10,13 @@ import { EsArchiverProvider } from './es_archiver'; import { EsProvider } from './es'; import { KibanaServerProvider } from './kibana_server'; import { RetryService } from './retry'; +import { BsearchService } from './bsearch'; +import { ConsoleProvider } from './console'; +import { DeploymentService } from './deployment'; +import { EsDeleteAllIndicesProvider } from './es_delete_all_indices'; +import { IndexPatternsService } from './index_patterns'; +import { SavedObjectInfoService } from './saved_object_info'; +import { RandomnessService } from './randomness'; import { SupertestWithoutAuthProvider } from './supertest_without_auth'; import { SamlAuthProvider } from './saml_auth'; @@ -18,6 +25,13 @@ export const services = { kibanaServer: KibanaServerProvider, esArchiver: EsArchiverProvider, retry: RetryService, + bsearch: BsearchService, + console: ConsoleProvider, + deployment: DeploymentService, + esDeleteAllIndices: EsDeleteAllIndicesProvider, + indexPatterns: IndexPatternsService, + savedObjectInfo: SavedObjectInfoService, + randomness: RandomnessService, supertestWithoutAuth: SupertestWithoutAuthProvider, samlAuth: SamlAuthProvider, }; diff --git a/test/common/services/bsearch.ts b/packages/kbn-ftr-common-functional-services/services/bsearch.ts similarity index 98% rename from test/common/services/bsearch.ts rename to packages/kbn-ftr-common-functional-services/services/bsearch.ts index 81063813cec5f..b36834dedbca5 100644 --- a/test/common/services/bsearch.ts +++ b/packages/kbn-ftr-common-functional-services/services/bsearch.ts @@ -12,7 +12,7 @@ import type SuperTest from 'supertest'; import type { IEsSearchResponse } from '@kbn/search-types'; import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; import { BFETCH_ROUTE_VERSION_LATEST } from '@kbn/bfetch-plugin/common'; -import { FtrService } from '../ftr_provider_context'; +import { FtrService } from './ftr_provider_context'; /** * Function copied from here: @@ -62,6 +62,7 @@ export interface SendOptions { * }); * expect(response).eql({ ... your value ... }); */ + export class BsearchService extends FtrService { private readonly retry = this.ctx.getService('retry'); diff --git a/test/api_integration/apis/console/helpers.ts b/packages/kbn-ftr-common-functional-services/services/console.ts similarity index 95% rename from test/api_integration/apis/console/helpers.ts rename to packages/kbn-ftr-common-functional-services/services/console.ts index cfd1365f212fa..1ca5128d83f7c 100644 --- a/test/api_integration/apis/console/helpers.ts +++ b/packages/kbn-ftr-common-functional-services/services/console.ts @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -import type { FtrProviderContext } from '../../ftr_provider_context'; +import type { FtrProviderContext } from './ftr_provider_context'; -export function helpers(getService: FtrProviderContext['getService']) { +export function ConsoleProvider({ getService }: FtrProviderContext) { const client = getService('es'); const createIndex = async (indexName: string) => { diff --git a/test/common/services/deployment.ts b/packages/kbn-ftr-common-functional-services/services/deployment.ts similarity index 96% rename from test/common/services/deployment.ts rename to packages/kbn-ftr-common-functional-services/services/deployment.ts index e61d6b360da19..28474a6bc60e2 100644 --- a/test/common/services/deployment.ts +++ b/packages/kbn-ftr-common-functional-services/services/deployment.ts @@ -11,7 +11,7 @@ import { Agent } from 'https'; import fetch from 'node-fetch'; import { getUrl } from '@kbn/test'; -import { FtrService } from '../ftr_provider_context'; +import { FtrService } from './ftr_provider_context'; export class DeploymentService extends FtrService { private readonly config = this.ctx.getService('config'); diff --git a/test/common/services/es_delete_all_indices.ts b/packages/kbn-ftr-common-functional-services/services/es_delete_all_indices.ts similarity index 97% rename from test/common/services/es_delete_all_indices.ts rename to packages/kbn-ftr-common-functional-services/services/es_delete_all_indices.ts index 5f0ecba2cbde8..cf3f93d9ef6aa 100644 --- a/test/common/services/es_delete_all_indices.ts +++ b/packages/kbn-ftr-common-functional-services/services/es_delete_all_indices.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrProviderContext } from './ftr_provider_context'; export function EsDeleteAllIndicesProvider({ getService }: FtrProviderContext) { const log = getService('log'); diff --git a/test/common/services/index_patterns.ts b/packages/kbn-ftr-common-functional-services/services/index_patterns.ts similarity index 91% rename from test/common/services/index_patterns.ts rename to packages/kbn-ftr-common-functional-services/services/index_patterns.ts index 3fe02863b8568..6113040b927b3 100644 --- a/test/common/services/index_patterns.ts +++ b/packages/kbn-ftr-common-functional-services/services/index_patterns.ts @@ -6,10 +6,11 @@ * Side Public License, v 1. */ -import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; +import type { DataViewSpec } from '@kbn/data-plugin/common'; + import { INITIAL_REST_VERSION } from '@kbn/data-views-plugin/server/constants'; -import { DataViewSpec } from '@kbn/data-plugin/common'; -import { FtrService } from '../ftr_provider_context'; +import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; +import { FtrService } from './ftr_provider_context'; export class IndexPatternsService extends FtrService { private readonly kibanaServer = this.ctx.getService('kibanaServer'); diff --git a/test/common/services/randomness.ts b/packages/kbn-ftr-common-functional-services/services/randomness.ts similarity index 97% rename from test/common/services/randomness.ts rename to packages/kbn-ftr-common-functional-services/services/randomness.ts index c799c34539f15..d3ea0c74ff5de 100644 --- a/test/common/services/randomness.ts +++ b/packages/kbn-ftr-common-functional-services/services/randomness.ts @@ -9,7 +9,7 @@ import Chance from 'chance'; import { ToolingLog } from '@kbn/tooling-log'; -import { FtrService } from '../ftr_provider_context'; +import { FtrService } from './ftr_provider_context'; let __CACHED_SEED__: number | undefined; function getSeed(log: ToolingLog) { diff --git a/test/common/services/saved_object_info/index.ts b/packages/kbn-ftr-common-functional-services/services/saved_object_info/index.ts similarity index 100% rename from test/common/services/saved_object_info/index.ts rename to packages/kbn-ftr-common-functional-services/services/saved_object_info/index.ts diff --git a/test/common/services/saved_object_info/saved_object_info.ts b/packages/kbn-ftr-common-functional-services/services/saved_object_info/saved_object_info.ts similarity index 97% rename from test/common/services/saved_object_info/saved_object_info.ts rename to packages/kbn-ftr-common-functional-services/services/saved_object_info/saved_object_info.ts index a1b98cbd408bf..289c730cac17a 100644 --- a/test/common/services/saved_object_info/saved_object_info.ts +++ b/packages/kbn-ftr-common-functional-services/services/saved_object_info/saved_object_info.ts @@ -13,7 +13,7 @@ import { flow, pipe } from 'fp-ts/function'; import * as TE from 'fp-ts/lib/TaskEither'; import * as T from 'fp-ts/lib/Task'; import { ToolingLog } from '@kbn/tooling-log'; -import { FtrService } from '../../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; import { print } from './utils'; const pluck = diff --git a/test/common/services/saved_object_info/saved_objects_info_svc.md b/packages/kbn-ftr-common-functional-services/services/saved_object_info/saved_objects_info_svc.md similarity index 100% rename from test/common/services/saved_object_info/saved_objects_info_svc.md rename to packages/kbn-ftr-common-functional-services/services/saved_object_info/saved_objects_info_svc.md diff --git a/test/common/services/saved_object_info/use_with_jq.md b/packages/kbn-ftr-common-functional-services/services/saved_object_info/use_with_jq.md similarity index 100% rename from test/common/services/saved_object_info/use_with_jq.md rename to packages/kbn-ftr-common-functional-services/services/saved_object_info/use_with_jq.md diff --git a/test/common/services/saved_object_info/utils.ts b/packages/kbn-ftr-common-functional-services/services/saved_object_info/utils.ts similarity index 100% rename from test/common/services/saved_object_info/utils.ts rename to packages/kbn-ftr-common-functional-services/services/saved_object_info/utils.ts diff --git a/packages/kbn-ftr-common-functional-services/tsconfig.json b/packages/kbn-ftr-common-functional-services/tsconfig.json index 56a442ad2f5a9..490eed5f7ac0e 100644 --- a/packages/kbn-ftr-common-functional-services/tsconfig.json +++ b/packages/kbn-ftr-common-functional-services/tsconfig.json @@ -16,8 +16,15 @@ "@kbn/es-archiver", "@kbn/test", "@kbn/expect", + "@kbn/search-types", + "@kbn/core-http-common", + "@kbn/bfetch-plugin", + "@kbn/data-plugin", + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", "@kbn/repo-info", "@kbn/es", + "@kbn/data-views-plugin" ], "exclude": [ "target/**/*", diff --git a/packages/kbn-ftr-common-functional-ui-services/index.ts b/packages/kbn-ftr-common-functional-ui-services/index.ts index cd383a03e5f5d..f5f5b9df5b8ae 100644 --- a/packages/kbn-ftr-common-functional-ui-services/index.ts +++ b/packages/kbn-ftr-common-functional-ui-services/index.ts @@ -22,3 +22,4 @@ export { } from './services/remote/network_profiles'; export type { TimeoutOpt } from './types'; export { TestSubjects } from './services/test_subjects'; +export { SecurityService } from './services/security'; diff --git a/packages/kbn-ftr-common-functional-ui-services/services/all.ts b/packages/kbn-ftr-common-functional-ui-services/services/all.ts index bffa7468e14ea..610697c69dfbf 100644 --- a/packages/kbn-ftr-common-functional-ui-services/services/all.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/all.ts @@ -12,6 +12,7 @@ import { FindProvider } from './find'; import { TestSubjects } from './test_subjects'; import { BrowserProvider } from './browser'; import { ToastsService } from './toasts'; +import { SecurityServiceProvider } from './security'; export const services = { retryOnStale: RetryOnStaleProvider, @@ -20,4 +21,5 @@ export const services = { testSubjects: TestSubjects, browser: BrowserProvider, toasts: ToastsService, + security: SecurityServiceProvider, }; diff --git a/packages/kbn-ftr-common-functional-ui-services/services/ftr_provider_context.ts b/packages/kbn-ftr-common-functional-ui-services/services/ftr_provider_context.ts index 992fe27059e45..6f589ac6d1bb4 100644 --- a/packages/kbn-ftr-common-functional-ui-services/services/ftr_provider_context.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/ftr_provider_context.ts @@ -7,12 +7,18 @@ */ import { GenericFtrProviderContext, GenericFtrService } from '@kbn/test'; -import { RetryService } from '@kbn/ftr-common-functional-services'; +import { + RetryService, + EsProvider, + KibanaServerProvider, +} from '@kbn/ftr-common-functional-services'; import { services as commonFunctionalUiServices } from './all'; const services = { ...commonFunctionalUiServices, retry: RetryService, + es: EsProvider, + kibanaServer: KibanaServerProvider, }; export type FtrProviderContext = GenericFtrProviderContext; diff --git a/test/common/services/console.ts b/packages/kbn-ftr-common-functional-ui-services/services/security/index.ts similarity index 57% rename from test/common/services/console.ts rename to packages/kbn-ftr-common-functional-ui-services/services/security/index.ts index a864952fa081b..308b2f8b075a0 100644 --- a/test/common/services/console.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/security/index.ts @@ -6,10 +6,4 @@ * Side Public License, v 1. */ -import type { FtrProviderContext } from '../ftr_provider_context'; -import { helpers } from '../../api_integration/apis/console/helpers'; -export function ConsoleProvider({ getService }: FtrProviderContext) { - return { - helpers: helpers(getService), - }; -} +export { SecurityService, SecurityServiceProvider } from './security'; diff --git a/test/common/services/security/role.ts b/packages/kbn-ftr-common-functional-ui-services/services/security/role.ts similarity index 100% rename from test/common/services/security/role.ts rename to packages/kbn-ftr-common-functional-ui-services/services/security/role.ts diff --git a/test/common/services/security/role_mappings.ts b/packages/kbn-ftr-common-functional-ui-services/services/security/role_mappings.ts similarity index 100% rename from test/common/services/security/role_mappings.ts rename to packages/kbn-ftr-common-functional-ui-services/services/security/role_mappings.ts diff --git a/test/common/services/security/security.ts b/packages/kbn-ftr-common-functional-ui-services/services/security/security.ts similarity index 95% rename from test/common/services/security/security.ts rename to packages/kbn-ftr-common-functional-ui-services/services/security/security.ts index a182f225f2388..5a5ff531acd5e 100644 --- a/test/common/services/security/security.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/security/security.ts @@ -9,7 +9,7 @@ import { Role } from './role'; import { User } from './user'; import { RoleMappings } from './role_mappings'; -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrProviderContext } from '../ftr_provider_context'; import { createTestUserService, TestUserSupertestProvider, TestUser } from './test_user'; import { createSystemIndicesUser } from './system_indices_user'; diff --git a/test/common/services/security/system_indices_user.ts b/packages/kbn-ftr-common-functional-ui-services/services/security/system_indices_user.ts similarity index 97% rename from test/common/services/security/system_indices_user.ts rename to packages/kbn-ftr-common-functional-ui-services/services/security/system_indices_user.ts index 52e166c645093..9d6016ebb17e9 100644 --- a/test/common/services/security/system_indices_user.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/security/system_indices_user.ts @@ -13,7 +13,7 @@ import { createEsClientForFtrConfig, createRemoteEsClientForFtrConfig, } from '@kbn/test'; -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrProviderContext } from '../ftr_provider_context'; const SYSTEM_INDICES_SUPERUSER_ROLE = 'system_indices_superuser'; diff --git a/test/common/services/security/test_user.ts b/packages/kbn-ftr-common-functional-ui-services/services/security/test_user.ts similarity index 96% rename from test/common/services/security/test_user.ts rename to packages/kbn-ftr-common-functional-ui-services/services/security/test_user.ts index f3012304a95bd..10a6da9f707dd 100644 --- a/test/common/services/security/test_user.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/security/test_user.ts @@ -9,10 +9,11 @@ import { format as formatUrl } from 'url'; import supertest from 'supertest'; -import { type Browser, TestSubjects } from '@kbn/ftr-common-functional-ui-services'; +import type { Browser } from '../browser'; +import type { TestSubjects } from '../test_subjects'; import { Role } from './role'; import { User } from './user'; -import { FtrService, FtrProviderContext } from '../../ftr_provider_context'; +import { FtrService, FtrProviderContext } from '../ftr_provider_context'; const TEST_USER_NAME = 'test_user'; const TEST_USER_PASSWORD = 'changeme'; diff --git a/test/common/services/security/user.ts b/packages/kbn-ftr-common-functional-ui-services/services/security/user.ts similarity index 100% rename from test/common/services/security/user.ts rename to packages/kbn-ftr-common-functional-ui-services/services/security/user.ts diff --git a/packages/kbn-investigation-shared/src/rest_specs/create_item.ts b/packages/kbn-investigation-shared/src/rest_specs/create_item.ts index c94673313a50c..a0696df4040d8 100644 --- a/packages/kbn-investigation-shared/src/rest_specs/create_item.ts +++ b/packages/kbn-investigation-shared/src/rest_specs/create_item.ts @@ -7,14 +7,14 @@ */ import * as t from 'io-ts'; -import { investigationItemsSchema } from '../schema'; +import { itemSchema } from '../schema'; import { investigationItemResponseSchema } from './investigation_item'; const createInvestigationItemParamsSchema = t.type({ path: t.type({ investigationId: t.string, }), - body: investigationItemsSchema, + body: itemSchema, }); const createInvestigationItemResponseSchema = investigationItemResponseSchema; diff --git a/packages/kbn-investigation-shared/src/rest_specs/index.ts b/packages/kbn-investigation-shared/src/rest_specs/index.ts index 50c1e300cd96a..9022266becf2a 100644 --- a/packages/kbn-investigation-shared/src/rest_specs/index.ts +++ b/packages/kbn-investigation-shared/src/rest_specs/index.ts @@ -17,6 +17,8 @@ export type * from './investigation_note'; 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'; @@ -29,3 +31,5 @@ export * from './investigation_note'; 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-investigation-shared/src/schema/investigation_item.ts b/packages/kbn-investigation-shared/src/schema/investigation_item.ts index 8689224960c52..717bf246e3590 100644 --- a/packages/kbn-investigation-shared/src/schema/investigation_item.ts +++ b/packages/kbn-investigation-shared/src/schema/investigation_item.ts @@ -8,20 +8,23 @@ import * as t from 'io-ts'; -const esqlItemSchema = t.type({ +const itemSchema = t.type({ title: t.string, - type: t.literal('esql'), - params: t.type({ - esql: t.string, - suggestion: t.any, - }), + type: t.string, + params: t.record(t.string, t.any), }); -const investigationItemsSchema = esqlItemSchema; // replace with union with various item types - const investigationItemSchema = t.intersection([ - t.type({ id: t.string, createdAt: t.number, createdBy: t.string }), - investigationItemsSchema, + t.type({ + id: t.string, + createdAt: t.number, + createdBy: t.string, + }), + itemSchema, ]); -export { investigationItemSchema, investigationItemsSchema, esqlItemSchema }; +type Item = t.TypeOf; +type InvestigationItem = t.TypeOf; + +export type { Item, InvestigationItem }; +export { investigationItemSchema, itemSchema }; 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/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/test/common/services/security/index.ts b/packages/kbn-object-versioning-utils/index.ts similarity index 85% rename from test/common/services/security/index.ts rename to packages/kbn-object-versioning-utils/index.ts index d34246c0c4411..650ac1804edec 100644 --- a/test/common/services/security/index.ts +++ b/packages/kbn-object-versioning-utils/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export { SecurityServiceProvider } from './security'; +export { validateVersion } from './lib/validate_version'; diff --git a/test/common/ftr_provider_context.ts b/packages/kbn-object-versioning-utils/jest.config.js similarity index 56% rename from test/common/ftr_provider_context.ts rename to packages/kbn-object-versioning-utils/jest.config.js index 6d21aedfe1d5e..2a127f38d568d 100644 --- a/test/common/ftr_provider_context.ts +++ b/packages/kbn-object-versioning-utils/jest.config.js @@ -6,9 +6,8 @@ * Side Public License, v 1. */ -import { GenericFtrProviderContext, GenericFtrService } from '@kbn/test'; - -import { services } from './services'; - -export type FtrProviderContext = GenericFtrProviderContext; -export class FtrService extends GenericFtrService {} +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-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/scripts/saved_objs_info.js b/scripts/saved_objs_info.js index f17a2897b83da..229565921ba90 100644 --- a/scripts/saved_objs_info.js +++ b/scripts/saved_objs_info.js @@ -7,4 +7,4 @@ */ require('../src/setup_node_env'); -require('@kbn/test-suites-src/common/services/saved_object_info').runSavedObjInfoSvc(); +require('@kbn/ftr-common-functional-services').runSavedObjInfoSvc(); 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/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 d7af8ac5ffed1..cc5bb94131a60 100644 --- a/src/plugins/data/common/search/expressions/esql.ts +++ b/src/plugins/data/common/search/expressions/esql.ts @@ -9,22 +9,37 @@ import type { KibanaRequest } from '@kbn/core/server'; import { esFieldTypeToKibanaFieldType } from '@kbn/field-types'; import { i18n } from '@kbn/i18n'; -import type { IKibanaSearchResponse, IKibanaSearchRequest } from '@kbn/search-types'; +import type { + IKibanaSearchRequest, + IKibanaSearchResponse, + ISearchGeneric, +} from '@kbn/search-types'; import type { Datatable, ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; import { getStartEndParams } from '@kbn/esql-utils'; - import { zipObject } from 'lodash'; -import { Observable, defer, throwError } from 'rxjs'; -import { catchError, map, switchMap, tap } from 'rxjs'; -import { buildEsQuery } from '@kbn/es-query'; -import type { ISearchGeneric } from '@kbn/search-types'; -import type { ESQLSearchResponse, ESQLSearchParams } from '@kbn/es-types'; +import { catchError, defer, map, Observable, switchMap, tap, throwError } from 'rxjs'; +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, KibanaContext, ESQL_TABLE_TYPE } from '..'; +import { + ESQL_ASYNC_SEARCH_STRATEGY, + ESQL_TABLE_TYPE, + isRunningResponse, + type KibanaContext, +} from '..'; import { UiSettingsCommon } from '../..'; +declare global { + interface Window { + /** + * Debug setting to make requests complete slower than normal. Only available on snapshots where `error_query` is enabled in ES. + */ + ELASTIC_ESQL_DELAY_SECONDS?: number; + } +} + type Input = KibanaContext | null; type Output = Observable; @@ -166,12 +181,31 @@ export const getEsqlFn = ({ getStartDependencies }: EsqlFnArguments) => { fieldName: timeField, }); - params.filter = buildEsQuery( - undefined, - input.query || [], - [...(input.filters ?? []), ...(timeFilter ? [timeFilter] : [])], - esQueryConfigs - ); + // Used for debugging & inside automated tests to simulate a slow query + const delayFilter: Filter | undefined = window.ELASTIC_ESQL_DELAY_SECONDS + ? { + meta: {}, + query: { + error_query: { + indices: [ + { + name: '*', + error_type: 'warning', + stall_time_seconds: window.ELASTIC_ESQL_DELAY_SECONDS, + }, + ], + }, + }, + } + : undefined; + + const filters = [ + ...(input.filters ?? []), + ...(timeFilter ? [timeFilter] : []), + ...(delayFilter ? [delayFilter] : []), + ]; + + params.filter = buildEsQuery(undefined, input.query || [], filters, esQueryConfigs); } let startTime = Date.now(); @@ -222,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/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/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/test/analytics/services/index.ts b/test/analytics/services/index.ts index 0c75df9bc2050..0d3465986249a 100644 --- a/test/analytics/services/index.ts +++ b/test/analytics/services/index.ts @@ -7,14 +7,17 @@ */ import { GenericFtrProviderContext } from '@kbn/test'; -import { services as commonServices } from '../../common/services'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; + import { services as functionalServices } from '../../functional/services'; import { pageObjects } from '../../functional/page_objects'; import { KibanaEBTServerProvider, KibanaEBTUIProvider } from './kibana_ebt'; export const services = { - ...commonServices, + ...commonFunctionalServices, + ...commonFunctionalUIServices, ...functionalServices, kibana_ebt_server: KibanaEBTServerProvider, kibana_ebt_ui: KibanaEBTUIProvider, diff --git a/test/api_integration/apis/console/autocomplete_entities.ts b/test/api_integration/apis/console/autocomplete_entities.ts index a410e50950cd1..1993ef1f7fe19 100644 --- a/test/api_integration/apis/console/autocomplete_entities.ts +++ b/test/api_integration/apis/console/autocomplete_entities.ts @@ -8,25 +8,11 @@ import expect from '@kbn/expect'; import type { FtrProviderContext } from '../../ftr_provider_context'; -import { helpers } from './helpers'; export default ({ getService }: FtrProviderContext) => { - const { - createIndex, - createAlias, - createLegacyTemplate, - createIndexTemplate, - createComponentTemplate, - createDataStream, - deleteIndex, - deleteAlias, - deleteLegacyTemplate, - deleteIndexTemplate, - deleteComponentTemplate, - deleteDataStream, - } = helpers(getService); - + const console = getService('console'); const supertest = getService('supertest'); + const sendRequest = (query: object) => supertest.get('/api/console/autocomplete_entities').query(query); @@ -40,22 +26,26 @@ export default ({ getService }: FtrProviderContext) => { before(async () => { // Setup indices, aliases, templates, and data streams - await createIndex(indexName); - await createAlias(indexName, aliasName); - await createComponentTemplate(componentTemplateName); - await createIndexTemplate(indexTemplateName, [dataStreamName], [componentTemplateName]); - await createDataStream(dataStreamName); - await createLegacyTemplate(legacyTemplateName); + await console.createIndex(indexName); + await console.createAlias(indexName, aliasName); + await console.createComponentTemplate(componentTemplateName); + await console.createIndexTemplate( + indexTemplateName, + [dataStreamName], + [componentTemplateName] + ); + await console.createDataStream(dataStreamName); + await console.createLegacyTemplate(legacyTemplateName); }); after(async () => { // Cleanup indices, aliases, templates, and data streams - await deleteAlias(indexName, aliasName); - await deleteIndex(indexName); - await deleteDataStream(dataStreamName); - await deleteIndexTemplate(indexTemplateName); - await deleteComponentTemplate(componentTemplateName); - await deleteLegacyTemplate(legacyTemplateName); + await console.deleteAlias(indexName, aliasName); + await console.deleteIndex(indexName); + await console.deleteDataStream(dataStreamName); + await console.deleteIndexTemplate(indexTemplateName); + await console.deleteComponentTemplate(componentTemplateName); + await console.deleteLegacyTemplate(legacyTemplateName); }); it('should not succeed if no settings are provided in query params', async () => { diff --git a/test/api_integration/services/index.ts b/test/api_integration/services/index.ts index 42a2616b781ac..f72460b7ffc5f 100644 --- a/test/api_integration/services/index.ts +++ b/test/api_integration/services/index.ts @@ -6,12 +6,13 @@ * Side Public License, v 1. */ -import { services as commonServices } from '../../common/services'; - +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; import { KibanaSupertestProvider, ElasticsearchSupertestProvider } from './supertest'; export const services = { - ...commonServices, + ...commonFunctionalServices, + ...commonFunctionalUIServices, supertest: KibanaSupertestProvider, esSupertest: ElasticsearchSupertestProvider, }; diff --git a/test/common/config.js b/test/common/config.js index 163703a693356..8f2d6b7e14018 100644 --- a/test/common/config.js +++ b/test/common/config.js @@ -9,7 +9,6 @@ import path from 'path'; import { format as formatUrl } from 'url'; import { esTestConfig, kbnTestConfig, kibanaServerTestUser } from '@kbn/test'; -import { services } from './services'; export default function () { const servers = { @@ -85,6 +84,5 @@ export default function () { })}`, ], }, - services, }; } diff --git a/test/common/services/index.ts b/test/common/services/index.ts index ccc786d4ccc6e..18855d9dee114 100644 --- a/test/common/services/index.ts +++ b/test/common/services/index.ts @@ -7,17 +7,26 @@ */ import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; -import { DeploymentService } from './deployment'; -import { RandomnessService } from './randomness'; -import { SecurityServiceProvider } from './security'; -import { EsDeleteAllIndicesProvider } from './es_delete_all_indices'; -import { SavedObjectInfoService } from './saved_object_info'; -import { IndexPatternsService } from './index_patterns'; -import { BsearchService } from './bsearch'; -import { ConsoleProvider } from './console'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; // pick only services that work for any FTR config, e.g. 'samlAuth' requires SAML setup in config file -const { es, esArchiver, kibanaServer, retry, supertestWithoutAuth } = commonFunctionalServices; +const { + es, + esArchiver, + kibanaServer, + retry, + supertestWithoutAuth, + deployment, + randomness, + esDeleteAllIndices, + savedObjectInfo, + indexPatterns, + bsearch, + console, +} = commonFunctionalServices; + +// pick what was there previously +const { security } = commonFunctionalUIServices; export const services = { es, @@ -25,12 +34,12 @@ export const services = { kibanaServer, retry, supertestWithoutAuth, - deployment: DeploymentService, - randomness: RandomnessService, - security: SecurityServiceProvider, - esDeleteAllIndices: EsDeleteAllIndicesProvider, - savedObjectInfo: SavedObjectInfoService, - indexPatterns: IndexPatternsService, - bsearch: BsearchService, - console: ConsoleProvider, + deployment, + randomness, + security, + esDeleteAllIndices, + savedObjectInfo, + indexPatterns, + bsearch, + console, }; 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/apps/discover/ftr_provider_context.d.ts b/test/functional/apps/discover/ftr_provider_context.d.ts index 5bf34af1bf9f3..b006a98a73d7c 100644 --- a/test/functional/apps/discover/ftr_provider_context.d.ts +++ b/test/functional/apps/discover/ftr_provider_context.d.ts @@ -7,7 +7,13 @@ */ import { GenericFtrProviderContext } from '@kbn/test'; -import { services } from '../../services'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { services as functionalServces } from '../../services'; import { pageObjects } from '../../page_objects'; +const services = { + ...functionalServces, + ...commonFunctionalServices, +}; + export type FtrProviderContext = GenericFtrProviderContext; diff --git a/test/functional/services/index.ts b/test/functional/services/index.ts index 83672889eff75..01df9b5fdcbbf 100644 --- a/test/functional/services/index.ts +++ b/test/functional/services/index.ts @@ -7,7 +7,7 @@ */ import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; -import { services as commonServiceProviders } from '../../common/services'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; import { AppsMenuService } from './apps_menu'; import { @@ -57,7 +57,7 @@ import { ESQLService } from './esql'; import { DataViewsService } from './data_views'; export const services = { - ...commonServiceProviders, + ...commonFunctionalServices, ...commonFunctionalUIServices, filterBar: FilterBarService, queryBar: QueryBarService, 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/health_gateway/services/index.ts b/test/health_gateway/services/index.ts index b9c44e227adae..5a89fb849f952 100644 --- a/test/health_gateway/services/index.ts +++ b/test/health_gateway/services/index.ts @@ -6,11 +6,13 @@ * Side Public License, v 1. */ -import { services as commonServices } from '../../common/services'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; import { HealthGatewayService } from './health_gateway'; export const services = { - ...commonServices, + ...commonFunctionalServices, + ...commonFunctionalUIServices, healthGateway: HealthGatewayService, }; 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/server_integration/config.base.js b/test/server_integration/config.base.js index 71006c258c423..61243595505eb 100644 --- a/test/server_integration/config.base.js +++ b/test/server_integration/config.base.js @@ -12,13 +12,15 @@ import { ElasticsearchSupertestProvider, } from './services'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; + export default async function ({ readConfigFile }) { const commonConfig = await readConfigFile(require.resolve('../common/config')); const functionalConfig = await readConfigFile(require.resolve('../functional/config.base.js')); return { services: { - ...commonConfig.get('services'), + ...commonFunctionalServices, supertest: createKibanaSupertestProvider(), supertestWithoutAuth: KibanaSupertestWithoutAuthProvider, esSupertest: ElasticsearchSupertestProvider, diff --git a/test/server_integration/services/types.d.ts b/test/server_integration/services/types.d.ts index 2df95f0297f90..204c0ae0106e5 100644 --- a/test/server_integration/services/types.d.ts +++ b/test/server_integration/services/types.d.ts @@ -7,7 +7,14 @@ */ import { GenericFtrProviderContext } from '@kbn/test'; -import { services as kibanaCommonServices } from '../../common/services'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; + +export const kibanaCommonServices = { + ...commonFunctionalServices, + ...commonFunctionalUIServices, +} as const; + import { services as kibanaApiIntegrationServices } from '../../api_integration/services'; export type FtrProviderContext = GenericFtrProviderContext< diff --git a/test/tsconfig.json b/test/tsconfig.json index b03067c0440ae..8b0d946bded62 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -47,8 +47,6 @@ "@kbn/controls-plugin", "@kbn/field-formats-plugin", "@kbn/axe-config", - "@kbn/dev-cli-runner", - "@kbn/dev-cli-errors", "@kbn/data-view-field-editor-plugin", "@kbn/data-views-plugin", "@kbn/guided-onboarding-plugin", @@ -71,12 +69,12 @@ "@kbn/links-plugin", "@kbn/ftr-common-functional-ui-services", "@kbn/monaco", - "@kbn/search-types", "@kbn/console-plugin", "@kbn/core-chrome-browser", "@kbn/default-nav-ml", "@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/schema/index.ts b/x-pack/packages/kbn-cloud-security-posture-common/jest.config.js similarity index 64% rename from x-pack/packages/kbn-cloud-security-posture-common/schema/index.ts rename to x-pack/packages/kbn-cloud-security-posture-common/jest.config.js index 981633d2a3fad..d6f06d2bcc21c 100644 --- a/x-pack/packages/kbn-cloud-security-posture-common/schema/index.ts +++ b/x-pack/packages/kbn-cloud-security-posture-common/jest.config.js @@ -5,4 +5,8 @@ * 2.0. */ -export { ruleStateAttributes, cspBenchmarkRuleMetadataSchema, rulesStates } from './rules'; +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/observability_solution/investigate/public/esql_widget/constants.ts b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/latest.ts similarity index 86% rename from x-pack/plugins/observability_solution/investigate/public/esql_widget/constants.ts rename to x-pack/packages/kbn-cloud-security-posture-common/schema/rules/latest.ts index 068d4b49fcf80..b56fab649ade5 100644 --- a/x-pack/plugins/observability_solution/investigate/public/esql_widget/constants.ts +++ b/x-pack/packages/kbn-cloud-security-posture-common/schema/rules/latest.ts @@ -5,4 +5,4 @@ * 2.0. */ -export const ESQL_WIDGET_NAME = 'esql'; +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/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/index.tsx b/x-pack/packages/kbn-cloud-security-posture-common/types/benchmark.ts similarity index 73% rename from x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/index.tsx rename to x-pack/packages/kbn-cloud-security-posture-common/types/benchmark.ts index 4297f7d35cd6c..ed661879558e7 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/index.tsx +++ b/x-pack/packages/kbn-cloud-security-posture-common/types/benchmark.ts @@ -4,5 +4,4 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -export { ReferenceLinePanel } from './reference_line_panel'; +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/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/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/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/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/components/schemas/new_package_policy.yaml b/x-pack/plugins/fleet/common/openapi/components/schemas/new_package_policy.yaml index 956f51a8016f5..ef22c197c5b40 100644 --- a/x-pack/plugins/fleet/common/openapi/components/schemas/new_package_policy.yaml +++ b/x-pack/plugins/fleet/common/openapi/components/schemas/new_package_policy.yaml @@ -47,6 +47,7 @@ properties: - enabled policy_id: type: string + nullable: true deprecated: true policy_ids: type: array diff --git a/x-pack/plugins/fleet/common/openapi/components/schemas/package_policy_request.yaml b/x-pack/plugins/fleet/common/openapi/components/schemas/package_policy_request.yaml index 7e820c75bf4c3..871bc8b6d1ae8 100644 --- a/x-pack/plugins/fleet/common/openapi/components/schemas/package_policy_request.yaml +++ b/x-pack/plugins/fleet/common/openapi/components/schemas/package_policy_request.yaml @@ -16,11 +16,17 @@ properties: type: string description: The package policy namespace. Leave blank to inherit the agent policy's namespace. example: 'customnamespace' + output_id: + type: string + description: Output ID to send package data to + example: 'output-id' + nullable: true policy_id: type: string description: Agent policy ID where that package policy will be added example: 'agent-policy-id' deprecated: true + nullable: true policy_ids: type: array items: 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/common/services/simplified_package_policy_helper.ts b/x-pack/plugins/fleet/common/services/simplified_package_policy_helper.ts index 8d616bf4cae11..14c7b3888f775 100644 --- a/x-pack/plugins/fleet/common/services/simplified_package_policy_helper.ts +++ b/x-pack/plugins/fleet/common/services/simplified_package_policy_helper.ts @@ -41,7 +41,7 @@ export type SimplifiedInputs = Record< export interface SimplifiedPackagePolicy { id?: string; - policy_id?: string; + policy_id?: string | null; policy_ids: string[]; output_id?: string; namespace: string; diff --git a/x-pack/plugins/fleet/common/types/models/package_policy.ts b/x-pack/plugins/fleet/common/types/models/package_policy.ts index a6db753d1a1ce..1e456f3e4d21d 100644 --- a/x-pack/plugins/fleet/common/types/models/package_policy.ts +++ b/x-pack/plugins/fleet/common/types/models/package_policy.ts @@ -78,8 +78,8 @@ export interface NewPackagePolicy { namespace?: string; enabled: boolean; is_managed?: boolean; - /** @deprecated */ - policy_id?: string; + /** @deprecated Nullable to allow user to clear existing policy id */ + policy_id?: string | null; policy_ids: string[]; // Nullable to allow user to reset to default outputs output_id?: string | null; diff --git a/x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts b/x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts index 8b74a3142fa97..4aa2e367e04ec 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts @@ -61,7 +61,7 @@ export type PostDeletePackagePoliciesResponse = Array<{ name?: string; success: boolean; package?: PackagePolicyPackage; - policy_id?: string; + policy_id?: string | null; policy_ids?: string[]; output_id?: string; // Support generic errors diff --git a/x-pack/plugins/fleet/cypress/tasks/integrations.ts b/x-pack/plugins/fleet/cypress/tasks/integrations.ts index ab640d8f26a0e..002aaadefa859 100644 --- a/x-pack/plugins/fleet/cypress/tasks/integrations.ts +++ b/x-pack/plugins/fleet/cypress/tasks/integrations.ts @@ -18,22 +18,18 @@ import { CONFIRM_MODAL } from '../screens/navigation'; import { request } from './common'; export const addIntegration = ({ useExistingPolicy } = { useExistingPolicy: false }) => { + cy.intercept('/api/fleet/agent_status?*').as('agentStatus'); + cy.getBySel(ADD_INTEGRATION_POLICY_BTN).click(); if (useExistingPolicy) { 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).click(); + cy.getBySel(CREATE_PACKAGE_POLICY_SAVE_BTN).should('be.enabled').click(); + // sometimes agent is assigned to default policy, sometimes not cy.getBySel(CONFIRM_MODAL.CONFIRM_BUTTON).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/components/confirm_deploy_modal.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/confirm_deploy_modal.test.tsx index acd3eca559937..1ac5e8c17cb5b 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/confirm_deploy_modal.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/confirm_deploy_modal.test.tsx @@ -55,4 +55,16 @@ describe('ConfirmDeployAgentPolicyModal', () => { 'Agent policies that will be updated to remove this integration policy:Agent policy 3' ); }); + + it('should render no agent policies message when not adding/removing agent policies', () => { + testRenderer = createFleetTestRendererMock(); + render({ + agentCount: 0, + agentPolicies: [], + agentPoliciesToRemove: [], + }); + const calloutText = renderResult.getByTestId('confirmNoPoliciesCallout').textContent; + expect(calloutText).toContain('No agent policies selected'); + expect(calloutText).toContain('This integration will not be added to any agent policies.'); + }); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/confirm_deploy_modal.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/confirm_deploy_modal.tsx index 9c6aa70ee1ac4..e7a1494fdc016 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/confirm_deploy_modal.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/confirm_deploy_modal.tsx @@ -27,7 +27,46 @@ export const ConfirmDeployAgentPolicyModal: React.FunctionComponent<{ agentPoliciesToAdd = [], agentPoliciesToRemove = [], }) => { - return ( + return agentPolicies.length === 0 && agentPoliciesToRemove.length === 0 ? ( + + } + onCancel={onCancel} + onConfirm={onConfirm} + cancelButtonText={ + + } + confirmButtonText={ + + } + buttonColor="primary" + > + +
+ +
+
+
+ ) : ( { + 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_agent_policy.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.test.tsx index 23a7ae4cc2fe4..dae4fee9d32af 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.test.tsx @@ -106,8 +106,6 @@ describe('step select agent policy', () => { await act(async () => { const select = renderResult.container.querySelector('[data-test-subj="agentPolicySelect"]'); expect((select as any)?.value).toEqual(''); - - expect(renderResult.getByText('At least one agent policy is required.')).toBeVisible(); }); }); @@ -179,8 +177,6 @@ describe('step select agent policy', () => { '[data-test-subj="agentPolicyMultiSelect"]' ); expect((select as any)?.value).toEqual(undefined); - - expect(renderResult.getByText('At least one agent policy is required.')).toBeVisible(); }); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.tsx index ecfd18ef9aac4..eb5eb9a34b448 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_agent_policy.tsx @@ -101,19 +101,23 @@ export const StepSelectAgentPolicy: React.FunctionComponent<{ updateAgentPolicies([]); } }; - if (isLoading || selectedPolicyIds.length === 0) { + if (isLoading || isFirstLoad) { return; } + const agentPolicyIds = agentPolicies.map((policy) => policy.id); const agentPoliciesHaveAllSelectedIds = selectedPolicyIds.every((id) => - agentPolicies.map((policy) => policy.id).includes(id) + agentPolicyIds.includes(id) ); - if (agentPolicies.length === 0 || !agentPoliciesHaveAllSelectedIds) { + if ( + (agentPolicies.length === 0 && selectedPolicyIds.length !== 0) || + !agentPoliciesHaveAllSelectedIds + ) { fetchAgentPolicyInfo(); } else if (agentPoliciesHaveAllSelectedIds && selectedPolicyIds.length < agentPolicies.length) { setSelectedAgentPolicyError(undefined); updateAgentPolicies(agentPolicies.filter((policy) => selectedPolicyIds.includes(policy.id))); } - }, [selectedPolicyIds, agentPolicies, updateAgentPolicies, isLoading]); + }, [selectedPolicyIds, agentPolicies, updateAgentPolicies, isLoading, isFirstLoad]); // Try to select default agent policy useEffect(() => { @@ -152,9 +156,11 @@ export const StepSelectAgentPolicy: React.FunctionComponent<{ // Bubble up any issues with agent policy selection useEffect(() => { - if (selectedPolicyIds.length > 0 && !selectedAgentPolicyError) { + if (!selectedAgentPolicyError) { setHasAgentPolicyError(false); - } else setHasAgentPolicyError(true); + } else { + setHasAgentPolicyError(true); + } }, [selectedAgentPolicyError, selectedPolicyIds, setHasAgentPolicyError]); const onChange = useCallback( @@ -237,16 +243,9 @@ export const StepSelectAgentPolicy: React.FunctionComponent<{ /> ) : null } - isInvalid={Boolean( - selectedPolicyIds.length === 0 || someNewAgentPoliciesHaveLimitedPackage - )} + isInvalid={Boolean(someNewAgentPoliciesHaveLimitedPackage)} error={ - selectedPolicyIds.length === 0 ? ( - - ) : someNewAgentPoliciesHaveLimitedPackage ? ( + someNewAgentPoliciesHaveLimitedPackage ? ( { + 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(); @@ -155,7 +169,7 @@ describe('StepSelectHosts', () => { ).toContain('Agent policy 1'); }); - it('should display dropdown without preselected value when Existing hosts selected with mulitple agent policies', () => { + it('should display dropdown without preselected value when Existing hosts selected with mulitple agent policies', async () => { (useGetAgentPolicies as jest.MockedFunction).mockReturnValue({ data: { items: [ @@ -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(); @@ -174,8 +192,9 @@ describe('StepSelectHosts', () => { fireEvent.click(renderResult.getByText('Existing hosts').closest('button')!); }); - waitFor(() => { - expect(renderResult.getByText('At least one agent policy is required.')).toBeInTheDocument(); + await act(async () => { + const select = renderResult.container.querySelector('[data-test-subj="agentPolicySelect"]'); + expect((select as any)?.value).toEqual(''); }); }); }); 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/hooks/navigation.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/hooks/navigation.tsx index ac0123d0845a7..8b9ca7886d236 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/hooks/navigation.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/hooks/navigation.tsx @@ -8,7 +8,8 @@ import { useCallback, useMemo, useEffect, useRef } from 'react'; import type { ApplicationStart } from '@kbn/core-application-browser'; -import { PLUGIN_ID } from '../../../../constants'; +import { PLUGIN_ID, INTEGRATIONS_PLUGIN_ID } from '../../../../constants'; +import { pkgKeyFromPackageInfo } from '../../../../services'; import { useStartServices, useLink, useIntraAppState } from '../../../../hooks'; import type { CreatePackagePolicyRouteState, @@ -86,10 +87,14 @@ export const useOnSaveNavigate = (params: UseOnSaveNavigateParams) => { if (!doOnSaveNavigation.current) { return; } - const packagePolicyPath = getPath('policy_details', { - policyId: packagePolicy.policy_ids[0], // TODO navigates to first policy - }); - + const hasNoAgentPolicies = packagePolicy.policy_ids.length === 0; + const packagePolicyPath = hasNoAgentPolicies + ? getPath('integration_details_policies', { + pkgkey: pkgKeyFromPackageInfo(packagePolicy.package!), + }) + : getPath('policy_details', { + policyId: packagePolicy.policy_ids[0], // TODO navigates to first policy + }); const [onSaveNavigateTo, onSaveQueryParams]: [ Parameters, CreatePackagePolicyRouteState['onSaveQueryParams'] @@ -97,7 +102,7 @@ export const useOnSaveNavigate = (params: UseOnSaveNavigateParams) => { ? [routeState.onSaveNavigateTo, routeState?.onSaveQueryParams] : [ [ - PLUGIN_ID, + hasNoAgentPolicies ? INTEGRATIONS_PLUGIN_ID : PLUGIN_ID, { path: packagePolicyPath, }, @@ -123,7 +128,15 @@ export const useOnSaveNavigate = (params: UseOnSaveNavigateParams) => { navigateToApp(...onSaveNavigateTo); } }, - [packagePolicy.policy_ids, getPath, navigateToApp, routeState, queryParamsPolicyId] + [ + packagePolicy.policy_ids, + packagePolicy.package, + getPath, + routeState?.onSaveNavigateTo, + routeState?.onSaveQueryParams, + queryParamsPolicyId, + navigateToApp, + ] ); return onSaveNavigate; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/form.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/form.tsx index 697731f744721..f624bd5c843af 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/form.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/form.tsx @@ -26,6 +26,7 @@ import { sendCreatePackagePolicy, sendBulkInstallPackages, sendGetPackagePolicies, + useMultipleAgentPolicies, } from '../../../../../hooks'; import { isVerificationError, packageToPackagePolicy } from '../../../../../services'; import { @@ -154,6 +155,8 @@ export function useOnSubmit({ const { notifications } = useStartServices(); const confirmForceInstall = useConfirmForceInstall(); const spaceSettings = useSpaceSettingsContext(); + const { canUseMultipleAgentPolicies } = useMultipleAgentPolicies(); + // only used to store the resulting package policy once saved const [savedPackagePolicy, setSavedPackagePolicy] = useState(); // Form state @@ -184,14 +187,10 @@ export function useOnSubmit({ if (isEqual(updatedAgentPolicies, agentPolicies)) { return; } - if (updatedAgentPolicies.length > 0) { - setAgentPolicies(updatedAgentPolicies); - if (packageInfo) { - setHasAgentPolicyError(false); - } - } else { - setHasAgentPolicyError(true); - setAgentPolicies([]); + + setAgentPolicies(updatedAgentPolicies); + if (packageInfo) { + setHasAgentPolicyError(false); } // eslint-disable-next-line no-console @@ -235,18 +234,17 @@ export function useOnSubmit({ ? validationHasErrors(newValidationResults) : false; const hasAgentPolicy = - newPackagePolicy.policy_ids.length > 0 && newPackagePolicy.policy_ids[0] !== ''; - if ( - hasPackage && - (hasAgentPolicy || selectedPolicyTab === SelectedPolicyTab.NEW) && - !hasValidationErrors - ) { + (newPackagePolicy.policy_ids.length > 0 && newPackagePolicy.policy_ids[0] !== '') || + selectedPolicyTab === SelectedPolicyTab.NEW; + const isOrphaningPolicy = + canUseMultipleAgentPolicies && newPackagePolicy.policy_ids.length === 0; + if (hasPackage && (hasAgentPolicy || isOrphaningPolicy) && !hasValidationErrors) { setFormState('VALID'); } else { setFormState('INVALID'); } }, - [packagePolicy, setFormState, updatePackagePolicyValidation, selectedPolicyTab] + [packagePolicy, updatePackagePolicyValidation, selectedPolicyTab, canUseMultipleAgentPolicies] ); // Initial loading of package info @@ -315,7 +313,8 @@ export function useOnSubmit({ return; } if ( - agentCount !== 0 && + (agentCount !== 0 || + (agentPolicies.length === 0 && selectedPolicyTab !== SelectedPolicyTab.NEW)) && !(isAgentlessIntegration(packageInfo) || isAgentlessPackagePolicy(packagePolicy)) && formState !== 'CONFIRM' ) { @@ -401,7 +400,7 @@ export function useOnSubmit({ setSavedPackagePolicy(data!.item); const promptForAgentEnrollment = - !(agentCount && agentPolicies.length > 0) && + (createdPolicy || (agentPolicies.length > 0 && !agentCount)) && !isAgentlessConfigured && hasFleetAddAgentsPrivileges; 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/create_package_policy_page/single_page_layout/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx index bfca5b75f78f5..7a8cfe4e956aa 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx @@ -498,7 +498,7 @@ export const CreatePackagePolicySinglePage: CreatePackagePolicyParams = ({ }> - {formState === 'CONFIRM' && agentPolicies.length > 0 && ( + {formState === 'CONFIRM' && ( { + 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.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/hooks/use_package_policy.tsx index bb1e2f10ad85e..49425e62e8a6b 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/hooks/use_package_policy.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/hooks/use_package_policy.tsx @@ -174,15 +174,17 @@ export function usePackagePolicyWithRelatedData( throw packagePolicyError; } - const { data, error: agentPolicyError } = await sendBulkGetAgentPolicies( - packagePolicyData!.item.policy_ids - ); + if (packagePolicyData!.item.policy_ids && packagePolicyData!.item.policy_ids.length > 0) { + const { data, error: agentPolicyError } = await sendBulkGetAgentPolicies( + packagePolicyData!.item.policy_ids + ); - if (agentPolicyError) { - throw agentPolicyError; - } + if (agentPolicyError) { + throw agentPolicyError; + } - setAgentPolicies(data?.items ?? []); + setAgentPolicies(data?.items ?? []); + } const { data: upgradePackagePolicyDryRunData, error: upgradePackagePolicyDryRunError } = await sendUpgradePackagePolicyDryRun([packagePolicyId]); 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 5acd854a76f04..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,13 +22,14 @@ 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; packageInfo?: PackageInfo; existingAgentPolicies: AgentPolicy[]; setHasAgentPolicyError: (hasError: boolean) => void; - updatePackagePolicy: (data: { policy_ids: string[] }) => void; + updatePackagePolicy: (fields: Partial) => void; agentPolicies: AgentPolicy[]; setAgentPolicies: (agentPolicies: AgentPolicy[]) => void; isLoadingData: boolean; @@ -96,20 +97,12 @@ export function usePackagePolicySteps({ if (!isLoadingData && isEqual(updatedAgentPolicies, agentPolicies)) { return; } - if (updatedAgentPolicies.length > 0) { - setAgentPolicies(updatedAgentPolicies); - updatePackagePolicy({ - policy_ids: updatedAgentPolicies.map((policy) => policy.id), - }); - if (packageInfo) { - setHasAgentPolicyError(false); - } - } else { - setHasAgentPolicyError(true); - setAgentPolicies([]); - updatePackagePolicy({ - policy_ids: [], - }); + setAgentPolicies(updatedAgentPolicies); + updatePackagePolicy({ + policy_ids: updatedAgentPolicies.map((policy) => policy.id), + }); + if (packageInfo) { + setHasAgentPolicyError(false); } // eslint-disable-next-line no-console @@ -150,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/edit_package_policy_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx index 8150a61b93fba..841c2184894f9 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx @@ -6,7 +6,6 @@ */ import React, { useState, useEffect, useCallback, useMemo, memo } from 'react'; -import { isEmpty } from 'lodash'; import { useRouteMatch } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -250,7 +249,10 @@ export const EditPackagePolicyForm = memo<{ return; } if ( - (agentCount !== 0 || agentPoliciesToAdd.length > 0 || agentPoliciesToRemove.length > 0) && + (agentCount !== 0 || + agentPolicies.length === 0 || + agentPoliciesToAdd.length > 0 || + agentPoliciesToRemove.length > 0) && !hasAgentlessAgentPolicy && formState !== 'CONFIRM' ) { @@ -485,7 +487,7 @@ export const EditPackagePolicyForm = memo<{ {isLoadingData ? ( - ) : loadingError || isEmpty(existingAgentPolicies) || !packageInfo ? ( + ) : loadingError || !packageInfo ? ( { // 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/components/status_badges.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/status_badges.tsx index af0bad093852e..44363d12088d1 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/status_badges.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/status_badges.tsx @@ -6,7 +6,7 @@ */ import { EuiFlexGroup, EuiHealth, EuiNotificationBadge, EuiFlexItem } from '@elastic/eui'; -import React, { memo, useMemo } from 'react'; +import React, { memo } from 'react'; import { AGENT_STATUSES, @@ -16,18 +16,11 @@ import { import type { SimplifiedAgentStatus } from '../../../../types'; export const AgentStatusBadges: React.FC<{ - showInactive?: boolean; agentStatus: { [k in SimplifiedAgentStatus]: number }; -}> = memo(({ agentStatus, showInactive }) => { - const agentStatuses = useMemo(() => { - return AGENT_STATUSES.filter((status) => - showInactive ? true : status !== 'inactive' && status !== 'unenrolled' - ); - }, [showInactive]); - +}> = memo(({ agentStatus }) => { return ( - {agentStatuses.map((status) => ( + {AGENT_STATUSES.map((status) => ( diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/table_header.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/table_header.tsx index a6375bec6a39a..bcac45801be05 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/table_header.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/table_header.tsx @@ -19,7 +19,6 @@ import type { SelectionMode } from './types'; export const AgentTableHeader: React.FunctionComponent<{ agentStatus?: { [k in SimplifiedAgentStatus]: number }; - showInactive: boolean; totalAgents: number; selectableAgents: number; managedAgentsOnCurrentPage: number; @@ -38,7 +37,6 @@ export const AgentTableHeader: React.FunctionComponent<{ setSelectionMode, selectedAgents, setSelectedAgents, - showInactive, clearFilters, isUsingFilter, }) => { @@ -69,9 +67,7 @@ export const AgentTableHeader: React.FunctionComponent<{ ) : null} - {agentStatus && ( - - )} + {agentStatus && } 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 84884569071ce..c1e1f83f49103 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 @@ -168,10 +168,6 @@ export const AgentListPage: React.FunctionComponent<{}> = () => { setSortOrder(sort!.direction); }; - const showInactive = useMemo(() => { - return selectedStatus.some((status) => status === 'inactive' || status === 'unenrolled'); - }, [selectedStatus]); - const renderActions = (agent: Agent) => { const agentPolicy = typeof agent.policy_id === 'string' ? agentPoliciesIndexedById[agent.policy_id] : undefined; @@ -435,7 +431,6 @@ export const AgentListPage: React.FunctionComponent<{}> = () => { {/* Agent total, bulk actions and status bar */} ( - - -   - - -); - export const PackagePoliciesPage = ({ name, version }: PackagePoliciesPanelProps) => { const { search } = useLocation(); const history = useHistory(); @@ -235,7 +224,7 @@ export const PackagePoliciesPage = ({ name, version }: PackagePoliciesPanelProps defaultMessage: 'Agent policies', }), truncateText: true, - render(id, { agentPolicies, packagePolicy }) { + render(ids, { agentPolicies, packagePolicy }) { return agentPolicies.length > 0 ? ( canShowMultiplePoliciesCell ? ( ) + ) : ids.length === 0 ? ( + + + ) : ( - + + +   + + ); }, }, @@ -282,7 +285,14 @@ export const PackagePoliciesPage = ({ name, version }: PackagePoliciesPanelProps }), render({ agentPolicies, packagePolicy }: InMemoryPackagePolicyAndAgentPolicy) { if (agentPolicies.length === 0) { - return null; + return ( + + + + ); } const agentPolicy = agentPolicies[0]; // TODO: handle multiple agent policies const canAddAgentsForPolicy = policyHasFleetServer(agentPolicy) diff --git a/x-pack/plugins/fleet/public/components/manage_agent_policies_modal.test.tsx b/x-pack/plugins/fleet/public/components/manage_agent_policies_modal.test.tsx index 50e930820767e..afb7df056cc41 100644 --- a/x-pack/plugins/fleet/public/components/manage_agent_policies_modal.test.tsx +++ b/x-pack/plugins/fleet/public/components/manage_agent_policies_modal.test.tsx @@ -151,16 +151,24 @@ describe('ManageAgentPoliciesModal', () => { }); }); - it('should display callout and disable confirm if policy is removed', async () => { + it('should display callout and allow to submit if all policies are removed', async () => { const results = render(); await act(async () => { results.getByTestId('comboBoxClearButton').click(); }); - expect(results.getByText('Confirm').getAttribute('disabled')).toBeDefined(); + expect(results.getByText('Confirm').getAttribute('disabled')).toBeNull(); expect(results.getByTestId('confirmRemovePoliciesCallout')).toBeInTheDocument(); expect(results.getByTestId('confirmRemovePoliciesCallout').textContent).toContain( 'Test policy will no longer use this integration.' ); + + await act(async () => { + results.getByText('Confirm').click(); + }); + expect(usePackagePolicyWithRelatedData('', {}).savePackagePolicy).toHaveBeenCalledWith({ + policy_id: undefined, + policy_ids: [], + }); }); }); diff --git a/x-pack/plugins/fleet/public/components/manage_agent_policies_modal.tsx b/x-pack/plugins/fleet/public/components/manage_agent_policies_modal.tsx index 26e9421ed86fe..7677ba4931346 100644 --- a/x-pack/plugins/fleet/public/components/manage_agent_policies_modal.tsx +++ b/x-pack/plugins/fleet/public/components/manage_agent_policies_modal.tsx @@ -70,6 +70,11 @@ export const ManageAgentPoliciesModal: React.FunctionComponent = ({ setIsSubmitting(true); const { error } = await savePackagePolicy({ policy_ids: selectedPolicyIds, + ...(selectedPolicyIds.length === 0 + ? { + policy_id: undefined, + } + : {}), }); setIsSubmitting(false); if (!error) { @@ -138,11 +143,7 @@ export const ManageAgentPoliciesModal: React.FunctionComponent = ({ /> } buttonColor="primary" - confirmButtonDisabled={ - selectedPolicyIds.length === 0 || - isSubmitting || - isEqual(initialPolicyIds, selectedPolicyIds) - } + confirmButtonDisabled={isSubmitting || isEqual(initialPolicyIds, selectedPolicyIds)} data-test-subj="manageAgentPoliciesModal" > diff --git a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.test.tsx b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.test.tsx index a41b3e265826a..90e680c2ff845 100644 --- a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.test.tsx +++ b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.test.tsx @@ -12,7 +12,7 @@ import { act, fireEvent } from '@testing-library/react'; import type { AgentPolicy, InMemoryPackagePolicy } from '../types'; import { createIntegrationsTestRendererMock } from '../mock'; -import { useMultipleAgentPolicies, useStartServices } from '../hooks'; +import { useMultipleAgentPolicies, useStartServices, useLink } from '../hooks'; import { PackagePolicyActionsMenu } from './package_policy_actions_menu'; @@ -203,10 +203,34 @@ describe('PackagePolicyActionsMenu', () => { const { utils } = renderMenu({ agentPolicies, packagePolicy }); await act(async () => { const editButton = utils.getByTestId('PackagePolicyActionsEditItem'); + expect(editButton).not.toHaveAttribute('disabled'); + expect(editButton).toHaveAttribute('href'); + expect(useLink().getHref as jest.Mock).toHaveBeenCalledWith('edit_integration', { + policyId: 'some-uuid1', + packagePolicyId: 'some-uuid2', + }); expect(editButton).toHaveAttribute( 'href', '/mock/app/fleet/policies/some-uuid1/edit-integration/some-uuid2' ); }); }); + + it('Should show Edit integration with correct href when there is no agent policy', async () => { + const packagePolicy = createMockPackagePolicy({ + policy_ids: [], + }); + const { utils } = renderMenu({ + agentPolicies: [], + packagePolicy, + }); + await act(async () => { + const editButton = utils.getByTestId('PackagePolicyActionsEditItem'); + expect(editButton).not.toHaveAttribute('disabled'); + expect(editButton).toHaveAttribute('href'); + expect(useLink().getHref as jest.Mock).toHaveBeenCalledWith('integration_policy_edit', { + packagePolicyId: 'some-uuid2', + }); + }); + }); }); diff --git a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx index 0eb0000af4fa4..fcebfcb2f2475 100644 --- a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx +++ b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx @@ -52,6 +52,7 @@ export const PackagePolicyActionsMenu: React.FunctionComponent<{ const isManaged = Boolean(packagePolicy.is_managed); const agentPolicyIsManaged = Boolean(agentPolicy?.is_managed); + const isOrphanedPolicy = !agentPolicy && packagePolicy.policy_ids.length === 0; const isAddAgentVisible = showAddAgent && agentPolicy && !agentPolicyIsManaged; @@ -92,12 +93,18 @@ export const PackagePolicyActionsMenu: React.FunctionComponent<{ : []), {}); diff --git a/x-pack/plugins/fleet/server/routes/package_policy/handlers.test.ts b/x-pack/plugins/fleet/server/routes/package_policy/handlers.test.ts index f42ed00360033..fbcf1ee80f206 100644 --- a/x-pack/plugins/fleet/server/routes/package_policy/handlers.test.ts +++ b/x-pack/plugins/fleet/server/routes/package_policy/handlers.test.ts @@ -20,14 +20,11 @@ import { } from '../../services'; import { createAppContextStartContractMock, xpackMocks } from '../../mocks'; import type { PackagePolicyClient, FleetRequestHandlerContext } from '../..'; -import type { - CreatePackagePolicyRequestSchema, - UpdatePackagePolicyRequestSchema, -} from '../../types/rest_spec'; +import type { UpdatePackagePolicyRequestSchema } from '../../types/rest_spec'; import type { AgentPolicy, FleetRequestHandler } from '../../types'; import type { PackagePolicy } from '../../types'; -import { createPackagePolicyHandler, getPackagePoliciesHandler } from './handlers'; +import { getPackagePoliciesHandler } from './handlers'; import { registerRoutes } from '.'; const packagePolicyServiceMock = packagePolicyService as jest.Mocked; @@ -170,59 +167,6 @@ describe('When calling package policy', () => { appContextService.stop(); }); - describe('Create api handler', () => { - const getCreateKibanaRequest = ( - newData?: typeof CreatePackagePolicyRequestSchema.body - ): KibanaRequest< - undefined, - typeof CreatePackagePolicyRequestSchema.query, - typeof CreatePackagePolicyRequestSchema.body - > => { - return httpServerMock.createKibanaRequest< - undefined, - typeof CreatePackagePolicyRequestSchema.query, - typeof CreatePackagePolicyRequestSchema.body - >({ - path: routeConfig.path, - method: 'post', - body: newData || {}, - query: { format: 'simplified' }, - }); - }; - - const newPolicy = { - name: 'endpoint-1', - description: 'desc', - enabled: true, - policy_ids: [], - inputs: [], - namespace: 'default', - package: { name: 'endpoint', title: 'Elastic Endpoint', version: '0.5.0' }, - }; - - beforeEach(() => { - jest.spyOn(licenseService, 'hasAtLeast').mockClear(); - // @ts-ignore - const postMock = routerMock.versioned.post.mock; - // @ts-ignore - routeConfig = postMock.calls.find(([{ path }]) => - path.startsWith(PACKAGE_POLICY_API_ROUTES.CREATE_PATTERN) - )!; - routeHandler = postMock.results[0].value.addVersion.mock.calls[0][1]; - }); - - it('should throw if no policy_id or policy_ids is provided', async () => { - const request = getCreateKibanaRequest(newPolicy as any); - await createPackagePolicyHandler(context, request as any, response); - expect(response.customError).toHaveBeenCalledWith({ - statusCode: 400, - body: { - message: 'Either policy_id or policy_ids must be provided', - }, - }); - }); - }); - describe('Update api handler', () => { const getUpdateKibanaRequest = ( newData?: typeof UpdatePackagePolicyRequestSchema.body diff --git a/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts b/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts index 5cc00ef014cde..3bc2f79d6afd7 100644 --- a/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts @@ -243,10 +243,6 @@ export const createPackagePolicyHandler: FleetRequestHandler< const spaceId = fleetContext.spaceId; try { - if (!newPolicy.policy_id && (!newPolicy.policy_ids || newPolicy.policy_ids.length === 0)) { - throw new PackagePolicyRequestError('Either policy_id or policy_ids must be provided'); - } - let newPackagePolicy: NewPackagePolicy; if (isSimplifiedCreatePackagePolicyRequest(newPolicy)) { if (!pkg) { @@ -390,7 +386,8 @@ export const updatePackagePolicyHandler: FleetRequestHandler< name: restOfBody.name ?? packagePolicy.name, description: restOfBody.description ?? packagePolicy.description, namespace: restOfBody.namespace ?? packagePolicy?.namespace, - policy_id: restOfBody.policy_id ?? packagePolicy.policy_id, + policy_id: + restOfBody.policy_id === undefined ? packagePolicy.policy_id : restOfBody.policy_id, enabled: 'enabled' in restOfBody ? restOfBody.enabled ?? packagePolicy.enabled @@ -406,10 +403,6 @@ export const updatePackagePolicyHandler: FleetRequestHandler< } newData.inputs = alignInputsAndStreams(newData.inputs); - if (newData.policy_ids && newData.policy_ids.length === 0) { - throw new PackagePolicyRequestError('At least one agent policy id must be provided'); - } - if ( newData.policy_ids && !isEmpty(packagePolicy.policy_ids) && 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.test.ts b/x-pack/plugins/fleet/server/services/package_policies/utils.test.ts index 311bfeb339f20..9d68dde10a13e 100644 --- a/x-pack/plugins/fleet/server/services/package_policies/utils.test.ts +++ b/x-pack/plugins/fleet/server/services/package_policies/utils.test.ts @@ -86,6 +86,19 @@ describe('Package Policy Utils', () => { ); }); + it('should throw if no enterprise license and no policy_ids is provided', async () => { + jest.spyOn(licenseService, 'hasAtLeast').mockReturnValue(false); + jest + .spyOn(appContextService, 'getExperimentalFeatures') + .mockReturnValue({ enableReusableIntegrationPolicies: true } as any); + + await expect( + preflightCheckPackagePolicy(soClient, { ...testPolicy, policy_ids: [] }) + ).rejects.toThrowError( + 'Reusable integration policies are only available with an Enterprise license' + ); + }); + it('should throw if enterprise license and multiple policy_ids is provided but no feature flag', async () => { jest.spyOn(licenseService, 'hasAtLeast').mockReturnValue(true); jest @@ -107,6 +120,16 @@ describe('Package Policy Utils', () => { ).resolves.not.toThrow(); }); + it('should not throw if enterprise license and no policy_ids is provided', async () => { + jest.spyOn(licenseService, 'hasAtLeast').mockReturnValue(true); + jest + .spyOn(appContextService, 'getExperimentalFeatures') + .mockReturnValue({ enableReusableIntegrationPolicies: true } as any); + await expect( + preflightCheckPackagePolicy(soClient, { ...testPolicy, policy_ids: [] }) + ).resolves.not.toThrow(); + }); + it('should throw if no valid license and output_id is provided', async () => { jest.spyOn(licenseService, 'hasAtLeast').mockReturnValue(false); 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 61ff380fec559..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, }; }; @@ -76,10 +37,11 @@ export async function preflightCheckPackagePolicy( soClient: SavedObjectsClientContract, packagePolicy: PackagePolicy | NewPackagePolicy ) { - // If package policy has multiple agent policies, check if they can be used + // If package policy has multiple agent policies IDs, or no agent policies (orphaned integration policy) + // check if user can use multiple agent policies feature const { canUseReusablePolicies, errorMessage: canUseMultipleAgentPoliciesErrorMessage } = canUseMultipleAgentPolicies(); - if ((packagePolicy.policy_ids ?? []).length > 1 && !canUseReusablePolicies) { + if (!canUseReusablePolicies && packagePolicy.policy_ids.length !== 1) { throw new PackagePolicyMultipleAgentPoliciesError(canUseMultipleAgentPoliciesErrorMessage); } diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index a53334c893fec..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, @@ -415,9 +414,16 @@ class PackagePolicyClientImpl implements PackagePolicyClient { } keepPolicyIdInSync(packagePolicy: NewPackagePolicy): void { + if (packagePolicy.policy_ids) { + if (packagePolicy.policy_ids.length === 0 && packagePolicy.policy_id !== undefined) { + packagePolicy.policy_id = null; + } + } else { + packagePolicy.policy_ids = []; + } if (packagePolicy.policy_id && !packagePolicy.policy_ids?.[0]) { packagePolicy.policy_ids = [packagePolicy.policy_id]; - } else if (!packagePolicy.policy_id) { + } else if (!packagePolicy.policy_id && packagePolicy.policy_ids[0]) { packagePolicy.policy_id = packagePolicy.policy_ids[0]; } } @@ -891,6 +897,8 @@ class PackagePolicyClientImpl implements PackagePolicyClient { } if (!oldPackagePolicy) { throw new PackagePolicyNotFoundError('Package policy not found'); + } else { + this.keepPolicyIdInSync(oldPackagePolicy); } if ( @@ -1021,16 +1029,19 @@ class PackagePolicyClientImpl implements PackagePolicyClient { } } } - // Bump revision of associated agent policy - logger.debug(`Bumping revision of associated agent policies ${packagePolicy.policy_ids}`); + + // Bump revision of all associated agent policies (old and new) + const associatedPolicyIds = new Set([...oldPackagePolicy.policy_ids, ...newPolicy.policy_ids]); + logger.debug(`Bumping revision of associated agent policies ${associatedPolicyIds}`); const bumpPromises = []; - for (const policyId of packagePolicy.policy_ids) { + for (const policyId of associatedPolicyIds) { bumpPromises.push( agentPolicyService.bumpRevision(soClient, esClient, policyId, { user: options?.user, }) ); } + const assetRemovePromise = removeOldAssets({ soClient, pkgName: newPolicy.package!.name, @@ -1060,6 +1071,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { error: Error | SavedObjectError; }>; }> { + const logger = appContextService.getLogger(); const savedObjectType = await getPackagePolicySavedObjectType(); for (const packagePolicy of packagePolicyUpdates) { auditLoggingService.writeCustomSoAuditLog({ @@ -1081,7 +1093,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient { const allSecretsToDelete: PolicySecretReference[] = []; const packageInfosandAssetsMap = await getPkgInfoAssetsMap({ - logger: appContextService.getLogger(), + logger, packageInfos: [...packageInfos.values()], savedObjectsClient: soClient, }); @@ -1103,6 +1115,8 @@ class PackagePolicyClientImpl implements PackagePolicyClient { const oldPackagePolicy = oldPackagePolicies.find((p) => p.id === id); if (!oldPackagePolicy) { throw new PackagePolicyNotFoundError('Package policy not found'); + } else { + this.keepPolicyIdInSync(oldPackagePolicy); } let secretReferences: PolicySecretReference[] | undefined; @@ -1188,10 +1202,13 @@ class PackagePolicyClientImpl implements PackagePolicyClient { policiesToUpdate ); - const agentPolicyIds = new Set(packagePolicyUpdates.flatMap((p) => p.policy_ids)); - - const bumpPromise = pMap(agentPolicyIds, async (agentPolicyId) => { - // Bump revision of associated agent policy + // Bump revision of all associated agent policies (old and new) + const associatedPolicyIds = new Set([ + ...packagePolicyUpdates.flatMap((p) => p.policy_ids), + ...oldPackagePolicies.flatMap((p) => p.policy_ids), + ]); + logger.debug(`Bumping revision of associated agent policies ${associatedPolicyIds}`); + const bumpPromise = pMap(associatedPolicyIds, async (agentPolicyId) => { await agentPolicyService.bumpRevision(soClient, esClient, agentPolicyId, { user: options?.user, }); @@ -1633,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, @@ -1787,16 +1797,6 @@ class PackagePolicyClientImpl implements PackagePolicyClient { })), } as NewPackagePolicyInput; }); - let agentPolicyId; - // fallback to first agent policy id in case no policy_id is specified, BWC with 8.0 - if (!newPolicy.policy_id && !newPolicy.policy_ids[0]) { - const { items: agentPolicies } = await agentPolicyService.list(soClient, { - perPage: 1, - }); - if (agentPolicies.length > 0) { - agentPolicyId = agentPolicies[0].id; - } - } newPackagePolicy = { ...newPP, name: newPolicy.name, @@ -1807,8 +1807,8 @@ class PackagePolicyClientImpl implements PackagePolicyClient { ...newPP.package!, experimental_data_stream_features: newPolicy.package?.experimental_data_stream_features, }, - policy_id: newPolicy.policy_id ?? agentPolicyId, - policy_ids: newPolicy.policy_ids ?? [agentPolicyId], + policy_id: newPolicy.policy_id ?? undefined, + policy_ids: newPolicy.policy_ids ?? undefined, output_id: newPolicy.output_id, inputs: newPolicy.inputs[0]?.streams ? newPolicy.inputs : inputs, vars: newPolicy.vars || newPP.vars, @@ -2592,7 +2592,7 @@ function _enforceFrozenVars( export interface NewPackagePolicyWithId extends NewPackagePolicy { id?: string; - policy_id?: string; + policy_id?: string | null; version?: string; } 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/types/models/package_policy.ts b/x-pack/plugins/fleet/server/types/models/package_policy.ts index c80cb45c84ff9..e105bc82b27db 100644 --- a/x-pack/plugins/fleet/server/types/models/package_policy.ts +++ b/x-pack/plugins/fleet/server/types/models/package_policy.ts @@ -96,7 +96,7 @@ const PackagePolicyBaseSchema = { name: schema.string(), description: schema.maybe(schema.string()), namespace: schema.maybe(PackagePolicyNamespaceSchema), - policy_id: schema.maybe(schema.string()), + policy_id: schema.nullable(schema.maybe(schema.string())), policy_ids: schema.maybe(schema.arrayOf(schema.string())), output_id: schema.nullable(schema.maybe(schema.string())), enabled: schema.boolean(), @@ -221,7 +221,7 @@ export const SimplifiedPackagePolicyPreconfiguredSchema = SimplifiedPackagePolic export const SimplifiedCreatePackagePolicyRequestBodySchema = SimplifiedPackagePolicyBaseSchema.extends({ - policy_id: schema.maybe(schema.string()), + policy_id: schema.nullable(schema.maybe(schema.string())), policy_ids: schema.maybe(schema.arrayOf(schema.string())), force: schema.maybe(schema.boolean()), package: schema.object({ diff --git a/x-pack/plugins/fleet/server/types/so_attributes.ts b/x-pack/plugins/fleet/server/types/so_attributes.ts index ef39759b206f5..1bb954cf990d2 100644 --- a/x-pack/plugins/fleet/server/types/so_attributes.ts +++ b/x-pack/plugins/fleet/server/types/so_attributes.ts @@ -119,7 +119,7 @@ export interface PackagePolicySOAttributes { created_at: string; created_by: string; inputs: PackagePolicyInput[]; - policy_id?: string; + policy_id?: string | null; policy_ids: string[]; // Nullable to allow user to reset to default outputs output_id?: string | null; 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/integration_assistant/__jest__/fixtures/ecs_mapping.ts b/x-pack/plugins/integration_assistant/__jest__/fixtures/ecs_mapping.ts index e0c2054a49e84..514012761e8d8 100644 --- a/x-pack/plugins/integration_assistant/__jest__/fixtures/ecs_mapping.ts +++ b/x-pack/plugins/integration_assistant/__jest__/fixtures/ecs_mapping.ts @@ -452,6 +452,8 @@ export const ecsTestState = { results: { test: 'testresults' }, samplesFormat: 'testsamplesFormat', ecsVersion: 'testversion', + chunkMapping: { test1: 'test1' }, + useFinalMapping: false, currentMapping: { test1: 'test1' }, lastExecutedChain: 'testchain', rawSamples: ['{"test1": "test1"}'], diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/duplicates.test.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/duplicates.test.ts index f3a51c80a5241..346947cd1a38a 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/duplicates.test.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/duplicates.test.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { FakeLLM } from '@langchain/core/utils/testing'; -import { handleDuplicates } from './duplicates'; -import type { EcsMappingState } from '../../types'; -import { ecsTestState } from '../../../__jest__/fixtures/ecs_mapping'; import { ActionsClientChatOpenAI, ActionsClientSimpleChatModel, } from '@kbn/langchain/server/language_models'; +import { FakeLLM } from '@langchain/core/utils/testing'; +import { ecsTestState } from '../../../__jest__/fixtures/ecs_mapping'; +import type { EcsMappingState } from '../../types'; +import { handleDuplicates } from './duplicates'; const model = new FakeLLM({ response: '{ "message": "ll callback later."}', diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/duplicates.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/duplicates.ts index 5c66168fc0bfe..2d59bd1c241d5 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/duplicates.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/duplicates.ts @@ -6,9 +6,9 @@ */ import { JsonOutputParser } from '@langchain/core/output_parsers'; -import type { EcsNodeParams } from './types'; import type { EcsMappingState } from '../../types'; import { ECS_DUPLICATES_PROMPT } from './prompts'; +import type { EcsNodeParams } from './types'; export async function handleDuplicates({ state, @@ -16,13 +16,18 @@ export async function handleDuplicates({ }: EcsNodeParams): Promise> { const outputParser = new JsonOutputParser(); const ecsDuplicatesGraph = ECS_DUPLICATES_PROMPT.pipe(model).pipe(outputParser); + const usesFinalMapping = state?.useFinalMapping; + const mapping = usesFinalMapping ? state.finalMapping : state.currentMapping; - const currentMapping = await ecsDuplicatesGraph.invoke({ + const result = await ecsDuplicatesGraph.invoke({ ecs: state.ecs, - current_mapping: JSON.stringify(state.currentMapping, null, 2), + current_mapping: JSON.stringify(mapping, null, 2), ex_answer: state.exAnswer, duplicate_fields: state.duplicateFields, }); - return { currentMapping, lastExecutedChain: 'duplicateFields' }; + return { + [usesFinalMapping ? 'finalMapping' : 'currentMapping']: result, + lastExecutedChain: 'duplicateFields', + }; } diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/graph.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/graph.ts index 86b0561a22e44..f9bc489607628 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/graph.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/graph.ts @@ -5,16 +5,16 @@ * 2.0. */ -import { END, START, StateGraph, Send } from '@langchain/langgraph'; +import { END, Send, START, StateGraph } from '@langchain/langgraph'; import type { EcsMappingState } from '../../types'; -import type { EcsGraphParams, EcsBaseNodeParams } from './types'; -import { modelInput, modelOutput, modelSubOutput } from './model'; import { handleDuplicates } from './duplicates'; import { handleInvalidEcs } from './invalid'; import { handleEcsMapping } from './mapping'; import { handleMissingKeys } from './missing'; -import { handleValidateMappings } from './validate'; +import { modelInput, modelMergedInputFromSubGraph, modelOutput, modelSubOutput } from './model'; import { graphState } from './state'; +import type { EcsBaseNodeParams, EcsGraphParams } from './types'; +import { handleValidateMappings } from './validate'; const handleCreateMappingChunks = async ({ state }: EcsBaseNodeParams) => { // Cherrypick a shallow copy of state to pass to subgraph @@ -44,7 +44,7 @@ function chainRouter({ state }: EcsBaseNodeParams): string { return 'invalidEcsFields'; } if (!state.finalized) { - return 'modelSubOutput'; + return 'modelOutput'; } return END; } @@ -69,7 +69,7 @@ async function getEcsSubGraph({ model }: EcsGraphParams) { duplicateFields: 'handleDuplicates', missingKeys: 'handleMissingKeys', invalidEcsFields: 'handleInvalidEcs', - modelSubOutput: 'modelSubOutput', + modelOutput: 'modelSubOutput', }) .addEdge('modelSubOutput', END); @@ -85,12 +85,29 @@ export async function getEcsGraph({ model }: EcsGraphParams) { }) .addNode('modelInput', (state: EcsMappingState) => modelInput({ state })) .addNode('modelOutput', (state: EcsMappingState) => modelOutput({ state })) + .addNode('handleValidation', (state: EcsMappingState) => handleValidateMappings({ state })) + .addNode('handleDuplicates', (state: EcsMappingState) => handleDuplicates({ state, model })) + .addNode('handleMissingKeys', (state: EcsMappingState) => handleMissingKeys({ state, model })) + .addNode('handleInvalidEcs', (state: EcsMappingState) => handleInvalidEcs({ state, model })) + .addNode('handleMergedSubGraphResponse', (state: EcsMappingState) => + modelMergedInputFromSubGraph({ state }) + ) .addNode('subGraph', subGraph) .addEdge(START, 'modelInput') - .addEdge('subGraph', 'modelOutput') + .addEdge('subGraph', 'handleMergedSubGraphResponse') + .addEdge('handleDuplicates', 'handleValidation') + .addEdge('handleMissingKeys', 'handleValidation') + .addEdge('handleInvalidEcs', 'handleValidation') + .addEdge('handleMergedSubGraphResponse', 'handleValidation') .addConditionalEdges('modelInput', (state: EcsMappingState) => handleCreateMappingChunks({ state }) ) + .addConditionalEdges('handleValidation', (state: EcsMappingState) => chainRouter({ state }), { + duplicateFields: 'handleDuplicates', + missingKeys: 'handleMissingKeys', + invalidEcsFields: 'handleInvalidEcs', + modelOutput: 'modelOutput', + }) .addEdge('modelOutput', END); const compiledEcsGraph = workflow.compile(); diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/invalid.test.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/invalid.test.ts index ad10aa5b030df..0986452d171a2 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/invalid.test.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/invalid.test.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { FakeLLM } from '@langchain/core/utils/testing'; -import { handleInvalidEcs } from './invalid'; -import type { EcsMappingState } from '../../types'; -import { ecsTestState } from '../../../__jest__/fixtures/ecs_mapping'; import { ActionsClientChatOpenAI, ActionsClientSimpleChatModel, } from '@kbn/langchain/server/language_models'; +import { FakeLLM } from '@langchain/core/utils/testing'; +import { ecsTestState } from '../../../__jest__/fixtures/ecs_mapping'; +import type { EcsMappingState } from '../../types'; +import { handleInvalidEcs } from './invalid'; const model = new FakeLLM({ response: '{ "message": "ll callback later."}', diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/invalid.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/invalid.ts index 4b050fac3ccf4..5440b5bc9b125 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/invalid.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/invalid.ts @@ -5,9 +5,9 @@ * 2.0. */ import { JsonOutputParser } from '@langchain/core/output_parsers'; -import type { EcsNodeParams } from './types'; import type { EcsMappingState } from '../../types'; import { ECS_INVALID_PROMPT } from './prompts'; +import type { EcsNodeParams } from './types'; export async function handleInvalidEcs({ state, @@ -15,14 +15,19 @@ export async function handleInvalidEcs({ }: EcsNodeParams): Promise> { const outputParser = new JsonOutputParser(); const ecsInvalidEcsGraph = ECS_INVALID_PROMPT.pipe(model).pipe(outputParser); + const usesFinalMapping = state?.useFinalMapping; + const mapping = usesFinalMapping ? state.finalMapping : state.currentMapping; - const currentMapping = await ecsInvalidEcsGraph.invoke({ + const result = await ecsInvalidEcsGraph.invoke({ ecs: state.ecs, - current_mapping: JSON.stringify(state.currentMapping, null, 2), + current_mapping: JSON.stringify(mapping, null, 2), ex_answer: state.exAnswer, combined_samples: state.combinedSamples, invalid_ecs_fields: state.invalidEcsFields, }); - return { currentMapping, lastExecutedChain: 'invalidEcs' }; + return { + [usesFinalMapping ? 'finalMapping' : 'currentMapping']: result, + lastExecutedChain: 'invalidEcs', + }; } diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/mapping.test.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/mapping.test.ts index 92954b83863bf..3e8bf31fc1ebb 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/mapping.test.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/mapping.test.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { FakeLLM } from '@langchain/core/utils/testing'; -import { handleEcsMapping } from './mapping'; -import type { EcsMappingState } from '../../types'; -import { ecsTestState } from '../../../__jest__/fixtures/ecs_mapping'; import { ActionsClientChatOpenAI, ActionsClientSimpleChatModel, } from '@kbn/langchain/server/language_models'; +import { FakeLLM } from '@langchain/core/utils/testing'; +import { ecsTestState } from '../../../__jest__/fixtures/ecs_mapping'; +import type { EcsMappingState } from '../../types'; +import { handleEcsMapping } from './mapping'; const model = new FakeLLM({ response: '{ "message": "ll callback later."}', diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/missing.test.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/missing.test.ts index 35fbc51bbb2e7..dc24226e54421 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/missing.test.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/missing.test.ts @@ -5,14 +5,14 @@ * 2.0. */ -import { FakeLLM } from '@langchain/core/utils/testing'; -import { handleMissingKeys } from './missing'; -import type { EcsMappingState } from '../../types'; -import { ecsTestState } from '../../../__jest__/fixtures/ecs_mapping'; import { ActionsClientChatOpenAI, ActionsClientSimpleChatModel, } from '@kbn/langchain/server/language_models'; +import { FakeLLM } from '@langchain/core/utils/testing'; +import { ecsTestState } from '../../../__jest__/fixtures/ecs_mapping'; +import type { EcsMappingState } from '../../types'; +import { handleMissingKeys } from './missing'; const model = new FakeLLM({ response: '{ "message": "ll callback later."}', diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/missing.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/missing.ts index 649c9a5d1facf..0c22af98a41bc 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/missing.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/missing.ts @@ -6,9 +6,9 @@ */ import { JsonOutputParser } from '@langchain/core/output_parsers'; -import { EcsNodeParams } from './types'; import { EcsMappingState } from '../../types'; import { ECS_MISSING_KEYS_PROMPT } from './prompts'; +import { EcsNodeParams } from './types'; export async function handleMissingKeys({ state, @@ -16,14 +16,19 @@ export async function handleMissingKeys({ }: EcsNodeParams): Promise> { const outputParser = new JsonOutputParser(); const ecsMissingGraph = ECS_MISSING_KEYS_PROMPT.pipe(model).pipe(outputParser); + const usesFinalMapping = state?.useFinalMapping; + const mapping = usesFinalMapping ? state.finalMapping : state.currentMapping; - const currentMapping = await ecsMissingGraph.invoke({ + const result = await ecsMissingGraph.invoke({ ecs: state.ecs, - current_mapping: JSON.stringify(state.currentMapping, null, 2), + current_mapping: JSON.stringify(mapping, null, 2), ex_answer: state.exAnswer, combined_samples: state.combinedSamples, missing_keys: state?.missingKeys, }); - return { currentMapping, lastExecutedChain: 'missingKeys' }; + return { + [usesFinalMapping ? 'finalMapping' : 'currentMapping']: result, + lastExecutedChain: 'missingKeys', + }; } diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/model.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/model.ts index 44508bca4ff1a..67dbc747152f5 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/model.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/model.ts @@ -4,17 +4,27 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import type { EcsMappingState } from '../../types'; import { prefixSamples } from '../../util/samples'; +import { mergeAndChunkSamples } from './chunk'; import { ECS_EXAMPLE_ANSWER, ECS_FIELDS } from './constants'; import { createPipeline } from './pipeline'; -import { mergeAndChunkSamples } from './chunk'; -import type { EcsMappingState } from '../../types'; import type { EcsBaseNodeParams } from './types'; export function modelSubOutput({ state }: EcsBaseNodeParams): Partial { return { - lastExecutedChain: 'ModelSubOutput', - finalMapping: state.currentMapping, + lastExecutedChain: 'modelSubOutput', + chunkMapping: state.currentMapping, + }; +} + +export function modelMergedInputFromSubGraph({ + state, +}: EcsBaseNodeParams): Partial { + return { + lastExecutedChain: 'modelMergedInputFromSubGraph', + useFinalMapping: true, + finalMapping: state.chunkMapping, }; } diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/pipeline.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/pipeline.ts index 35c1fb4d31f42..7a13572169540 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/pipeline.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/pipeline.ts @@ -163,7 +163,7 @@ function generateProcessors(ecsMapping: object, samples: object, basePath: strin export function createPipeline(state: EcsMappingState): IngestPipeline { const samples = JSON.parse(state.combinedSamples); - const processors = generateProcessors(state.currentMapping, samples); + const processors = generateProcessors(state.finalMapping, samples); // Retrieve all source field names from convert processors to populate single remove processor: const fieldsToRemove = processors .map((p: any) => p.convert?.field) diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/prompts.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/prompts.ts index 4e5e4794d5b8f..5df21295c8e29 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/prompts.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/prompts.ts @@ -166,10 +166,17 @@ Here is some context for you to reference for your task, read it carefully as yo {duplicate_fields} - + +Go through each ECS field in the above list of duplicate fields step by step and and modify the current mapping following this process: +1. For each duplicate ECS field there is 2 or more source fields that has target set to the same ECS field, identify which of these it is. +2. For each of the source fields that has the same target set, choose only one of them to have the target set to the ECS field, for the rest you should either find another matching ECS field or set the source to be null. +3. Make sure that all of the ECS fields mentioned in the duplicate fields above have been resolved and return the updated current mapping object. + To resolve the duplicate mappings, go through each key and value defined in the duplicate fields, and modify the current mapping step by step, and ensure they follow these guidelines: -- Multiple keys should not have the same value (ECS field it will be mapped to). If multiple keys do have the same value then always choose the best match for the ECS field, while the other duplicates should have their value changed to null. +- Only focus on ECS fields reported as duplicate fields, do not modify any other fields. +- For all fields that are marked duplicate, when the best target is choosen, remember to set the value of the source field to null. +- The value "target" should not have a null value, but rather the source object itself should be set to null, use the existing current mapping for reference. - Do not respond with anything except the updated current mapping JSON object enclosed with 3 backticks (\`). See example response below. diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/state.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/state.ts index 35a307f1de934..079f35a4cc1b8 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/state.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/state.ts @@ -16,7 +16,7 @@ export const graphState: StateGraphArgs['channels'] = { }, chunkSize: { value: (x: number, y?: number) => y ?? x, - default: () => 10, + default: () => 25, }, lastExecutedChain: { value: (x: string, y?: string) => y ?? x, @@ -58,10 +58,18 @@ export const graphState: StateGraphArgs['channels'] = { value: (x: object, y?: object) => y ?? x, default: () => ({}), }, - finalMapping: { + chunkMapping: { reducer: merge, default: () => ({}), }, + finalMapping: { + value: (x: object, y?: object) => y ?? x, + default: () => ({}), + }, + useFinalMapping: { + value: (x: boolean, y?: boolean) => y ?? x, + default: () => false, + }, currentPipeline: { value: (x: object, y?: object) => y ?? x, default: () => ({}), diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/validate.test.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/validate.test.ts index 052c0d6bf11b3..20074bc4f1047 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/validate.test.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/validate.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { findInvalidEcsFields, processMapping } from './validate'; +import { findDuplicateFields, findInvalidEcsFields, processMapping } from './validate'; describe('Testing ecs handler', () => { it('processMapping()', async () => { @@ -90,3 +90,35 @@ describe('findInvalidEcsFields', () => { expect(invalid.length).toBe(1); }); }); + +describe('findDuplicateFields', () => { + it('duplicates: samples with duplicates', async () => { + const finalMapping = { + teleport_log: { + audit: { + ei: null, + event: { + target: 'event.action', + confidence: 0.9, + type: 'string', + date_formats: [], + }, + uid: { + target: 'event.action', + confidence: 0.8, + type: 'string', + date_formats: [], + }, + }, + }, + }; + const samples = [ + '{"teleport_log":{"audit":{"ei":0,"event":"user.login","uid":"8c815e54-c83b-43d7-b578-2bcf5b6775fa","code":"T1000W","time":"2024-05-09T20:58:57.77Z","cluster_name":"teleport.ericbeahan.com","user":"root","success":false,"error":"invalid username, password or second factor","method":"local","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36","addr.remote":"136.32.177.60:52457"}}}', + '{"teleport_log":{"audit":{"ei":0,"event":"user.login","uid":"6bf237a0-2753-418d-b01b-2d82ebf42636","code":"T1000W","time":"2024-05-09T21:00:22.747Z","cluster_name":"teleport.ericbeahan.com","user":"teleport-admin","success":false,"error":"invalid username, password or second factor","method":"local","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36","addr.remote":"136.32.177.60:52818"}}}', + ]; + const duplicates = findDuplicateFields(samples, finalMapping); + expect(duplicates).toStrictEqual([ + "One or more samples have matching fields for ECS field 'event.action': teleport_log.audit.event, teleport_log.audit.uid", + ]); + }); +}); diff --git a/x-pack/plugins/integration_assistant/server/graphs/ecs/validate.ts b/x-pack/plugins/integration_assistant/server/graphs/ecs/validate.ts index 0a22ef4bc0fda..87005e3553e90 100644 --- a/x-pack/plugins/integration_assistant/server/graphs/ecs/validate.ts +++ b/x-pack/plugins/integration_assistant/server/graphs/ecs/validate.ts @@ -6,6 +6,7 @@ */ /* eslint-disable @typescript-eslint/no-explicit-any */ import { ECS_FULL } from '../../../common/ecs'; +import { mergeSamples } from '../../util/samples'; import { ECS_RESERVED } from './constants'; import type { EcsBaseNodeParams } from './types'; @@ -89,7 +90,7 @@ function getValueFromPath(obj: AnyObject, path: string[]): unknown { return path.reduce((acc, key) => (acc && acc[key] !== undefined ? acc[key] : null), obj); } -function findDuplicateFields(prefixedSamples: string[], ecsMapping: AnyObject): string[] { +export function findDuplicateFields(prefixedSamples: string[], ecsMapping: AnyObject): string[] { const parsedSamples = prefixedSamples.map((sample) => JSON.parse(sample)); const results: string[] = []; const output: Record = {}; @@ -148,9 +149,13 @@ export function findInvalidEcsFields(currentMapping: AnyObject): string[] { } export function handleValidateMappings({ state }: EcsBaseNodeParams): AnyObject { - const missingKeys = findMissingFields(state?.combinedSamples, state?.currentMapping); - const duplicateFields = findDuplicateFields(state?.prefixedSamples, state?.currentMapping); - const invalidEcsFields = findInvalidEcsFields(state?.currentMapping); + const usesFinalMapping = state?.useFinalMapping; + const mapping = usesFinalMapping ? state.finalMapping : state.currentMapping; + const samples = usesFinalMapping ? mergeSamples(state.prefixedSamples) : state.combinedSamples; + + const missingKeys = findMissingFields(samples, mapping); + const duplicateFields = findDuplicateFields(state?.prefixedSamples, mapping); + const invalidEcsFields = findInvalidEcsFields(mapping); return { missingKeys, duplicateFields, diff --git a/x-pack/plugins/integration_assistant/server/types.ts b/x-pack/plugins/integration_assistant/server/types.ts index d6fa5652c44b8..44af5afcd10e7 100644 --- a/x-pack/plugins/integration_assistant/server/types.ts +++ b/x-pack/plugins/integration_assistant/server/types.ts @@ -5,13 +5,13 @@ * 2.0. */ -import type { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugin/server'; import { - ActionsClientChatOpenAI, ActionsClientBedrockChatModel, - ActionsClientSimpleChatModel, + ActionsClientChatOpenAI, ActionsClientGeminiChatModel, + ActionsClientSimpleChatModel, } from '@kbn/langchain/server'; +import type { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugin/server'; import { SamplesFormat } from '../common'; export interface IntegrationAssistantPluginSetup { @@ -76,6 +76,8 @@ export interface EcsMappingState { finalized: boolean; currentMapping: object; finalMapping: object; + chunkMapping: object; + useFinalMapping: boolean; currentPipeline: object; duplicateFields: string[]; missingKeys: string[]; 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/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/common/util/group_color_utils.ts b/x-pack/plugins/ml/common/util/group_color_utils.ts index 3c2398a18684f..77d16b8aaad50 100644 --- a/x-pack/plugins/ml/common/util/group_color_utils.ts +++ b/x-pack/plugins/ml/common/util/group_color_utils.ts @@ -24,7 +24,7 @@ const COLORS = [ euiVars.euiColorPrimary, ]; -const colorMap: Record = {}; +const colorMap: Record = Object.create(null); export function tabColor(name: string): string { if (colorMap[name] === undefined) { 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/annotations_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 81% rename from x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_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 bd63354936703..a046f9c4ade2b 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_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 { AnnotationsPanel } from './annotations_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/lib/alerts/register_anomaly_detection_alert_type.ts b/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts index 93b6daac5081e..deb7c9d2cc657 100644 --- a/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts +++ b/x-pack/plugins/ml/server/lib/alerts/register_anomaly_detection_alert_type.ts @@ -255,7 +255,7 @@ export function registerAnomalyDetectionAlertType({ spaceId, rule, }: ExecutorOptions) => { - const fakeRequest = {} as KibanaRequest; + const fakeRequest = Object.create(null) as KibanaRequest; const alertingService = mlSharedServices.alertingServiceProvider( services.savedObjectsClient, fakeRequest diff --git a/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts b/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts index b311a637eb2d7..7d50f99a42128 100644 --- a/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts +++ b/x-pack/plugins/ml/server/lib/alerts/register_jobs_monitoring_rule_type.ts @@ -266,7 +266,7 @@ export function registerJobsMonitoringRuleType({ throw new AlertsClientError(); } - const fakeRequest = {} as KibanaRequest; + const fakeRequest = Object.create(null) as KibanaRequest; const { getTestsResults } = mlServicesProviders.jobsHealthServiceProvider( services.savedObjectsClient, fakeRequest, diff --git a/x-pack/plugins/ml/server/lib/capabilities/__mocks__/ml_capabilities.ts b/x-pack/plugins/ml/server/lib/capabilities/__mocks__/ml_capabilities.ts index ebc90c1f208ac..a27556faa6450 100644 --- a/x-pack/plugins/ml/server/lib/capabilities/__mocks__/ml_capabilities.ts +++ b/x-pack/plugins/ml/server/lib/capabilities/__mocks__/ml_capabilities.ts @@ -13,7 +13,7 @@ import { } from '../../../../common/types/capabilities'; export function getAdminCapabilities() { - const caps: any = {}; + const caps: any = Object.create(null); Object.keys(adminMlCapabilities).forEach((k) => { caps[k] = true; }); @@ -21,7 +21,7 @@ export function getAdminCapabilities() { } export function getUserCapabilities() { - const caps: any = {}; + const caps: any = Object.create(null); Object.keys(userMlCapabilities).forEach((k) => { caps[k] = true; }); diff --git a/x-pack/plugins/ml/server/models/calculate_model_memory_limit/calculate_model_memory_limit.ts b/x-pack/plugins/ml/server/models/calculate_model_memory_limit/calculate_model_memory_limit.ts index 868a1c5709224..c36e569a6eb3a 100644 --- a/x-pack/plugins/ml/server/models/calculate_model_memory_limit/calculate_model_memory_limit.ts +++ b/x-pack/plugins/ml/server/models/calculate_model_memory_limit/calculate_model_memory_limit.ts @@ -65,8 +65,8 @@ const cardinalityCheckProvider = (client: IScopedClusterClient) => { const { detectors, influencers, bucket_span: bucketSpan } = analysisConfig; - let overallCardinality = {}; - let maxBucketCardinality = {}; + let overallCardinality = Object.create(null); + let maxBucketCardinality = Object.create(null); // Get fields required for the model memory estimation const overallCardinalityFields: Set = detectors.reduce( diff --git a/x-pack/plugins/ml/server/models/data_frame_analytics/analytics_manager.ts b/x-pack/plugins/ml/server/models/data_frame_analytics/analytics_manager.ts index f959683b6ae88..4e112a2ff313b 100644 --- a/x-pack/plugins/ml/server/models/data_frame_analytics/analytics_manager.ts +++ b/x-pack/plugins/ml/server/models/data_frame_analytics/analytics_manager.ts @@ -228,7 +228,7 @@ export class AnalyticsManager { private async getInitialElementsModelRoot(modelId: string): Promise { const resultElements = []; const modelElements = []; - const details: any = {}; + const details: any = Object.create(null); let data: estypes.MlTrainedModelConfig | estypes.MlDataframeAnalyticsSummary | undefined; // fetch model data and create model elements data = this.findTrainedModel(modelId); @@ -296,7 +296,7 @@ export class AnalyticsManager { ): Promise { const resultElements = []; const modelElements = []; - const details: any = {}; + const details: any = Object.create(null); const data = this.findJob(jobId); const nextLinkId = data?.source?.index[0]; @@ -351,7 +351,7 @@ export class AnalyticsManager { try { await this.initData(); // Create first node for incoming analyticsId or modelId - let initialData: InitialElementsReturnType = {} as InitialElementsReturnType; + let initialData: InitialElementsReturnType = Object.create(null) as InitialElementsReturnType; const job = analyticsId === undefined ? undefined : this.findJob(analyticsId); if (analyticsId !== undefined && job !== undefined) { const jobCreateTime = job.create_time!; diff --git a/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts b/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts index 07eebe6aaa66a..d54976a37ecd1 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts +++ b/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts @@ -355,7 +355,7 @@ export class DataRecognizer { const jobs: ModuleJob[] = []; const datafeeds: ModuleDatafeed[] = []; - const kibana: KibanaObjects = {}; + const kibana: KibanaObjects = Object.create(null); // load all of the job configs if (isModule(module)) { const tempJobs: ModuleJob[] = module.jobs.map((j) => ({ @@ -595,7 +595,7 @@ export class DataRecognizer { } public async dataRecognizerJobsExist(moduleId: string): Promise { - const results = {} as JobExistResult; + const results = Object.create(null) as JobExistResult; // Load the module with the specified ID and check if the jobs // in the module have been created. @@ -851,7 +851,7 @@ export class DataRecognizer { start?: number, end?: number ): Promise<{ [key: string]: DatafeedResponse }> { - const results = {} as { [key: string]: DatafeedResponse }; + const results = Object.create(null) as { [key: string]: DatafeedResponse }; for (const datafeed of datafeeds) { results[datafeed.id] = await this._startDatafeed(datafeed, start, end); } @@ -957,7 +957,9 @@ export class DataRecognizer { // creates an empty results object, // listing each job/datafeed/savedObject with a save success boolean private _createResultsTemplate(moduleConfig: Module): DataRecognizerConfigResponse { - const results: DataRecognizerConfigResponse = {} as DataRecognizerConfigResponse; + const results: DataRecognizerConfigResponse = Object.create( + null + ) as DataRecognizerConfigResponse; const reducedConfig = { jobs: moduleConfig.jobs, datafeeds: moduleConfig.datafeeds, @@ -982,7 +984,7 @@ export class DataRecognizer { if (Array.isArray(reducedConfig[i])) { createResultsItems(reducedConfig[i] as any[], results, i); } else { - results[i] = {} as any; + results[i] = Object.create(null); Object.keys(reducedConfig[i]).forEach((k) => { createResultsItems((reducedConfig[i] as Module['kibana'])[k] as any[], results[i], k); }); @@ -1174,7 +1176,7 @@ export class DataRecognizer { ); if (!job.config.analysis_limits) { - job.config.analysis_limits = {} as AnalysisLimits; + job.config.analysis_limits = Object.create(null) as AnalysisLimits; } job.config.analysis_limits.model_memory_limit = modelMemoryLimit; @@ -1206,7 +1208,7 @@ export class DataRecognizer { // so set the jobs mml to be the max if (!job.config.analysis_limits) { - job.config.analysis_limits = {} as AnalysisLimits; + job.config.analysis_limits = Object.create(null) as AnalysisLimits; } job.config.analysis_limits.model_memory_limit = maxMml; diff --git a/x-pack/plugins/ml/server/models/data_visualizer/data_visualizer.ts b/x-pack/plugins/ml/server/models/data_visualizer/data_visualizer.ts index 720a39193b9a7..fa84a271e84bd 100644 --- a/x-pack/plugins/ml/server/models/data_visualizer/data_visualizer.ts +++ b/x-pack/plugins/ml/server/models/data_visualizer/data_visualizer.ts @@ -246,7 +246,7 @@ export class DataVisualizer { ): Promise { // Batch up fields by type, getting stats for multiple fields at a time. const batches: Field[][] = []; - const batchedFields: { [key: string]: Field[][] } = {}; + const batchedFields: { [key: string]: Field[][] } = Object.create(null); each(fields, (field) => { if (field.fieldName === undefined) { // undefined fieldName is used for a document count request. @@ -584,7 +584,7 @@ export class DataVisualizer { { maxRetries: 0 } ); - const buckets: { [key: string]: number } = {}; + const buckets: { [key: string]: number } = Object.create(null); const dataByTimeBucket: Array<{ key: string; doc_count: number }> = get( body, ['aggregations', 'eventRate', 'buckets'], @@ -628,7 +628,7 @@ export class DataVisualizer { () => (count += PERCENTILE_SPACING) ); - const aggs: { [key: string]: any } = {}; + const aggs: { [key: string]: any } = Object.create(null); fields.forEach((field, i) => { const safeFieldName = getSafeAggregationName(field.fieldName, i); aggs[`${safeFieldName}_field_stats`] = { @@ -757,7 +757,7 @@ export class DataVisualizer { const size = 0; const filterCriteria = buildBaseFilterCriteria(timeFieldName, earliestMs, latestMs, query); - const aggs: Aggs = {}; + const aggs: Aggs = Object.create(null); fields.forEach((field, i) => { const safeFieldName = getSafeAggregationName(field.fieldName, i); const top = { @@ -839,7 +839,7 @@ export class DataVisualizer { const size = 0; const filterCriteria = buildBaseFilterCriteria(timeFieldName, earliestMs, latestMs, query); - const aggs: Aggs = {}; + const aggs: Aggs = Object.create(null); fields.forEach((field, i) => { const safeFieldName = getSafeAggregationName(field.fieldName, i); aggs[`${safeFieldName}_field_stats`] = { @@ -910,7 +910,7 @@ export class DataVisualizer { const size = 0; const filterCriteria = buildBaseFilterCriteria(timeFieldName, earliestMs, latestMs, query); - const aggs: Aggs = {}; + const aggs: Aggs = Object.create(null); fields.forEach((field, i) => { const safeFieldName = getSafeAggregationName(field.fieldName, i); aggs[`${safeFieldName}_value_count`] = { diff --git a/x-pack/plugins/ml/server/models/fields_service/fields_service.ts b/x-pack/plugins/ml/server/models/fields_service/fields_service.ts index cba34e2cbb8e3..a7e1812888c2f 100644 --- a/x-pack/plugins/ml/server/models/fields_service/fields_service.ts +++ b/x-pack/plugins/ml/server/models/fields_service/fields_service.ts @@ -146,7 +146,7 @@ export function fieldsServiceProvider({ asCurrentUser }: IScopedClusterClient) { mustCriteria.push(query); } - const runtimeMappings: any = {}; + const runtimeMappings: any = Object.create(null); const aggs = fieldsToAgg.reduce( (obj, field) => { if ( diff --git a/x-pack/plugins/ml/server/models/filter/filter_manager.ts b/x-pack/plugins/ml/server/models/filter/filter_manager.ts index 84f5ae9d7e5a7..3aed4b80a792d 100644 --- a/x-pack/plugins/ml/server/models/filter/filter_manager.ts +++ b/x-pack/plugins/ml/server/models/filter/filter_manager.ts @@ -77,7 +77,7 @@ export class FilterManager { ]); // Build a map of filter_ids against jobs and detectors using that filter. - let filtersInUse: FiltersInUse = {}; + let filtersInUse: FiltersInUse = Object.create(null); if (results[JOBS] && (results[JOBS] as estypes.MlGetJobsResponse).jobs) { filtersInUse = this.buildFiltersInUse((results[JOBS] as estypes.MlGetJobsResponse).jobs); } @@ -136,7 +136,7 @@ export class FilterManager { buildFiltersInUse(jobsList: Job[]) { // Build a map of filter_ids against jobs and detectors using that filter. - const filtersInUse: FiltersInUse = {}; + const filtersInUse: FiltersInUse = Object.create(null); jobsList.forEach((job) => { const detectors = job.analysis_config.detectors; detectors.forEach((detector) => { diff --git a/x-pack/plugins/ml/server/models/job_audit_messages/job_audit_messages.ts b/x-pack/plugins/ml/server/models/job_audit_messages/job_audit_messages.ts index 43125551e8339..52f2f9b0cadae 100644 --- a/x-pack/plugins/ml/server/models/job_audit_messages/job_audit_messages.ts +++ b/x-pack/plugins/ml/server/models/job_audit_messages/job_audit_messages.ts @@ -89,7 +89,7 @@ export function jobAuditMessagesProvider( gte = `now-${from}`; } - let timeFilter = {}; + let timeFilter = Object.create(null); if (from !== null) { timeFilter = { range: { diff --git a/x-pack/plugins/ml/server/models/job_service/datafeeds.ts b/x-pack/plugins/ml/server/models/job_service/datafeeds.ts index 50400054a4e04..5c2c44c326c8c 100644 --- a/x-pack/plugins/ml/server/models/job_service/datafeeds.ts +++ b/x-pack/plugins/ml/server/models/job_service/datafeeds.ts @@ -41,7 +41,7 @@ export function datafeedsProvider(client: IScopedClusterClient, mlClient: MlClie return acc; }, {} as { [id: string]: boolean }); - const results: Results = {}; + const results: Results = Object.create(null); async function doStart(datafeedId: string): Promise<{ started: boolean; error?: string }> { if (doStartsCalled[datafeedId] === false) { @@ -114,7 +114,7 @@ export function datafeedsProvider(client: IScopedClusterClient, mlClient: MlClie } async function stopDatafeeds(datafeedIds: string[]) { - const results: Results = {}; + const results: Results = Object.create(null); for (const datafeedId of datafeedIds) { try { diff --git a/x-pack/plugins/ml/server/models/job_service/groups.ts b/x-pack/plugins/ml/server/models/job_service/groups.ts index cdb5d373393bb..06641fff9795f 100644 --- a/x-pack/plugins/ml/server/models/job_service/groups.ts +++ b/x-pack/plugins/ml/server/models/job_service/groups.ts @@ -22,8 +22,8 @@ export function groupsProvider(mlClient: MlClient) { const calMngr = new CalendarManager(mlClient); async function getAllGroups() { - const groups: { [id: string]: Group } = {}; - const jobIds: { [id: string]: undefined | null } = {}; + const groups: { [id: string]: Group } = Object.create(null); + const jobIds: { [id: string]: undefined | null } = Object.create(null); const [body, calendars] = await Promise.all([mlClient.getJobs(), calMngr.getAllCalendars()]); const { jobs } = body; @@ -70,7 +70,7 @@ export function groupsProvider(mlClient: MlClient) { } async function updateGroups(jobs: UpdateGroupsRequest['jobs']) { - const results: Results = {}; + const results: Results = Object.create(null); for (const job of jobs) { const { jobId, groups } = job; try { diff --git a/x-pack/plugins/ml/server/models/job_service/jobs.ts b/x-pack/plugins/ml/server/models/job_service/jobs.ts index d9cebc84bb742..7e29fe8966151 100644 --- a/x-pack/plugins/ml/server/models/job_service/jobs.ts +++ b/x-pack/plugins/ml/server/models/job_service/jobs.ts @@ -89,7 +89,7 @@ export function jobsProvider( deleteUserAnnotations = false, deleteAlertingRules = false ) { - const results: Results = {}; + const results: Results = Object.create(null); const datafeedIds = await getDatafeedIdsByJobId(); if (deleteAlertingRules && rulesClient) { @@ -149,7 +149,7 @@ export function jobsProvider( } async function closeJobs(jobIds: string[]) { - const results: Results = {}; + const results: Results = Object.create(null); for (const jobId of jobIds) { try { await mlClient.closeJob({ job_id: jobId }); @@ -185,7 +185,7 @@ export function jobsProvider( } async function resetJobs(jobIds: string[], deleteUserAnnotations = false) { - const results: ResetJobsResponse = {}; + const results: ResetJobsResponse = Object.create(null); for (const jobId of jobIds) { try { // @ts-expect-error @elastic-elasticsearch resetJob response incorrect, missing task @@ -229,7 +229,7 @@ export function jobsProvider( async function jobsSummary(jobIds: string[] = []) { const fullJobsList: CombinedJobWithStats[] = await createFullJobsList(); const fullJobsIds = fullJobsList.map((job) => job.job_id); - let auditMessagesByJob: { [id: string]: AuditMessage } = {}; + let auditMessagesByJob: { [id: string]: AuditMessage } = Object.create(null); // even if there are errors getting the audit messages, we still want to show the full list try { @@ -309,12 +309,12 @@ export function jobsProvider( async function jobsWithTimerange() { const fullJobsList = await createFullJobsList(); - const jobsMap: { [id: string]: string[] } = {}; + const jobsMap: { [id: string]: string[] } = Object.create(null); const jobs = fullJobsList.map((job) => { jobsMap[job.job_id] = job.groups || []; const hasDatafeed = isPopulatedObject(job.datafeed_config); - const timeRange: { to?: number; from?: number } = {}; + const timeRange: { to?: number; from?: number } = Object.create(null); const dataCounts = job.data_counts; if (dataCounts !== undefined) { @@ -378,9 +378,9 @@ export function jobsProvider( async function createFullJobsList(jobIds: string[] = []) { const jobs: CombinedJobWithStats[] = []; - const groups: { [jobId: string]: string[] } = {}; - const datafeeds: { [id: string]: DatafeedWithStats } = {}; - const calendarsByJobId: { [jobId: string]: string[] } = {}; + const groups: { [jobId: string]: string[] } = Object.create(null); + const datafeeds: { [id: string]: DatafeedWithStats } = Object.create(null); + const calendarsByJobId: { [jobId: string]: string[] } = Object.create(null); const globalCalendars: string[] = []; const jobIdsString = jobIds.join(); @@ -583,7 +583,7 @@ export function jobsProvider( jobIds: string[] = [], allSpaces: boolean = false ): Promise { - const results: JobsExistResponse = {}; + const results: JobsExistResponse = Object.create(null); for (const jobId of jobIds) { try { if (jobId === '') { @@ -669,7 +669,7 @@ export function jobsProvider( jobs: Array<{ job: Job; datafeed: Datafeed }>, authHeader: AuthorizationHeader ) { - const results: BulkCreateResults = {}; + const results: BulkCreateResults = Object.create(null); await Promise.all( jobs.map(async ({ job, datafeed }) => { results[job.job_id] = { job: { success: false }, datafeed: { success: false } }; diff --git a/x-pack/plugins/ml/server/models/job_service/new_job/line_chart.ts b/x-pack/plugins/ml/server/models/job_service/new_job/line_chart.ts index 6a439a3711c6d..d95808bef1bc0 100644 --- a/x-pack/plugins/ml/server/models/job_service/new_job/line_chart.ts +++ b/x-pack/plugins/ml/server/models/job_service/new_job/line_chart.ts @@ -69,7 +69,7 @@ export function newJobLineChartProvider({ asCurrentUser }: IScopedClusterClient) function processSearchResults(resp: any, fields: string[]): ProcessedResults { const aggregationsByTime = get(resp, ['aggregations', 'times', 'buckets'], []); - const tempResults: Record = {}; + const tempResults: Record = Object.create(null); fields.forEach((f, i) => (tempResults[i] = [])); aggregationsByTime.forEach((dataForTime: any) => { @@ -166,7 +166,10 @@ function getSearchJsonFromConfig( json.body.query = query; - const aggs: Record> = {}; + const aggs: Record< + number, + Record + > = Object.create(null); aggFieldNamePairs.forEach(({ agg, field }, i) => { if (field !== null && field !== EVENT_RATE_FIELD_ID) { diff --git a/x-pack/plugins/ml/server/models/job_service/new_job/population_chart.ts b/x-pack/plugins/ml/server/models/job_service/new_job/population_chart.ts index 03daf69a3813a..de450ea697ea8 100644 --- a/x-pack/plugins/ml/server/models/job_service/new_job/population_chart.ts +++ b/x-pack/plugins/ml/server/models/job_service/new_job/population_chart.ts @@ -75,7 +75,7 @@ export function newJobPopulationChartProvider({ asCurrentUser }: IScopedClusterC function processSearchResults(resp: any, fields: string[]): ProcessedResults { const aggregationsByTime = get(resp, ['aggregations', 'times', 'buckets'], []); - const tempResults: Record = {}; + const tempResults: Record = Object.create(null); fields.forEach((f, i) => (tempResults[i] = [])); aggregationsByTime.forEach((dataForTime: any) => { @@ -188,7 +188,7 @@ function getPopulationSearchJsonFromConfig( json.body.query = query; - const aggs: any = {}; + const aggs: any = Object.create(null); aggFieldNamePairs.forEach(({ agg, field, by }, i) => { if (field === EVENT_RATE_FIELD_ID) { diff --git a/x-pack/plugins/ml/server/models/job_service/new_job_caps/field_service.ts b/x-pack/plugins/ml/server/models/job_service/new_job_caps/field_service.ts index 6cfd847403852..74065222a529d 100644 --- a/x-pack/plugins/ml/server/models/job_service/new_job_caps/field_service.ts +++ b/x-pack/plugins/ml/server/models/job_service/new_job_caps/field_service.ts @@ -125,7 +125,7 @@ class FieldsService { // the _indexPattern will be replaced with a comma separated list // of index patterns from all of the rollup jobs public async getData(includeNested: boolean = false): Promise { - let rollupFields: RollupFields = {}; + let rollupFields: RollupFields = Object.create(null); if (this._isRollup) { const rollupService = await rollupServiceProvider( @@ -159,7 +159,7 @@ class FieldsService { function combineAllRollupFields( rollupConfigs: estypes.RollupGetRollupCapsRollupCapabilitySummary[] ): RollupFields { - const rollupFields: RollupFields = {}; + const rollupFields: RollupFields = Object.create(null); rollupConfigs.forEach((conf) => { Object.keys(conf.fields).forEach((fieldName) => { if (rollupFields[fieldName] === undefined) { diff --git a/x-pack/plugins/ml/server/models/job_validation/job_validation.test.ts b/x-pack/plugins/ml/server/models/job_validation/job_validation.test.ts index f31f708100d4e..98fb5ce52e240 100644 --- a/x-pack/plugins/ml/server/models/job_validation/job_validation.test.ts +++ b/x-pack/plugins/ml/server/models/job_validation/job_validation.test.ts @@ -23,7 +23,7 @@ callAs.search.mockResponse({ hits: { total: { value: 1, relation: ES_CLIENT_TOTAL_HITS_RELATION.EQ } }, }); -const authHeader: AuthorizationHeader = {}; +const authHeader: AuthorizationHeader = Object.create(null); const mlClusterClient = { asCurrentUser: callAs, diff --git a/x-pack/plugins/ml/server/models/results_service/anomaly_charts.ts b/x-pack/plugins/ml/server/models/results_service/anomaly_charts.ts index 8b6f1d1fa0494..8d14417a1d383 100644 --- a/x-pack/plugins/ml/server/models/results_service/anomaly_charts.ts +++ b/x-pack/plugins/ml/server/models/results_service/anomaly_charts.ts @@ -227,7 +227,7 @@ export function anomalyChartsDataProvider(mlClient: MlClient, client: IScopedClu esSearchRequest.query!.bool!.minimum_should_match = shouldCriteria.length / 2; } - esSearchRequest.aggs!.byTime.aggs = {}; + esSearchRequest.aggs!.byTime.aggs = Object.create(null); if (metricFieldName !== undefined && metricFieldName !== '' && metricFunction) { const metricAgg: any = { @@ -258,7 +258,7 @@ export function anomalyChartsDataProvider(mlClient: MlClient, client: IScopedClu } esSearchRequest.aggs!.byTime.aggs = tempAggs; } else { - esSearchRequest.aggs!.byTime.aggs.metric = metricAgg; + esSearchRequest.aggs!.byTime.aggs!.metric = metricAgg; } } else { // if metricFieldName is not defined, it's probably a variation of the non zero count function @@ -465,9 +465,9 @@ export function anomalyChartsDataProvider(mlClient: MlClient, client: IScopedClu return { records: [], errors: undefined }; } // Aggregate by job, detector, and analysis fields (partition, by, over). - const aggregatedData: Record = {}; + const aggregatedData: Record = Object.create(null); - const jobsErrorMessage: Record = {}; + const jobsErrorMessage: Record = Object.create(null); each(anomalyRecords, (record) => { // Check if we can plot a chart for this record, depending on whether the source data // is chartable, and if model plot is enabled for the job. @@ -516,13 +516,13 @@ export function anomalyChartsDataProvider(mlClient: MlClient, client: IScopedClu } const jobId = record.job_id; if (aggregatedData[jobId] === undefined) { - aggregatedData[jobId] = {}; + aggregatedData[jobId] = Object.create(null); } const detectorsForJob = aggregatedData[jobId]; const detectorIndex = record.detector_index; if (detectorsForJob[detectorIndex] === undefined) { - detectorsForJob[detectorIndex] = {}; + detectorsForJob[detectorIndex] = Object.create(null); } // TODO - work out how best to display results from detectors with just an over field. @@ -534,11 +534,11 @@ export function anomalyChartsDataProvider(mlClient: MlClient, client: IScopedClu const groupsForDetector = detectorsForJob[detectorIndex]; if (groupsForDetector[firstFieldName] === undefined) { - groupsForDetector[firstFieldName] = {}; + groupsForDetector[firstFieldName] = Object.create(null); } const valuesForGroup: Record = groupsForDetector[firstFieldName]; if (valuesForGroup[firstFieldValue] === undefined) { - valuesForGroup[firstFieldValue] = {}; + valuesForGroup[firstFieldValue] = Object.create(null); } const dataForGroupValue = valuesForGroup[firstFieldValue]; @@ -568,12 +568,12 @@ export function anomalyChartsDataProvider(mlClient: MlClient, client: IScopedClu if (secondFieldName !== undefined && secondFieldValue !== undefined) { if (dataForGroupValue[secondFieldName] === undefined) { - dataForGroupValue[secondFieldName] = {}; + dataForGroupValue[secondFieldName] = Object.create(null); } const splitsForGroup = dataForGroupValue[secondFieldName]; if (splitsForGroup[secondFieldValue] === undefined) { - splitsForGroup[secondFieldValue] = {}; + splitsForGroup[secondFieldValue] = Object.create(null); } const dataForSplitValue = splitsForGroup[secondFieldValue]; @@ -604,7 +604,7 @@ export function anomalyChartsDataProvider(mlClient: MlClient, client: IScopedClu }); // Group job id by error message instead of by job: - const errorMessages: Record> | undefined = {}; + const errorMessages: Record> = Object.create(null); Object.keys(jobsErrorMessage).forEach((jobId) => { const msg = jobsErrorMessage[jobId]; if (errorMessages[msg] === undefined) { @@ -907,13 +907,13 @@ export function anomalyChartsDataProvider(mlClient: MlClient, client: IScopedClu handleError = (errorMsg: string, jobId: string) => { // Group the jobIds by the type of error message if (!errorMessages) { - errorMessages = {}; + errorMessages = Object.create(null); } - if (errorMessages[errorMsg]) { - errorMessages[errorMsg].add(jobId); + if (errorMessages![errorMsg]) { + errorMessages![errorMsg].add(jobId); } else { - errorMessages[errorMsg] = new Set([jobId]); + errorMessages![errorMsg] = new Set([jobId]); } }; } @@ -1408,7 +1408,7 @@ export function anomalyChartsDataProvider(mlClient: MlClient, client: IScopedClu const dataByJobId = get(resp, ['aggregations', 'jobs', 'buckets'], []); each(dataByJobId, (dataForJob: any) => { const jobId: string = dataForJob.key; - const resultsForTime: Record = {}; + const resultsForTime: Record = Object.create(null); const dataByTime = get(dataForJob, ['times', 'buckets'], []); each(dataByTime, (dataForTime: any) => { const time: string = dataForTime.key; @@ -1543,7 +1543,7 @@ export function anomalyChartsDataProvider(mlClient: MlClient, client: IScopedClu typeof metricFunction === 'string' ) { // @ts-ignore - body.aggs.sample.aggs.byTime.aggs.entities.aggs = {}; + body.aggs.sample.aggs.byTime.aggs.entities.aggs = Object.create(null); const metricAgg = { [metricFunction]: { diff --git a/x-pack/plugins/ml/server/models/results_service/results_service.ts b/x-pack/plugins/ml/server/models/results_service/results_service.ts index 0a732cf45a94c..bbf9c4def4722 100644 --- a/x-pack/plugins/ml/server/models/results_service/results_service.ts +++ b/x-pack/plugins/ml/server/models/results_service/results_service.ts @@ -54,7 +54,7 @@ interface Influencer { * @param source */ export function getTypicalAndActualValues(source: MlAnomalyRecordDoc) { - const result: { actual?: number[]; typical?: number[] } = {}; + const result: { actual?: number[]; typical?: number[] } = Object.create(null); const functionDescription = source.function_description || ''; const causes = source.causes || []; @@ -254,9 +254,9 @@ export function resultsServiceProvider(mlClient: MlClient, client?: IScopedClust (item: any) => item.entityName === 'mlcategory' ); if (categoryAnomalies.length > 0) { - tableData.examplesByJobId = {}; + tableData.examplesByJobId = Object.create(null); - const categoryIdsByJobId: { [key: string]: any } = {}; + const categoryIdsByJobId: { [key: string]: any } = Object.create(null); categoryAnomalies.forEach((anomaly) => { if (categoryIdsByJobId[anomaly.jobId] === undefined) { categoryIdsByJobId[anomaly.jobId] = []; @@ -420,7 +420,7 @@ export function resultsServiceProvider(mlClient: MlClient, client?: IScopedClust ['aggregations', 'byJobId', 'buckets'], [] ); - const timestampByJobId: { [key: string]: number | undefined } = {}; + const timestampByJobId: { [key: string]: number | undefined } = Object.create(null); bucketsByJobId.forEach((bucket) => { timestampByJobId[bucket.key] = bucket.maxTimestamp.value; }); @@ -446,7 +446,7 @@ export function resultsServiceProvider(mlClient: MlClient, client?: IScopedClust [jobId] ); - const examplesByCategoryId: { [key: string]: any } = {}; + const examplesByCategoryId: { [key: string]: any } = Object.create(null); // @ts-expect-error incorrect search response type if (body.hits.total.value > 0) { body.hits.hits.forEach((hit: any) => { diff --git a/x-pack/plugins/ml/server/routes/data_frame_analytics.ts b/x-pack/plugins/ml/server/routes/data_frame_analytics.ts index e408c2a719fbb..0229f9e9bba5b 100644 --- a/x-pack/plugins/ml/server/routes/data_frame_analytics.ts +++ b/x-pack/plugins/ml/server/routes/data_frame_analytics.ts @@ -668,7 +668,7 @@ export function dataFrameAnalyticsRoutes( routeGuard.fullLicenseAPIGuard(async ({ client, mlClient, request, response }) => { try { const { analyticsIds, allSpaces } = request.body; - const results: { [id: string]: { exists: boolean } } = {}; + const results: { [id: string]: { exists: boolean } } = Object.create(null); for (const id of analyticsIds) { try { const body = allSpaces diff --git a/x-pack/plugins/ml/server/routes/trained_models.ts b/x-pack/plugins/ml/server/routes/trained_models.ts index 2f3e402e05be3..b0197c19aa5f8 100644 --- a/x-pack/plugins/ml/server/routes/trained_models.ts +++ b/x-pack/plugins/ml/server/routes/trained_models.ts @@ -617,7 +617,8 @@ export function trainedModelsRoutes( try { const { deploymentId, modelId } = request.params; - const results: Record = {}; + const results: Record = + Object.create(null); for (const id of deploymentId.split(',')) { try { diff --git a/x-pack/plugins/ml/server/saved_objects/checks.ts b/x-pack/plugins/ml/server/saved_objects/checks.ts index 1985115d6ebf1..f8e1827c78a87 100644 --- a/x-pack/plugins/ml/server/saved_objects/checks.ts +++ b/x-pack/plugins/ml/server/saved_objects/checks.ts @@ -404,7 +404,7 @@ export function checksFactory( .reduce((acc, cur) => { const type = cur.type; if (acc[type] === undefined) { - acc[type] = {}; + acc[type] = Object.create(null); } acc[type][cur.jobId] = cur.namespaces; return acc; diff --git a/x-pack/plugins/ml/server/saved_objects/service.ts b/x-pack/plugins/ml/server/saved_objects/service.ts index eed08b2a74d63..e6c32f2bc6531 100644 --- a/x-pack/plugins/ml/server/saved_objects/service.ts +++ b/x-pack/plugins/ml/server/saved_objects/service.ts @@ -75,7 +75,7 @@ export function mlSavedObjectServiceFactory( currentSpaceOnly: boolean = true ) { await isMlReady(); - const filterObject: JobObjectFilter = {}; + const filterObject: JobObjectFilter = Object.create(null); if (jobType !== undefined) { filterObject.type = jobType; @@ -225,7 +225,7 @@ export function mlSavedObjectServiceFactory( async function getAllJobObjectsForAllSpaces(jobType?: JobType, jobId?: string) { await isMlReady(); - const filterObject: JobObjectFilter = {}; + const filterObject: JobObjectFilter = Object.create(null); if (jobType !== undefined) { filterObject.type = jobType; @@ -359,7 +359,7 @@ export function mlSavedObjectServiceFactory( return {}; } - const results: SavedObjectResult = {}; + const results: SavedObjectResult = Object.create(null); const jobs = await _getJobObjects(jobType); const jobObjectIdMap = new Map(); const jobObjectsToUpdate: Array<{ type: string; id: string }> = []; @@ -463,7 +463,7 @@ export function mlSavedObjectServiceFactory( async function _getTrainedModelObjects(modelId?: string, currentSpaceOnly: boolean = true) { await isMlReady(); - const filterObject: TrainedModelObjectFilter = {}; + const filterObject: TrainedModelObjectFilter = Object.create(null); if (modelId !== undefined) { filterObject.model_id = modelId; @@ -725,7 +725,7 @@ export function mlSavedObjectServiceFactory( if (modelIds.length === 0 || (spacesToAdd.length === 0 && spacesToRemove.length === 0)) { return {}; } - const results: SavedObjectResult = {}; + const results: SavedObjectResult = Object.create(null); const models = await _getTrainedModelObjects(); const trainedModelObjectIdMap = new Map(); const objectsToUpdate: Array<{ type: string; id: string }> = []; diff --git a/x-pack/plugins/ml/server/saved_objects/sync.ts b/x-pack/plugins/ml/server/saved_objects/sync.ts index cb8713f03acdf..f96233debf9a1 100644 --- a/x-pack/plugins/ml/server/saved_objects/sync.ts +++ b/x-pack/plugins/ml/server/saved_objects/sync.ts @@ -61,7 +61,7 @@ export function syncSavedObjectsFactory( if (job.checks.savedObjectExits === false) { const type = 'anomaly-detector'; if (results.savedObjectsCreated[type] === undefined) { - results.savedObjectsCreated[type] = {}; + results.savedObjectsCreated[type] = Object.create(null); } if (simulate === true) { results.savedObjectsCreated[type]![job.jobId] = { success: true }; @@ -88,7 +88,7 @@ export function syncSavedObjectsFactory( if (job.checks.savedObjectExits === false) { const type = 'data-frame-analytics'; if (results.savedObjectsCreated[type] === undefined) { - results.savedObjectsCreated[type] = {}; + results.savedObjectsCreated[type] = Object.create(null); } if (simulate === true) { results.savedObjectsCreated[type]![job.jobId] = { success: true }; @@ -119,7 +119,7 @@ export function syncSavedObjectsFactory( const { modelId } = model; const type = 'trained-model'; if (results.savedObjectsCreated[type] === undefined) { - results.savedObjectsCreated[type] = {}; + results.savedObjectsCreated[type] = Object.create(null); } if (simulate === true) { results.savedObjectsCreated[type]![modelId] = { success: true }; @@ -161,7 +161,7 @@ export function syncSavedObjectsFactory( if (job.checks.jobExists === false) { const type = 'anomaly-detector'; if (results.savedObjectsDeleted[type] === undefined) { - results.savedObjectsDeleted[type] = {}; + results.savedObjectsDeleted[type] = Object.create(null); } if (simulate === true) { results.savedObjectsDeleted[type]![job.jobId] = { success: true }; @@ -191,7 +191,7 @@ export function syncSavedObjectsFactory( if (job.checks.jobExists === false) { const type = 'data-frame-analytics'; if (results.savedObjectsDeleted[type] === undefined) { - results.savedObjectsDeleted[type] = {}; + results.savedObjectsDeleted[type] = Object.create(null); } if (simulate === true) { results.savedObjectsDeleted[type]![job.jobId] = { success: true }; @@ -225,7 +225,7 @@ export function syncSavedObjectsFactory( const { modelId, namespaces } = model; const type = 'trained-model'; if (results.savedObjectsDeleted[type] === undefined) { - results.savedObjectsDeleted[type] = {}; + results.savedObjectsDeleted[type] = Object.create(null); } if (simulate === true) { @@ -265,7 +265,7 @@ export function syncSavedObjectsFactory( adJobsById[job.jobId].datafeedId !== job.datafeedId) ) { if (results.datafeedsAdded[type] === undefined) { - results.datafeedsAdded[type] = {}; + results.datafeedsAdded[type] = Object.create(null); } // add datafeed id for jobs where the datafeed exists but the id is missing from the saved object // or if the datafeed id in the saved object is not the same as the one attached to the job in es @@ -298,7 +298,7 @@ export function syncSavedObjectsFactory( job.datafeedId !== undefined ) { if (results.datafeedsRemoved[type] === undefined) { - results.datafeedsRemoved[type] = {}; + results.datafeedsRemoved[type] = Object.create(null); } // remove datafeed id for jobs where the datafeed no longer exists but the id is populated in the saved object if (simulate === true) { 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..9493d3503a5dd 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'>; @@ -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', + } + )} + + ), + }} + /> + } + /> + +

+
+
+ + -
-
+ +
; @@ -35,6 +36,7 @@ export function LogRateChart({ height }: { height: number }) { query: { rangeFrom, rangeTo, environment, kuery }, path: { serviceName }, } = useApmParams('/logs-services/{serviceName}'); + const { start, end } = useTimeRange({ rangeFrom, rangeTo }); const { data = INITIAL_STATE, status } = useFetcher( @@ -76,44 +78,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', + } + )} + + ), + }} + /> + } + /> + +

+
+
+ + + -
-
+ +
(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/tsconfig.json b/x-pack/plugins/observability_solution/apm/tsconfig.json index 7389566ed6a4c..a31ddcca0bdce 100644 --- a/x-pack/plugins/observability_solution/apm/tsconfig.json +++ b/x-pack/plugins/observability_solution/apm/tsconfig.json @@ -128,9 +128,8 @@ "@kbn/core-analytics-browser", "@kbn/apm-types", "@kbn/entities-schema", - "@kbn/aiops-log-rate-analysis" + "@kbn/aiops-log-rate-analysis", + "@kbn/router-utils" ], - "exclude": [ - "target/**/*" - ] + "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/observability_solution/investigate/common/index.ts b/x-pack/plugins/observability_solution/investigate/common/index.ts index 541e2d7206bf3..47b5ad6ed2318 100644 --- a/x-pack/plugins/observability_solution/investigate/common/index.ts +++ b/x-pack/plugins/observability_solution/investigate/common/index.ts @@ -4,11 +4,5 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -export type { - Investigation, - InvestigateWidget, - InvestigateWidgetCreate, - InvestigationNote, -} from './types'; export { mergePlainObjects } from './utils/merge_plain_objects'; diff --git a/x-pack/plugins/observability_solution/investigate/common/types.ts b/x-pack/plugins/observability_solution/investigate/common/types.ts index 8a2bba966ed7e..55eab5836ce5b 100644 --- a/x-pack/plugins/observability_solution/investigate/common/types.ts +++ b/x-pack/plugins/observability_solution/investigate/common/types.ts @@ -5,47 +5,9 @@ * 2.0. */ -import type { DeepPartial } from 'utility-types'; - export interface GlobalWidgetParameters { timeRange: { from: string; to: string; }; } - -export interface Investigation { - id: string; - createdAt: number; - title: string; - items: InvestigateWidget[]; - notes: InvestigationNote[]; - parameters: GlobalWidgetParameters; -} - -export interface InvestigationNote { - id: string; - createdAt: number; - createdBy: string; - content: string; -} - -export interface InvestigateWidget< - TParameters extends Record = {}, - TData extends Record = {} -> { - id: string; - createdAt: number; - createdBy: string; - title: string; - type: string; - parameters: GlobalWidgetParameters & TParameters; - data: TData; -} - -export type InvestigateWidgetCreate = {}> = Pick< - InvestigateWidget, - 'title' | 'type' -> & { - parameters: DeepPartial & TParameters; -}; diff --git a/x-pack/plugins/observability_solution/investigate/public/create_widget.ts b/x-pack/plugins/observability_solution/investigate/public/create_widget.ts deleted file mode 100644 index 697202ac42d2b..0000000000000 --- a/x-pack/plugins/observability_solution/investigate/public/create_widget.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 { DeepPartial } from 'utility-types'; -import { InvestigateWidgetCreate } from '../common'; -import { GlobalWidgetParameters } from '../common/types'; - -type MakePartial, K extends keyof T> = Omit & - DeepPartial>; - -type PredefinedKeys = 'type'; - -export type WidgetFactory> = < - T extends MakePartial, PredefinedKeys> ->( - widgetCreate: T -) => Pick, PredefinedKeys> & - Omit & { parameters: T['parameters'] & DeepPartial }; - -export function createWidgetFactory>( - type: string -): WidgetFactory { - const createWidget: WidgetFactory = (widgetCreate) => { - return { - type, - ...widgetCreate, - }; - }; - - return createWidget; -} diff --git a/x-pack/plugins/observability_solution/investigate/public/esql_widget/create_esql_widget.ts b/x-pack/plugins/observability_solution/investigate/public/esql_widget/create_esql_widget.ts deleted file mode 100644 index f3226afd14198..0000000000000 --- a/x-pack/plugins/observability_solution/investigate/public/esql_widget/create_esql_widget.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { createWidgetFactory } from '../create_widget'; -import { ESQL_WIDGET_NAME } from './constants'; -import type { EsqlWidgetParameters } from './types'; - -export const createEsqlWidget = createWidgetFactory(ESQL_WIDGET_NAME); diff --git a/x-pack/plugins/observability_solution/investigate/public/esql_widget/types.ts b/x-pack/plugins/observability_solution/investigate/public/esql_widget/types.ts deleted file mode 100644 index 764daedc9c5ed..0000000000000 --- a/x-pack/plugins/observability_solution/investigate/public/esql_widget/types.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { IconType } from '@elastic/eui'; -import type { Ast } from '@kbn/interpreter'; - -// copied over from the Lens plugin to prevent dependency hell -type TableChangeType = 'initial' | 'unchanged' | 'reduced' | 'extended' | 'reorder' | 'layers'; - -interface Suggestion { - visualizationId: string; - datasourceState?: V; - datasourceId?: string; - columns: number; - score: number; - title: string; - visualizationState: T; - previewExpression?: Ast | string; - previewIcon: IconType; - hide?: boolean; - // flag to indicate if the visualization is incomplete - incomplete?: boolean; - changeType: TableChangeType; - keptLayerIds: string[]; -} - -export interface EsqlWidgetParameters { - esql: string; - suggestion?: Suggestion; -} diff --git a/x-pack/plugins/observability_solution/investigate/public/hooks/use_investigation/create_new_investigation.ts b/x-pack/plugins/observability_solution/investigate/public/hooks/use_investigation/create_new_investigation.ts deleted file mode 100644 index af6227e552115..0000000000000 --- a/x-pack/plugins/observability_solution/investigate/public/hooks/use_investigation/create_new_investigation.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import { GetInvestigationResponse } from '@kbn/investigation-shared'; -import { v4 } from 'uuid'; -import type { Investigation } from '../../../common'; - -export function createNewInvestigation(): Investigation { - return { - id: v4(), - createdAt: new Date().getTime(), - title: i18n.translate('xpack.investigate.newInvestigationTitle', { - defaultMessage: 'New investigation', - }), - items: [], - notes: [], - parameters: { - timeRange: { - from: new Date(Date.now() - 15 * 60 * 1000).toISOString(), - to: new Date().toISOString(), - }, - }, - }; -} - -export function fromInvestigationResponse( - investigationData: GetInvestigationResponse -): Investigation { - return { - id: investigationData.id, - createdAt: investigationData.createdAt, - title: investigationData.title, - items: [], - notes: investigationData.notes, - parameters: { - timeRange: { - from: new Date(investigationData.params.timeRange.from).toISOString(), - to: new Date(investigationData.params.timeRange.to).toISOString(), - }, - }, - }; -} diff --git a/x-pack/plugins/observability_solution/investigate/public/hooks/use_investigation/index.tsx b/x-pack/plugins/observability_solution/investigate/public/hooks/use_investigation/index.tsx deleted file mode 100644 index fd3c50cdb80ac..0000000000000 --- a/x-pack/plugins/observability_solution/investigate/public/hooks/use_investigation/index.tsx +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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, NotificationsStart } from '@kbn/core/public'; -import { i18n } from '@kbn/i18n'; -import { GetInvestigationResponse } from '@kbn/investigation-shared'; -import { pull } from 'lodash'; -import React, { useMemo, useRef, useState } from 'react'; -import useObservable from 'react-use/lib/useObservable'; -import { v4 } from 'uuid'; -import type { GlobalWidgetParameters } from '../..'; -import type { InvestigateWidget, InvestigateWidgetCreate } from '../../../common'; -import type { WidgetDefinition } from '../../types'; -import { createNewInvestigation, fromInvestigationResponse } from './create_new_investigation'; -import { StatefulInvestigation, createInvestigationStore } from './investigation_store'; - -export type RenderableInvestigateWidget = InvestigateWidget & { - loading: boolean; - element: React.ReactNode; -}; - -export type RenderableInvestigation = Omit & { - items: RenderableInvestigateWidget[]; -}; - -export interface UseInvestigationApi { - investigation?: StatefulInvestigation; - renderableInvestigation?: RenderableInvestigation; - copyItem: (id: string) => Promise; - deleteItem: (id: string) => Promise; - addItem: (options: InvestigateWidgetCreate) => Promise; - setGlobalParameters: (parameters: GlobalWidgetParameters) => Promise; - setTitle: (title: string) => Promise; -} - -function useInvestigationWithoutContext({ - user, - notifications, - widgetDefinitions, - investigationData, -}: { - user: AuthenticatedUser; - notifications: NotificationsStart; - widgetDefinitions: WidgetDefinition[]; - investigationData?: GetInvestigationResponse; -}): UseInvestigationApi { - const [investigationStore, _] = useState(() => - createInvestigationStore({ - user, - widgetDefinitions, - investigation: investigationData - ? fromInvestigationResponse(investigationData) - : createNewInvestigation(), - }) - ); - - const investigation$ = investigationStore.asObservable(); - const investigation = useObservable(investigation$)?.investigation; - - const addItem = async (widget: InvestigateWidgetCreate) => { - try { - const id = v4(); - await investigationStore.addItem(id, widget); - } catch (error) { - notifications.showErrorDialog({ - title: i18n.translate('xpack.investigate.failedToAddWidget', { - defaultMessage: 'Failed to add widget', - }), - error, - }); - } - }; - - const deleteItem = async (id: string) => { - return investigationStore.deleteItem(id); - }; - - const widgetComponentsById = useRef< - Record> - >({}); - - const itemsWithContext = useMemo(() => { - const unusedComponentIds = Object.keys(widgetComponentsById); - - const nextItemsWithContext = - investigation?.items.map((item) => { - let Component = widgetComponentsById.current[item.id]; - if (!Component) { - const id = item.id; - const widgetDefinition = widgetDefinitions.find( - (definition) => definition.type === item.type - )!; - - Component = widgetComponentsById.current[id] = (props) => { - return <>{widgetDefinition?.render({ widget: props.widget })}; - }; - } - - pull(unusedComponentIds, item.id); - - return { - ...item, - Component, - }; - }) ?? []; - - unusedComponentIds.forEach((id) => { - delete widgetComponentsById.current[id]; - }); - - return nextItemsWithContext; - }, [investigation?.items, widgetDefinitions]); - - const renderableInvestigation = useMemo(() => { - return investigation - ? { - ...investigation, - items: itemsWithContext.map((item) => { - const { Component, ...rest } = item; - return { - ...rest, - element: , - }; - }), - } - : undefined; - }, [investigation, itemsWithContext]); - - const { copyItem, setGlobalParameters, setTitle } = investigationStore; - - return { - addItem, - copyItem, - deleteItem, - investigation, - renderableInvestigation, - setGlobalParameters, - setTitle, - }; -} - -export function createUseInvestigation({ - notifications, - widgetDefinitions, -}: { - notifications: NotificationsStart; - widgetDefinitions: WidgetDefinition[]; -}) { - return ({ - user, - investigationData, - }: { - user: AuthenticatedUser; - investigationData?: GetInvestigationResponse; - }) => { - return useInvestigationWithoutContext({ - user, - notifications, - widgetDefinitions, - investigationData, - }); - }; -} diff --git a/x-pack/plugins/observability_solution/investigate/public/hooks/use_investigation/investigation_store.ts b/x-pack/plugins/observability_solution/investigate/public/hooks/use_investigation/investigation_store.ts deleted file mode 100644 index be2da347f995a..0000000000000 --- a/x-pack/plugins/observability_solution/investigate/public/hooks/use_investigation/investigation_store.ts +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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/security-plugin/common'; -import { MaybePromise } from '@kbn/utility-types'; -import { BehaviorSubject, Observable } from 'rxjs'; -import { v4 } from 'uuid'; -import { InvestigateWidget } from '../../../common'; -import { - GlobalWidgetParameters, - InvestigateWidgetCreate, - Investigation, -} from '../../../common/types'; -import { WidgetDefinition } from '../../types'; -import { regenerateItem } from './regenerate_item'; - -export type StatefulInvestigateWidget = InvestigateWidget & { - loading: boolean; -}; - -export type StatefulInvestigation = Omit & { - items: StatefulInvestigateWidget[]; -}; - -interface InvestigationStore { - copyItem: (id: string) => Promise; - deleteItem: (id: string) => Promise; - addItem: (id: string, item: InvestigateWidgetCreate) => Promise; - asObservable: () => Observable<{ - investigation: StatefulInvestigation; - }>; - setGlobalParameters: (globalWidgetParameters: GlobalWidgetParameters) => Promise; - setTitle: (title: string) => Promise; - destroy: () => void; -} - -export function createInvestigationStore({ - investigation, - user, - widgetDefinitions, -}: { - investigation: Investigation; - user: AuthenticatedUser; - widgetDefinitions: WidgetDefinition[]; -}): InvestigationStore { - const controller = new AbortController(); - - const observable$ = new BehaviorSubject<{ investigation: StatefulInvestigation }>({ - investigation: { - ...investigation, - items: investigation.items.map((item) => ({ ...item, loading: false })), - }, - }); - - async function updateInvestigationInPlace( - cb: (prevInvestigation: StatefulInvestigation) => MaybePromise - ) { - observable$.next({ investigation: await cb(observable$.value.investigation) }); - } - - const asObservable = observable$.asObservable(); - - return { - addItem: (itemId, item) => { - return updateInvestigationInPlace(async (prevInvestigation) => { - return { - ...prevInvestigation, - items: prevInvestigation.items.concat({ - ...(await regenerateItem({ - user, - widgetDefinitions, - signal: controller.signal, - widget: { - ...item, - id: itemId, - }, - globalWidgetParameters: prevInvestigation.parameters, - })), - loading: false, - }), - }; - }); - }, - copyItem: (itemId) => { - return updateInvestigationInPlace((prevInvestigation) => { - const itemToCopy = prevInvestigation.items.find((item) => item.id === itemId); - if (!itemToCopy) { - throw new Error('Cannot find item for id ' + itemId); - } - return { - ...prevInvestigation, - items: prevInvestigation.items.concat({ - ...itemToCopy, - id: v4(), - }), - }; - }); - }, - deleteItem: (itemId) => { - return updateInvestigationInPlace((prevInvestigation) => { - return { - ...prevInvestigation, - items: prevInvestigation.items.filter((item) => item.id !== itemId), - }; - }); - }, - asObservable: () => asObservable, - destroy: () => { - return controller.abort(); - }, - setGlobalParameters: async (parameters) => { - await updateInvestigationInPlace((prevInvestigation) => { - return { - ...prevInvestigation, - items: prevInvestigation.items.map((item) => { - return { ...item, loading: true }; - }), - }; - }); - - await updateInvestigationInPlace(async (prevInvestigation) => { - return { - ...prevInvestigation, - parameters, - items: await Promise.all( - prevInvestigation.items.map(async (item) => { - return { - ...(await regenerateItem({ - widget: item, - globalWidgetParameters: parameters, - signal: controller.signal, - user, - widgetDefinitions, - })), - loading: false, - }; - }) - ), - }; - }); - }, - setTitle: async (title: string) => { - return updateInvestigationInPlace((prevInvestigation) => { - return { ...prevInvestigation, title }; - }); - }, - }; -} diff --git a/x-pack/plugins/observability_solution/investigate/public/hooks/use_investigation/regenerate_item.ts b/x-pack/plugins/observability_solution/investigate/public/hooks/use_investigation/regenerate_item.ts deleted file mode 100644 index 7f7d6208ed9eb..0000000000000 --- a/x-pack/plugins/observability_solution/investigate/public/hooks/use_investigation/regenerate_item.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { AuthenticatedUser } from '@kbn/core-security-common'; -import { v4 } from 'uuid'; -import { InvestigateWidget, InvestigateWidgetCreate, mergePlainObjects } from '../../../common'; -import { GlobalWidgetParameters } from '../../../common/types'; -import { WidgetDefinition } from '../../types'; - -export async function regenerateItem({ - user, - widgetDefinitions, - signal, - widget, - globalWidgetParameters, -}: { - user: AuthenticatedUser; - widgetDefinitions: WidgetDefinition[]; - widget: InvestigateWidgetCreate | InvestigateWidget; - signal: AbortSignal; - globalWidgetParameters: GlobalWidgetParameters; -}): Promise { - const now = Date.now(); - - const definition = widgetDefinitions.find( - (currentDefinition) => currentDefinition.type === widget.type - ); - - if (!definition) { - throw new Error(`Definition for widget ${widget.type} not found`); - } - - const nextParameters = mergePlainObjects(widget.parameters, globalWidgetParameters); - - const widgetData = await definition.generate({ - parameters: nextParameters, - signal, - }); - - return { - createdAt: now, - id: v4(), - ...widget, - parameters: nextParameters, - data: widgetData, - createdBy: user.username, - }; -} diff --git a/x-pack/plugins/observability_solution/investigate/public/index.ts b/x-pack/plugins/observability_solution/investigate/public/index.ts index 2f55a27ef1c27..07493d8360552 100644 --- a/x-pack/plugins/observability_solution/investigate/public/index.ts +++ b/x-pack/plugins/observability_solution/investigate/public/index.ts @@ -13,27 +13,16 @@ import type { InvestigateSetupDependencies, InvestigateStartDependencies, ConfigSchema, - OnWidgetAdd, } from './types'; -export type { InvestigatePublicSetup, InvestigatePublicStart, OnWidgetAdd }; +export type { InvestigatePublicSetup, InvestigatePublicStart }; -export { - type Investigation, - type InvestigateWidget, - type InvestigateWidgetCreate, - type GlobalWidgetParameters, -} from '../common/types'; +export { type GlobalWidgetParameters } from '../common/types'; export { mergePlainObjects } from '../common/utils/merge_plain_objects'; -export { createWidgetFactory } from './create_widget'; export { getEsFilterFromGlobalParameters } from './util/get_es_filters_from_global_parameters'; -export { ESQL_WIDGET_NAME } from './esql_widget/constants'; -export { createEsqlWidget } from './esql_widget/create_esql_widget'; -export type { EsqlWidgetParameters } from './esql_widget/types'; - export const plugin: PluginInitializer< InvestigatePublicSetup, InvestigatePublicStart, diff --git a/x-pack/plugins/observability_solution/investigate/public/investigation/item_definition_registry.ts b/x-pack/plugins/observability_solution/investigate/public/investigation/item_definition_registry.ts new file mode 100644 index 0000000000000..6fcb8308e7161 --- /dev/null +++ b/x-pack/plugins/observability_solution/investigate/public/investigation/item_definition_registry.ts @@ -0,0 +1,45 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { GlobalWidgetParameters } from '../../common/types'; + +export type ItemDefinitionData = Record; +export type ItemDefinitionParams = Record; + +export interface ItemDefinition< + Params extends ItemDefinitionParams = {}, + Data extends ItemDefinitionData = {} +> { + type: string; + generate: (option: { itemParams: Params; globalParams: GlobalWidgetParameters }) => Promise; + render: (option: { + data: Data; + itemParams: Params; + globalParams: GlobalWidgetParameters; + }) => React.ReactNode; +} + +export class ItemDefinitionRegistry { + private readonly definitions: ItemDefinition[] = []; + + constructor() {} + + public registerItem( + definition: ItemDefinition + ) { + // @ts-ignore TODO fix this type issue with generics + this.definitions.push(definition); + } + + public getItemDefinitions(): ItemDefinition[] { + return this.definitions; + } + + public getItemDefinitionByType(type: string): ItemDefinition | undefined { + return this.definitions.find((definition) => definition.type === type); + } +} diff --git a/x-pack/plugins/observability_solution/investigate/public/plugin.tsx b/x-pack/plugins/observability_solution/investigate/public/plugin.tsx index 887753446c4a9..9429383d851a8 100644 --- a/x-pack/plugins/observability_solution/investigate/public/plugin.tsx +++ b/x-pack/plugins/observability_solution/investigate/public/plugin.tsx @@ -4,17 +4,13 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { - AuthenticatedUser, - CoreSetup, - CoreStart, - Plugin, - PluginInitializerContext, -} from '@kbn/core/public'; -import { GetInvestigationResponse } from '@kbn/investigation-shared'; -import type { Logger } from '@kbn/logging'; -import { useMemo } from 'react'; -import { createUseInvestigation } from './hooks/use_investigation'; +import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; +import { + ItemDefinition, + ItemDefinitionData, + ItemDefinitionParams, + ItemDefinitionRegistry, +} from './investigation/item_definition_registry'; import type { ConfigSchema, InvestigatePublicSetup, @@ -22,7 +18,6 @@ import type { InvestigateSetupDependencies, InvestigateStartDependencies, } from './types'; -import { WidgetRegistry } from './widget_registry'; export class InvestigatePlugin implements @@ -33,57 +28,28 @@ export class InvestigatePlugin InvestigateStartDependencies > { - logger: Logger; - - widgetRegistry: WidgetRegistry = new WidgetRegistry(); + private itemDefinitionRegistry: ItemDefinitionRegistry = new ItemDefinitionRegistry(); - registrationPromises: Array> = []; + constructor(context: PluginInitializerContext) {} - constructor(context: PluginInitializerContext) { - this.logger = context.logger.get(); - } setup(coreSetup: CoreSetup, pluginsSetup: InvestigateSetupDependencies): InvestigatePublicSetup { return { - register: (callback) => { - const registrationPromise = Promise.race([ - callback(this.widgetRegistry.registerWidget), - new Promise((resolve, reject) => { - setTimeout(() => { - reject(new Error('Timed out running registration function')); - }, 30000); - }), - ]).catch((error) => { - this.logger.error( - new Error('Encountered an error during widget registration', { cause: error }) - ); - return Promise.resolve(); - }); - - this.registrationPromises.push(registrationPromise); + registerItemDefinition: < + Params extends ItemDefinitionParams, + Data extends ItemDefinitionData + >( + definition: ItemDefinition + ) => { + this.itemDefinitionRegistry.registerItem(definition); }, }; } start(coreStart: CoreStart, pluginsStart: InvestigateStartDependencies): InvestigatePublicStart { return { - getWidgetDefinitions: this.widgetRegistry.getWidgetDefinitions, - useInvestigation: ({ - user, - investigationData, - }: { - user: AuthenticatedUser; - investigationData?: GetInvestigationResponse; - }) => { - const widgetDefinitions = useMemo(() => this.widgetRegistry.getWidgetDefinitions(), []); - - return createUseInvestigation({ - notifications: coreStart.notifications, - widgetDefinitions, - })({ - user, - investigationData, - }); - }, + getItemDefinitions: () => this.itemDefinitionRegistry.getItemDefinitions(), + getItemDefinitionByType: (type: string) => + this.itemDefinitionRegistry.getItemDefinitionByType(type), }; } } diff --git a/x-pack/plugins/observability_solution/investigate/public/types.ts b/x-pack/plugins/observability_solution/investigate/public/types.ts index dc6eb8b62021d..36a87759c2711 100644 --- a/x-pack/plugins/observability_solution/investigate/public/types.ts +++ b/x-pack/plugins/observability_solution/investigate/public/types.ts @@ -6,54 +6,11 @@ */ /* eslint-disable @typescript-eslint/no-empty-interface*/ -import type { AuthenticatedUser } from '@kbn/core/public'; -import type { CompatibleJSONSchema } from '@kbn/observability-ai-assistant-plugin/public'; -import type { GetInvestigationResponse } from '@kbn/investigation-shared'; -import type { FromSchema } from 'json-schema-to-ts'; -import type { InvestigateWidget } from '../common'; -import type { GlobalWidgetParameters, InvestigateWidgetCreate } from '../common/types'; -import type { UseInvestigationApi } from './hooks/use_investigation'; - -export type OnWidgetAdd = (create: InvestigateWidgetCreate) => Promise; - -interface WidgetRenderOptions { - widget: TInvestigateWidget; -} - -export interface WidgetDefinition { - type: string; - description: string; - schema: CompatibleJSONSchema; - generate: (options: { - parameters: GlobalWidgetParameters; - signal: AbortSignal; - }) => Promise>; - render: (options: WidgetRenderOptions) => React.ReactNode; -} - -type RegisterWidgetOptions = Omit; - -type MaybeSchemaFrom = - {} & (TSchema extends CompatibleJSONSchema ? FromSchema : {}); - -type GenerateCallback< - TSchema extends CompatibleJSONSchema | undefined, - TData extends Record | undefined -> = (options: { - parameters: MaybeSchemaFrom & GlobalWidgetParameters; - signal: AbortSignal; -}) => Promise; - -export type RegisterWidget = < - TSchema extends CompatibleJSONSchema, - TData extends Record ->( - definition: Omit & { schema: TSchema }, - generateCallback: GenerateCallback, - renderCallback: ( - options: WidgetRenderOptions, TData>> - ) => React.ReactNode -) => void; +import { + ItemDefinition, + ItemDefinitionData, + ItemDefinitionParams, +} from './investigation/item_definition_registry'; export interface ConfigSchema {} @@ -62,13 +19,15 @@ export interface InvestigateSetupDependencies {} export interface InvestigateStartDependencies {} export interface InvestigatePublicSetup { - register: (callback: (registerWidget: RegisterWidget) => Promise) => void; + registerItemDefinition: < + Params extends ItemDefinitionParams = {}, + Data extends ItemDefinitionData = {} + >( + itemDefinition: ItemDefinition + ) => void; } export interface InvestigatePublicStart { - getWidgetDefinitions: () => WidgetDefinition[]; - useInvestigation: ({}: { - user: AuthenticatedUser; - investigationData?: GetInvestigationResponse; - }) => UseInvestigationApi; + getItemDefinitions: () => ItemDefinition[]; + getItemDefinitionByType: (type: string) => ItemDefinition | undefined; } diff --git a/x-pack/plugins/observability_solution/investigate/public/widget_registry.ts b/x-pack/plugins/observability_solution/investigate/public/widget_registry.ts deleted file mode 100644 index f76adf5a72506..0000000000000 --- a/x-pack/plugins/observability_solution/investigate/public/widget_registry.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { RegisterWidget, WidgetDefinition } from './types'; - -export class WidgetRegistry { - private readonly definitions: WidgetDefinition[] = []; - - constructor() {} - - registerWidget: RegisterWidget = (definition, generateCallback, renderCallback) => { - this.definitions.push({ - ...definition, - generate: generateCallback as WidgetDefinition['generate'], - render: renderCallback as WidgetDefinition['render'], - }); - }; - - getWidgetDefinitions = (): WidgetDefinition[] => { - return this.definitions; - }; -} diff --git a/x-pack/plugins/observability_solution/investigate/tsconfig.json b/x-pack/plugins/observability_solution/investigate/tsconfig.json index d48acf4a215ad..e2e39f527c2e1 100644 --- a/x-pack/plugins/observability_solution/investigate/tsconfig.json +++ b/x-pack/plugins/observability_solution/investigate/tsconfig.json @@ -14,14 +14,7 @@ "@kbn/core", "@kbn/logging", "@kbn/config-schema", - "@kbn/observability-ai-assistant-plugin", "@kbn/es-query", - "@kbn/interpreter", - "@kbn/security-plugin", - "@kbn/i18n", - "@kbn/utility-types", - "@kbn/core-security-common", - "@kbn/investigation-shared", ], "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/observability_solution/investigate_app/kibana.jsonc b/x-pack/plugins/observability_solution/investigate_app/kibana.jsonc index 5b31cbc3973a2..c7e860a047366 100644 --- a/x-pack/plugins/observability_solution/investigate_app/kibana.jsonc +++ b/x-pack/plugins/observability_solution/investigate_app/kibana.jsonc @@ -21,9 +21,9 @@ "security", ], "requiredBundles": [ + "esql", "kibanaReact", "kibanaUtils", - "esql", "esqlDataGrid", ], "optionalPlugins": [], diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_widget_grid/index.stories.tsx b/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_widget_grid/index.stories.tsx deleted file mode 100644 index 072d25b1e5526..0000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_widget_grid/index.stories.tsx +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { ComponentMeta, ComponentStoryObj } from '@storybook/react'; -import React, { useState } from 'react'; -import { v4 } from 'uuid'; -import { InvestigateWidgetGrid as Component, InvestigateWidgetGridItem } from '.'; -import { KibanaReactStorybookDecorator } from '../../../.storybook/storybook_decorator'; - -const meta: ComponentMeta = { - component: Component, - title: 'app/Organisms/InvestigateWidgetGrid', - decorators: [KibanaReactStorybookDecorator], -}; - -export default meta; - -function WithPersistedChanges(props: React.ComponentProps) { - const [items, setItems] = useState(props.items); - - return ( - { - setItems((prevItems) => - prevItems.concat({ - ...item, - id: v4(), - }) - ); - }} - onItemDelete={async (item) => { - setItems((prevItems) => prevItems.filter((currentItem) => currentItem.id !== item.id)); - }} - items={items} - /> - ); -} - -const defaultProps: ComponentStoryObj = { - args: {}, - render: (props) => ( -
- -
- ), -}; - -function createItem>(overrides: T) { - return { - ...overrides, - id: v4(), - columns: 4, - rows: 2, - description: '', - loading: false, - overrides: [], - }; -} - -export const InvestigateWidgetGridStory: ComponentStoryObj = { - ...defaultProps, - args: { - ...defaultProps.args, - items: [ - createItem({ - title: '1', - element: ( -
- This should not overflow -
- ), - columns: 4, - rows: 12, - }), - - createItem({ - title: '2', - element: <>TODO, - columns: 2, - rows: 3, - overrides: [ - { - id: v4(), - label: '4 hours earlier', - }, - { - id: v4(), - label: 'service.name:opbeans-java AND service.enviroment:(production OR development)', - }, - ], - }), - createItem({ - title: '3', - element: <>TODO, - columns: 2, - rows: 3, - }), - createItem({ - title: '4', - element: <>TODO, - columns: 4, - rows: 3, - }), - ], - }, - name: 'default', -}; diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_widget_grid/styles.scss b/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_widget_grid/styles.scss deleted file mode 100644 index 5528e053f84aa..0000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_widget_grid/styles.scss +++ /dev/null @@ -1 +0,0 @@ -@import '../../../../../../../src/plugins/dashboard/public/dashboard_container/dashboard_container'; diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/query_key_factory.ts b/x-pack/plugins/observability_solution/investigate_app/public/hooks/query_key_factory.ts index d2f6bc9060e43..62078d7d55bca 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/hooks/query_key_factory.ts +++ b/x-pack/plugins/observability_solution/investigate_app/public/hooks/query_key_factory.ts @@ -13,6 +13,9 @@ export const investigationKeys = { notes: ['investigation', 'notes'] as const, fetchNotes: (params: { investigationId: string }) => [...investigationKeys.notes, 'fetch', params] as const, + items: ['investigation', 'items'] as const, + fetchItems: (params: { investigationId: string }) => + [...investigationKeys.items, 'fetch', params] as const, }; export type InvestigationKeys = typeof investigationKeys; diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_add_investigation_item.ts b/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_add_investigation_item.ts new file mode 100644 index 0000000000000..a11b5d976fe00 --- /dev/null +++ b/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_add_investigation_item.ts @@ -0,0 +1,49 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IHttpFetchError, ResponseErrorBody } from '@kbn/core/public'; +import { + CreateInvestigationItemParams, + CreateInvestigationItemResponse, +} from '@kbn/investigation-shared'; +import { useMutation } from '@tanstack/react-query'; +import { useKibana } from './use_kibana'; + +type ServerError = IHttpFetchError; + +export function useAddInvestigationItem() { + const { + core: { + http, + notifications: { toasts }, + }, + } = useKibana(); + + return useMutation< + CreateInvestigationItemResponse, + ServerError, + { investigationId: string; item: CreateInvestigationItemParams }, + { investigationId: string } + >( + ['addInvestigationItem'], + ({ investigationId, item }) => { + const body = JSON.stringify(item); + return http.post( + `/api/observability/investigations/${investigationId}/items`, + { body, version: '2023-10-31' } + ); + }, + { + onSuccess: (response, {}) => { + toasts.addSuccess('Item saved'); + }, + 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/hooks/use_delete_investigation_item.ts b/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_delete_investigation_item.ts new file mode 100644 index 0000000000000..41c19013e6b2d --- /dev/null +++ b/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_delete_investigation_item.ts @@ -0,0 +1,44 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IHttpFetchError, ResponseErrorBody } from '@kbn/core/public'; +import { useMutation } from '@tanstack/react-query'; +import { useKibana } from './use_kibana'; + +type ServerError = IHttpFetchError; + +export function useDeleteInvestigationItem() { + const { + core: { + http, + notifications: { toasts }, + }, + } = useKibana(); + + return useMutation< + void, + ServerError, + { investigationId: string; itemId: string }, + { investigationId: string } + >( + ['deleteInvestigationItem'], + ({ investigationId, itemId }) => { + return http.delete( + `/api/observability/investigations/${investigationId}/items/${itemId}`, + { version: '2023-10-31' } + ); + }, + { + onSuccess: (response, {}) => { + toasts.addSuccess('Item deleted'); + }, + 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/hooks/use_delete_investigation_note.ts b/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_delete_investigation_note.ts index 136387372c581..aed3cc571ec92 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_delete_investigation_note.ts +++ b/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_delete_investigation_note.ts @@ -25,7 +25,7 @@ export function useDeleteInvestigationNote() { { investigationId: string; noteId: string }, { investigationId: string } >( - ['addInvestigationNote'], + ['deleteInvestigationNote'], ({ investigationId, noteId }) => { return http.delete( `/api/observability/investigations/${investigationId}/notes/${noteId}`, diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_investigation_items.ts b/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_investigation_items.ts new file mode 100644 index 0000000000000..5cc253fc6c44d --- /dev/null +++ b/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_investigation_items.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 { + GetInvestigationItemsResponse, + InvestigationItemResponse, +} from '@kbn/investigation-shared'; +import { + QueryObserverResult, + RefetchOptions, + RefetchQueryFilters, + useQuery, +} from '@tanstack/react-query'; +import { investigationKeys } from './query_key_factory'; +import { useKibana } from './use_kibana'; + +export interface Params { + investigationId: string; + initialItems?: InvestigationItemResponse[]; +} + +export interface Response { + isInitialLoading: boolean; + isLoading: boolean; + isRefetching: boolean; + isSuccess: boolean; + isError: boolean; + refetch: ( + options?: (RefetchOptions & RefetchQueryFilters) | undefined + ) => Promise>; + data: GetInvestigationItemsResponse | undefined; +} + +export function useFetchInvestigationItems({ investigationId, initialItems }: Params): Response { + const { + core: { + http, + notifications: { toasts }, + }, + } = useKibana(); + + const { isInitialLoading, isLoading, isError, isSuccess, isRefetching, data, refetch } = useQuery( + { + queryKey: investigationKeys.fetchItems({ investigationId }), + queryFn: async ({ signal }) => { + return await http.get( + `/api/observability/investigations/${investigationId}/items`, + { version: '2023-10-31', signal } + ); + }, + initialData: initialItems, + refetchOnWindowFocus: false, + refetchInterval: 10 * 1000, + refetchIntervalInBackground: true, + onError: (error: Error) => { + toasts.addError(error, { + title: 'Something went wrong while fetching investigation items', + }); + }, + } + ); + + return { + data, + isInitialLoading, + isLoading, + isRefetching, + isSuccess, + isError, + refetch, + }; +} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_update_investigation_note.ts b/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_update_investigation_note.ts new file mode 100644 index 0000000000000..312cb90ad289b --- /dev/null +++ b/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_update_investigation_note.ts @@ -0,0 +1,46 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IHttpFetchError, ResponseErrorBody } from '@kbn/core/public'; +import { UpdateInvestigationNoteParams } from '@kbn/investigation-shared'; +import { useMutation } from '@tanstack/react-query'; +import { useKibana } from './use_kibana'; + +type ServerError = IHttpFetchError; + +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/README.md b/x-pack/plugins/observability_solution/investigate_app/public/items/README.md new file mode 100644 index 0000000000000..710c9fd3624ec --- /dev/null +++ b/x-pack/plugins/observability_solution/investigate_app/public/items/README.md @@ -0,0 +1 @@ +This folder replaces widgets/ diff --git a/x-pack/plugins/observability_solution/investigate_app/public/widgets/embeddable_widget/register_embeddable_widget.tsx b/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx similarity index 79% rename from x-pack/plugins/observability_solution/investigate_app/public/widgets/embeddable_widget/register_embeddable_widget.tsx rename to x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx index 779fb9c5301b9..7e331a6604721 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/widgets/embeddable_widget/register_embeddable_widget.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx @@ -6,16 +6,14 @@ */ import { EuiLoadingSpinner } from '@elastic/eui'; import { css } from '@emotion/css'; +import { ReactEmbeddableRenderer } from '@kbn/embeddable-plugin/public'; import type { GlobalWidgetParameters } from '@kbn/investigate-plugin/public'; import { useAbortableAsync } from '@kbn/observability-ai-assistant-plugin/public'; import React, { useEffect, useMemo, useRef, useState } from 'react'; import { v4 } from 'uuid'; -import { ReactEmbeddableRenderer } from '@kbn/embeddable-plugin/public'; -import { EMBEDDABLE_WIDGET_NAME } from '../../constants'; -import { useKibana } from '../../hooks/use_kibana'; -import { RegisterWidgetOptions } from '../register_widgets'; -import { EmbeddableWidgetParameters } from './types'; import { ErrorMessage } from '../../components/error_message'; +import { useKibana } from '../../hooks/use_kibana'; +import { Options } from '../register_items'; const embeddableClassName = css` height: 100%; @@ -24,7 +22,7 @@ const embeddableClassName = css` } `; -type Props = EmbeddableWidgetParameters & GlobalWidgetParameters; +type Props = EmbeddableItemParams & GlobalWidgetParameters; type ParentApi = ReturnType['getParentApi']>; @@ -155,40 +153,38 @@ function EmbeddableWidget(props: Props) { return ; } -export function registerEmbeddableWidget({ registerWidget }: RegisterWidgetOptions) { - registerWidget( - { - type: EMBEDDABLE_WIDGET_NAME, - description: 'Display a saved embeddable', - schema: { - type: 'object', - properties: { - type: { - type: 'string', - }, - config: { - type: 'object', - }, - savedObjectId: { - type: 'string', - }, - }, - required: ['type', 'config'], - } as const, - }, - async ({ parameters, signal }) => { +interface EmbeddableItemParams { + type: string; + config: Record; + savedObjectId?: string; +} + +export function registerEmbeddableItem({ + dependencies: { + setup: { investigate }, + }, + services, +}: Options) { + investigate.registerItemDefinition({ + type: 'embeddable', + generate: async (option: { + itemParams: EmbeddableItemParams; + globalParams: GlobalWidgetParameters; + }) => { return {}; }, - ({ widget }) => { + render: (option: { + itemParams: EmbeddableItemParams; + globalParams: GlobalWidgetParameters; + }) => { const parameters = { - type: widget.parameters.type, - config: widget.parameters.config, - savedObjectId: widget.parameters.savedObjectId, - timeRange: widget.parameters.timeRange, - query: widget.parameters.query, + type: option.itemParams.type, + config: option.itemParams.config, + savedObjectId: option.itemParams.savedObjectId, + timeRange: option.globalParams.timeRange, }; return ; - } - ); + }, + }); } diff --git a/x-pack/plugins/observability_solution/investigate_app/public/widgets/esql_widget/get_date_histogram_results.ts b/x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/get_date_histogram_results.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/widgets/esql_widget/get_date_histogram_results.ts rename to x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/get_date_histogram_results.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/widgets/esql_widget/register_esql_widget.tsx b/x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/register_esql_item.tsx similarity index 80% rename from x-pack/plugins/observability_solution/investigate_app/public/widgets/esql_widget/register_esql_widget.tsx rename to x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/register_esql_item.tsx index 84818c758ffe1..695daf1f48cb2 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/widgets/esql_widget/register_esql_widget.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/register_esql_item.tsx @@ -10,20 +10,16 @@ import type { DataView } from '@kbn/data-views-plugin/common'; import type { ESQLSearchResponse } from '@kbn/es-types'; import { ESQLDataGrid } from '@kbn/esql-datagrid/public'; import { i18n } from '@kbn/i18n'; -import { - type EsqlWidgetParameters, - type GlobalWidgetParameters, -} from '@kbn/investigate-plugin/public'; +import { type GlobalWidgetParameters } from '@kbn/investigate-plugin/public'; import type { Suggestion } from '@kbn/lens-plugin/public'; import { useAbortableAsync } from '@kbn/observability-ai-assistant-plugin/public'; import React, { useMemo } from 'react'; import { ErrorMessage } from '../../components/error_message'; -import { ESQL_WIDGET_NAME } from '../../constants'; import { useKibana } from '../../hooks/use_kibana'; import { getDatatableFromEsqlResponse } from '../../utils/get_data_table_from_esql_response'; import { getEsFilterFromOverrides } from '../../utils/get_es_filter_from_overrides'; import { getLensAttrsForSuggestion } from '../../utils/get_lens_attrs_for_suggestion'; -import type { RegisterWidgetOptions } from '../register_widgets'; +import type { Options } from '../register_items'; import { getDateHistogramResults } from './get_date_histogram_results'; const lensClassName = css` @@ -45,6 +41,26 @@ interface Props { }; } +interface EsqlItemParams { + esql: string; + suggestion?: Suggestion; +} + +interface EsqlItemData { + dataView: DataView; + columns: ESQLSearchResponse['columns']; + values: ESQLSearchResponse['values']; + suggestion: Suggestion; + dateHistoResponse?: { + query: string; + columns: ESQLSearchResponse['columns']; + values: ESQLSearchResponse['values']; + groupingExpression: string; + }; +} + +export const ESQL_ITEM_TYPE = 'esql'; + export function EsqlWidget({ suggestion, dataView, @@ -207,34 +223,21 @@ export function EsqlWidget({ ); } -export function registerEsqlWidget({ +export function registerEsqlItem({ dependencies: { setup: { investigate }, }, services, - registerWidget, -}: RegisterWidgetOptions) { - registerWidget( - { - type: ESQL_WIDGET_NAME, - description: 'Visualize an ES|QL query', - schema: { - type: 'object', - properties: { - esql: { - description: 'The ES|QL query', - type: 'string', - }, - }, - required: ['esql'], - } as const, - }, - async ({ parameters, signal }) => { - const { - esql: esqlQuery, - timeRange, - suggestion: suggestionFromParameters, - } = parameters as EsqlWidgetParameters & GlobalWidgetParameters; +}: Options) { + investigate.registerItemDefinition({ + type: ESQL_ITEM_TYPE, + generate: async (option: { + itemParams: EsqlItemParams; + globalParams: GlobalWidgetParameters; + }) => { + const controller = new AbortController(); + const { esql: esqlQuery, suggestion: suggestionFromParameters } = option.itemParams; + const { timeRange } = option.globalParams; const esql = await services.esql; @@ -252,7 +255,7 @@ export function registerEsqlWidget({ const mainResponse = await esql.queryWithMeta({ query: esqlQuery, - signal, + signal: controller.signal, filter: getFilter(), }); @@ -263,37 +266,36 @@ export function registerEsqlWidget({ columns: mainResponse.query.columns, esql, filter: getFilter(), - signal, + signal: controller.signal, suggestion, timeRange, }); return { - main: { - columns: mainResponse.query.columns, - values: mainResponse.query.values, - suggestion, - dataView: mainResponse.meta.dataView, - }, - dateHistogram: dateHistoResponse, + dataView: mainResponse.meta.dataView, + columns: mainResponse.query.columns, + values: mainResponse.query.values, + suggestion, + dateHistoResponse, }; }, - ({ widget }) => { - const { - main: { dataView, columns, values, suggestion }, - dateHistogram, - } = widget.data; + render: (option: { + itemParams: EsqlItemParams; + globalParams: GlobalWidgetParameters; + data: EsqlItemData; + }) => { + const { itemParams, data } = option; return ( ); - } - ); + }, + }); } diff --git a/x-pack/plugins/observability_solution/investigate_app/public/widgets/register_widgets.ts b/x-pack/plugins/observability_solution/investigate_app/public/items/register_items.ts similarity index 55% rename from x-pack/plugins/observability_solution/investigate_app/public/widgets/register_widgets.ts rename to x-pack/plugins/observability_solution/investigate_app/public/items/register_items.ts index fd2e2b9728176..ff0304105a0b0 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/widgets/register_widgets.ts +++ b/x-pack/plugins/observability_solution/investigate_app/public/items/register_items.ts @@ -5,22 +5,20 @@ * 2.0. */ -import type { RegisterWidget } from '@kbn/investigate-plugin/public/types'; import type { InvestigateAppServices } from '../services/types'; import type { InvestigateAppSetupDependencies, InvestigateAppStartDependencies } from '../types'; -import { registerEmbeddableWidget } from './embeddable_widget/register_embeddable_widget'; -import { registerEsqlWidget } from './esql_widget/register_esql_widget'; +import { registerEmbeddableItem } from './embeddable_item/register_embeddable_item'; +import { registerEsqlItem } from './esql_item/register_esql_item'; -export interface RegisterWidgetOptions { +export interface Options { dependencies: { setup: InvestigateAppSetupDependencies; start: InvestigateAppStartDependencies; }; services: InvestigateAppServices; - registerWidget: RegisterWidget; } -export function registerWidgets(options: RegisterWidgetOptions) { - registerEsqlWidget(options); - registerEmbeddableWidget(options); +export function registerItems(options: Options) { + registerEsqlItem(options); + registerEmbeddableItem(options); } diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/add_observation_ui/index.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/add_investigation_item.tsx similarity index 93% rename from x-pack/plugins/observability_solution/investigate_app/public/components/add_observation_ui/index.tsx rename to x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/add_investigation_item.tsx index 69f43ef515146..e4dcd2fe2000d 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/components/add_observation_ui/index.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/add_investigation_item.tsx @@ -9,19 +9,20 @@ import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiPanel, EuiTitle } fro import { css } from '@emotion/css'; import { TextBasedLangEditor } from '@kbn/esql/public'; import { i18n } from '@kbn/i18n'; -import { GlobalWidgetParameters, OnWidgetAdd } from '@kbn/investigate-plugin/public'; +import { GlobalWidgetParameters } from '@kbn/investigate-plugin/public'; +import { Item } from '@kbn/investigation-shared'; import React from 'react'; import { EsqlWidgetPreview } from './esql_widget_preview'; type Props = { - onWidgetAdd: OnWidgetAdd; + onItemAdd: (item: Item) => void; } & GlobalWidgetParameters; const emptyPreview = css` padding: 36px 0px 36px 0px; `; -export function AddObservationUI({ onWidgetAdd, timeRange }: Props) { +export function AddInvestigationItem({ onItemAdd: onItemAdd, timeRange }: Props) { const [isOpen, setIsOpen] = React.useState(false); const [query, setQuery] = React.useState({ esql: '' }); @@ -113,9 +114,9 @@ export function AddObservationUI({ onWidgetAdd, timeRange }: Props) { { + onItemAdd={(item) => { resetState(); - return onWidgetAdd(widget); + return onItemAdd(item); }} /> )} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/add_observation_ui/esql_widget_preview.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/esql_widget_preview.tsx similarity index 85% rename from x-pack/plugins/observability_solution/investigate_app/public/components/add_observation_ui/esql_widget_preview.tsx rename to x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/esql_widget_preview.tsx index 2d1e1f1506797..7ceedaed3b312 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/components/add_observation_ui/esql_widget_preview.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/esql_widget_preview.tsx @@ -8,38 +8,33 @@ import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; import { css } from '@emotion/css'; import type { DataView } from '@kbn/data-views-plugin/common'; import type { ESQLColumn, ESQLRow } from '@kbn/es-types'; -import { - ESQL_WIDGET_NAME, - GlobalWidgetParameters, - InvestigateWidgetCreate, - OnWidgetAdd, - createEsqlWidget, -} from '@kbn/investigate-plugin/public'; +import { GlobalWidgetParameters } from '@kbn/investigate-plugin/public'; +import { Item } from '@kbn/investigation-shared'; import type { Suggestion } from '@kbn/lens-plugin/public'; import { useAbortableAsync } from '@kbn/observability-ai-assistant-plugin/public'; import React, { useEffect, useMemo, useState } from 'react'; -import { useKibana } from '../../hooks/use_kibana'; -import { getEsFilterFromOverrides } from '../../utils/get_es_filter_from_overrides'; -import { getDateHistogramResults } from '../../widgets/esql_widget/get_date_histogram_results'; -import { EsqlWidget } from '../../widgets/esql_widget/register_esql_widget'; -import { ErrorMessage } from '../error_message'; -import { SuggestVisualizationList } from '../suggest_visualization_list'; +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 { ESQL_ITEM_TYPE, EsqlWidget } from '../../../../items/esql_item/register_esql_item'; +import { getEsFilterFromOverrides } from '../../../../utils/get_es_filter_from_overrides'; -function getWidgetFromSuggestion({ +function getItemFromSuggestion({ query, suggestion, }: { query: string; suggestion: Suggestion; -}): InvestigateWidgetCreate { - return createEsqlWidget({ +}): Item { + return { title: suggestion.title, - type: ESQL_WIDGET_NAME, - parameters: { + type: ESQL_ITEM_TYPE, + params: { esql: query, suggestion, }, - }); + }; } function PreviewContainer({ children }: { children: React.ReactNode }) { @@ -64,11 +59,11 @@ function PreviewContainer({ children }: { children: React.ReactNode }) { export function EsqlWidgetPreview({ esqlQuery, - onWidgetAdd, + onItemAdd, timeRange, }: { esqlQuery: string; - onWidgetAdd: OnWidgetAdd; + onItemAdd: (item: Item) => void; } & GlobalWidgetParameters) { const { services: { esql }, @@ -199,7 +194,7 @@ export function EsqlWidgetPreview({ { - onWidgetAdd(getWidgetFromSuggestion({ query: esqlQuery, suggestion })); + onItemAdd(getItemFromSuggestion({ query: esqlQuery, suggestion })); }} loading={queryResult.loading} onMouseLeave={() => {}} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/grid_item/index.stories.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/grid_item/index.stories.tsx similarity index 90% rename from x-pack/plugins/observability_solution/investigate_app/public/components/grid_item/index.stories.tsx rename to x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/grid_item/index.stories.tsx index 6111d0181ccbb..54b13f1eea29d 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/components/grid_item/index.stories.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/grid_item/index.stories.tsx @@ -9,8 +9,8 @@ import { Meta, StoryObj } from '@storybook/react'; import React from 'react'; import { v4 } from 'uuid'; import { GridItem as Component } from '.'; -import { extendProps } from '../../../.storybook/extend_props'; -import { KibanaReactStorybookDecorator } from '../../../.storybook/storybook_decorator'; +import { extendProps } from '../../../../../.storybook/extend_props'; +import { KibanaReactStorybookDecorator } from '../../../../../.storybook/storybook_decorator'; type Props = React.ComponentProps; diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/grid_item/index.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/grid_item/index.tsx similarity index 95% rename from x-pack/plugins/observability_solution/investigate_app/public/components/grid_item/index.tsx rename to x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/grid_item/index.tsx index 465f6f803edd9..91f7a58b43b5e 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/components/grid_item/index.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/grid_item/index.tsx @@ -7,8 +7,8 @@ import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiText } from '@elastic/eui'; import { css } from '@emotion/css'; import React from 'react'; -import { useTheme } from '../../hooks/use_theme'; -import { InvestigateTextButton } from '../investigate_text_button'; +import { useTheme } from '../../../../hooks/use_theme'; +import { InvestigateTextButton } from '../../../../components/investigate_text_button'; export const GRID_ITEM_HEADER_HEIGHT = 40; diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/index.stories.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/index.stories.tsx index 8dfb18a753ac2..83b61c331843f 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/index.stories.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/index.stories.tsx @@ -5,10 +5,11 @@ * 2.0. */ +import { mockAuthenticatedUser } from '@kbn/core-security-common/mocks'; import { ComponentMeta, ComponentStoryObj } from '@storybook/react'; import React from 'react'; -import { InvestigationDetails as Component } from '.'; import { KibanaReactStorybookDecorator } from '../../../../../.storybook/storybook_decorator'; +import { InvestigationDetails as Component } from './investigation_details'; const meta: ComponentMeta = { component: Component, @@ -20,7 +21,7 @@ export default meta; const defaultProps: ComponentStoryObj = { args: {}, - render: (props) => , + render: (props) => , }; export const InvestigateViewStory: ComponentStoryObj = { diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/index.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/index.tsx deleted file mode 100644 index c1c77ef564545..0000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/index.tsx +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import datemath from '@elastic/datemath'; -import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; -import { AuthenticatedUser } from '@kbn/security-plugin/common'; -import React from 'react'; -import useAsync from 'react-use/lib/useAsync'; -import { AddObservationUI } from '../../../../components/add_observation_ui'; -import { InvestigateSearchBar } from '../../../../components/investigate_search_bar'; -import { InvestigateWidgetGrid } from '../../../../components/investigate_widget_grid'; -import { useFetchInvestigation } from '../../../../hooks/use_fetch_investigation'; -import { useKibana } from '../../../../hooks/use_kibana'; -import { InvestigationNotes } from '../investigation_notes/investigation_notes'; - -function InvestigationDetailsWithUser({ - user, - investigationId, -}: { - user: AuthenticatedUser; - investigationId: string; -}) { - const { - dependencies: { - start: { investigate }, - }, - } = useKibana(); - // const widgetDefinitions = investigate.getWidgetDefinitions(); - const { data: investigationData } = useFetchInvestigation({ id: investigationId }); - - const { - addItem, - copyItem, - deleteItem, - investigation, - setGlobalParameters, - renderableInvestigation, - } = investigate.useInvestigation({ - user, - investigationData, - }); - - if (!investigation || !renderableInvestigation || !investigationData) { - return ; - } - - return ( - - - - - - { - const nextDateRange = { - from: datemath.parse(dateRange.from)!.toISOString(), - to: datemath.parse(dateRange.to)!.toISOString(), - }; - await setGlobalParameters({ - ...renderableInvestigation.parameters, - timeRange: nextDateRange, - }); - }} - /> - - - - { - return copyItem(copiedItem.id); - }} - onItemDelete={async (deletedItem) => { - return deleteItem(deletedItem.id); - }} - /> - - - - { - return addItem(widget); - }} - /> - - - - - - - - ); -} - -export function InvestigationDetails({ investigationId }: { investigationId: string }) { - const { - core: { security }, - } = useKibana(); - - const user = useAsync(() => { - return security.authc.getCurrentUser(); - }, [security]); - - return user.value ? ( - - ) : null; -} 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 new file mode 100644 index 0000000000000..ebeb1a4dc1b42 --- /dev/null +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/investigation_details.tsx @@ -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 { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; +import { AuthenticatedUser } from '@kbn/security-plugin/common'; +import React from 'react'; +import { useFetchInvestigation } from '../../../../hooks/use_fetch_investigation'; +import { InvestigationItems } from '../investigation_items/investigation_items'; +import { InvestigationNotes } from '../investigation_notes/investigation_notes'; + +interface Props { + user: AuthenticatedUser; + investigationId: string; +} + +export function InvestigationDetails({ user, investigationId }: Props) { + const { data: investigation, isLoading } = useFetchInvestigation({ id: investigationId }); + + if (isLoading || !investigation) { + return ; + } + + 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 new file mode 100644 index 0000000000000..7be8799077118 --- /dev/null +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_items/investigation_items.tsx @@ -0,0 +1,90 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { GetInvestigationResponse, Item } from '@kbn/investigation-shared'; +import { pick } from 'lodash'; +import React from 'react'; +import { useAddInvestigationItem } from '../../../../hooks/use_add_investigation_item'; +import { useDeleteInvestigationItem } from '../../../../hooks/use_delete_investigation_item'; +import { useFetchInvestigationItems } from '../../../../hooks/use_fetch_investigation_items'; +import { useRenderItems } from '../../hooks/use_render_items'; +import { AddInvestigationItem } from '../add_investigation_item/add_investigation_item'; +import { InvestigationItemsList } from '../investigation_items_list/investigation_items_list'; +import { InvestigationSearchBar } from '../investigation_search_bar/investigation_search_bar'; + +export interface Props { + investigation: GetInvestigationResponse; +} + +export function InvestigationItems({ investigation }: Props) { + const { data: items, refetch } = useFetchInvestigationItems({ + investigationId: investigation.id, + initialItems: investigation.items, + }); + const renderableItems = useRenderItems({ items, params: investigation.params }); + + const { mutateAsync: addInvestigationItem, isLoading: isAdding } = useAddInvestigationItem(); + const { mutateAsync: deleteInvestigationItem, isLoading: isDeleting } = + useDeleteInvestigationItem(); + + const onAddItem = async (item: Item) => { + await addInvestigationItem({ investigationId: investigation.id, item }); + refetch(); + }; + + const onDeleteItem = async (itemId: string) => { + await deleteInvestigationItem({ investigationId: investigation.id, itemId }); + refetch(); + }; + + return ( + + + { + // const nextDateRange = { + // from: datemath.parse(dateRange.from)!.toISOString(), + // to: datemath.parse(dateRange.to)!.toISOString(), + // }; + // await setGlobalParameters({ + // ...renderableInvestigation.parameters, + // timeRange: nextDateRange, + // }); + }} + /> + + + { + await onAddItem(pick(copiedItem, ['title', 'type', 'params'])); + }} + onItemDelete={async (deletedItem) => { + await onDeleteItem(deletedItem.id); + }} + /> + + + + + + ); +} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_widget_grid/index.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_items_list/investigation_items_list.tsx similarity index 75% rename from x-pack/plugins/observability_solution/investigate_app/public/components/investigate_widget_grid/index.tsx rename to x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_items_list/investigation_items_list.tsx index 41c3b3a3e8b66..8ec5bf3ffef98 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_widget_grid/index.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_items_list/investigation_items_list.tsx @@ -8,24 +8,19 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import React from 'react'; import 'react-grid-layout/css/styles.css'; import 'react-resizable/css/styles.css'; +import { RenderedInvestigationItem } from '../../hooks/use_render_items'; import { GridItem } from '../grid_item'; -import './styles.scss'; - -export interface InvestigateWidgetGridItem { - id: string; - title: string; - element: React.ReactNode; - loading: boolean; -} interface InvestigateWidgetGridProps { - items: InvestigateWidgetGridItem[]; - onItemCopy: (item: InvestigateWidgetGridItem) => Promise; - onItemDelete: (item: InvestigateWidgetGridItem) => Promise; + items: RenderedInvestigationItem[]; + isLoading: boolean; + onItemCopy: (item: RenderedInvestigationItem) => Promise; + onItemDelete: (item: RenderedInvestigationItem) => Promise; } -export function InvestigateWidgetGrid({ +export function InvestigationItemsList({ items, + isLoading, onItemDelete, onItemCopy, }: InvestigateWidgetGridProps) { @@ -41,7 +36,7 @@ export function InvestigateWidgetGrid({ { return onItemCopy(item); }} 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 0f03a9f374ac3..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 { InvestigationNote } from '@kbn/investigate-plugin/common'; +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; - initialNotes: InvestigationNote[]; + investigation: GetInvestigationResponse; + user: AuthenticatedUser; } -export function InvestigationNotes({ investigationId, initialNotes }: Props) { +export function InvestigationNotes({ investigation, user }: Props) { const theme = useTheme(); const [noteInput, setNoteInput] = useState(''); const { data: notes, refetch } = useFetchInvestigationNotes({ - investigationId, - initialNotes, + 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}; `; @@ -70,14 +62,14 @@ export function InvestigationNotes({ investigationId, initialNotes }: Props) { - {notes?.map((currNote: InvestigationNote) => { + {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, initialNotes }: 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 0e0b29cccdd6f..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 { InvestigationNote } from '@kbn/investigate-plugin/common'; -// 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: InvestigationNote; - 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/components/investigate_search_bar/index.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_search_bar/investigation_search_bar.tsx similarity index 93% rename from x-pack/plugins/observability_solution/investigate_app/public/components/investigate_search_bar/index.tsx rename to x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_search_bar/investigation_search_bar.tsx index 45519f2e799be..a6ad73bc67d0d 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_search_bar/index.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_search_bar/investigation_search_bar.tsx @@ -8,7 +8,7 @@ import { css } from '@emotion/css'; import type { TimeRange } from '@kbn/es-query'; import { SearchBar } from '@kbn/unified-search-plugin/public'; import React from 'react'; -import { useKibana } from '../../hooks/use_kibana'; +import { useKibana } from '../../../../hooks/use_kibana'; const parentClassName = css` width: 100%; @@ -21,7 +21,7 @@ interface Props { onRefresh?: Required>['onRefresh']; } -export function InvestigateSearchBar({ +export function InvestigationSearchBar({ dateRangeFrom, dateRangeTo, onQuerySubmit, diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/hooks/use_render_items.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/hooks/use_render_items.tsx new file mode 100644 index 0000000000000..dc2c1c029bccd --- /dev/null +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/hooks/use_render_items.tsx @@ -0,0 +1,84 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import { GetInvestigationResponse, InvestigationItem } from '@kbn/investigation-shared'; +import React, { useEffect, useState } from 'react'; +import { useKibana } from '../../../hooks/use_kibana'; + +export type RenderedInvestigationItem = InvestigationItem & { + loading: boolean; + element: React.ReactNode; +}; + +export function useRenderItems({ + items, + params, +}: { + items?: InvestigationItem[]; + params: GetInvestigationResponse['params']; +}) { + const { + dependencies: { + start: { investigate }, + }, + } = useKibana(); + + const [renderableItems, setRenderableItems] = useState([]); + + useEffect(() => { + async function renderItems(currItems: InvestigationItem[]) { + return await Promise.all( + currItems.map(async (item) => { + const itemDefinition = investigate.getItemDefinitionByType(item.type); + if (!itemDefinition) { + return Promise.resolve({ + ...item, + loading: false, + element: ( +
+ {i18n.translate('xpack.investigateApp.renderableItems.div.notFoundLabel', { + defaultMessage: 'Not found for type {type}', + values: { type: item.type }, + })} +
+ ), + }); + } + + const globalParams = { + timeRange: { + from: new Date(params.timeRange.from).toISOString(), + to: new Date(params.timeRange.to).toISOString(), + }, + }; + + const data = await itemDefinition.generate({ + itemParams: item.params, + globalParams, + }); + + return Promise.resolve({ + ...item, + loading: false, + element: itemDefinition.render({ + data, + globalParams, + itemParams: item.params, + }), + }); + }) + ); + } + + if (items) { + renderItems(items).then((nextRenderableItems) => setRenderableItems(nextRenderableItems)); + } + }, [items, investigate, params]); + + return renderableItems; +} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/investigation_details_page.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/investigation_details_page.tsx index 90af6b4591c69..8bce69ea125af 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/investigation_details_page.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/investigation_details_page.tsx @@ -11,23 +11,29 @@ import { alertOriginSchema } from '@kbn/investigation-shared'; import { ALERT_RULE_CATEGORY } from '@kbn/rule-data-utils/src/default_alerts_as_data'; import React from 'react'; import { useParams } from 'react-router-dom'; +import useAsync from 'react-use/lib/useAsync'; import { paths } from '../../../common/paths'; import { useFetchAlert } from '../../hooks/use_get_alert_details'; import { useFetchInvestigation } from '../../hooks/use_get_investigation_details'; import { useKibana } from '../../hooks/use_kibana'; -import { InvestigationDetails } from './components/investigation_details'; +import { InvestigationDetails } from './components/investigation_details/investigation_details'; import { InvestigationDetailsPathParams } from './types'; export function InvestigationDetailsPage() { const { core: { http: { basePath }, + security, }, dependencies: { start: { observabilityShared }, }, } = useKibana(); + const user = useAsync(() => { + return security.authc.getCurrentUser(); + }, [security]); + const { investigationId } = useParams(); const ObservabilityPageTemplate = observabilityShared.navigation.PageTemplate; @@ -44,6 +50,10 @@ export function InvestigationDetailsPage() { const { data: alertDetails } = useFetchAlert({ id: alertId }); + if (!user.value) { + return null; + } + if (isFetchInvestigationLoading) { return (

@@ -106,7 +116,7 @@ export function InvestigationDetailsPage() { ], }} > - + ); } 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 75b07099cbb62..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,28 +125,25 @@ export class InvestigateAppPlugin .getStartServices() .then(([, pluginsStart]) => pluginsStart); - pluginsSetup.investigate.register((registerWidget) => - Promise.all([ - pluginsStartPromise, - import('./widgets/register_widgets').then((m) => m.registerWidgets), - getCreateEsqlService(), - ]).then(([pluginsStart, registerWidgets, createEsqlService]) => { - registerWidgets({ - dependencies: { - setup: pluginsSetup, - start: pluginsStart, - }, - services: { - esql: createEsqlService({ - data: pluginsStart.data, - dataViews: pluginsStart.dataViews, - lens: pluginsStart.lens, - }), - }, - registerWidget, - }); - }) - ); + Promise.all([ + pluginsStartPromise, + import('./items/register_items').then((m) => m.registerItems), + getCreateEsqlService(), + ]).then(([pluginsStart, registerItems, createEsqlService]) => { + registerItems({ + dependencies: { + setup: pluginsSetup, + start: pluginsStart, + }, + services: { + esql: createEsqlService({ + data: pluginsStart.data, + dataViews: pluginsStart.dataViews, + lens: pluginsStart.lens, + }), + }, + }); + }); return {}; } diff --git a/x-pack/plugins/observability_solution/investigate_app/public/widgets/embeddable_widget/create_embeddable_widget.ts b/x-pack/plugins/observability_solution/investigate_app/public/widgets/embeddable_widget/create_embeddable_widget.ts deleted file mode 100644 index 61e99df8b28b2..0000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/widgets/embeddable_widget/create_embeddable_widget.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { createWidgetFactory } from '@kbn/investigate-plugin/public'; -import { EMBEDDABLE_WIDGET_NAME } from '../../constants'; -import { EmbeddableWidgetParameters } from './types'; - -export const createEmbeddableWidget = - createWidgetFactory(EMBEDDABLE_WIDGET_NAME); diff --git a/x-pack/plugins/observability_solution/investigate_app/public/widgets/embeddable_widget/types.ts b/x-pack/plugins/observability_solution/investigate_app/public/widgets/embeddable_widget/types.ts deleted file mode 100644 index d3ecd0379c716..0000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/widgets/embeddable_widget/types.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { InvestigateWidget, InvestigateWidgetCreate } from '@kbn/investigate-plugin/common'; - -export interface EmbeddableWidgetParameters { - type: string; - savedObjectId?: string; - config: Record; -} - -export type EmbeddableWidgetCreate = InvestigateWidgetCreate; - -export type EmbeddableWidget = InvestigateWidget; 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/plugin.mock.tsx b/x-pack/plugins/observability_solution/observability/public/plugin.mock.tsx index 9bef3e98ddf84..93892427c01f9 100644 --- a/x-pack/plugins/observability_solution/observability/public/plugin.mock.tsx +++ b/x-pack/plugins/observability_solution/observability/public/plugin.mock.tsx @@ -15,6 +15,20 @@ import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks import type { AlertActionsProps } from '@kbn/triggers-actions-ui-plugin/public/types'; import { getAlertsTableDefaultAlertActionsLazy } from '@kbn/triggers-actions-ui-plugin/public/common/get_alerts_table_default_row_actions'; import { lensPluginMock } from '@kbn/lens-plugin/public/mocks'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; + +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: false, + }, + }, + logger: { + log: () => {}, + 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_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/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/service/client/index.test.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.test.ts index 33bd0ab49b1d7..f5c6b79b21788 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.test.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.test.ts @@ -33,7 +33,7 @@ type ChunkDelta = CreateChatCompletionResponseChunk['choices'][number]['delta']; type LlmSimulator = ReturnType; -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/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/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/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/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/osquery/public/fleet_integration/navigation_buttons.tsx b/x-pack/plugins/osquery/public/fleet_integration/navigation_buttons.tsx index cab1ca3beece1..bf6ce0dcc73e8 100644 --- a/x-pack/plugins/osquery/public/fleet_integration/navigation_buttons.tsx +++ b/x-pack/plugins/osquery/public/fleet_integration/navigation_buttons.tsx @@ -14,7 +14,7 @@ import { useKibana, isModifiedEvent, isLeftClickEvent } from '../common/lib/kiba interface NavigationButtonsProps { isDisabled?: boolean; - agentPolicyId?: string | undefined; + agentPolicyId?: string | null; } const NavigationButtonsComponent: React.FC = ({ 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/attack_discovery/attack_discovery_panel/tabs/attack_discovery_tab/index.tsx b/x-pack/plugins/security_solution/public/attack_discovery/attack_discovery_panel/tabs/attack_discovery_tab/index.tsx index 23a63d0503db3..a850ed1a5d41b 100644 --- a/x-pack/plugins/security_solution/public/attack_discovery/attack_discovery_panel/tabs/attack_discovery_tab/index.tsx +++ b/x-pack/plugins/security_solution/public/attack_discovery/attack_discovery_panel/tabs/attack_discovery_tab/index.tsx @@ -11,7 +11,7 @@ import { css } from '@emotion/react'; import React, { useMemo } from 'react'; import { AttackChain } from '../../../attack/attack_chain'; -import { InvestigateInTimelineButton } from '../../../../common/components/event_details/table/investigate_in_timeline_button'; +import { InvestigateInTimelineButton } from '../../../../common/components/event_details/investigate_in_timeline_button'; import { buildAlertsKqlFilter } from '../../../../detections/components/alerts_table/actions'; import { getTacticMetadata } from '../../../helpers'; import { AttackDiscoveryMarkdownFormatter } from '../../../attack_discovery_markdown_formatter'; diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/event_details.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/event_details.tsx deleted file mode 100644 index 92381ec3846bc..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/event_details/event_details.tsx +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export enum EventsViewType { - osqueryView = 'osquery-results-view', - responseActionsView = 'response-actions-results-view', -} diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.test.ts b/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.test.ts deleted file mode 100644 index fc793df1025e7..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.test.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { UseSummaryRowsProps } from './get_alert_summary_rows'; -import { useSummaryRows } from './get_alert_summary_rows'; -import { createAppRootMockRenderer, endpointAlertDataMock } from '../../mock/endpoint'; -import type { RenderHookResult } from '@testing-library/react-hooks/src/types'; -import type { AlertSummaryRow } from './helpers'; - -describe('useSummaryRows', () => { - let hookProps: UseSummaryRowsProps; - let renderHook: () => RenderHookResult; - - beforeEach(() => { - const appContextMock = createAppRootMockRenderer(); - - appContextMock.setExperimentalFlag({ - responseActionsSentinelOneV1Enabled: true, - responseActionsCrowdstrikeManualHostIsolationEnabled: true, - }); - - hookProps = { - data: endpointAlertDataMock.generateEndpointAlertDetailsItemData(), - browserFields: {}, - scopeId: 'scope-id', - eventId: 'event-id', - investigationFields: [], - }; - - renderHook = () => { - return appContextMock.renderHook(() => - useSummaryRows(hookProps) - ); - }; - }); - - it('returns summary rows for default event categories', () => { - const { result } = renderHook(); - - expect(result.current).toEqual( - expect.arrayContaining([ - expect.objectContaining({ title: 'host.name', description: expect.anything() }), - ]) - ); - }); - - it('excludes fields not related to the event source', () => { - const { result } = renderHook(); - - expect(result.current).not.toEqual( - expect.arrayContaining([ - expect.objectContaining({ - title: 'agent.id', - description: expect.anything(), - }), - ]) - ); - }); - - it('includes sentinel_one agent status field', () => { - hookProps.data = endpointAlertDataMock.generateSentinelOneAlertDetailsItemData(); - const { result } = renderHook(); - - expect(result.current).toEqual( - expect.arrayContaining([ - expect.objectContaining({ - title: 'Agent status', - description: expect.objectContaining({ - values: ['abfe4a35-d5b4-42a0-a539-bd054c791769'], - }), - }), - ]) - ); - }); - - it('includes crowdstrike agent status field', () => { - hookProps.data = endpointAlertDataMock.generateCrowdStrikeAlertDetailsItemData(); - const { result } = renderHook(); - - expect(result.current).toEqual( - expect.arrayContaining([ - expect.objectContaining({ - title: 'Agent status', - description: expect.objectContaining({ - values: ['abfe4a35-d5b4-42a0-a539-bd054c791769'], - }), - }), - ]) - ); - }); -}); diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx index 357e1230ebee5..f591c3d48e0db 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx @@ -4,16 +4,12 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useMemo } from 'react'; -import { find, isEmpty, uniqBy } from 'lodash/fp'; +import { find, uniqBy } from 'lodash/fp'; import { ALERT_RULE_PARAMETERS, ALERT_RULE_TYPE } from '@kbn/rule-data-utils'; import { EventCode, EventCategory } from '@kbn/securitysolution-ecs'; +import { i18n } from '@kbn/i18n'; import { SUPPORTED_AGENT_ID_ALERT_FIELDS } from '../../../../common/endpoint/service/response_actions/constants'; -import { isResponseActionsAlertAgentIdField } from '../../lib/endpoint'; -import { useAlertResponseActionsSupport } from '../../hooks/endpoint/use_alert_response_actions_support'; -import * as i18n from './translations'; -import type { BrowserFields } from '../../../../common/search_strategy/index_fields'; import { ALERTS_HEADERS_THRESHOLD_CARDINALITY, ALERTS_HEADERS_THRESHOLD_COUNT, @@ -31,17 +27,27 @@ import { AGENT_STATUS_FIELD_NAME, QUARANTINED_PATH_FIELD_NAME, } from '../../../timelines/components/timeline/body/renderers/constants'; -import type { AlertSummaryRow } from './helpers'; -import { getEnrichedFieldInfo } from './helpers'; -import type { EventSummaryField, EnrichedFieldInfo } from './types'; +import type { EventSummaryField } from './types'; import type { TimelineEventsDetailsItem } from '../../../../common/search_strategy/timeline'; const THRESHOLD_TERMS_FIELD = `${ALERT_THRESHOLD_RESULT}.terms.field`; const THRESHOLD_TERMS_VALUE = `${ALERT_THRESHOLD_RESULT}.terms.value`; const THRESHOLD_CARDINALITY_FIELD = `${ALERT_THRESHOLD_RESULT}.cardinality.field`; -const THRESHOLD_CARDINALITY_VALUE = `${ALERT_THRESHOLD_RESULT}.cardinality.value`; const THRESHOLD_COUNT = `${ALERT_THRESHOLD_RESULT}.count`; +const AGENT_STATUS = i18n.translate('xpack.securitySolution.detections.alerts.agentStatus', { + defaultMessage: 'Agent status', +}); +const QUARANTINED_FILE_PATH = i18n.translate( + 'xpack.securitySolution.detections.alerts.quarantinedFilePath', + { + defaultMessage: 'Quarantined file path', + } +); +const RULE_TYPE = i18n.translate('xpack.securitySolution.detections.alerts.ruleType', { + defaultMessage: 'Rule type', +}); + /** Always show these fields */ const alwaysDisplayedFields: EventSummaryField[] = [ { id: 'host.name' }, @@ -52,7 +58,7 @@ const alwaysDisplayedFields: EventSummaryField[] = [ return { id: fieldPath, overrideField: AGENT_STATUS_FIELD_NAME, - label: i18n.AGENT_STATUS, + label: AGENT_STATUS, }; }), @@ -72,7 +78,7 @@ const alwaysDisplayedFields: EventSummaryField[] = [ { id: 'orchestrator.resource.type' }, { id: 'process.executable' }, { id: 'file.path' }, - { id: ALERT_RULE_TYPE, label: i18n.RULE_TYPE }, + { id: ALERT_RULE_TYPE, label: RULE_TYPE }, ]; /** @@ -163,7 +169,7 @@ function getFieldsByEventCode( { id: 'file.Ext.quarantine_path', overrideField: QUARANTINED_PATH_FIELD_NAME, - label: i18n.QUARANTINED_FILE_PATH, + label: QUARANTINED_FILE_PATH, }, ]; default: @@ -297,192 +303,3 @@ export function getEventCategoriesFromData(data: TimelineEventsDetailsItem[]): E return { primaryEventCategory, allEventCategories }; } - -export interface UseSummaryRowsProps { - data: TimelineEventsDetailsItem[]; - browserFields: BrowserFields; - scopeId: string; - eventId: string; - investigationFields?: string[]; - isDraggable?: boolean; - isReadOnly?: boolean; -} - -export const useSummaryRows = ({ - data, - browserFields, - scopeId, - eventId, - isDraggable = false, - isReadOnly = false, - investigationFields, -}: UseSummaryRowsProps): AlertSummaryRow[] => { - const responseActionsSupport = useAlertResponseActionsSupport(data); - - return useMemo(() => { - const eventCategories = getEventCategoriesFromData(data); - - const eventCodeField = find({ category: 'event', field: 'event.code' }, data); - - const eventCode = Array.isArray(eventCodeField?.originalValue) - ? eventCodeField?.originalValue?.[0] - : eventCodeField?.originalValue; - - const eventRuleTypeField = find({ category: 'kibana', field: ALERT_RULE_TYPE }, data); - const eventRuleType = Array.isArray(eventRuleTypeField?.originalValue) - ? eventRuleTypeField?.originalValue?.[0] - : eventRuleTypeField?.originalValue; - - const tableFields = getEventFieldsToDisplay({ - eventCategories, - eventCode, - eventRuleType, - highlightedFieldsOverride: investigationFields ?? [], - }); - - return data != null - ? tableFields.reduce((acc, field) => { - const item = data.find( - (d) => d.field === field.id || (field.legacyId && d.field === field.legacyId) - ); - if (!item || isEmpty(item.values)) { - return acc; - } - - // If we found the data by its legacy id we swap the ids to display the correct one - if (item.field === field.legacyId) { - field.id = field.legacyId; - } - - const linkValueField = - field.linkField != null && data.find((d) => d.field === field.linkField); - const description = { - ...getEnrichedFieldInfo({ - item, - linkValueField: linkValueField || undefined, - contextId: scopeId, - scopeId, - browserFields, - eventId, - field, - }), - isDraggable, - isReadOnly, - }; - - // If the field is one used by a supported Response Actions agentType, - // and the alert's host supports response actions - // but the alert field is not the one that the agentType on the alert host uses, - // then exit and return accumulator - if ( - isResponseActionsAlertAgentIdField(field.id) && - responseActionsSupport.isSupported && - responseActionsSupport.details.agentIdField !== field.id - ) { - return acc; - } - - if (field.id === THRESHOLD_TERMS_FIELD) { - const enrichedInfo = enrichThresholdTerms(item, data, description); - if (enrichedInfo) { - return [...acc, ...enrichedInfo]; - } else { - return acc; - } - } - - if (field.id === THRESHOLD_CARDINALITY_FIELD) { - const enrichedInfo = enrichThresholdCardinality(item, data, description); - if (enrichedInfo) { - return [...acc, enrichedInfo]; - } else { - return acc; - } - } - - return [ - ...acc, - { - title: field.label ?? field.id, - description, - }, - ]; - }, []) - : []; - }, [ - data, - investigationFields, - scopeId, - browserFields, - eventId, - isDraggable, - isReadOnly, - responseActionsSupport.details.agentIdField, - responseActionsSupport.isSupported, - ]); -}; - -/** - * Enriches the summary data for threshold terms. - * For any given threshold term, it generates a row with the term's name and the associated value. - */ -function enrichThresholdTerms( - { values: termsFieldArr }: TimelineEventsDetailsItem, - data: TimelineEventsDetailsItem[], - description: EnrichedFieldInfo -) { - const termsValueItem = data.find((d) => d.field === THRESHOLD_TERMS_VALUE); - const termsValueArray = termsValueItem && termsValueItem.values; - - // Make sure both `fields` and `values` are an array and that they have the same length - if ( - Array.isArray(termsFieldArr) && - termsFieldArr.length > 0 && - Array.isArray(termsValueArray) && - termsFieldArr.length === termsValueArray.length - ) { - return termsFieldArr - .map((field, index) => ({ - title: field, - description: { - ...description, - values: [termsValueArray[index]], - }, - })) - .filter( - (entry) => - !alwaysDisplayedFields - .map((alwaysThereEntry) => alwaysThereEntry.id) - .includes(entry.title) - ); - } -} - -/** - * Enriches the summary data for threshold cardinality. - * Reads out the cardinality field and the value and interpolates them into a combined string value. - */ -function enrichThresholdCardinality( - { values: cardinalityFieldArr }: TimelineEventsDetailsItem, - data: TimelineEventsDetailsItem[], - description: EnrichedFieldInfo -) { - const cardinalityValueItem = data.find((d) => d.field === THRESHOLD_CARDINALITY_VALUE); - const cardinalityValueArray = cardinalityValueItem && cardinalityValueItem.values; - - // Only return a summary row if we actually have the correct field and value - if ( - Array.isArray(cardinalityFieldArr) && - cardinalityFieldArr.length === 1 && - Array.isArray(cardinalityValueArray) && - cardinalityFieldArr.length === cardinalityValueArray.length - ) { - return { - title: ALERTS_HEADERS_THRESHOLD_CARDINALITY, - description: { - ...description, - values: [`count(${cardinalityFieldArr[0]}) >= ${cardinalityValueArray[0]}`], - }, - }; - } -} diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/helpers.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/helpers.tsx index 6b3bd565f0eef..46f6449cce85e 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/helpers.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/helpers.tsx @@ -5,42 +5,7 @@ * 2.0. */ -import { get, getOr, isEmpty } from 'lodash/fp'; - -import { - elementOrChildrenHasFocus, - getFocusedDataColindexCell, - getTableSkipFocus, - handleSkipFocus, - stopPropagationAndPreventDefault, -} from '@kbn/timelines-plugin/public'; -import type { BrowserFields } from '../../containers/source'; -import type { TimelineEventsDetailsItem } from '../../../../common/search_strategy/timeline'; -import type { EnrichedFieldInfo, EventSummaryField } from './types'; - -import { - AGENT_STATUS_FIELD_NAME, - QUARANTINED_PATH_FIELD_NAME, -} from '../../../timelines/components/timeline/body/renderers/constants'; - -/** - * An item rendered in the table - */ -export interface Item { - description: string; - field: JSX.Element; - fieldId: string; - type: string; - values: string[]; -} - -export interface AlertSummaryRow { - title: string; - description: EnrichedFieldInfo & { - isDraggable?: boolean; - isReadOnly?: boolean; - }; -} +import { isEmpty } from 'lodash/fp'; /** Returns example text, or an empty string if the field does not have an example */ export const getExampleText = (example: string | number | null | undefined): string => @@ -69,111 +34,3 @@ export const getIconFromType = (type: string | null | undefined) => { }; export const EVENT_FIELDS_TABLE_CLASS_NAME = 'event-fields-table'; - -/** - * Returns `true` if the Event Details "event fields" table, or it's children, - * has focus - */ -export const tableHasFocus = (containerElement: HTMLElement | null): boolean => - elementOrChildrenHasFocus( - containerElement?.querySelector(`.${EVENT_FIELDS_TABLE_CLASS_NAME}`) - ); - -/** - * This function has a side effect. It will skip focus "after" or "before" - * the Event Details table, with exceptions as noted below. - * - * If the currently-focused table cell has additional focusable children, - * i.e. draggables or always-open popover content, the browser's "natural" - * focus management will determine which element is focused next. - */ -export const onEventDetailsTabKeyPressed = ({ - containerElement, - keyboardEvent, - onSkipFocusBeforeEventsTable, - onSkipFocusAfterEventsTable, -}: { - containerElement: HTMLElement | null; - keyboardEvent: React.KeyboardEvent; - onSkipFocusBeforeEventsTable: () => void; - onSkipFocusAfterEventsTable: () => void; -}) => { - const { shiftKey } = keyboardEvent; - - const eventFieldsTableSkipFocus = getTableSkipFocus({ - containerElement, - getFocusedCell: getFocusedDataColindexCell, - shiftKey, - tableHasFocus, - tableClassName: EVENT_FIELDS_TABLE_CLASS_NAME, - }); - - if (eventFieldsTableSkipFocus !== 'SKIP_FOCUS_NOOP') { - stopPropagationAndPreventDefault(keyboardEvent); - handleSkipFocus({ - onSkipFocusBackwards: onSkipFocusBeforeEventsTable, - onSkipFocusForward: onSkipFocusAfterEventsTable, - skipFocus: eventFieldsTableSkipFocus, - }); - } -}; - -export function getEnrichedFieldInfo({ - browserFields, - contextId, - eventId, - field, - item, - linkValueField, - scopeId, -}: { - browserFields: BrowserFields; - contextId: string; - item: TimelineEventsDetailsItem; - eventId: string; - field?: EventSummaryField; - scopeId: string; - linkValueField?: TimelineEventsDetailsItem; -}): EnrichedFieldInfo { - const fieldInfo = { - contextId, - eventId, - fieldType: 'string', - linkValue: undefined, - scopeId, - }; - const linkValue = getOr(null, 'originalValue.0', linkValueField); - const category = item.category ?? ''; - const fieldName = item.field ?? ''; - - const browserField = get([category, 'fields', fieldName], browserFields); - const overrideField = field?.overrideField; - return { - ...fieldInfo, - data: { - field: overrideField ?? fieldName, - format: browserField?.format?.id ?? '', - type: browserField?.type ?? '', - isObjectArray: item.isObjectArray, - }, - values: item.values, - linkValue: linkValue ?? undefined, - fieldFromBrowserField: browserField, - }; -} - -/** - * A lookup table for fields that should not have actions - */ -export const FIELDS_WITHOUT_ACTIONS: { [field: string]: boolean } = { - [AGENT_STATUS_FIELD_NAME]: true, - [QUARANTINED_PATH_FIELD_NAME]: true, -}; - -/** - * Checks whether the given field should have hover or row actions. - * The lookup is fast, so it is not necessary to memoize the result. - */ -export function hasHoverOrRowActions(field: string): boolean { - return !FIELDS_WITHOUT_ACTIONS[field]; -} diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/insights/translations.ts b/x-pack/plugins/security_solution/public/common/components/event_details/insights/translations.ts deleted file mode 100644 index 6afd236caf3d6..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/event_details/insights/translations.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -// TODO: MOVE TO FLYOUT FOLDER - https://github.com/elastic/security-team/issues/7462 -export const SUPPRESSED_ALERTS_COUNT_TECHNICAL_PREVIEW = i18n.translate( - 'xpack.securitySolution.alertDetails.overview.insights.suppressedAlertsCountTechnicalPreview', - { - defaultMessage: 'Technical Preview', - } -); diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/table/investigate_in_timeline_button.test.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/investigate_in_timeline_button.test.tsx similarity index 85% rename from x-pack/plugins/security_solution/public/common/components/event_details/table/investigate_in_timeline_button.test.tsx rename to x-pack/plugins/security_solution/public/common/components/event_details/investigate_in_timeline_button.test.tsx index 1c364e97fbd10..c9b2312c28f5e 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/table/investigate_in_timeline_button.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/investigate_in_timeline_button.test.tsx @@ -9,12 +9,12 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import { InvestigateInTimelineButton } from './investigate_in_timeline_button'; -import { TestProviders } from '../../../mock'; +import { TestProviders } from '../../mock'; import { getDataProvider } from './use_action_cell_data_provider'; -import { ACTION_INVESTIGATE_IN_TIMELINE } from '../../../../detections/components/alerts_table/translations'; +import { ACTION_INVESTIGATE_IN_TIMELINE } from '../../../detections/components/alerts_table/translations'; -jest.mock('../../../lib/kibana'); +jest.mock('../../lib/kibana'); describe('InvestigateInTimelineButton', () => { describe('When all props are provided', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/table/investigate_in_timeline_button.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/investigate_in_timeline_button.tsx similarity index 80% rename from x-pack/plugins/security_solution/public/common/components/event_details/table/investigate_in_timeline_button.tsx rename to x-pack/plugins/security_solution/public/common/components/event_details/investigate_in_timeline_button.tsx index eb43d61b2f8d4..f496ecc89b90b 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/table/investigate_in_timeline_button.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/investigate_in_timeline_button.tsx @@ -12,18 +12,18 @@ import type { IconType } from '@elastic/eui'; import type { Filter } from '@kbn/es-query'; import { useDispatch, useSelector } from 'react-redux'; -import { sourcererSelectors } from '../../../store'; -import { InputsModelId } from '../../../store/inputs/constants'; -import type { TimeRange } from '../../../store/inputs/model'; -import { inputsActions } from '../../../store/inputs'; -import { updateProviders, setFilters } from '../../../../timelines/store/actions'; -import { sourcererActions } from '../../../store/actions'; -import { SourcererScopeName } from '../../../../sourcerer/store/model'; -import type { DataProvider } from '../../../../../common/types'; -import { TimelineId } from '../../../../../common/types/timeline'; -import { TimelineTypeEnum } from '../../../../../common/api/timeline'; -import { useCreateTimeline } from '../../../../timelines/hooks/use_create_timeline'; -import { ACTION_INVESTIGATE_IN_TIMELINE } from '../../../../detections/components/alerts_table/translations'; +import { sourcererSelectors } from '../../store'; +import { InputsModelId } from '../../store/inputs/constants'; +import type { TimeRange } from '../../store/inputs/model'; +import { inputsActions } from '../../store/inputs'; +import { updateProviders, setFilters } from '../../../timelines/store/actions'; +import { sourcererActions } from '../../store/actions'; +import { SourcererScopeName } from '../../../sourcerer/store/model'; +import type { DataProvider } from '../../../../common/types'; +import { TimelineId } from '../../../../common/types/timeline'; +import { TimelineTypeEnum } from '../../../../common/api/timeline'; +import { useCreateTimeline } from '../../../timelines/hooks/use_create_timeline'; +import { ACTION_INVESTIGATE_IN_TIMELINE } from '../../../detections/components/alerts_table/translations'; export interface InvestigateInTimelineButtonProps { asEmptyButton: boolean; diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/__mocks__/index.ts b/x-pack/plugins/security_solution/public/common/components/event_details/mocks.ts similarity index 99% rename from x-pack/plugins/security_solution/public/common/components/event_details/__mocks__/index.ts rename to x-pack/plugins/security_solution/public/common/components/event_details/mocks.ts index 0f2cce38662d2..ffaf78cb29b4e 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/public/common/components/event_details/mocks.ts @@ -5,7 +5,7 @@ * 2.0. */ -export const generateAlertDetailsDataMock = () => [ +const generateAlertDetailsDataMock = () => [ { category: 'process', field: 'process.name', values: ['-'], originalValue: '-' }, { category: 'process', field: 'process.pid', values: [0], originalValue: 0 }, { category: 'process', field: 'process.executable', values: ['-'], originalValue: '-' }, diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/table/use_action_cell_data_provider.ts b/x-pack/plugins/security_solution/public/common/components/event_details/table/use_action_cell_data_provider.ts deleted file mode 100644 index d9bec6670766b..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/event_details/table/use_action_cell_data_provider.ts +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor 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 complexity */ - -import type { Filter } from '@kbn/es-query'; -import { escapeDataProviderId } from '@kbn/securitysolution-t-grid'; -import { isArray, isEmpty, isString } from 'lodash/fp'; -import { useMemo } from 'react'; -import type { FieldSpec } from '@kbn/data-plugin/common'; - -import { - AGENT_STATUS_FIELD_NAME, - EVENT_MODULE_FIELD_NAME, - EVENT_URL_FIELD_NAME, - GEO_FIELD_TYPE, - HOST_NAME_FIELD_NAME, - IP_FIELD_TYPE, - MESSAGE_FIELD_NAME, - REFERENCE_URL_FIELD_NAME, - RULE_REFERENCE_FIELD_NAME, - SIGNAL_RULE_NAME_FIELD_NAME, - SIGNAL_STATUS_FIELD_NAME, -} from '../../../../timelines/components/timeline/body/renderers/constants'; -import { BYTES_FORMAT } from '../../../../timelines/components/timeline/body/renderers/bytes'; -import { EVENT_DURATION_FIELD_NAME } from '../../../../timelines/components/duration'; -import { getDisplayValue } from '../../../../timelines/components/timeline/data_providers/helpers'; -import { PORT_NAMES } from '../../../../explore/network/components/port/helpers'; -import { INDICATOR_REFERENCE } from '../../../../../common/cti/constants'; -import type { DataProvider, DataProvidersAnd, QueryOperator } from '../../../../../common/types'; -import { IS_OPERATOR } from '../../../../../common/types'; - -export interface UseActionCellDataProvider { - contextId?: string; - eventId?: string; - field: string; - fieldFormat?: string; - fieldFromBrowserField?: Partial; - fieldType?: string; - isObjectArray?: boolean; - linkValue?: string | null; - values: string[] | null | undefined; -} - -export interface ActionCellValuesAndDataProvider { - values: string[]; - dataProviders: DataProvider[]; - filters: Filter[]; -} - -export const getDataProvider = ( - field: string, - id: string, - value: string | string[], - operator: QueryOperator = IS_OPERATOR, - excluded: boolean = false -): DataProvider => ({ - and: [], - enabled: true, - id: escapeDataProviderId(id), - name: field, - excluded, - kqlQuery: '', - queryMatch: { - field, - value, - operator, - displayValue: getDisplayValue(value), - }, -}); - -export const getDataProviderAnd = ( - field: string, - id: string, - value: string | string[], - operator: QueryOperator = IS_OPERATOR, - excluded: boolean = false -): DataProvidersAnd => { - const { and, ...dataProvider } = getDataProvider(field, id, value, operator, excluded); - return dataProvider; -}; - -export const useActionCellDataProvider = ({ - contextId, - eventId, - field, - fieldFormat, - fieldFromBrowserField, - fieldType, - isObjectArray, - linkValue, - values, -}: UseActionCellDataProvider): ActionCellValuesAndDataProvider | null => { - const cellData = useMemo(() => { - if (values === null || values === undefined) return null; - const arrayValues = Array.isArray(values) ? values : [values]; - - // For fields with multiple values we need add an extra filter that makes sure - // that only fields that match ALL the values are queried later on. - let filters: Filter[] = []; - if (arrayValues.length > 1) { - filters = [ - { - meta: {}, - query: { - bool: { - must: arrayValues.map((value) => ({ term: { [field]: value } })), - }, - }, - }, - ]; - } - - return arrayValues.reduce( - (memo, value, index) => { - let id: string = ''; - let valueAsString: string = isString(value) ? value : `${values}`; - const appendedUniqueId = `${contextId}-${eventId}-${field}-${index}-${value}`; - if (fieldFromBrowserField == null) { - memo.values.push(valueAsString); - return memo; - } - - if (isObjectArray || fieldType === GEO_FIELD_TYPE || [MESSAGE_FIELD_NAME].includes(field)) { - memo.values.push(valueAsString); - return memo; - } else if (fieldType === IP_FIELD_TYPE) { - id = `formatted-ip-data-provider-${contextId}-${field}-${value}-${eventId}`; - if (isString(value) && !isEmpty(value)) { - let addresses = value; - try { - addresses = JSON.parse(value); - } catch (_) { - // Default to keeping the existing string value - } - if (isArray(addresses)) { - valueAsString = addresses.join(','); - addresses.forEach((ip) => memo.dataProviders.push(getDataProvider(field, id, ip))); - } - memo.dataProviders.push(getDataProvider(field, id, addresses)); - memo.values.push(valueAsString); - return memo; - } - } else if (PORT_NAMES.some((portName) => field === portName)) { - id = `port-default-draggable-${appendedUniqueId}`; - } else if (field === EVENT_DURATION_FIELD_NAME) { - id = `duration-default-draggable-${appendedUniqueId}`; - } else if (field === HOST_NAME_FIELD_NAME) { - id = `event-details-value-default-draggable-${appendedUniqueId}`; - } else if (fieldFormat === BYTES_FORMAT) { - id = `bytes-default-draggable-${appendedUniqueId}`; - } else if (field === SIGNAL_RULE_NAME_FIELD_NAME) { - id = `event-details-value-default-draggable-${appendedUniqueId}-${linkValue}`; - } else if (field === EVENT_MODULE_FIELD_NAME) { - id = `event-details-value-default-draggable-${appendedUniqueId}-${value}`; - } else if (field === SIGNAL_STATUS_FIELD_NAME) { - id = `alert-details-value-default-draggable-${appendedUniqueId}`; - } else if (field === AGENT_STATUS_FIELD_NAME) { - const valueToUse = typeof value === 'string' ? value : ''; - id = `event-details-value-default-draggable-${appendedUniqueId}`; - valueAsString = valueToUse; - } else if ( - [ - RULE_REFERENCE_FIELD_NAME, - REFERENCE_URL_FIELD_NAME, - EVENT_URL_FIELD_NAME, - INDICATOR_REFERENCE, - ].includes(field) - ) { - id = `event-details-value-default-draggable-${appendedUniqueId}-${value}`; - } else { - id = `event-details-value-default-draggable-${appendedUniqueId}`; - } - memo.values.push(valueAsString); - memo.dataProviders.push(getDataProvider(field, id, value)); - return memo; - }, - { values: [], dataProviders: [], filters } - ); - }, [ - contextId, - eventId, - field, - fieldFormat, - fieldFromBrowserField, - fieldType, - isObjectArray, - linkValue, - values, - ]); - return cellData; -}; diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/translations.ts b/x-pack/plugins/security_solution/public/common/components/event_details/translations.ts index 2362284b3f696..f991db91582db 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/translations.ts +++ b/x-pack/plugins/security_solution/public/common/components/event_details/translations.ts @@ -7,64 +7,6 @@ import { i18n } from '@kbn/i18n'; -export const TABLE = i18n.translate('xpack.securitySolution.eventDetails.table', { - defaultMessage: 'Table', -}); - -export const DESCRIPTION = i18n.translate('xpack.securitySolution.eventDetails.description', { - defaultMessage: 'Description', -}); - -export const AGENT_STATUS = i18n.translate('xpack.securitySolution.detections.alerts.agentStatus', { - defaultMessage: 'Agent status', -}); - -export const QUARANTINED_FILE_PATH = i18n.translate( - 'xpack.securitySolution.detections.alerts.quarantinedFilePath', - { - defaultMessage: 'Quarantined file path', - } -); - -export const RULE_TYPE = i18n.translate('xpack.securitySolution.detections.alerts.ruleType', { - defaultMessage: 'Rule type', -}); - -export const ACTIONS = i18n.translate('xpack.securitySolution.eventDetails.table.actions', { - defaultMessage: 'Actions', -}); - -export const ALERT_REASON = i18n.translate('xpack.securitySolution.eventDetails.alertReason', { - defaultMessage: 'Alert reason', -}); - -export const ENDPOINT_COMMANDS = Object.freeze({ - tried: (command: string) => - i18n.translate('xpack.securitySolution.eventDetails.responseActions.endpoint.tried', { - values: { command }, - defaultMessage: 'tried to execute {command} command', - }), - executed: (command: string) => - i18n.translate('xpack.securitySolution.eventDetails.responseActions.endpoint.executed', { - values: { command }, - defaultMessage: 'executed {command} command', - }), - pending: (command: string) => - i18n.translate('xpack.securitySolution.eventDetails.responseActions.endpoint.pending', { - values: { command }, - defaultMessage: 'is executing {command} command', - }), - failed: (command: string) => - i18n.translate('xpack.securitySolution.eventDetails.responseActions.endpoint.failed', { - values: { command }, - defaultMessage: 'failed to execute {command} command', - }), -}); - -export const SUMMARY_VIEW = i18n.translate('xpack.securitySolution.eventDetails.summaryView', { - defaultMessage: 'summary', -}); - export const ALERT_SUMMARY_CONVERSATION_ID = i18n.translate( 'xpack.securitySolution.alertSummaryView.alertSummaryViewConversationId', { diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/types.ts b/x-pack/plugins/security_solution/public/common/components/event_details/types.ts index 7db13725d9eb3..7aff42e2a0ebc 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/types.ts +++ b/x-pack/plugins/security_solution/public/common/components/event_details/types.ts @@ -17,17 +17,6 @@ export interface FieldsData { isObjectArray: boolean; } -export interface EnrichedFieldInfo { - data: FieldsData | EventFieldsData; - eventId: string; - fieldFromBrowserField?: Partial; - scopeId: string; - values: string[] | null | undefined; - linkValue?: string; -} - -export type EnrichedFieldInfoWithValues = EnrichedFieldInfo & { values: string[] }; - export interface EventSummaryField { id: string; legacyId?: string; diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/use_action_cell_data_provider.ts b/x-pack/plugins/security_solution/public/common/components/event_details/use_action_cell_data_provider.ts new file mode 100644 index 0000000000000..ded9ced84b3ac --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/event_details/use_action_cell_data_provider.ts @@ -0,0 +1,44 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { escapeDataProviderId } from '@kbn/securitysolution-t-grid'; + +import { getDisplayValue } from '../../../timelines/components/timeline/data_providers/helpers'; +import type { DataProvider, DataProvidersAnd, QueryOperator } from '../../../../common/types'; +import { IS_OPERATOR } from '../../../../common/types'; + +export const getDataProvider = ( + field: string, + id: string, + value: string | string[], + operator: QueryOperator = IS_OPERATOR, + excluded: boolean = false +): DataProvider => ({ + and: [], + enabled: true, + id: escapeDataProviderId(id), + name: field, + excluded, + kqlQuery: '', + queryMatch: { + field, + value, + operator, + displayValue: getDisplayValue(value), + }, +}); + +export const getDataProviderAnd = ( + field: string, + id: string, + value: string | string[], + operator: QueryOperator = IS_OPERATOR, + excluded: boolean = false +): DataProvidersAnd => { + const { and, ...dataProvider } = getDataProvider(field, id, value, operator, excluded); + return dataProvider; +}; diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.test.tsx index 8ea10b1c54f8c..37d4e004edf54 100644 --- a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.test.tsx @@ -16,15 +16,15 @@ import { import { KibanaServices } from '../../../../lib/kibana'; import type { DefaultTimeRangeSetting } from '../../../../utils/default_date_settings'; import { plugin, renderer as Renderer } from '.'; -import type { InvestigateInTimelineButtonProps } from '../../../event_details/table/investigate_in_timeline_button'; +import type { InvestigateInTimelineButtonProps } from '../../../event_details/investigate_in_timeline_button'; import { useUpsellingMessage } from '../../../../hooks/use_upselling'; jest.mock('../../../../lib/kibana'); const mockGetServices = KibanaServices.get as jest.Mock; -jest.mock('../../../event_details/table/investigate_in_timeline_button', () => { +jest.mock('../../../event_details/investigate_in_timeline_button', () => { const originalModule = jest.requireActual( - '../../../event_details/table/investigate_in_timeline_button' + '../../../event_details/investigate_in_timeline_button' ); return { ...originalModule, diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.tsx b/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.tsx index f38a20ddd7ad0..0496033b0ab45 100644 --- a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.tsx @@ -43,7 +43,7 @@ import { useKibana } from '../../../../lib/kibana'; import { useInsightQuery } from './use_insight_query'; import { useInsightDataProviders, type Provider } from './use_insight_data_providers'; import { BasicAlertDataContext } from '../../../../../flyout/document_details/left/components/investigation_guide_view'; -import { InvestigateInTimelineButton } from '../../../event_details/table/investigate_in_timeline_button'; +import { InvestigateInTimelineButton } from '../../../event_details/investigate_in_timeline_button'; import { getTimeRangeSettings, parseDateWithDefault, diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_data_providers.test.ts b/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_data_providers.test.ts index 9ab25b00eabd3..4d1807b91b718 100644 --- a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_data_providers.test.ts +++ b/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_data_providers.test.ts @@ -11,7 +11,7 @@ import { useInsightDataProviders, type UseInsightDataProvidersResult, } from './use_insight_data_providers'; -import { mockAlertDetailsData } from '../../../event_details/__mocks__'; +import { mockAlertDetailsData } from '../../../event_details/mocks'; const mockAlertDetailsDataWithIsObject = mockAlertDetailsData.map((detail) => { return { diff --git a/x-pack/plugins/security_solution/public/common/components/response_actions/endpoint_action_results.tsx b/x-pack/plugins/security_solution/public/common/components/response_actions/endpoint_action_results.tsx index 7444a53ee441f..f0d21c00287fd 100644 --- a/x-pack/plugins/security_solution/public/common/components/response_actions/endpoint_action_results.tsx +++ b/x-pack/plugins/security_solution/public/common/components/response_actions/endpoint_action_results.tsx @@ -15,7 +15,7 @@ import type { import { useUserPrivileges } from '../user_privileges'; import { useGetAutomatedActionResponseList } from '../../../management/hooks/response_actions/use_get_automated_action_list'; import { ActionsLogExpandedTray } from '../../../management/components/endpoint_response_actions_list/components/action_log_expanded_tray'; -import { ENDPOINT_COMMANDS } from '../event_details/translations'; +import { ENDPOINT_COMMANDS } from './translations'; import { ResponseActionsEmptyPrompt } from './response_actions_empty_prompt'; interface EndpointResponseActionResultsProps { diff --git a/x-pack/plugins/security_solution/public/common/components/response_actions/translations.ts b/x-pack/plugins/security_solution/public/common/components/response_actions/translations.ts index c71d344539bb6..2c59cfef1bfd8 100644 --- a/x-pack/plugins/security_solution/public/common/components/response_actions/translations.ts +++ b/x-pack/plugins/security_solution/public/common/components/response_actions/translations.ts @@ -13,3 +13,26 @@ export const LOAD_CONNECTORS_ERROR_MESSAGE = i18n.translate( defaultMessage: 'Error loading connectors. Please check your configuration and try again.', } ); + +export const ENDPOINT_COMMANDS = Object.freeze({ + tried: (command: string) => + i18n.translate('xpack.securitySolution.eventDetails.responseActions.endpoint.tried', { + values: { command }, + defaultMessage: 'tried to execute {command} command', + }), + executed: (command: string) => + i18n.translate('xpack.securitySolution.eventDetails.responseActions.endpoint.executed', { + values: { command }, + defaultMessage: 'executed {command} command', + }), + pending: (command: string) => + i18n.translate('xpack.securitySolution.eventDetails.responseActions.endpoint.pending', { + values: { command }, + defaultMessage: 'is executing {command} command', + }), + failed: (command: string) => + i18n.translate('xpack.securitySolution.eventDetails.responseActions.endpoint.failed', { + values: { command }, + defaultMessage: 'failed to execute {command} command', + }), +}); diff --git a/x-pack/plugins/security_solution/public/detections/mitre/get_mitre_threat_component.ts b/x-pack/plugins/security_solution/public/detections/mitre/get_mitre_threat_component.ts deleted file mode 100644 index 0848cbcca15c6..0000000000000 --- a/x-pack/plugins/security_solution/public/detections/mitre/get_mitre_threat_component.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { Threats } from '@kbn/securitysolution-io-ts-alerting-types'; -import type { SearchHit } from '../../../common/search_strategy'; -import { buildThreatDescription } from '../../detection_engine/rule_creation_ui/components/description_step/helpers'; - -// TODO: MOVE TO FLYOUT FOLDER - https://github.com/elastic/security-team/issues/7462 -export const getMitreComponentParts = (searchHit?: SearchHit) => { - const ruleParameters = searchHit?.fields - ? searchHit?.fields['kibana.alert.rule.parameters'] - : null; - const threat = ruleParameters ? (ruleParameters[0]?.threat as Threats) : null; - return threat && threat.length > 0 - ? buildThreatDescription({ - label: threat[0].framework, - threat, - }) - : null; -}; diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.test.tsx index d7e16697ce250..18efc5fcbad7f 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.test.tsx @@ -155,16 +155,6 @@ jest.mock('../../../common/lib/kibana', () => { }; }); -jest.mock('../../../timelines/components/side_panel/hooks/use_detail_panel', () => { - return { - useDetailPanel: () => ({ - openEventDetailsPanel: jest.fn(), - handleOnDetailsPanelClosed: () => {}, - DetailsPanel: () =>

    , - shouldShowDetailsPanel: false, - }), - }; -}); const dataViewId = 'security-solution-default'; const stateWithBuildingBlockAlertsEnabled: State = { diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.tsx index 70b238825d66a..ea16fcfa80e93 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.tsx @@ -20,9 +20,9 @@ import { CellTooltipWrapper } from '../../shared/components/cell_tooltip_wrapper import type { DataProvider } from '../../../../../common/types'; import { SeverityBadge } from '../../../../common/components/severity_badge'; import { usePaginatedAlerts } from '../hooks/use_paginated_alerts'; -import { InvestigateInTimelineButton } from '../../../../common/components/event_details/table/investigate_in_timeline_button'; +import { InvestigateInTimelineButton } from '../../../../common/components/event_details/investigate_in_timeline_button'; import { ACTION_INVESTIGATE_IN_TIMELINE } from '../../../../detections/components/alerts_table/translations'; -import { getDataProvider } from '../../../../common/components/event_details/table/use_action_cell_data_provider'; +import { getDataProvider } from '../../../../common/components/event_details/use_action_cell_data_provider'; import { AlertPreviewButton } from '../../../shared/components/alert_preview_button'; export const TIMESTAMP_DATE_FORMAT = 'MMM D, YYYY @ HH:mm:ss.SSS'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.tsx index e3134591d6c9b..5aae6c4b39269 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.tsx @@ -26,7 +26,7 @@ import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { FormattedCount } from '../../../../common/components/formatted_number'; import { useLicense } from '../../../../common/hooks/use_license'; -import { InvestigateInTimelineButton } from '../../../../common/components/event_details/table/investigate_in_timeline_button'; +import { InvestigateInTimelineButton } from '../../../../common/components/event_details/investigate_in_timeline_button'; import type { PrevalenceData } from '../../shared/hooks/use_prevalence'; import { usePrevalence } from '../../shared/hooks/use_prevalence'; import { @@ -47,7 +47,7 @@ import { useDocumentDetailsContext } from '../../shared/context'; import { getDataProvider, getDataProviderAnd, -} from '../../../../common/components/event_details/table/use_action_cell_data_provider'; +} from '../../../../common/components/event_details/use_action_cell_data_provider'; import { getEmptyTagValue } from '../../../../common/components/empty_value'; import { IS_OPERATOR } from '../../../../../common/types'; import { useKibana } from '../../../../common/lib/kibana'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/suppressed_alerts.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/suppressed_alerts.tsx index efd1628f9d70a..b817be7a308b5 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/suppressed_alerts.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/suppressed_alerts.tsx @@ -11,15 +11,22 @@ import type { EcsSecurityExtension as Ecs } from '@kbn/securitysolution-ecs'; import { ALERT_RULE_TYPE } from '@kbn/rule-data-utils'; import { EuiBetaBadge, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; +import { i18n } from '@kbn/i18n'; import { ExpandablePanel } from '@kbn/security-solution-common'; import { CORRELATIONS_DETAILS_SUPPRESSED_ALERTS_SECTION_TEST_ID, SUPPRESSED_ALERTS_SECTION_TECHNICAL_PREVIEW_TEST_ID, } from './test_ids'; -import { SUPPRESSED_ALERTS_COUNT_TECHNICAL_PREVIEW } from '../../../../common/components/event_details/insights/translations'; import { InvestigateInTimelineAction } from '../../../../detections/components/alerts_table/timeline_actions/investigate_in_timeline_action'; import { isSuppressionRuleInGA } from '../../../../../common/detection_engine/utils'; +const SUPPRESSED_ALERTS_COUNT_TECHNICAL_PREVIEW = i18n.translate( + 'xpack.securitySolution.flyout.left.insights.suppressedAlertsCountTechnicalPreview', + { + defaultMessage: 'Technical Preview', + } +); + export interface SuppressedAlertsProps { /** * An object with top level fields from the ECS object diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/mitre_attack.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/mitre_attack.tsx index 2c7a45dc17346..7aabc3eefb964 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/mitre_attack.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/mitre_attack.tsx @@ -8,9 +8,27 @@ import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui'; import type { FC } from 'react'; import React, { useMemo } from 'react'; -import { MITRE_ATTACK_DETAILS_TEST_ID, MITRE_ATTACK_TITLE_TEST_ID } from './test_ids'; -import { getMitreComponentParts } from '../../../../detections/mitre/get_mitre_threat_component'; +import type { Threats } from '@kbn/securitysolution-io-ts-alerting-types'; +import type { SearchHit } from '../../../../../common/search_strategy'; +import { buildThreatDescription } from '../../../../detection_engine/rule_creation_ui/components/description_step/helpers'; import { useDocumentDetailsContext } from '../../shared/context'; +import { MITRE_ATTACK_DETAILS_TEST_ID, MITRE_ATTACK_TITLE_TEST_ID } from './test_ids'; + +/** + * Retrieves mitre attack information from the alert information + */ +const getMitreComponentParts = (searchHit?: SearchHit) => { + const ruleParameters = searchHit?.fields + ? searchHit?.fields['kibana.alert.rule.parameters'] + : null; + const threat = ruleParameters ? (ruleParameters[0]?.threat as Threats) : null; + return threat && threat.length > 0 + ? buildThreatDescription({ + label: threat[0].framework, + threat, + }) + : null; +}; export const MitreAttack: FC = () => { const { searchHit } = useDocumentDetailsContext(); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/status.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/status.tsx index 2737a5a608b5a..c75e1426da10b 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/status.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/status.tsx @@ -9,17 +9,13 @@ import type { FC } from 'react'; import React, { useMemo } from 'react'; import { find } from 'lodash/fp'; import { FormattedMessage } from '@kbn/i18n-react'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; import { getEmptyTagValue } from '../../../../common/components/empty_value'; -import type { - EnrichedFieldInfo, - EnrichedFieldInfoWithValues, -} from '../../../../common/components/event_details/types'; import { SIGNAL_STATUS_FIELD_NAME } from '../../../../timelines/components/timeline/body/renderers/constants'; -import { StatusPopoverButton } from '../../../../common/components/event_details/overview/status_popover_button'; +import { StatusPopoverButton } from './status_popover_button'; import { useDocumentDetailsContext } from '../../shared/context'; -import { getEnrichedFieldInfo } from '../../../../common/components/event_details/helpers'; +import type { EnrichedFieldInfo, EnrichedFieldInfoWithValues } from '../utils/enriched_field_info'; +import { getEnrichedFieldInfo } from '../utils/enriched_field_info'; import { CellActions } from './cell_actions'; import { STATUS_TITLE_TEST_ID } from './test_ids'; @@ -34,7 +30,6 @@ function hasData(fieldInfo?: EnrichedFieldInfo): fieldInfo is EnrichedFieldInfoW * Document details status displayed in flyout right section header */ export const DocumentStatus: FC = () => { - const { closeFlyout } = useExpandableFlyoutApi(); const { eventId, browserFields, dataFormattedForFieldBrowser, scopeId, isPreview } = useDocumentDetailsContext(); @@ -77,7 +72,6 @@ export const DocumentStatus: FC = () => { contextId={scopeId} enrichedFieldInfo={statusData} scopeId={scopeId} - handleOnEventClosed={closeFlyout} /> )} diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/overview/status_popover_button.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/status_popover_button.test.tsx similarity index 98% rename from x-pack/plugins/security_solution/public/common/components/event_details/overview/status_popover_button.test.tsx rename to x-pack/plugins/security_solution/public/flyout/document_details/right/components/status_popover_button.test.tsx index e6cb909bfaf01..e9161ba909ec6 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/overview/status_popover_button.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/status_popover_button.test.tsx @@ -9,8 +9,9 @@ import React from 'react'; import { render } from '@testing-library/react'; import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl'; import { StatusPopoverButton } from './status_popover_button'; -import { TestProviders } from '../../../mock'; +import { TestProviders } from '../../../../common/mock'; import { useAlertsPrivileges } from '../../../../detections/containers/detection_engine/alerts/use_alerts_privileges'; + const props = { eventId: 'testid', contextId: 'alerts-page', diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/overview/status_popover_button.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/status_popover_button.tsx similarity index 75% rename from x-pack/plugins/security_solution/public/common/components/event_details/overview/status_popover_button.tsx rename to x-pack/plugins/security_solution/public/flyout/document_details/right/components/status_popover_button.tsx index f02b37672545a..b5ff44ede0dd7 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/overview/status_popover_button.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/status_popover_button.tsx @@ -6,8 +6,10 @@ */ import { EuiContextMenu, EuiPopover, EuiPopoverTitle } from '@elastic/eui'; -import React, { useCallback, useMemo, useState } from 'react'; - +import React, { memo, useCallback, useMemo, useState } from 'react'; +import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import { getFieldFormat } from '../utils/get_field_format'; +import type { EnrichedFieldInfoWithValues } from '../utils/enriched_field_info'; import { useAlertsActions } from '../../../../detections/components/alerts_table/timeline_actions/use_alerts_actions'; import type { Status } from '../../../../../common/api/detection_engine'; import { @@ -15,30 +17,44 @@ import { CLICK_TO_CHANGE_ALERT_STATUS, } from '../../../../detections/components/alerts_table/translations'; import { FormattedFieldValue } from '../../../../timelines/components/timeline/body/renderers/formatted_field'; -import type { EnrichedFieldInfoWithValues } from '../types'; -import type { inputsModel } from '../../../store'; -import { inputsSelectors } from '../../../store'; -import { useDeepEqualSelector } from '../../../hooks/use_selector'; -import { getFieldFormat } from '../get_field_format'; +import type { inputsModel } from '../../../../common/store'; +import { inputsSelectors } from '../../../../common/store'; +import { useDeepEqualSelector } from '../../../../common/hooks/use_selector'; interface StatusPopoverButtonProps { + /** + * Id of the document + */ eventId: string; + /** + * Value used to create a unique identifier in children components + */ contextId: string; + /** + * Information used to + */ enrichedFieldInfo: EnrichedFieldInfoWithValues; + /** + * Maintain backwards compatibility // TODO remove when possible + */ scopeId: string; - handleOnEventClosed: () => void; } -// TODO: MOVE TO FLYOUT FOLDER - https://github.com/elastic/security-team/issues/7462 -export const StatusPopoverButton = React.memo( - ({ eventId, contextId, enrichedFieldInfo, scopeId, handleOnEventClosed }) => { +/** + * Renders a button and its popover to display the status of an alert and allows the user to change it. + * It is used in the header of the document details flyout. + */ +export const StatusPopoverButton = memo( + ({ eventId, contextId, enrichedFieldInfo, scopeId }: StatusPopoverButtonProps) => { + const { closeFlyout } = useExpandableFlyoutApi(); + const [isPopoverOpen, setIsPopoverOpen] = useState(false); const togglePopover = useCallback(() => setIsPopoverOpen(!isPopoverOpen), [isPopoverOpen]); const closePopover = useCallback(() => setIsPopoverOpen(false), []); const closeAfterAction = useCallback(() => { closePopover(); - handleOnEventClosed(); - }, [closePopover, handleOnEventClosed]); + closeFlyout(); + }, [closeFlyout, closePopover]); const getGlobalQuerySelector = useMemo(() => inputsSelectors.globalQuery(), []); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/suppressed_alerts.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/suppressed_alerts.tsx index e8ef71bbe594e..a8cd147a4ac14 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/suppressed_alerts.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/suppressed_alerts.tsx @@ -9,6 +9,7 @@ import React from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiBetaBadge } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import type { Type } from '@kbn/securitysolution-io-ts-alerting-types'; +import { i18n } from '@kbn/i18n'; import { isSuppressionRuleInGA } from '../../../../../common/detection_engine/utils'; import { @@ -16,7 +17,13 @@ import { CORRELATIONS_SUPPRESSED_ALERTS_TECHNICAL_PREVIEW_TEST_ID, } from './test_ids'; import { InsightsSummaryRow } from './insights_summary_row'; -import { SUPPRESSED_ALERTS_COUNT_TECHNICAL_PREVIEW } from '../../../../common/components/event_details/insights/translations'; + +const SUPPRESSED_ALERTS_COUNT_TECHNICAL_PREVIEW = i18n.translate( + 'xpack.securitySolution.flyout.right.overview.insights.suppressedAlertsCountTechnicalPreview', + { + defaultMessage: 'Technical Preview', + } +); export interface SuppressedAlertsProps { /** diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.tsx index 8212ddc70c420..86950fa31837f 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.tsx @@ -8,7 +8,7 @@ import React, { memo } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; import type { FieldSpec } from '@kbn/data-plugin/common'; -import { getFieldFormat } from '../../../../common/components/event_details/get_field_format'; +import { getFieldFormat } from '../utils/get_field_format'; import type { EventFieldsData } from '../../../../common/components/event_details/types'; import { OverflowField } from '../../../../common/components/tables/helpers'; import { FormattedFieldValue } from '../../../../timelines/components/timeline/body/renderers/formatted_field'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/take_action_dropdown.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/take_action_dropdown.test.tsx index 6a902ef2b5ce6..6189f1b353ec8 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/take_action_dropdown.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/take_action_dropdown.test.tsx @@ -11,7 +11,7 @@ import { waitFor } from '@testing-library/react'; import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; import type { TakeActionDropdownProps } from './take_action_dropdown'; import { TakeActionDropdown } from './take_action_dropdown'; -import { generateAlertDetailsDataMock } from '../../../../common/components/event_details/__mocks__'; +import { mockAlertDetailsData } from '../../../../common/components/event_details/mocks'; import { getDetectionAlertMock } from '../../../../common/mock/mock_detection_alerts'; import { TimelineId } from '../../../../../common/types/timeline'; import { TestProviders } from '../../../../common/mock'; @@ -77,7 +77,7 @@ describe('take action dropdown', () => { beforeEach(() => { defaultProps = { - dataFormattedForFieldBrowser: generateAlertDetailsDataMock() as TimelineEventsDetailsItem[], + dataFormattedForFieldBrowser: mockAlertDetailsData as TimelineEventsDetailsItem[], dataAsNestedObject: getDetectionAlertMock(), handleOnEventClosed: jest.fn(), isHostIsolationPanelOpen: false, diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_assistant.ts b/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_assistant.ts index 2196674964cfe..da65a684b026c 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_assistant.ts +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_assistant.ts @@ -8,6 +8,7 @@ import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; import { useAssistantOverlay } from '@kbn/elastic-assistant'; import { useCallback } from 'react'; +import { i18n } from '@kbn/i18n'; import { useAssistantAvailability } from '../../../../assistant/use_assistant_availability'; import { getRawData } from '../../../../assistant/helpers'; import { @@ -17,7 +18,6 @@ import { EVENT_SUMMARY_CONTEXT_DESCRIPTION, EVENT_SUMMARY_CONVERSATION_ID, EVENT_SUMMARY_VIEW_CONTEXT_TOOLTIP, - SUMMARY_VIEW, } from '../../../../common/components/event_details/translations'; import { PROMPT_CONTEXT_ALERT_CATEGORY, @@ -25,6 +25,10 @@ import { PROMPT_CONTEXTS, } from '../../../../assistant/content/prompt_contexts'; +const SUMMARY_VIEW = i18n.translate('xpack.securitySolution.eventDetails.summaryView', { + defaultMessage: 'summary', +}); + const useAssistantNoop = () => ({ promptContextId: undefined }); export interface UseAssistantParams { diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts b/x-pack/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts new file mode 100644 index 0000000000000..110cd30556e98 --- /dev/null +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts @@ -0,0 +1,70 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { BrowserFields, TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; +import { get, getOr } from 'lodash/fp'; +import type { FieldSpec } from '@kbn/data-views-plugin/common'; +import type { + EventFieldsData, + EventSummaryField, + FieldsData, +} from '../../../../common/components/event_details/types'; + +export interface EnrichedFieldInfo { + data: FieldsData | EventFieldsData; + eventId: string; + fieldFromBrowserField?: Partial; + scopeId: string; + values: string[] | null | undefined; + linkValue?: string; +} + +export type EnrichedFieldInfoWithValues = EnrichedFieldInfo & { values: string[] }; + +export function getEnrichedFieldInfo({ + browserFields, + contextId, + eventId, + field, + item, + linkValueField, + scopeId, +}: { + browserFields: BrowserFields; + contextId: string; + item: TimelineEventsDetailsItem; + eventId: string; + field?: EventSummaryField; + scopeId: string; + linkValueField?: TimelineEventsDetailsItem; +}): EnrichedFieldInfo { + const fieldInfo = { + contextId, + eventId, + fieldType: 'string', + linkValue: undefined, + scopeId, + }; + const linkValue = getOr(null, 'originalValue.0', linkValueField); + const category = item.category ?? ''; + const fieldName = item.field ?? ''; + + const browserField = get([category, 'fields', fieldName], browserFields); + const overrideField = field?.overrideField; + return { + ...fieldInfo, + data: { + field: overrideField ?? fieldName, + format: browserField?.format?.id ?? '', + type: browserField?.type ?? '', + isObjectArray: item.isObjectArray, + }, + values: item.values, + linkValue: linkValue ?? undefined, + fieldFromBrowserField: browserField, + }; +} diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/get_field_format.ts b/x-pack/plugins/security_solution/public/flyout/document_details/right/utils/get_field_format.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/event_details/get_field_format.ts rename to x-pack/plugins/security_solution/public/flyout/document_details/right/utils/get_field_format.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx index c93cb6228ac6a..2ed2b20ab78a7 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx @@ -573,13 +573,15 @@ export const EndpointList = () => { ); } else if (!policyItemsLoading && hasPolicyData) { - const selectionOptions: EuiSelectableProps['options'] = policyItems.map((item) => { - return { - key: item.policy_id, - label: item.name, - checked: selectedPolicyId === item.policy_id ? 'on' : undefined, - }; - }); + const selectionOptions: EuiSelectableProps['options'] = policyItems + .filter((item) => item.policy_id) + .map((item) => { + return { + key: item.policy_id as string, + label: item.name, + checked: selectedPolicyId === item.policy_id ? 'on' : undefined, + }; + }); return ( { - connectorId?: string; - subAction: string; - subActionParams?: P; - disabled?: boolean; -} - -export const useSubAction = ({ - connectorId, - subAction, - subActionParams, - disabled = false, - ...rest -}: UseSubActionParams) => { - const { http } = useKibana().services; - - return useQuery({ - queryKey: ['useSubAction', connectorId, subAction, subActionParams], - queryFn: ({ signal }) => - executeAction({ - id: connectorId as string, - params: { - subAction, - subActionParams, - }, - http, - signal, - }), - enabled: !disabled && !!connectorId && !!subAction, - ...rest, - }); -}; diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/use_sub_action_mutation.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/use_sub_action_mutation.tsx deleted file mode 100644 index 6a2c788a59c26..0000000000000 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/flyout/use_sub_action_mutation.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { executeAction } from '@kbn/triggers-actions-ui-plugin/public'; -import { useMutation } from '@tanstack/react-query'; -import { useKibana } from '../../../../../common/lib/kibana/kibana_react'; - -export interface UseSubActionParams

    { - connectorId: string; - subAction: string; - subActionParams?: P; -} - -export const useSubActionMutation = ({ - connectorId, - subAction, - subActionParams, -}: UseSubActionParams

    ) => { - const { http } = useKibana().services; - - return useMutation({ - mutationKey: ['executeSubAction', connectorId, subAction, subActionParams], - mutationFn: () => - executeAction({ - id: connectorId, - params: { - subAction, - subActionParams, - }, - http, - }), - }); -}; diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/helpers.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/helpers.tsx deleted file mode 100644 index fc1941b6824c2..0000000000000 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/helpers.tsx +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { DEFAULT_ALERTS_INDEX, DEFAULT_PREVIEW_INDEX } from '../../../../../common/constants'; - -/* -The referenced alert _index in the flyout uses the `.internal.` such as -`.internal.alerts-security.alerts-spaceId` in the alert page flyout and -.internal.preview.alerts-security.alerts-spaceId` in the rule creation preview flyout -but we always want to use their respective aliase indices rather than accessing their backing .internal. indices. -*/ -export const getAlertIndexAlias = ( - index: string, - spaceId: string = 'default' -): string | undefined => { - if (index.startsWith(`.internal${DEFAULT_ALERTS_INDEX}`)) { - return `${DEFAULT_ALERTS_INDEX}-${spaceId}`; - } else if (index.startsWith(`.internal${DEFAULT_PREVIEW_INDEX}`)) { - return `${DEFAULT_PREVIEW_INDEX}-${spaceId}`; - } -}; diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.test.tsx deleted file mode 100644 index 06bce7781e0bf..0000000000000 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.test.tsx +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { renderHook, act } from '@testing-library/react-hooks'; -import React from 'react'; -import type { UseDetailPanelConfig } from './use_detail_panel'; -import { useDetailPanel } from './use_detail_panel'; -import { useDeepEqualSelector } from '../../../../common/hooks/use_selector'; -import { SourcererScopeName } from '../../../../sourcerer/store/model'; -import { TimelineId } from '../../../../../common/types/timeline'; -import { ExpandableFlyoutProvider } from '@kbn/expandable-flyout'; -import { TestProviders } from '../../../../common/mock'; -import { createTelemetryServiceMock } from '../../../../common/lib/telemetry/telemetry_service.mock'; - -const mockedTelemetry = createTelemetryServiceMock(); -jest.mock('../../../../common/lib/kibana', () => { - const original = jest.requireActual('../../../../common/lib/kibana'); - return { - ...original, - useKibana: () => ({ - ...original.useKibana(), - services: { - ...original.useKibana().services, - telemetry: mockedTelemetry, - }, - }), - }; -}); -jest.mock('../../../../common/hooks/use_selector'); -jest.mock('../../../store'); - -jest.mock('../../../../sourcerer/containers', () => { - const mockSourcererReturn = { - browserFields: {}, - loading: true, - indexPattern: {}, - selectedPatterns: [], - missingPatterns: [], - }; - return { - useSourcererDataView: jest.fn().mockReturnValue(mockSourcererReturn), - }; -}); - -describe('useDetailPanel', () => { - const defaultProps: UseDetailPanelConfig = { - sourcererScope: SourcererScopeName.detections, - scopeId: TimelineId.test, - }; - const mockGetExpandedDetail = jest.fn().mockImplementation(() => ({})); - beforeEach(() => { - (useDeepEqualSelector as jest.Mock).mockImplementation((cb) => { - return mockGetExpandedDetail(); - }); - }); - afterEach(() => { - (useDeepEqualSelector as jest.Mock).mockClear(); - }); - - const wrapper = ({ children }: { children: React.ReactChild }) => ( - - {children} - - ); - const renderUseDetailPanel = (props = defaultProps) => - renderHook(() => useDetailPanel(props), { wrapper }); - - test('should return open fns (event, host, network, user), handleOnDetailsPanelClosed fn, shouldShowDetailsPanel, and the DetailsPanel component', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderUseDetailPanel(); - await waitForNextUpdate(); - - expect(result.current.openEventDetailsPanel).toBeDefined(); - }); - }); -}); diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.tsx deleted file mode 100644 index fde0d04b8610f..0000000000000 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/hooks/use_detail_panel.tsx +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { useMemo, useCallback } from 'react'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { useKibana } from '../../../../common/lib/kibana'; -import { useSourcererDataView } from '../../../../sourcerer/containers'; -import type { SourcererScopeName } from '../../../../sourcerer/store/model'; -import { DocumentDetailsRightPanelKey } from '../../../../flyout/document_details/shared/constants/panel_keys'; - -export interface UseDetailPanelConfig { - sourcererScope: SourcererScopeName; - scopeId: string; -} -export interface UseDetailPanelReturn { - openEventDetailsPanel: (eventId?: string, onClose?: () => void) => void; -} - -export const useDetailPanel = ({ - sourcererScope, - scopeId, -}: UseDetailPanelConfig): UseDetailPanelReturn => { - const { telemetry } = useKibana().services; - const { selectedPatterns } = useSourcererDataView(sourcererScope); - - const { openFlyout } = useExpandableFlyoutApi(); - - const eventDetailsIndex = useMemo(() => selectedPatterns.join(','), [selectedPatterns]); - - const openEventDetailsPanel = useCallback( - (eventId?: string, onClose?: () => void) => { - openFlyout({ - right: { - id: DocumentDetailsRightPanelKey, - params: { - id: eventId, - indexName: eventDetailsIndex, - scopeId, - }, - }, - }); - telemetry.reportDetailsFlyoutOpened({ - location: scopeId, - panel: 'right', - }); - }, - [openFlyout, eventDetailsIndex, scopeId, telemetry] - ); - - return { - openEventDetailsPanel, - }; -}; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx index 1a4906b6c530a..246e46cfab04e 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx @@ -53,8 +53,8 @@ const SearchTimelineSuperSelectComponent: React.FC { - setIsPopoverOpen(true); + const handlePopover = useCallback(() => { + setIsPopoverOpen((isOpen) => !isOpen); }, []); const handleKeyboardOpen: EuiFieldTextProps['onKeyDown'] = useCallback((event) => { @@ -69,7 +69,7 @@ const SearchTimelineSuperSelectComponent: React.FC ( { }), }; }); -const mockOpenDetailFn = jest.fn(); - -jest.mock('../../../side_panel/hooks/use_detail_panel', () => { - return { - useDetailPanel: () => ({ - openEventDetailsPanel: mockOpenDetailFn, - handleOnDetailsPanelClosed: () => {}, - DetailsPanel: () =>

    , - shouldShowDetailsPanel: false, - }), - }; -}); describe('useSessionView with active timeline and a session id and graph event id', () => { let setTimelineFullScreen: jest.Mock; @@ -155,12 +143,7 @@ describe('useSessionView with active timeline and a session id and graph event i }, { wrapper: Wrapper } ); - expect(kibana.services.sessionView.getSessionView).toHaveBeenCalledWith({ - height: 1000, - sessionEntityId: 'test', - loadAlertDetails: mockOpenDetailFn, - canReadPolicyManagement: false, - }); + expect(kibana.services.sessionView.getSessionView).toHaveBeenCalled(); }); describe('useSessionView with non active timeline and graph event id set', () => { diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/session/use_session_view.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/session/use_session_view.tsx index 49af740647ce1..e2aa8c42511d7 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/session/use_session_view.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/session/use_session_view.tsx @@ -11,6 +11,9 @@ import styled from 'styled-components'; import { useDispatch } from 'react-redux'; import { dataTableSelectors, tableDefaults } from '@kbn/securitysolution-data-table'; import type { TableId } from '@kbn/securitysolution-data-table'; +import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import { DocumentDetailsRightPanelKey } from '../../../../../flyout/document_details/shared/constants/panel_keys'; +import { useSourcererDataView } from '../../../../../sourcerer/containers'; import { getScopedActions, isActiveTimeline, @@ -20,7 +23,6 @@ import { import { useKibana } from '../../../../../common/lib/kibana'; import * as i18n from './translations'; import { TimelineTabs } from '../../../../../../common/types/timeline'; -import { useDetailPanel } from '../../../side_panel/hooks/use_detail_panel'; import { SourcererScopeName } from '../../../../../sourcerer/store/model'; import { isFullScreen } from '../../body/column_headers'; import { SCROLLING_DISABLED_CLASS_NAME } from '../../../../../../common/constants'; @@ -242,7 +244,7 @@ export const useSessionViewNavigation = ({ scopeId }: { scopeId: string }) => { }; export const useSessionView = ({ scopeId, height }: { scopeId: string; height?: number }) => { - const { sessionView } = useKibana().services; + const { sessionView, telemetry } = useKibana().services; const getScope = useMemo(() => { if (isTimelineScope(scopeId)) { return timelineSelectors.getTimelineByIdSelector(); @@ -280,10 +282,30 @@ export const useSessionView = ({ scopeId, height }: { scopeId: string; height?: return SourcererScopeName.default; } }, [scopeId]); - const { openEventDetailsPanel } = useDetailPanel({ - sourcererScope, - scopeId, - }); + + const { selectedPatterns } = useSourcererDataView(sourcererScope); + const eventDetailsIndex = useMemo(() => selectedPatterns.join(','), [selectedPatterns]); + + const { openFlyout } = useExpandableFlyoutApi(); + const openAlertDetailsFlyout = useCallback( + (eventId?: string, onClose?: () => void) => { + openFlyout({ + right: { + id: DocumentDetailsRightPanelKey, + params: { + id: eventId, + indexName: eventDetailsIndex, + scopeId, + }, + }, + }); + telemetry.reportDetailsFlyoutOpened({ + location: scopeId, + panel: 'right', + }); + }, + [openFlyout, eventDetailsIndex, scopeId, telemetry] + ); const sessionViewComponent = useMemo(() => { const sessionViewSearchBarHeight = 118; @@ -291,7 +313,7 @@ export const useSessionView = ({ scopeId, height }: { scopeId: string; height?: return sessionViewConfig !== null ? sessionView.getSessionView({ ...sessionViewConfig, - loadAlertDetails: openEventDetailsPanel, + loadAlertDetails: openAlertDetailsFlyout, isFullScreen: fullScreen, height: heightMinusSearchBar, canReadPolicyManagement, @@ -301,13 +323,13 @@ export const useSessionView = ({ scopeId, height }: { scopeId: string; height?: height, sessionViewConfig, sessionView, - openEventDetailsPanel, + openAlertDetailsFlyout, fullScreen, canReadPolicyManagement, ]); return { - openEventDetailsPanel, + openEventDetailsPanel: openAlertDetailsFlyout, SessionView: sessionViewComponent, }; }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/fetch_rules_by_query_or_ids.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/fetch_rules_by_query_or_ids.ts index d59ba5676b607..d74bcc5e7f450 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/fetch_rules_by_query_or_ids.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/fetch_rules_by_query_or_ids.ts @@ -13,18 +13,19 @@ import { initPromisePool } from '../../../../../../utils/promise_pool'; import type { RuleAlertType } from '../../../../rule_schema'; import { readRules } from '../../../logic/detection_rules_client/read_rules'; import { findRules } from '../../../logic/search/find_rules'; -import { MAX_RULES_TO_PROCESS_TOTAL } from './route'; export const fetchRulesByQueryOrIds = async ({ query, ids, rulesClient, abortSignal, + maxRules, }: { query: string | undefined; ids: string[] | undefined; rulesClient: RulesClient; abortSignal: AbortSignal; + maxRules: number; }): Promise> => { 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/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/timelines/common/utils/accessibility/helpers.ts b/x-pack/plugins/timelines/common/utils/accessibility/helpers.ts index e877edd28458b..f1bedd4fc42eb 100644 --- a/x-pack/plugins/timelines/common/utils/accessibility/helpers.ts +++ b/x-pack/plugins/timelines/common/utils/accessibility/helpers.ts @@ -638,13 +638,6 @@ export const onKeyDownFocusHandler = ({ } }; -/** - * An `onFocus` event handler that focuses the first child draggable - * keyboard handler - */ -export const onFocusReFocusDraggable = (event: React.FocusEvent) => - event.target.querySelector(`.${DRAGGABLE_KEYBOARD_WRAPPER_CLASS_NAME}`)?.focus(); - /** Returns `true` when the element, or one of it's children has focus */ export const elementOrChildrenHasFocus = (element: HTMLElement | null | undefined): boolean => element === document.activeElement || element?.querySelector(':focus-within') != null; @@ -661,18 +654,6 @@ export type FocusableElement = | HTMLTextAreaElement | HTMLVideoElement; -/** - * This function has a side effect. It focuses the first element with a - * matching `className` in the `containerElement`. - */ -export const skipFocusInContainerTo = ({ - containerElement, - className, -}: { - containerElement: HTMLElement | null; - className: string; -}) => containerElement?.querySelector(`.${className}`)?.focus(); - /** * Returns a table cell's focusable children, which may be one of the following * a) a `HTMLButtonElement` that does NOT have the `disabled` attribute 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 5720c13617f13..c389ecbced287 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", @@ -19741,7 +19749,6 @@ "xpack.fleet.createPackagePolicy.StepSelectPolicy.errorLoadingAgentPoliciesTitle": "Erreur lors du chargement des stratégies d'agent", "xpack.fleet.createPackagePolicy.StepSelectPolicy.errorLoadingPackageTitle": "Erreur lors du chargement des informations de pack", "xpack.fleet.createPackagePolicy.StepSelectPolicy.errorLoadingSelectedAgentPolicyTitle": "Erreur lors du chargement de la stratégie d'agent sélectionnée", - "xpack.fleet.createPackagePolicy.StepSelectPolicy.noPolicySelectedError": "Une stratégie d'agent est requise.", "xpack.fleet.createPackagePolicy.transformInstallWithCurrentUserPermissionCallout": "Ce package a {count, plural, one {une ressource de transformation qui sera créée et démarrée} other {# ressources de transformation qui seront créées et démarrées}} avec les mêmes rôles que l'utilisateur responsable de l'installation du package.", "xpack.fleet.createPackagePolicyBottomBar.addAnotherIntegration": "Ajouter une autre intégration", "xpack.fleet.createPackagePolicyBottomBar.backButton": "Retour", @@ -25716,23 +25723,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", @@ -26032,15 +26030,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", @@ -26955,8 +26953,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.", @@ -29606,13 +29604,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", @@ -33068,13 +33065,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", @@ -34450,7 +34445,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}", @@ -35423,7 +35417,6 @@ "xpack.securitySolution.alertCountByRuleByStatus.status": "Statut", "xpack.securitySolution.alertCountByRuleByStatus.tooltipTitle": "Nom de règle", "xpack.securitySolution.alertDetails.overview.hostRiskDataTitle": "Données de risque de {riskEntity}", - "xpack.securitySolution.alertDetails.overview.insights.suppressedAlertsCountTechnicalPreview": "Version d'évaluation technique", "xpack.securitySolution.alertDetails.summary.readLess": "Lire moins", "xpack.securitySolution.alertDetails.summary.readMore": "En savoir plus", "xpack.securitySolution.alerts.badge.readOnly.tooltip": "Impossible de mettre à jour les alertes", @@ -36419,8 +36412,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.", @@ -38786,15 +38779,11 @@ "xpack.securitySolution.event.summary.threat_indicator.modal.allMatches": "Toutes les correspondances d'indicateur", "xpack.securitySolution.event.summary.threat_indicator.modal.close": "Fermer", "xpack.securitySolution.event.summary.threat_indicator.showMatches": "Afficher les {count} alertes de correspondance d'indicateur", - "xpack.securitySolution.eventDetails.alertReason": "Raison d'alerte", - "xpack.securitySolution.eventDetails.description": "Description", "xpack.securitySolution.eventDetails.responseActions.endpoint.executed": "a exécuté la commande {command}", "xpack.securitySolution.eventDetails.responseActions.endpoint.failed": "n'a pas pu exécuter la commande {command}", "xpack.securitySolution.eventDetails.responseActions.endpoint.pending": "exécute la commande {command}", "xpack.securitySolution.eventDetails.responseActions.endpoint.tried": "a tenté d'exécuter la commande {command}", "xpack.securitySolution.eventDetails.summaryView": "résumé", - "xpack.securitySolution.eventDetails.table": "Tableau", - "xpack.securitySolution.eventDetails.table.actions": "Actions", "xpack.securitySolution.eventFilter.flyoutForm.confirmModal.name": "filtre d'événements", "xpack.securitySolution.eventFilter.flyoutForm.creationSuccessToastTitle": "\"{name}\" a été ajouté à la liste de filtres d'événements.", "xpack.securitySolution.eventFilter.form.description.placeholder": "Description", @@ -39232,10 +39221,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", @@ -39322,10 +39307,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", @@ -41688,7 +41669,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", @@ -42033,8 +42013,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", @@ -43480,8 +43460,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 1b7ca43b70998..9c07019f89da0 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": "クラウドプロバイダー", @@ -19731,7 +19739,6 @@ "xpack.fleet.createPackagePolicy.StepSelectPolicy.errorLoadingAgentPoliciesTitle": "エージェントポリシーの読み込みエラー", "xpack.fleet.createPackagePolicy.StepSelectPolicy.errorLoadingPackageTitle": "パッケージ情報の読み込みエラー", "xpack.fleet.createPackagePolicy.StepSelectPolicy.errorLoadingSelectedAgentPolicyTitle": "選択したエージェントポリシーの読み込みエラー", - "xpack.fleet.createPackagePolicy.StepSelectPolicy.noPolicySelectedError": "エージェントポリシーは必須です。", "xpack.fleet.createPackagePolicy.transformInstallWithCurrentUserPermissionCallout": "このパッケージには、パッケージをインストールするユーザーと同じロールで作成、開始される{count, plural, one {1個のトランスフォームアセット} other {# トランスフォームアセット}}があります。", "xpack.fleet.createPackagePolicyBottomBar.addAnotherIntegration": "別の統合を追加", "xpack.fleet.createPackagePolicyBottomBar.backButton": "戻る", @@ -25704,23 +25711,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": "トレンドライン", @@ -26021,15 +26019,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": "注釈", @@ -26944,8 +26942,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": "データビューはどのインデックスも参照していません。", @@ -29595,13 +29593,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": "母集団で頻繁にまれ", @@ -33055,13 +33052,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": "行を展開", @@ -34435,7 +34430,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}", @@ -35408,7 +35402,6 @@ "xpack.securitySolution.alertCountByRuleByStatus.status": "ステータス", "xpack.securitySolution.alertCountByRuleByStatus.tooltipTitle": "ルール名", "xpack.securitySolution.alertDetails.overview.hostRiskDataTitle": "{riskEntity}リスクデータ", - "xpack.securitySolution.alertDetails.overview.insights.suppressedAlertsCountTechnicalPreview": "テクニカルプレビュー", "xpack.securitySolution.alertDetails.summary.readLess": "表示を減らす", "xpack.securitySolution.alertDetails.summary.readMore": "続きを読む", "xpack.securitySolution.alerts.badge.readOnly.tooltip": "アラートを更新できません", @@ -36403,8 +36396,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": "インジケータープレフィックスの無効化を空にすることはできません", @@ -38768,15 +38761,11 @@ "xpack.securitySolution.event.summary.threat_indicator.modal.allMatches": "すべてのインジケーター一致", "xpack.securitySolution.event.summary.threat_indicator.modal.close": "閉じる", "xpack.securitySolution.event.summary.threat_indicator.showMatches": "すべての{count}件のインジケーター一致アラートを表示", - "xpack.securitySolution.eventDetails.alertReason": "アラートの理由", - "xpack.securitySolution.eventDetails.description": "説明", "xpack.securitySolution.eventDetails.responseActions.endpoint.executed": "{command}コマンドを実行しました", "xpack.securitySolution.eventDetails.responseActions.endpoint.failed": "{command}コマンドを実行できませんでした", "xpack.securitySolution.eventDetails.responseActions.endpoint.pending": "{command}コマンドを実行しています", "xpack.securitySolution.eventDetails.responseActions.endpoint.tried": "{command}コマンドを実行しようとしました", "xpack.securitySolution.eventDetails.summaryView": "まとめ", - "xpack.securitySolution.eventDetails.table": "表", - "xpack.securitySolution.eventDetails.table.actions": "アクション", "xpack.securitySolution.eventFilter.flyoutForm.confirmModal.name": "イベントフィルター", "xpack.securitySolution.eventFilter.flyoutForm.creationSuccessToastTitle": "\"{name}\"がイベントフィルターリストに追加されました。", "xpack.securitySolution.eventFilter.form.description.placeholder": "説明", @@ -39215,10 +39204,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": "概要", @@ -39305,10 +39290,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": "新しいホストとユーザーのインサイトがあります", @@ -41673,7 +41654,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": "ドキュメントを表示", @@ -42017,8 +41997,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": "カスタムフィルター", @@ -43460,8 +43440,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 b12d587e357bd..b67b0cdc24bac 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": "云服务提供商", @@ -19757,7 +19765,6 @@ "xpack.fleet.createPackagePolicy.StepSelectPolicy.errorLoadingAgentPoliciesTitle": "加载代理策略时出错", "xpack.fleet.createPackagePolicy.StepSelectPolicy.errorLoadingPackageTitle": "加载软件包信息时出错", "xpack.fleet.createPackagePolicy.StepSelectPolicy.errorLoadingSelectedAgentPolicyTitle": "加载选定代理策略时出错", - "xpack.fleet.createPackagePolicy.StepSelectPolicy.noPolicySelectedError": "代理策略必填。", "xpack.fleet.createPackagePolicy.transformInstallWithCurrentUserPermissionCallout": "此软件包具有 {count, plural, one {一个转换资产} other {# 个转换资产}},它们将使用与安装软件包的用户相同的角色创建并启动。", "xpack.fleet.createPackagePolicyBottomBar.addAnotherIntegration": "添加其他集成", "xpack.fleet.createPackagePolicyBottomBar.backButton": "返回", @@ -25736,23 +25743,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": "趋势线", @@ -26053,15 +26051,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": "标注", @@ -26976,8 +26974,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": "您的数据视图未指向任何索引。", @@ -29630,13 +29628,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": "群体中极罕见", @@ -33095,13 +33092,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": "展开行", @@ -34476,7 +34471,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}", @@ -35449,7 +35443,6 @@ "xpack.securitySolution.alertCountByRuleByStatus.status": "状态", "xpack.securitySolution.alertCountByRuleByStatus.tooltipTitle": "规则名称", "xpack.securitySolution.alertDetails.overview.hostRiskDataTitle": "{riskEntity}风险数据", - "xpack.securitySolution.alertDetails.overview.insights.suppressedAlertsCountTechnicalPreview": "技术预览", "xpack.securitySolution.alertDetails.summary.readLess": "阅读更少内容", "xpack.securitySolution.alertDetails.summary.readMore": "阅读更多内容", "xpack.securitySolution.alerts.badge.readOnly.tooltip": "无法更新告警", @@ -36445,8 +36438,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": "指标前缀覆盖不得为空", @@ -38812,15 +38805,11 @@ "xpack.securitySolution.event.summary.threat_indicator.modal.allMatches": "所有指标匹配", "xpack.securitySolution.event.summary.threat_indicator.modal.close": "关闭", "xpack.securitySolution.event.summary.threat_indicator.showMatches": "显示所有 {count} 个指标匹配告警", - "xpack.securitySolution.eventDetails.alertReason": "告警原因", - "xpack.securitySolution.eventDetails.description": "描述", "xpack.securitySolution.eventDetails.responseActions.endpoint.executed": "已执行 {command} 命令", "xpack.securitySolution.eventDetails.responseActions.endpoint.failed": "无法执行 {command} 命令", "xpack.securitySolution.eventDetails.responseActions.endpoint.pending": "正在执行 {command} 命令", "xpack.securitySolution.eventDetails.responseActions.endpoint.tried": "已尝试执行 {command} 命令", "xpack.securitySolution.eventDetails.summaryView": "摘要", - "xpack.securitySolution.eventDetails.table": "表", - "xpack.securitySolution.eventDetails.table.actions": "操作", "xpack.securitySolution.eventFilter.flyoutForm.confirmModal.name": "事件筛选", "xpack.securitySolution.eventFilter.flyoutForm.creationSuccessToastTitle": "“{name}”已添加到事件筛选列表。", "xpack.securitySolution.eventFilter.form.description.placeholder": "描述", @@ -39259,10 +39248,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": "概览", @@ -39348,10 +39333,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": "有新主机和用户洞见可用", @@ -41717,7 +41698,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": "查看文档", @@ -42061,8 +42041,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": "定制筛选", @@ -43508,8 +43488,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/config.ts b/x-pack/plugins/triggers_actions_ui/config.ts deleted file mode 100644 index 3f288f7e4ddb7..0000000000000 --- a/x-pack/plugins/triggers_actions_ui/config.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema, TypeOf } from '@kbn/config-schema'; - -export const configSchema = schema.object({ - enableGeoTrackingThresholdAlert: schema.maybe(schema.boolean({ defaultValue: false })), -}); - -export type ConfigSchema = TypeOf; 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/helper.ts b/x-pack/test/api_integration/apis/cloud_security_posture/helper.ts index 13bc2ee7de9d2..7c21e6df09f8c 100644 --- a/x-pack/test/api_integration/apis/cloud_security_posture/helper.ts +++ b/x-pack/test/api_integration/apis/cloud_security_posture/helper.ts @@ -11,7 +11,7 @@ import expect from '@kbn/expect'; import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; import type { IndexDetails } from '@kbn/cloud-security-posture-common'; import { CLOUD_SECURITY_PLUGIN_VERSION } from '@kbn/cloud-security-posture-plugin/common/constants'; -import { SecurityService } from '@kbn/test-suites-src/common/services/security/security'; +import { SecurityService } from '@kbn/ftr-common-functional-ui-services'; export interface RoleCredentials { apiKey: { id: string; name: string }; 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/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..5e034ce3a1847 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 { @@ -25,7 +26,7 @@ import { ELASTIC_HTTP_VERSION_HEADER, X_ELASTIC_INTERNAL_ORIGIN_REQUEST, } from '@kbn/core-http-common'; -import type { SecurityService } from '@kbn/test-suites-src/common/services/security/security'; +import type { SecurityService } from '@kbn/ftr-common-functional-ui-services'; import basicClusterFixture from './fixtures/basiccluster.json'; import multiClusterFixture from './fixtures/multicluster.json'; import type { FtrProviderContext } from '../../ftr_provider_context'; @@ -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/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/common/services/bsearch_secure.ts b/x-pack/test/common/services/bsearch_secure.ts index f454aa3818ea6..ccd1866ddd66e 100644 --- a/x-pack/test/common/services/bsearch_secure.ts +++ b/x-pack/test/common/services/bsearch_secure.ts @@ -5,8 +5,8 @@ * 2.0. */ -// NOTE: This is pretty much a copy/paste from test/common/services/bsearch.ts but with the ability -// to provide custom auth +// NOTE: This is pretty much a copy/paste from packages/kbn-ftr-common-functional-services/services/bsearch.ts +// but with the ability to provide custom auth import expect from '@kbn/expect'; import request from 'superagent'; diff --git a/x-pack/test/common/services/index.ts b/x-pack/test/common/services/index.ts index 5e931b440654a..edf64c828e944 100644 --- a/x-pack/test/common/services/index.ts +++ b/x-pack/test/common/services/index.ts @@ -6,7 +6,8 @@ */ import { services as kibanaApiIntegrationServices } from '@kbn/test-suites-src/api_integration/services'; -import { services as kibanaCommonServices } from '@kbn/test-suites-src/common/services'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; import { InfraLogViewsServiceProvider } from './infra_log_views'; import { SpacesServiceProvider } from './spaces'; import { BsearchSecureService } from './bsearch_secure'; @@ -14,7 +15,8 @@ import { ApmSynthtraceKibanaClientProvider } from './apm_synthtrace_kibana_clien import { InfraSynthtraceKibanaClientProvider } from './infra_synthtrace_kibana_client'; export const services = { - ...kibanaCommonServices, + ...commonFunctionalServices, + ...commonFunctionalUIServices, infraLogViews: InfraLogViewsServiceProvider, supertest: kibanaApiIntegrationServices.supertest, spaces: SpacesServiceProvider, 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/package_policy/create.ts b/x-pack/test/fleet_api_integration/apis/package_policy/create.ts index 9f9cdbbbdbb3b..5beb4a066dc9d 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/create.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/create.ts @@ -186,6 +186,28 @@ export default function (providerContext: FtrProviderContext) { expect(response.body.item.policy_ids).to.eql([agentPolicyId, agentPolicyId2]); }); + it('should work with no policy ids', async function () { + const response = await supertest + .post(`/api/fleet/package_policies`) + .set('kbn-xsrf', 'xxxx') + .send({ + name: 'filetest-no-policies', + description: '', + namespace: 'default', + policy_ids: [], + enabled: true, + inputs: [], + package: { + name: 'filetest', + title: 'For File Tests', + version: '0.1.0', + }, + }) + .expect(200); + expect(response.body.item.policy_id).to.eql(null); + expect(response.body.item.policy_ids).to.eql([]); + }); + it('should allow to pass an empty namespace', async function () { await supertest .post(`/api/fleet/package_policies`) diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/update.ts b/x-pack/test/fleet_api_integration/apis/package_policy/update.ts index 6c456bea90d3d..a8b89723a01ab 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/update.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/update.ts @@ -320,6 +320,35 @@ export default function (providerContext: FtrProviderContext) { expect(response.body.item.policy_ids).to.eql([agentPolicyId, managedAgentPolicyId]); }); + it('should work with no policy ids', async function () { + const { body: packagePolicyResponse } = await supertest + .post(`/api/fleet/package_policies`) + .set('kbn-xsrf', 'xxxx') + .send({ + name: 'filetest-to-clear-policy', + description: '', + namespace: 'default', + policy_id: agentPolicyId, + policy_ids: [agentPolicyId], + enabled: true, + inputs: [], + package: { + name: 'filetest', + title: 'For File Tests', + version: '0.1.0', + }, + }); + const response = await supertest + .put(`/api/fleet/package_policies/${packagePolicyResponse.item.id}`) + .set('kbn-xsrf', 'xxxx') + .send({ + policy_ids: [], + }) + .expect(200); + expect(response.body.item.policy_id).to.eql(null); + expect(response.body.item.policy_ids).to.eql([]); + }); + it('should trim whitespace from name on update', async function () { await supertest .put(`/api/fleet/package_policies/${packagePolicyId}`) 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..9b6a76c3ff6bc 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, @@ -331,11 +333,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; diff --git a/x-pack/test/fleet_api_integration/apis/test_users.ts b/x-pack/test/fleet_api_integration/apis/test_users.ts index f84c1f72fb657..74581fd681af7 100644 --- a/x-pack/test/fleet_api_integration/apis/test_users.ts +++ b/x-pack/test/fleet_api_integration/apis/test_users.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { SecurityService } from '@kbn/test-suites-src/common/services/security/security'; +import type { SecurityService } from '@kbn/ftr-common-functional-ui-services'; export const testUsers: { [rollName: string]: { username: string; password: string; permissions?: any }; diff --git a/x-pack/test/fleet_cypress/services.ts b/x-pack/test/fleet_cypress/services.ts index 272cf7eb8da4e..8986c0928d750 100644 --- a/x-pack/test/fleet_cypress/services.ts +++ b/x-pack/test/fleet_cypress/services.ts @@ -4,5 +4,10 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; -export * from '@kbn/test-suites-src/common/services'; +export const services = { + ...commonFunctionalServices, + ...commonFunctionalUIServices, +} as const; 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/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/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/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/osquery_cypress/services.ts b/x-pack/test/osquery_cypress/services.ts index 272cf7eb8da4e..95fd493e6f668 100644 --- a/x-pack/test/osquery_cypress/services.ts +++ b/x-pack/test/osquery_cypress/services.ts @@ -5,4 +5,10 @@ * 2.0. */ -export * from '@kbn/test-suites-src/common/services'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; + +export const services = { + ...commonFunctionalServices, + ...commonFunctionalUIServices, +} as const; 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/profiling_api_integration/common/create_profiling_users/helpers/create_or_update_user.ts b/x-pack/test/profiling_api_integration/common/create_profiling_users/helpers/create_or_update_user.ts index 679a750af410b..2f467d4507e7f 100644 --- a/x-pack/test/profiling_api_integration/common/create_profiling_users/helpers/create_or_update_user.ts +++ b/x-pack/test/profiling_api_integration/common/create_profiling_users/helpers/create_or_update_user.ts @@ -8,7 +8,7 @@ /* eslint-disable no-console */ import { difference, union } from 'lodash'; -import { SecurityService } from '@kbn/test-suites-src/common/services/security/security'; +import type { SecurityService } from '@kbn/ftr-common-functional-ui-services'; import { Elasticsearch, Kibana } from '..'; import { callKibana, isAxiosError } from './call_kibana'; diff --git a/x-pack/test/profiling_api_integration/common/create_profiling_users/index.ts b/x-pack/test/profiling_api_integration/common/create_profiling_users/index.ts index d7c101dd52eaa..18a056b001c56 100644 --- a/x-pack/test/profiling_api_integration/common/create_profiling_users/index.ts +++ b/x-pack/test/profiling_api_integration/common/create_profiling_users/index.ts @@ -5,7 +5,7 @@ * 2.0. */ import { asyncForEach } from '@kbn/std'; -import { SecurityService } from '@kbn/test-suites-src/common/services/security/security'; +import type { SecurityService } from '@kbn/ftr-common-functional-ui-services'; import { ProfilingUsername, profilingUsers } from './authentication'; import { AbortError, callKibana } from './helpers/call_kibana'; import { createOrUpdateUser } from './helpers/create_or_update_user'; diff --git a/x-pack/test/saved_objects_field_count/config.ts b/x-pack/test/saved_objects_field_count/config.ts index eb2aeb1df90a9..603a325ca0479 100644 --- a/x-pack/test/saved_objects_field_count/config.ts +++ b/x-pack/test/saved_objects_field_count/config.ts @@ -6,6 +6,7 @@ */ import { FtrConfigProviderContext } from '@kbn/test'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { const kibanaCommonTestsConfig = await readConfigFile( @@ -15,6 +16,10 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { return { ...kibanaCommonTestsConfig.getAll(), + services: { + ...commonFunctionalServices, + }, + testFiles: [require.resolve('./test')], esTestCluster: { 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/config/services/security_solution_serverless_utils.ts b/x-pack/test/security_solution_api_integration/config/services/security_solution_serverless_utils.ts index da57ccf64860e..00df4f0374c27 100644 --- a/x-pack/test/security_solution_api_integration/config/services/security_solution_serverless_utils.ts +++ b/x-pack/test/security_solution_api_integration/config/services/security_solution_serverless_utils.ts @@ -9,7 +9,7 @@ import supertest from 'supertest'; import { format as formatUrl } from 'url'; import { IEsSearchResponse } from '@kbn/search-types'; import { RoleCredentials } from '@kbn/test-suites-serverless/shared/services'; -import type { SendOptions } from '@kbn/test-suites-src/common/services/bsearch'; +import type { SendOptions } from '@kbn/ftr-common-functional-services'; import type { SendOptions as SecureBsearchSendOptions } from '@kbn/test-suites-serverless/shared/services/bsearch_secure'; import type { FtrProviderContext } from '../../ftr_provider_context'; import type { SecuritySolutionUtilsInterface } from './types'; diff --git a/x-pack/test/security_solution_api_integration/config/services/types.ts b/x-pack/test/security_solution_api_integration/config/services/types.ts index 72397582dad00..838f31e69412e 100644 --- a/x-pack/test/security_solution_api_integration/config/services/types.ts +++ b/x-pack/test/security_solution_api_integration/config/services/types.ts @@ -9,7 +9,7 @@ import TestAgent from 'supertest/lib/agent'; import type { IEsSearchResponse } from '@kbn/search-types'; import type { BsearchSecureService } from '@kbn/test-suites-serverless/shared/services/bsearch_secure'; -import type { BsearchService, SendOptions } from '@kbn/test-suites-src/common/services/bsearch'; +import type { BsearchService, SendOptions } from '@kbn/ftr-common-functional-services'; export interface SecuritySolutionServerlessBsearch extends Omit { send: (options: SendOptions) => Promise; 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_api_integration/test_suites/entity_analytics/utils/users_and_roles.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/utils/users_and_roles.ts index 3bccaf4a00fe3..a9663cd943a78 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/utils/users_and_roles.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/utils/users_and_roles.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { SecurityService } from '@kbn/test-suites-src/common/services/security/security'; +import type { SecurityService } from '@kbn/ftr-common-functional-ui-services'; export const usersAndRolesFactory = (security: SecurityService) => ({ createRole: async ({ name, privileges }: { name: string; privileges: any }) => { diff --git a/x-pack/test/security_solution_api_integration/test_suites/explore/hosts/trial_license_complete_tier/tests/host_details.ts b/x-pack/test/security_solution_api_integration/test_suites/explore/hosts/trial_license_complete_tier/tests/host_details.ts index 1c74a987e4fec..cf2ac65f1086b 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/explore/hosts/trial_license_complete_tier/tests/host_details.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/explore/hosts/trial_license_complete_tier/tests/host_details.ts @@ -11,7 +11,7 @@ import { HostsQueries, } from '@kbn/security-solution-plugin/common/search_strategy'; import TestAgent from 'supertest/lib/agent'; -import { BsearchService } from '@kbn/test-suites-src/common/services/bsearch'; +import { BsearchService } from '@kbn/ftr-common-functional-services'; import { FtrProviderContextWithSpaces } from '../../../../../ftr_provider_context_with_spaces'; import { hostDetailsFilebeatExpectedResult } from '../mocks/host_details'; diff --git a/x-pack/test/security_solution_api_integration/test_suites/explore/hosts/trial_license_complete_tier/tests/hosts.ts b/x-pack/test/security_solution_api_integration/test_suites/explore/hosts/trial_license_complete_tier/tests/hosts.ts index a39da25c81aa3..80052ef3ddf56 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/explore/hosts/trial_license_complete_tier/tests/hosts.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/explore/hosts/trial_license_complete_tier/tests/hosts.ts @@ -16,7 +16,7 @@ import { FirstLastSeenStrategyResponse, } from '@kbn/security-solution-plugin/common/search_strategy'; import TestAgent from 'supertest/lib/agent'; -import { BsearchService } from '@kbn/test-suites-src/common/services/bsearch'; +import { BsearchService } from '@kbn/ftr-common-functional-services'; import { FtrProviderContextWithSpaces } from '../../../../../ftr_provider_context_with_spaces'; diff --git a/x-pack/test/security_solution_api_integration/test_suites/explore/hosts/trial_license_complete_tier/tests/uncommon_processes.ts b/x-pack/test/security_solution_api_integration/test_suites/explore/hosts/trial_license_complete_tier/tests/uncommon_processes.ts index 19710d4eedf45..22001c26b66b5 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/explore/hosts/trial_license_complete_tier/tests/uncommon_processes.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/explore/hosts/trial_license_complete_tier/tests/uncommon_processes.ts @@ -12,7 +12,7 @@ import { HostsUncommonProcessesStrategyResponse, } from '@kbn/security-solution-plugin/common/search_strategy'; import TestAgent from 'supertest/lib/agent'; -import { BsearchService } from '@kbn/test-suites-src/common/services/bsearch'; +import { BsearchService } from '@kbn/ftr-common-functional-services'; import { FtrProviderContextWithSpaces } from '../../../../../ftr_provider_context_with_spaces'; const FROM = '2000-01-01T00:00:00.000Z'; diff --git a/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_details.ts b/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_details.ts index 5e9040424713b..166af42ba5702 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_details.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_details.ts @@ -11,7 +11,7 @@ import { NetworkQueries, } from '@kbn/security-solution-plugin/common/search_strategy'; import TestAgent from 'supertest/lib/agent'; -import { BsearchService } from '@kbn/test-suites-src/common/services/bsearch'; +import { BsearchService } from '@kbn/ftr-common-functional-services'; import { FtrProviderContextWithSpaces } from '../../../../../ftr_provider_context_with_spaces'; diff --git a/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_dns.ts b/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_dns.ts index 7254dc6e99a5e..22edc8cff64de 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_dns.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_dns.ts @@ -14,7 +14,7 @@ import { NetworkDnsStrategyResponse, } from '@kbn/security-solution-plugin/common/search_strategy'; import TestAgent from 'supertest/lib/agent'; -import { BsearchService } from '@kbn/test-suites-src/common/services/bsearch'; +import { BsearchService } from '@kbn/ftr-common-functional-services'; import { FtrProviderContextWithSpaces } from '../../../../../ftr_provider_context_with_spaces'; export default function ({ getService }: FtrProviderContextWithSpaces) { diff --git a/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_top_n_flow.ts b/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_top_n_flow.ts index 2306861471073..8b1adb16975f6 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_top_n_flow.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/network_top_n_flow.ts @@ -15,7 +15,7 @@ import { NetworkTopNFlowStrategyResponse, } from '@kbn/security-solution-plugin/common/search_strategy'; import TestAgent from 'supertest/lib/agent'; -import { BsearchService } from '@kbn/test-suites-src/common/services/bsearch'; +import { BsearchService } from '@kbn/ftr-common-functional-services'; import { FtrProviderContextWithSpaces } from '../../../../../ftr_provider_context_with_spaces'; diff --git a/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/tls.ts b/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/tls.ts index 4c555ca0d6555..36b2b677a1949 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/tls.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/tests/tls.ts @@ -14,7 +14,8 @@ import { NetworkTlsStrategyResponse, } from '@kbn/security-solution-plugin/common/search_strategy'; import TestAgent from 'supertest/lib/agent'; -import { BsearchService } from '@kbn/test-suites-src/common/services/bsearch'; + +import { BsearchService } from '@kbn/ftr-common-functional-services'; import { FtrProviderContextWithSpaces } from '../../../../../ftr_provider_context_with_spaces'; diff --git a/x-pack/test/security_solution_api_integration/test_suites/explore/overview/trial_license_complete_tier/tests/overview_host.ts b/x-pack/test/security_solution_api_integration/test_suites/explore/overview/trial_license_complete_tier/tests/overview_host.ts index d99fbd296ba3e..ffb287239ac0f 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/explore/overview/trial_license_complete_tier/tests/overview_host.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/explore/overview/trial_license_complete_tier/tests/overview_host.ts @@ -12,7 +12,7 @@ import { HostsOverviewStrategyResponse, } from '@kbn/security-solution-plugin/common/search_strategy'; import TestAgent from 'supertest/lib/agent'; -import { BsearchService } from '@kbn/test-suites-src/common/services/bsearch'; +import { BsearchService } from '@kbn/ftr-common-functional-services'; import { FtrProviderContextWithSpaces } from '../../../../../ftr_provider_context_with_spaces'; export default function ({ getService }: FtrProviderContextWithSpaces) { diff --git a/x-pack/test/security_solution_api_integration/test_suites/explore/overview/trial_license_complete_tier/tests/overview_network.ts b/x-pack/test/security_solution_api_integration/test_suites/explore/overview/trial_license_complete_tier/tests/overview_network.ts index 952e3eed8f8af..f8d4aa80c0e3d 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/explore/overview/trial_license_complete_tier/tests/overview_network.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/explore/overview/trial_license_complete_tier/tests/overview_network.ts @@ -11,7 +11,7 @@ import { NetworkQueries, } from '@kbn/security-solution-plugin/common/search_strategy'; import TestAgent from 'supertest/lib/agent'; -import { BsearchService } from '@kbn/test-suites-src/common/services/bsearch'; +import { BsearchService } from '@kbn/ftr-common-functional-services'; import { FtrProviderContextWithSpaces } from '../../../../../ftr_provider_context_with_spaces'; export default function ({ getService }: FtrProviderContextWithSpaces) { diff --git a/x-pack/test/security_solution_api_integration/test_suites/explore/users/trial_license_complete_tier/tests/authentications.ts b/x-pack/test/security_solution_api_integration/test_suites/explore/users/trial_license_complete_tier/tests/authentications.ts index d7329a597e2e0..39dddc7a0c046 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/explore/users/trial_license_complete_tier/tests/authentications.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/explore/users/trial_license_complete_tier/tests/authentications.ts @@ -15,7 +15,7 @@ import { import type { UserAuthenticationsRequestOptions } from '@kbn/security-solution-plugin/common/api/search_strategy'; import TestAgent from 'supertest/lib/agent'; -import { BsearchService } from '@kbn/test-suites-src/common/services/bsearch'; +import { BsearchService } from '@kbn/ftr-common-functional-services'; import { FtrProviderContextWithSpaces } from '../../../../../ftr_provider_context_with_spaces'; const FROM = '2000-01-01T00:00:00.000Z'; diff --git a/x-pack/test/security_solution_api_integration/test_suites/explore/users/trial_license_complete_tier/tests/users.ts b/x-pack/test/security_solution_api_integration/test_suites/explore/users/trial_license_complete_tier/tests/users.ts index 65b44bf4cbc5e..6765e6d2bb164 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/explore/users/trial_license_complete_tier/tests/users.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/explore/users/trial_license_complete_tier/tests/users.ts @@ -14,7 +14,8 @@ import { NetworkUsersStrategyResponse, } from '@kbn/security-solution-plugin/common/search_strategy'; import TestAgent from 'supertest/lib/agent'; -import { BsearchService } from '@kbn/test-suites-src/common/services/bsearch'; + +import { BsearchService } from '@kbn/ftr-common-functional-services'; import { FtrProviderContextWithSpaces } from '../../../../../ftr_provider_context_with_spaces'; diff --git a/x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/tests/events.ts b/x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/tests/events.ts index c66978bbe1b42..c42ac64de4a23 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/tests/events.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/tests/events.ts @@ -14,8 +14,9 @@ import { TimelineEventsAllStrategyResponse, } from '@kbn/security-solution-plugin/common/search_strategy'; import TestAgent from 'supertest/lib/agent'; -import { BsearchService } from '@kbn/test-suites-src/common/services/bsearch'; +import { BsearchService } from '@kbn/ftr-common-functional-services'; import { FtrProviderContextWithSpaces } from '../../../../../ftr_provider_context_with_spaces'; + import { getFieldsToRequest, getFilterValue } from '../../../../utils'; const TO = '3000-01-01T00:00:00.000Z'; diff --git a/x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/tests/timeline_details.ts b/x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/tests/timeline_details.ts index 1e3119260455d..12539d43a145f 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/tests/timeline_details.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/tests/timeline_details.ts @@ -13,7 +13,8 @@ import { TimelineKpiStrategyResponse, } from '@kbn/security-solution-plugin/common/search_strategy'; import TestAgent from 'supertest/lib/agent'; -import { BsearchService } from '@kbn/test-suites-src/common/services/bsearch'; + +import { BsearchService } from '@kbn/ftr-common-functional-services'; import { FtrProviderContextWithSpaces } from '../../../../../ftr_provider_context_with_spaces'; import { timelineDetailsFilebeatExpectedResults as EXPECTED_DATA } from '../mocks/timeline_details'; diff --git a/x-pack/test/security_solution_api_integration/tsconfig.json b/x-pack/test/security_solution_api_integration/tsconfig.json index 2f420920027d5..1f558e3c3f051 100644 --- a/x-pack/test/security_solution_api_integration/tsconfig.json +++ b/x-pack/test/security_solution_api_integration/tsconfig.json @@ -49,6 +49,6 @@ "@kbn/dev-cli-runner", "@kbn/search-types", "@kbn/security-plugin", - "@kbn/test-suites-src", + "@kbn/ftr-common-functional-ui-services", ] } 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/threat_intelligence_cypress/config.ts b/x-pack/test/threat_intelligence_cypress/config.ts index 963cfab55dad5..c2e9a6ac8b180 100644 --- a/x-pack/test/threat_intelligence_cypress/config.ts +++ b/x-pack/test/threat_intelligence_cypress/config.ts @@ -6,9 +6,8 @@ */ import { FtrConfigProviderContext } from '@kbn/test'; - import { CA_CERT_PATH } from '@kbn/dev-utils'; - +import { services } from './services'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { const kibanaCommonTestsConfig = await readConfigFile( require.resolve('@kbn/test-suites-src/common/config') @@ -20,6 +19,8 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { return { ...kibanaCommonTestsConfig.getAll(), + services, + esTestCluster: { ...xpackFunctionalTestsConfig.get('esTestCluster'), serverArgs: [ diff --git a/x-pack/test/upgrade_assistant_integration/config.js b/x-pack/test/upgrade_assistant_integration/config.js index dbdf0ade8affe..9529e4bc568d3 100644 --- a/x-pack/test/upgrade_assistant_integration/config.js +++ b/x-pack/test/upgrade_assistant_integration/config.js @@ -5,6 +5,8 @@ * 2.0. */ +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; + export default async function ({ readConfigFile }) { // Read the Kibana API integration tests config file so that we can utilize its services. const kibanaAPITestsConfig = await readConfigFile( @@ -13,15 +15,12 @@ export default async function ({ readConfigFile }) { const xPackFunctionalTestsConfig = await readConfigFile( require.resolve('../functional/config.base.js') ); - const kibanaCommonConfig = await readConfigFile( - require.resolve('@kbn/test-suites-src/common/config') - ); return { testFiles: [require.resolve('./upgrade_assistant')], servers: xPackFunctionalTestsConfig.get('servers'), services: { - ...kibanaCommonConfig.get('services'), + ...commonFunctionalServices, supertest: kibanaAPITestsConfig.get('services.supertest'), }, junit: { 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/console/autocomplete_entities.ts b/x-pack/test_serverless/api_integration/test_suites/common/console/autocomplete_entities.ts index 72640103c0ef9..3ec162ad28ffd 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/console/autocomplete_entities.ts +++ b/x-pack/test_serverless/api_integration/test_suites/common/console/autocomplete_entities.ts @@ -11,7 +11,7 @@ import { InternalRequestHeader, RoleCredentials } from '../../../../shared/servi export default ({ getService }: FtrProviderContext) => { const svlCommonApi = getService('svlCommonApi'); - const consoleService = getService('console'); + const console = getService('console'); const svlUserManager = getService('svlUserManager'); const supertestWithoutAuth = getService('supertestWithoutAuth'); @@ -27,17 +27,6 @@ export default ({ getService }: FtrProviderContext) => { }; describe('/api/console/autocomplete_entities', function () { - let createIndex: (typeof consoleService)['helpers']['createIndex']; - let createAlias: (typeof consoleService)['helpers']['createAlias']; - let createIndexTemplate: (typeof consoleService)['helpers']['createIndexTemplate']; - let createComponentTemplate: (typeof consoleService)['helpers']['createComponentTemplate']; - let createDataStream: (typeof consoleService)['helpers']['createDataStream']; - let deleteIndex: (typeof consoleService)['helpers']['deleteIndex']; - let deleteAlias: (typeof consoleService)['helpers']['deleteAlias']; - let deleteIndexTemplate: (typeof consoleService)['helpers']['deleteIndexTemplate']; - let deleteComponentTemplate: (typeof consoleService)['helpers']['deleteComponentTemplate']; - let deleteDataStream: (typeof consoleService)['helpers']['deleteDataStream']; - const indexName = 'test-index-1'; const aliasName = 'test-alias-1'; const indexTemplateName = 'test-index-template-1'; @@ -47,36 +36,26 @@ export default ({ getService }: FtrProviderContext) => { before(async () => { roleAuthc = await svlUserManager.createM2mApiKeyWithRoleScope('admin'); internalRequestHeader = svlCommonApi.getInternalRequestHeader(); - ({ - helpers: { - createIndex, - createAlias, - createIndexTemplate, - createComponentTemplate, - createDataStream, - deleteIndex, - deleteAlias, - deleteIndexTemplate, - deleteComponentTemplate, - deleteDataStream, - }, - } = consoleService); // Setup indices, aliases, templates, and data streams - await createIndex(indexName); - await createAlias(indexName, aliasName); - await createComponentTemplate(componentTemplateName); - await createIndexTemplate(indexTemplateName, [dataStreamName], [componentTemplateName]); - await createDataStream(dataStreamName); + await console.createIndex(indexName); + await console.createAlias(indexName, aliasName); + await console.createComponentTemplate(componentTemplateName); + await console.createIndexTemplate( + indexTemplateName, + [dataStreamName], + [componentTemplateName] + ); + await console.createDataStream(dataStreamName); }); after(async () => { // Cleanup indices, aliases, templates, and data streams - await deleteAlias(indexName, aliasName); - await deleteIndex(indexName); - await deleteDataStream(dataStreamName); - await deleteIndexTemplate(indexTemplateName); - await deleteComponentTemplate(componentTemplateName); + await console.deleteAlias(indexName, aliasName); + await console.deleteIndex(indexName); + await console.deleteDataStream(dataStreamName); + await console.deleteIndexTemplate(indexTemplateName); + await console.deleteComponentTemplate(componentTemplateName); await svlUserManager.invalidateM2mApiKeyWithRoleScope(roleAuthc); }); 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/shared/services/bsearch_secure.ts b/x-pack/test_serverless/shared/services/bsearch_secure.ts index 7ebe89bed8247..03f8241c9e12a 100644 --- a/x-pack/test_serverless/shared/services/bsearch_secure.ts +++ b/x-pack/test_serverless/shared/services/bsearch_secure.ts @@ -5,8 +5,8 @@ * 2.0. */ -// NOTE: This is pretty much a copy/paste from test/common/services/bsearch.ts but with the ability -// to provide custom auth +// NOTE: This is pretty much a copy/paste from packages/kbn-ftr-common-functional-services/services/bsearch.ts +// but with the ability to provide custom auth import expect from '@kbn/expect'; import { GenericFtrService } from '@kbn/test'; 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..acc904dd83ec8 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 ""