From 6cd2cd6cf83fcf18b7ab66ac3f38f11ab9d69f8a Mon Sep 17 00:00:00 2001 From: Sean Story Date: Wed, 18 Dec 2024 08:02:41 -0600 Subject: [PATCH 1/9] Replace 'ent-search-generic' with 'search-default' pipeline (#204670) ## Summary Part of https://github.com/elastic/search-team/issues/8812 This PR replaces usage of `ent-search-generic-ingestion` pipeline with `search-default-ingestion` pipeline. The function of these two is identical, the only difference being their name. This merely removes a reference to "ent-search" (Enterprise Search) for 9.0 where Enterprise Search will no longer be available. ### Related PRs - Elasticsearch changes: https://github.com/elastic/elasticsearch/pull/118899 - Connectors changes: https://github.com/elastic/connectors/pull/3049 --- .../lib/collect_connector_stats_test_data.ts | 4 ++-- .../lib/create_connector_document.test.ts | 4 ++-- x-pack/plugins/enterprise_search/common/constants.ts | 2 +- .../pipelines_json_configurations_logic.test.ts | 12 ++++++------ .../search_index/pipelines/pipelines_logic.test.ts | 2 +- .../shared/header_actions/syncs_logic.test.ts | 2 +- .../server/lib/connectors/add_connector.test.ts | 8 ++++---- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/kbn-search-connectors/lib/collect_connector_stats_test_data.ts b/packages/kbn-search-connectors/lib/collect_connector_stats_test_data.ts index 38b334462c401..cbd104480ae6d 100644 --- a/packages/kbn-search-connectors/lib/collect_connector_stats_test_data.ts +++ b/packages/kbn-search-connectors/lib/collect_connector_stats_test_data.ts @@ -29,7 +29,7 @@ export const spoConnector: Connector = { last_indexed_document_count: 1000, pipeline: { extract_binary_content: false, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: false, }, @@ -99,7 +99,7 @@ export const mysqlConnector: Connector = { last_indexed_document_count: 2000, pipeline: { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: false, }, diff --git a/packages/kbn-search-connectors/lib/create_connector_document.test.ts b/packages/kbn-search-connectors/lib/create_connector_document.test.ts index 0d0400d7081f5..c8b14317c33de 100644 --- a/packages/kbn-search-connectors/lib/create_connector_document.test.ts +++ b/packages/kbn-search-connectors/lib/create_connector_document.test.ts @@ -21,7 +21,7 @@ describe('createConnectorDocument', () => { name: 'indexName-name', pipeline: { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: false, }, @@ -103,7 +103,7 @@ describe('createConnectorDocument', () => { name: 'indexName-name', pipeline: { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: false, }, diff --git a/x-pack/plugins/enterprise_search/common/constants.ts b/x-pack/plugins/enterprise_search/common/constants.ts index 638e292ff0e25..8e69b80564802 100644 --- a/x-pack/plugins/enterprise_search/common/constants.ts +++ b/x-pack/plugins/enterprise_search/common/constants.ts @@ -235,7 +235,7 @@ export const ENTERPRISE_SEARCH_DOCUMENTS_DEFAULT_DOC_COUNT = 25; export const ENTERPRISE_SEARCH_CONNECTOR_CRAWLER_SERVICE_TYPE = 'elastic-crawler'; -export const DEFAULT_PIPELINE_NAME = 'ent-search-generic-ingestion'; +export const DEFAULT_PIPELINE_NAME = 'search-default-ingestion'; export const DEFAULT_PIPELINE_VALUES: IngestPipelineParams = { extract_binary_content: true, name: DEFAULT_PIPELINE_NAME, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.test.ts index 6fbeffd30b714..367cf8631676f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.test.ts @@ -53,7 +53,7 @@ describe('IndexPipelinesConfigurationsLogic', () => { }); it('fetchIndexPipelinesDataSuccess selects index ingest pipeline if found', async () => { const pipelines = { - 'ent-search-generic-ingest': { + 'search-default-ingest': { version: 1, }, [indexName]: { @@ -68,7 +68,7 @@ describe('IndexPipelinesConfigurationsLogic', () => { }); it('fetchIndexPipelinesDataSuccess selects first pipeline as default pipeline', async () => { const pipelines = { - 'ent-search-generic-ingest': { + 'search-default-ingest': { version: 1, }, }; @@ -76,7 +76,7 @@ describe('IndexPipelinesConfigurationsLogic', () => { await nextTick(); expect(IndexPipelinesConfigurationsLogic.values.selectedPipelineId).toEqual( - 'ent-search-generic-ingest' + 'search-default-ingest' ); }); }); @@ -84,7 +84,7 @@ describe('IndexPipelinesConfigurationsLogic', () => { describe('selectors', () => { it('pipelineNames returns names of pipelines', async () => { const pipelines = { - 'ent-search-generic-ingest': { + 'search-default-ingest': { version: 1, }, [indexName]: { @@ -96,13 +96,13 @@ describe('IndexPipelinesConfigurationsLogic', () => { await nextTick(); expect(IndexPipelinesConfigurationsLogic.values.pipelineNames).toEqual([ - 'ent-search-generic-ingest', + 'search-default-ingest', indexName, ]); }); it('selectedPipeline returns full pipeline', async () => { const pipelines = { - 'ent-search-generic-ingest': { + 'search-default-ingest': { version: 1, }, foo: { diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.test.ts index bacde5895073e..597b22f15049f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.test.ts @@ -21,7 +21,7 @@ import { PipelinesLogic } from './pipelines_logic'; const DEFAULT_PIPELINE_VALUES = { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: true, }; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_logic.test.ts index 5406622ff9f3c..88f1f2663a951 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_logic.test.ts @@ -126,7 +126,7 @@ const mockConnector: Connector = { name: 'test', pipeline: { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: true, }, diff --git a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts index 5190bd6144bfa..0a193d5b03554 100644 --- a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts @@ -52,7 +52,7 @@ describe('addConnector lib function', () => { _meta: { pipeline: { default_extract_binary_content: true, - default_name: 'ent-search-generic-ingestion', + default_name: 'search-default-ingestion', default_reduce_whitespace: true, default_run_ml_inference: true, }, @@ -89,7 +89,7 @@ describe('addConnector lib function', () => { name: 'index_name', pipeline: { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: true, }, @@ -134,7 +134,7 @@ describe('addConnector lib function', () => { name: 'index_name', pipeline: { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: true, }, @@ -264,7 +264,7 @@ describe('addConnector lib function', () => { name: '', pipeline: { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: true, }, From e0786738c950870c49b4899937cc3904a1b8ef97 Mon Sep 17 00:00:00 2001 From: Clint Andrew Hall Date: Wed, 18 Dec 2024 08:51:45 -0600 Subject: [PATCH 2/9] [ai][assistant] Refactor search to use new Assistant logo and beacon (#204287) > A follow-up to #203879 ## Summary This PR integrates the new Assistant Icon, Beacon, and Avatar into solutions and packages owned by Search. In most cases this was a 1:1 replacement, but in a few, Icon was replaced with Beacon or Beacon was added for consistency, (e.g. welcome screens, upsells, etc), . Note: the scaling of the icon/avatar _before_ was one different from EUI. The new components match EUI directly and represent a 2x scale change (e.g. 's' becomes 'l', 'm' becomes 'xl', etc). --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../kbn-ai-assistant/src/chat/chat_header.tsx | 4 ++-- .../src/chat/chat_item_avatar.tsx | 20 +++---------------- .../src/chat/welcome_message.tsx | 7 ++++--- .../packages/kbn-ai-assistant/tsconfig.json | 1 + .../public/components/nav_control/index.tsx | 5 +++-- x-pack/plugins/search_assistant/tsconfig.json | 3 ++- 6 files changed, 15 insertions(+), 25 deletions(-) diff --git a/x-pack/packages/kbn-ai-assistant/src/chat/chat_header.tsx b/x-pack/packages/kbn-ai-assistant/src/chat/chat_header.tsx index c4b4fcba0329f..2488323842a10 100644 --- a/x-pack/packages/kbn-ai-assistant/src/chat/chat_header.tsx +++ b/x-pack/packages/kbn-ai-assistant/src/chat/chat_header.tsx @@ -19,7 +19,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/css'; -import { AssistantAvatar } from '@kbn/observability-ai-assistant-plugin/public'; +import { AssistantIcon } from '@kbn/ai-assistant-icon'; import { ChatActionsMenu } from './chat_actions_menu'; import type { UseGenAIConnectorsResult } from '../hooks/use_genai_connectors'; import { FlyoutPositionMode } from './chat_flyout'; @@ -94,7 +94,7 @@ export function ChatHeader({ {loading ? ( ) : ( - + )} diff --git a/x-pack/packages/kbn-ai-assistant/src/chat/chat_item_avatar.tsx b/x-pack/packages/kbn-ai-assistant/src/chat/chat_item_avatar.tsx index ae78d55dd43ff..0c6b6bf5de04d 100644 --- a/x-pack/packages/kbn-ai-assistant/src/chat/chat_item_avatar.tsx +++ b/x-pack/packages/kbn-ai-assistant/src/chat/chat_item_avatar.tsx @@ -7,10 +7,10 @@ import React from 'react'; import { UserAvatar } from '@kbn/user-profile-components'; -import { css } from '@emotion/css'; import { EuiAvatar, EuiLoadingSpinner } from '@elastic/eui'; import type { AuthenticatedUser } from '@kbn/security-plugin/common'; -import { AssistantAvatar, MessageRole } from '@kbn/observability-ai-assistant-plugin/public'; +import { MessageRole } from '@kbn/observability-ai-assistant-plugin/public'; +import { AssistantAvatar } from '@kbn/ai-assistant-icon'; interface ChatAvatarProps { currentUser?: Pick | undefined; @@ -18,13 +18,6 @@ interface ChatAvatarProps { loading: boolean; } -const assistantAvatarClassName = css` - svg { - width: 16px; - height: 16px; - } -`; - export function ChatItemAvatar({ currentUser, role, loading }: ChatAvatarProps) { const isLoading = loading || !currentUser; @@ -39,14 +32,7 @@ export function ChatItemAvatar({ currentUser, role, loading }: ChatAvatarProps) case MessageRole.Assistant: case MessageRole.Elastic: case MessageRole.Function: - return ( - - ); + return ; case MessageRole.System: return ; diff --git a/x-pack/packages/kbn-ai-assistant/src/chat/welcome_message.tsx b/x-pack/packages/kbn-ai-assistant/src/chat/welcome_message.tsx index 2ce11d16905af..0783c7f64620a 100644 --- a/x-pack/packages/kbn-ai-assistant/src/chat/welcome_message.tsx +++ b/x-pack/packages/kbn-ai-assistant/src/chat/welcome_message.tsx @@ -11,6 +11,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiSpacer, useCurrentEuiBreakpoint } from '@ import type { ActionConnector } from '@kbn/triggers-actions-ui-plugin/public'; import { GenerativeAIForObservabilityConnectorFeatureId } from '@kbn/actions-plugin/common'; import { isSupportedConnectorType } from '@kbn/observability-ai-assistant-plugin/public'; +import { AssistantBeacon } from '@kbn/ai-assistant-icon'; import type { UseKnowledgeBaseResult } from '../hooks/use_knowledge_base'; import type { UseGenAIConnectorsResult } from '../hooks/use_genai_connectors'; import { Disclaimer } from './disclaimer'; @@ -78,9 +79,11 @@ export function WelcomeMessage({ gutterSize="none" className={fullHeightClassName} > + + + - ) : null} - - diff --git a/x-pack/packages/kbn-ai-assistant/tsconfig.json b/x-pack/packages/kbn-ai-assistant/tsconfig.json index 159a38f67f426..c23f92085c28d 100644 --- a/x-pack/packages/kbn-ai-assistant/tsconfig.json +++ b/x-pack/packages/kbn-ai-assistant/tsconfig.json @@ -38,5 +38,6 @@ "@kbn/share-plugin", "@kbn/ai-assistant-common", "@kbn/storybook", + "@kbn/ai-assistant-icon", ] } diff --git a/x-pack/plugins/search_assistant/public/components/nav_control/index.tsx b/x-pack/plugins/search_assistant/public/components/nav_control/index.tsx index a341fdbe81412..f75eff1042eb6 100644 --- a/x-pack/plugins/search_assistant/public/components/nav_control/index.tsx +++ b/x-pack/plugins/search_assistant/public/components/nav_control/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React, { useEffect, useRef, useState } from 'react'; -import { AssistantAvatar, useAbortableAsync } from '@kbn/observability-ai-assistant-plugin/public'; +import { useAbortableAsync } from '@kbn/observability-ai-assistant-plugin/public'; import { EuiButton, EuiLoadingSpinner, EuiToolTip, useEuiTheme } from '@elastic/eui'; import { css } from '@emotion/react'; import { v4 } from 'uuid'; @@ -19,6 +19,7 @@ import type { CoreStart } from '@kbn/core/public'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; +import { AssistantIcon } from '@kbn/ai-assistant-icon'; interface NavControlWithProviderDeps { coreStart: CoreStart; @@ -123,7 +124,7 @@ export function NavControl() { fullWidth={false} minWidth={0} > - {chatService.loading ? : } + {chatService.loading ? : } {chatService.value && diff --git a/x-pack/plugins/search_assistant/tsconfig.json b/x-pack/plugins/search_assistant/tsconfig.json index 30002038bbc2d..f29f624ab46ea 100644 --- a/x-pack/plugins/search_assistant/tsconfig.json +++ b/x-pack/plugins/search_assistant/tsconfig.json @@ -28,7 +28,8 @@ "@kbn/licensing-plugin", "@kbn/ml-plugin", "@kbn/share-plugin", - "@kbn/triggers-actions-ui-plugin" + "@kbn/triggers-actions-ui-plugin", + "@kbn/ai-assistant-icon" ], "exclude": [ "target/**/*", From 17569187b6992252eff68a7ba408dd8b88fd883d Mon Sep 17 00:00:00 2001 From: Matthew Kime Date: Wed, 18 Dec 2024 09:05:22 -0600 Subject: [PATCH 3/9] [index management] Better privilege checking for component index templates (#202251) ## Summary Builds on https://github.com/elastic/kibana/pull/201717 Part of https://github.com/elastic/kibana/issues/178654 `manage_index_templates` cluster privilege determines access to component index templates tab within index management. --- .../translations/translations/fr-FR.json | 4 - .../translations/translations/ja-JP.json | 4 - .../translations/translations/zh-CN.json | 4 - .../helpers/setup_environment.tsx | 1 + .../public/application/app_context.tsx | 1 + .../component_template_list/auth_provider.tsx | 26 --- .../component_template_list_container.tsx | 16 +- .../with_privileges.tsx | 83 ---------- .../application/mount_management_section.ts | 4 +- .../public/application/sections/home/home.tsx | 27 +-- .../plugins/index_management/public/plugin.ts | 8 +- .../plugins/index_management/server/plugin.ts | 4 + .../routes/api/component_templates/index.ts | 2 - .../register_privileges_route.test.ts | 155 ------------------ .../register_privileges_route.ts | 64 -------- .../index_management/component_templates.ts | 17 -- .../index_management/component_templates.ts | 155 +++++++++++------- 17 files changed, 129 insertions(+), 446 deletions(-) delete mode 100644 x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/auth_provider.tsx delete mode 100644 x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/with_privileges.tsx delete mode 100644 x-pack/plugins/index_management/server/routes/api/component_templates/register_privileges_route.test.ts delete mode 100644 x-pack/plugins/index_management/server/routes/api/component_templates/register_privileges_route.ts diff --git a/x-pack/platform/plugins/private/translations/translations/fr-FR.json b/x-pack/platform/plugins/private/translations/translations/fr-FR.json index 65bff9f9ca698..07bc02dbceec3 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -22338,8 +22338,6 @@ "xpack.idxMgmt.goToDiscover.discoverIndexButtonLabel": "Découvrir les index", "xpack.idxMgmt.goToDiscover.showIndexToolTip": "Montrer {indexName} dans Discover", "xpack.idxMgmt.home.appTitle": "Gestion des index", - "xpack.idxMgmt.home.componentTemplates.checkingPrivilegesDescription": "Vérification des privilèges…", - "xpack.idxMgmt.home.componentTemplates.checkingPrivilegesErrorMessage": "Erreur lors de la récupération des privilèges utilisateur depuis le serveur.", "xpack.idxMgmt.home.componentTemplates.confirmButtonLabel": "Supprimer {numComponentTemplatesToDelete, plural, one {le modèle de composant} other {les modèles de composants} }", "xpack.idxMgmt.home.componentTemplates.deleteModal.cancelButtonLabel": "Annuler", "xpack.idxMgmt.home.componentTemplates.deleteModal.deleteDescription": "Vous êtes sur le point de supprimer {numComponentTemplatesToDelete, plural, one {ce modèle de composant} other {ces modèles de composants} } :", @@ -22348,8 +22346,6 @@ "xpack.idxMgmt.home.componentTemplates.deleteModal.multipleErrorsNotificationMessageText": "Erreur lors de la suppression de {count} modèles de composants", "xpack.idxMgmt.home.componentTemplates.deleteModal.successDeleteMultipleNotificationMessageText": "{numSuccesses, plural, one {# modèle de composant supprimé} other {# modèles de composants supprimés}}", "xpack.idxMgmt.home.componentTemplates.deleteModal.successDeleteSingleNotificationMessageText": "Le modèle de composant \"{componentTemplateName}\" a bien été supprimé", - "xpack.idxMgmt.home.componentTemplates.deniedPrivilegeDescription": "Pour utiliser les modèles de composants, vous devez posséder {privilegesCount, plural, one {ce privilège de cluster} other {ces privilèges de cluster}} : {missingPrivileges}.", - "xpack.idxMgmt.home.componentTemplates.deniedPrivilegeTitle": "Privilèges de cluster requis", "xpack.idxMgmt.home.componentTemplates.emptyPromptButtonLabel": "Créer un modèle de composant", "xpack.idxMgmt.home.componentTemplates.emptyPromptDescription": "Par exemple, vous pouvez créer un modèle de composant pour les paramètres d'index réutilisables dans tous les modèles d'index.", "xpack.idxMgmt.home.componentTemplates.emptyPromptDocumentionLink": "En savoir plus.", diff --git a/x-pack/platform/plugins/private/translations/translations/ja-JP.json b/x-pack/platform/plugins/private/translations/translations/ja-JP.json index a9d26dc336ff0..8641da40c1e3c 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -22196,8 +22196,6 @@ "xpack.idxMgmt.goToDiscover.discoverIndexButtonLabel": "Discoverインデックス", "xpack.idxMgmt.goToDiscover.showIndexToolTip": "Discoverで{indexName}を表示", "xpack.idxMgmt.home.appTitle": "インデックス管理", - "xpack.idxMgmt.home.componentTemplates.checkingPrivilegesDescription": "権限を確認中…", - "xpack.idxMgmt.home.componentTemplates.checkingPrivilegesErrorMessage": "サーバーからユーザー特権を取得中にエラーが発生。", "xpack.idxMgmt.home.componentTemplates.confirmButtonLabel": "{numComponentTemplatesToDelete, plural, other {個のコンポーネントテンプレート} }を削除", "xpack.idxMgmt.home.componentTemplates.deleteModal.cancelButtonLabel": "キャンセル", "xpack.idxMgmt.home.componentTemplates.deleteModal.deleteDescription": "{numComponentTemplatesToDelete, plural, one {このコンポーネントテンプレート} other {これらのコンポーネントテンプレート} }を削除しようとしています。", @@ -22206,8 +22204,6 @@ "xpack.idxMgmt.home.componentTemplates.deleteModal.multipleErrorsNotificationMessageText": "{count}個のコンポーネントテンプレートの削除エラー", "xpack.idxMgmt.home.componentTemplates.deleteModal.successDeleteMultipleNotificationMessageText": "{numSuccesses, plural, other {# 個のコンポーネントテンプレート}}を削除しました", "xpack.idxMgmt.home.componentTemplates.deleteModal.successDeleteSingleNotificationMessageText": "コンポーネントテンプレート''{componentTemplateName}''を削除しました", - "xpack.idxMgmt.home.componentTemplates.deniedPrivilegeDescription": "コンポーネントテンプレートを使用するには、{privilegesCount, plural, one {このクラスター特権} other {これらのクラスター特権}}が必要です:{missingPrivileges}。", - "xpack.idxMgmt.home.componentTemplates.deniedPrivilegeTitle": "クラスターの権限が必要です", "xpack.idxMgmt.home.componentTemplates.emptyPromptButtonLabel": "コンポーネントテンプレートを作成", "xpack.idxMgmt.home.componentTemplates.emptyPromptDescription": "たとえば、インデックステンプレート全体で再利用できるインデックス設定のコンポーネントテンプレートを作成できます。", "xpack.idxMgmt.home.componentTemplates.emptyPromptDocumentionLink": "詳細情報", diff --git a/x-pack/platform/plugins/private/translations/translations/zh-CN.json b/x-pack/platform/plugins/private/translations/translations/zh-CN.json index 370c4d8fa63b9..d6bca0a79d647 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -21842,16 +21842,12 @@ "xpack.idxMgmt.goToDiscover.discoverIndexButtonLabel": "Discover 索引", "xpack.idxMgmt.goToDiscover.showIndexToolTip": "在 Discover 中显示 {indexName}", "xpack.idxMgmt.home.appTitle": "索引管理", - "xpack.idxMgmt.home.componentTemplates.checkingPrivilegesDescription": "正在检查权限……", - "xpack.idxMgmt.home.componentTemplates.checkingPrivilegesErrorMessage": "从服务器获取用户权限时出错。", "xpack.idxMgmt.home.componentTemplates.confirmButtonLabel": "删除{numComponentTemplatesToDelete, plural, other {组件模板} }", "xpack.idxMgmt.home.componentTemplates.deleteModal.cancelButtonLabel": "取消", "xpack.idxMgmt.home.componentTemplates.deleteModal.deleteDescription": "您即将删除{numComponentTemplatesToDelete, plural, other {以下组件模板} }:", "xpack.idxMgmt.home.componentTemplates.deleteModal.modalTitleText": "删除{numComponentTemplatesToDelete, plural, one {组件模板} other { # 个组件模板}}", "xpack.idxMgmt.home.componentTemplates.deleteModal.multipleErrorsNotificationMessageText": "删除 {count} 个组件模板时出错", "xpack.idxMgmt.home.componentTemplates.deleteModal.successDeleteMultipleNotificationMessageText": "已删除 {numSuccesses, plural, other {# 个组件模板}}", - "xpack.idxMgmt.home.componentTemplates.deniedPrivilegeDescription": "要使用'组件模板',必须具有{privilegesCount, plural, other {以下集群权限}}:{missingPrivileges}。", - "xpack.idxMgmt.home.componentTemplates.deniedPrivilegeTitle": "需要集群权限", "xpack.idxMgmt.home.componentTemplates.emptyPromptButtonLabel": "创建组件模板", "xpack.idxMgmt.home.componentTemplates.emptyPromptDescription": "例如,您可以为可在多个索引模板上重复使用的索引设置创建组件模板。", "xpack.idxMgmt.home.componentTemplates.emptyPromptDocumentionLink": "了解详情。", diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx b/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx index 24f641ae2833f..535e0219bf823 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx @@ -95,6 +95,7 @@ const appDependencies = { monitor: true, manageEnrich: true, monitorEnrich: true, + manageIndexTemplates: true, }, } as any; diff --git a/x-pack/plugins/index_management/public/application/app_context.tsx b/x-pack/plugins/index_management/public/application/app_context.tsx index 3573ae33812d9..1019d580dec5d 100644 --- a/x-pack/plugins/index_management/public/application/app_context.tsx +++ b/x-pack/plugins/index_management/public/application/app_context.tsx @@ -84,6 +84,7 @@ export interface AppDependencies { monitor: boolean; manageEnrich: boolean; monitorEnrich: boolean; + manageIndexTemplates: boolean; }; } diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/auth_provider.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/auth_provider.tsx deleted file mode 100644 index 88da23007a4f6..0000000000000 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/auth_provider.tsx +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; - -import { AuthorizationProvider } from '../shared_imports'; -import { useComponentTemplatesContext } from '../component_templates_context'; - -export const ComponentTemplatesAuthProvider: React.FunctionComponent<{ - children?: React.ReactNode; -}> = ({ children }) => { - const { httpClient, apiBasePath } = useComponentTemplatesContext(); - - return ( - - {children} - - ); -}; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/component_template_list_container.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/component_template_list_container.tsx index 30cec15545610..e3583b41c1108 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/component_template_list_container.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/component_template_list_container.tsx @@ -11,8 +11,6 @@ import { RouteComponentProps } from 'react-router-dom'; import qs from 'query-string'; import { useExecutionContext } from '../shared_imports'; import { useComponentTemplatesContext } from '../component_templates_context'; -import { ComponentTemplatesAuthProvider } from './auth_provider'; -import { ComponentTemplatesWithPrivileges } from './with_privileges'; import { ComponentTemplateList } from './component_template_list'; interface MatchParams { @@ -39,14 +37,10 @@ export const ComponentTemplateListContainer: React.FunctionComponent< const filter = urlParams.filter ?? ''; return ( - - - - - + ); }; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/with_privileges.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/with_privileges.tsx deleted file mode 100644 index 5ae9b2f14ec82..0000000000000 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/with_privileges.tsx +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FormattedMessage } from '@kbn/i18n-react'; -import React, { FunctionComponent } from 'react'; - -import { - PageLoading, - PageError, - useAuthorizationContext, - WithPrivileges, - NotAuthorizedSection, -} from '../shared_imports'; -import { APP_CLUSTER_REQUIRED_PRIVILEGES } from '../constants'; - -export const ComponentTemplatesWithPrivileges: FunctionComponent<{ - children?: React.ReactNode; -}> = ({ children }) => { - const { apiError } = useAuthorizationContext(); - - if (apiError) { - return ( - - } - error={apiError} - /> - ); - } - - return ( - `cluster.${privilege}`)} - > - {({ isLoading, hasPrivileges, privilegesMissing }) => { - if (isLoading) { - return ( - - - - ); - } - - if (!hasPrivileges) { - return ( - - } - message={ - - } - /> - ); - } - - return <>{children}; - }} - - ); -}; diff --git a/x-pack/plugins/index_management/public/application/mount_management_section.ts b/x-pack/plugins/index_management/public/application/mount_management_section.ts index 83cf620a0e8e0..003f5279ae520 100644 --- a/x-pack/plugins/index_management/public/application/mount_management_section.ts +++ b/x-pack/plugins/index_management/public/application/mount_management_section.ts @@ -73,7 +73,8 @@ export function getIndexManagementDependencies({ }): AppDependencies { const { docLinks, application, uiSettings, settings } = core; const { url } = startDependencies.share; - const { monitor, manageEnrich, monitorEnrich } = application.capabilities.index_management; + const { monitor, manageEnrich, monitorEnrich, manageIndexTemplates } = + application.capabilities.index_management; return { core: { @@ -109,6 +110,7 @@ export function getIndexManagementDependencies({ monitor: !!monitor, manageEnrich: !!manageEnrich, monitorEnrich: !!monitorEnrich, + manageIndexTemplates: !!manageIndexTemplates, }, }; } diff --git a/x-pack/plugins/index_management/public/application/sections/home/home.tsx b/x-pack/plugins/index_management/public/application/sections/home/home.tsx index 2d0fc7d4ec108..53ef500f597e0 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/home.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/home.tsx @@ -66,7 +66,10 @@ export const IndexManagementHome: React.FunctionComponent ), }, - { + ]; + + if (privs.manageIndexTemplates) { + tabs.push({ id: Section.ComponentTemplates, name: ( ), - }, - ]; + }); + } if (privs.monitorEnrich) { tabs.push({ @@ -139,14 +142,16 @@ export const IndexManagementHome: React.FunctionComponent - + {privs.manageIndexTemplates && ( + + )} {privs.monitorEnrich && ( )} diff --git a/x-pack/plugins/index_management/public/plugin.ts b/x-pack/plugins/index_management/public/plugin.ts index 06adcc75d80b3..35996a43e2cd6 100644 --- a/x-pack/plugins/index_management/public/plugin.ts +++ b/x-pack/plugins/index_management/public/plugin.ts @@ -105,8 +105,12 @@ export class IndexMgmtUIPlugin const { fleet, usageCollection, management, cloud } = plugins; this.capabilities$.subscribe((capabilities) => { - const { monitor, manageEnrich, monitorEnrich } = capabilities.index_management; - if (this.config.isIndexManagementUiEnabled && (monitor || manageEnrich || monitorEnrich)) { + const { monitor, manageEnrich, monitorEnrich, manageIndexTemplates } = + capabilities.index_management; + if ( + this.config.isIndexManagementUiEnabled && + (monitor || manageEnrich || monitorEnrich || manageIndexTemplates) + ) { management.sections.section.data.registerApp({ id: PLUGIN.id, title: i18n.translate('xpack.idxMgmt.appTitle', { defaultMessage: 'Index Management' }), diff --git a/x-pack/plugins/index_management/server/plugin.ts b/x-pack/plugins/index_management/server/plugin.ts index ab6b058cddc78..d6689f02255bc 100644 --- a/x-pack/plugins/index_management/server/plugin.ts +++ b/x-pack/plugins/index_management/server/plugin.ts @@ -46,6 +46,10 @@ export class IndexMgmtServerPlugin implements Plugin { - const routeContextMock = { - core: { - elasticsearch: { - client: { - asCurrentUser: { - security: { - hasPrivileges, - }, - }, - }, - }, - }, - } as unknown as RequestHandlerContext; - - return routeContextMock; -}; - -describe('GET privileges', () => { - let routeHandler: RequestHandler; - - beforeEach(() => { - const router = httpService.createRouter(); - - registerPrivilegesRoute({ - router, - config: { - isSecurityEnabled: () => true, - isLegacyTemplatesEnabled: true, - isIndexStatsEnabled: true, - isSizeAndDocCountEnabled: false, - isDataStreamStatsEnabled: true, - enableMappingsSourceFieldSection: true, - enableTogglingDataRetention: true, - enableProjectLevelRetentionChecks: false, - }, - indexDataEnricher: mockedIndexDataEnricher, - lib: { - handleEsError: jest.fn(), - }, - }); - - routeHandler = router.get.mock.calls[0][1]; - }); - - it('should return the correct response when a user has privileges', async () => { - const privilegesResponseMock = { - username: 'elastic', - has_all_requested: true, - cluster: { manage_index_templates: true }, - index: {}, - application: {}, - }; - - const routeContextMock = mockRouteContext({ - hasPrivileges: jest.fn().mockResolvedValueOnce(privilegesResponseMock), - }); - - const request = httpServerMock.createKibanaRequest(); - const response = await routeHandler(routeContextMock, request, kibanaResponseFactory); - - expect(response.payload).toEqual({ - hasAllPrivileges: true, - missingPrivileges: { - cluster: [], - }, - }); - }); - - it('should return the correct response when a user does not have privileges', async () => { - const privilegesResponseMock = { - username: 'elastic', - has_all_requested: false, - cluster: { manage_index_templates: false }, - index: {}, - application: {}, - }; - - const routeContextMock = mockRouteContext({ - hasPrivileges: jest.fn().mockResolvedValueOnce(privilegesResponseMock), - }); - - const request = httpServerMock.createKibanaRequest(); - const response = await routeHandler(routeContextMock, request, kibanaResponseFactory); - - expect(response.payload).toEqual({ - hasAllPrivileges: false, - missingPrivileges: { - cluster: ['manage_index_templates'], - }, - }); - }); - - describe('With security disabled', () => { - beforeEach(() => { - const router = httpService.createRouter(); - - registerPrivilegesRoute({ - router, - config: { - isSecurityEnabled: () => false, - isLegacyTemplatesEnabled: true, - isIndexStatsEnabled: true, - isSizeAndDocCountEnabled: false, - isDataStreamStatsEnabled: true, - enableMappingsSourceFieldSection: true, - enableTogglingDataRetention: true, - enableProjectLevelRetentionChecks: false, - }, - indexDataEnricher: mockedIndexDataEnricher, - lib: { - handleEsError: jest.fn(), - }, - }); - - routeHandler = router.get.mock.calls[0][1]; - }); - - it('should return the default privileges response', async () => { - const routeContextMock = mockRouteContext({ - hasPrivileges: jest.fn(), - }); - - const request = httpServerMock.createKibanaRequest(); - const response = await routeHandler(routeContextMock, request, kibanaResponseFactory); - - expect(response.payload).toEqual({ - hasAllPrivileges: true, - missingPrivileges: { - cluster: [], - }, - }); - }); - }); -}); diff --git a/x-pack/plugins/index_management/server/routes/api/component_templates/register_privileges_route.ts b/x-pack/plugins/index_management/server/routes/api/component_templates/register_privileges_route.ts deleted file mode 100644 index a053eb44657cb..0000000000000 --- a/x-pack/plugins/index_management/server/routes/api/component_templates/register_privileges_route.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { Privileges } from '@kbn/es-ui-shared-plugin/public'; -import { RouteDependencies } from '../../../types'; -import { addBasePath } from '..'; - -const extractMissingPrivileges = (privilegesObject: { [key: string]: boolean } = {}): string[] => - Object.keys(privilegesObject).reduce((privileges: string[], privilegeName: string): string[] => { - if (!privilegesObject[privilegeName]) { - privileges.push(privilegeName); - } - return privileges; - }, []); - -export const registerPrivilegesRoute = ({ - router, - config, - lib: { handleEsError }, -}: RouteDependencies) => { - router.get( - { - path: addBasePath('/component_templates/privileges'), - validate: false, - }, - async (context, request, response) => { - const privilegesResult: Privileges = { - hasAllPrivileges: true, - missingPrivileges: { - cluster: [], - }, - }; - - // Skip the privileges check if security is not enabled - if (!config.isSecurityEnabled()) { - return response.ok({ body: privilegesResult }); - } - - const { client } = (await context.core).elasticsearch; - - try { - const { has_all_requested: hasAllPrivileges, cluster } = - await client.asCurrentUser.security.hasPrivileges({ - body: { - cluster: ['manage_index_templates'], - }, - }); - - if (!hasAllPrivileges) { - privilegesResult.missingPrivileges.cluster = extractMissingPrivileges(cluster); - } - - privilegesResult.hasAllPrivileges = hasAllPrivileges; - return response.ok({ body: privilegesResult }); - } catch (error) { - return handleEsError({ error, response }); - } - } - ); -}; diff --git a/x-pack/test/api_integration/apis/management/index_management/component_templates.ts b/x-pack/test/api_integration/apis/management/index_management/component_templates.ts index fb57f0813d843..e325f4bbfa588 100644 --- a/x-pack/test/api_integration/apis/management/index_management/component_templates.ts +++ b/x-pack/test/api_integration/apis/management/index_management/component_templates.ts @@ -10,13 +10,11 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { componentTemplatesApi } from './lib/component_templates.api'; import { componentTemplateHelpers } from './lib/component_template.helpers'; -import { API_BASE_PATH } from './constants'; const CACHE_TEMPLATES = true; export default function ({ getService }: FtrProviderContext) { const log = getService('log'); - const supertest = getService('supertest'); const { createComponentTemplate, @@ -395,21 +393,6 @@ export default function ({ getService }: FtrProviderContext) { }); }); - describe('Privileges', () => { - it('should return privileges result', async () => { - const uri = `${API_BASE_PATH}/component_templates/privileges`; - - const { body } = await supertest.get(uri).set('kbn-xsrf', 'xxx').expect(200); - - expect(body).to.eql({ - hasAllPrivileges: true, - missingPrivileges: { - cluster: [], - }, - }); - }); - }); - describe('Get datastreams', () => { const COMPONENT_NAME = 'test_get_component_template_datastreams'; const COMPONENT = { diff --git a/x-pack/test_serverless/functional/test_suites/common/management/index_management/component_templates.ts b/x-pack/test_serverless/functional/test_suites/common/management/index_management/component_templates.ts index d72aadd9dbb1a..66a0a0f33d545 100644 --- a/x-pack/test_serverless/functional/test_suites/common/management/index_management/component_templates.ts +++ b/x-pack/test_serverless/functional/test_suites/common/management/index_management/component_templates.ts @@ -13,94 +13,125 @@ import { FtrProviderContext } from '../../../../ftr_provider_context'; export default ({ getPageObjects, getService }: FtrProviderContext) => { const pageObjects = getPageObjects(['svlCommonPage', 'common', 'indexManagement', 'header']); const browser = getService('browser'); - const security = getService('security'); + const samlAuth = getService('samlAuth'); const testSubjects = getService('testSubjects'); const es = getService('es'); const TEST_COMPONENT_TEMPLATE = '.a_test_component_template'; describe('Index component templates', function () { - before(async () => { - await security.testUser.setRoles(['index_management_user']); - await pageObjects.svlCommonPage.loginAsAdmin(); - }); + describe('with access', () => { + before(async () => { + await pageObjects.svlCommonPage.loginAsAdmin(); + }); - beforeEach(async () => { - await pageObjects.common.navigateToApp('indexManagement'); - // Navigate to the index templates tab - await pageObjects.indexManagement.changeTabs('component_templatesTab'); - await pageObjects.header.waitUntilLoadingHasFinished(); - }); + beforeEach(async () => { + await pageObjects.common.navigateToApp('indexManagement'); + // Navigate to the index templates tab + await pageObjects.indexManagement.changeTabs('component_templatesTab'); + await pageObjects.header.waitUntilLoadingHasFinished(); + }); - it('renders the component templates tab', async () => { - const url = await browser.getCurrentUrl(); - expect(url).to.contain(`/component_templates`); - }); + it('renders the component templates tab', async () => { + const url = await browser.getCurrentUrl(); + expect(url).to.contain(`/component_templates`); + }); - describe('Component templates list', () => { - before(async () => { - await es.cluster.putComponentTemplate({ - name: TEST_COMPONENT_TEMPLATE, - body: { - template: { - settings: { - index: { - number_of_shards: 1, + describe('Component templates list', () => { + before(async () => { + await es.cluster.putComponentTemplate({ + name: TEST_COMPONENT_TEMPLATE, + body: { + template: { + settings: { + index: { + number_of_shards: 1, + }, }, }, }, - }, + }); }); - }); - after(async () => { - await es.cluster.deleteComponentTemplate( - { name: TEST_COMPONENT_TEMPLATE }, - { ignore: [404] } - ); + after(async () => { + await es.cluster.deleteComponentTemplate( + { name: TEST_COMPONENT_TEMPLATE }, + { ignore: [404] } + ); + }); + + it('Displays the test component template in the list', async () => { + const templates = await testSubjects.findAll('componentTemplateTableRow'); + + const getTemplateName = async (template: WebElementWrapper) => { + const templateNameElement = await template.findByTestSubject('templateDetailsLink'); + return await templateNameElement.getVisibleText(); + }; + + const componentTemplateList = await Promise.all( + templates.map((template) => getTemplateName(template)) + ); + + const newComponentTemplateExists = Boolean( + componentTemplateList.find((templateName) => templateName === TEST_COMPONENT_TEMPLATE) + ); + + expect(newComponentTemplateExists).to.be(true); + }); }); - it('Displays the test component template in the list', async () => { - const templates = await testSubjects.findAll('componentTemplateTableRow'); + describe('Create component template', () => { + after(async () => { + await es.cluster.deleteComponentTemplate( + { name: TEST_COMPONENT_TEMPLATE }, + { ignore: [404] } + ); + }); - const getTemplateName = async (template: WebElementWrapper) => { - const templateNameElement = await template.findByTestSubject('templateDetailsLink'); - return await templateNameElement.getVisibleText(); - }; + it('Creates component template', async () => { + await testSubjects.click('createPipelineButton'); - const componentTemplateList = await Promise.all( - templates.map((template) => getTemplateName(template)) - ); + await testSubjects.setValue('nameField', TEST_COMPONENT_TEMPLATE); - const newComponentTemplateExists = Boolean( - componentTemplateList.find((templateName) => templateName === TEST_COMPONENT_TEMPLATE) - ); + // Finish wizard flow + await testSubjects.click('nextButton'); + await testSubjects.click('nextButton'); + await testSubjects.click('nextButton'); + await testSubjects.click('nextButton'); + await testSubjects.click('nextButton'); - expect(newComponentTemplateExists).to.be(true); + expect(await testSubjects.getVisibleText('title')).to.contain(TEST_COMPONENT_TEMPLATE); + }); }); }); - describe('Create component template', () => { - after(async () => { - await es.cluster.deleteComponentTemplate( - { name: TEST_COMPONENT_TEMPLATE }, - { ignore: [404] } - ); + describe('no access', () => { + this.tags(['skipSvlOblt', 'skipMKI']); + before(async () => { + await samlAuth.setCustomRole({ + elasticsearch: { + cluster: ['monitor'], + indices: [{ names: ['*'], privileges: ['all'] }], + }, + kibana: [ + { + base: ['all'], + feature: {}, + spaces: ['*'], + }, + ], + }); + await pageObjects.svlCommonPage.loginWithCustomRole(); + await pageObjects.common.navigateToApp('indexManagement'); + await pageObjects.header.waitUntilLoadingHasFinished(); }); - it('Creates component template', async () => { - await testSubjects.click('createPipelineButton'); - - await testSubjects.setValue('nameField', TEST_COMPONENT_TEMPLATE); - - // Finish wizard flow - await testSubjects.click('nextButton'); - await testSubjects.click('nextButton'); - await testSubjects.click('nextButton'); - await testSubjects.click('nextButton'); - await testSubjects.click('nextButton'); + after(async () => { + await samlAuth.deleteCustomRole(); + }); - expect(await testSubjects.getVisibleText('title')).to.contain(TEST_COMPONENT_TEMPLATE); + it('hides the component templates tab', async () => { + await testSubjects.missingOrFail('component_templatesTab'); }); }); }); From 860d5b6b3599dcdf1a090923224b5c315156c1a5 Mon Sep 17 00:00:00 2001 From: Katerina Date: Wed, 18 Dec 2024 17:06:54 +0200 Subject: [PATCH 4/9] [Performance] Update `onPageReady` documentation (#204179) ## Summary Related to this: https://github.com/elastic/kibana/pull/202889 Update the documentation with the recent changes --- .../adding_custom_performance_metrics.mdx | 66 +++++++++++++++++-- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/dev_docs/tutorials/performance/adding_custom_performance_metrics.mdx b/dev_docs/tutorials/performance/adding_custom_performance_metrics.mdx index 37322e3f55e05..41570826ad2bd 100644 --- a/dev_docs/tutorials/performance/adding_custom_performance_metrics.mdx +++ b/dev_docs/tutorials/performance/adding_custom_performance_metrics.mdx @@ -294,7 +294,63 @@ This event will be indexed with the following structure: } ``` +#### Add time ranges + +The meta field supports telemetry on time ranges, providing calculated metrics for enhanced context. This includes: + +- **Query range in ceconds:** + + - Calculated as the time difference in seconds between `rangeFrom` and `rangeTo`. + +- **Offset calculation:** + - A **negative offset** indicates that `rangeTo` is in the past. + - A **positive offset** indicates that `rangeTo` is in the future. + - An offset of **zero** indicates that `rangeTo` matches `'now'`. + +###### Code example + +``` +onPageReady({ + meta: { + rangeFrom: 'now-15m', + rangeTo: 'now', + } +}); +``` + +This will be indexed as: + +```typescript +{ + "_index": "backing-ebt-kibana-browser-performance-metrics-000001", // Performance metrics are stored in a dedicated simplified index (browser \ server). + "_source": { + "timestamp": "2024-08-13T11:29:58.275Z" + "event_type": "performance_metric", // All performance events share a common event type to simplify mapping + "eventName": 'kibana:plugin_render_time', // Event name as specified when reporting it + "duration": 736, // Event duration as specified when reporting it + "meta": { + "target": '/home', + "query_range_secs": 900 + "query_offset_secs": 0 // now + }, + "context": { // Context holds information identifying the deployment, version, application and page that generated the event + "version": "8.16.0-SNAPSHOT", + "cluster_name": "elasticsearch", + "pageName": "application:home:app", + "applicationId": "home", + "page": "app", + "entityId": "61c58ad0-3dd3-11e8-b2b9-5d5dc1715159", + "branch": "main", + ... + }, + + ... + }, +} +``` + #### Add custom metrics + Having `kibana:plugin_render_time` metric event is not always enough, depending on the use case you would likely need some complementary information to give some sense to the value reported by the metric (e.g. number of hosts, number of services, number of dataStreams, etc). `kibana:plugin_render_time` metric API supports up to 9 numbered free fields that can be used to report numeric metrics that you intend to analyze. Note that they can be used for any type of numeric information you may want to report. @@ -304,10 +360,12 @@ We could make use of these custom metrics using the following format: ... // Call onPageReady once the meaningful data has rendered and visible to the user onPageReady({ - key1: 'datasets', - value1: 5, - key2: 'documents', - value2: 1000, + customMetrics: { + key1: 'datasets', + value1: 5, + key2: 'documents', + value2: 1000, + } }); ... ``` From 6490c45550446a79794135ae66e4b75e473c38f5 Mon Sep 17 00:00:00 2001 From: Marco Liberati Date: Wed, 18 Dec 2024 16:15:43 +0100 Subject: [PATCH 5/9] [Lens][Embeddable] Unify internal api into a single object (#204194) ## Summary Fixes #198753 Initially `visualizationContext` was migrated from the legacy system "as-is" when refactoring to the new system. This PR merges the `visualizationContextHelpers` within the Lens `internalApi` to avoid: * attributes unsync (it rely on the `attributes` variable which is hold by the `internalApi` already) * single place to find internal variables Took also the opportunity to simplify the mocks here: * use the actual implementation for the internalApi vs mocks * this would simplify also the maintenance of types in the future * adapted the tests to use the new implementation and `internalApi` --- .../public/react_embeddable/data_loader.ts | 16 ++---- .../lens/public/react_embeddable/helper.ts | 2 +- .../initializers/initialize_actions.test.ts | 13 +++-- .../initializers/initialize_actions.ts | 27 ++++++---- .../initializers/initialize_internal_api.ts | 24 ++++++++- .../initialize_visualization_context.ts | 32 ----------- .../react_embeddable/lens_embeddable.tsx | 8 +-- .../public/react_embeddable/mocks/index.tsx | 53 ++++--------------- .../lens_embeddable_component.test.tsx | 5 +- .../lens/public/react_embeddable/types.ts | 10 +++- .../react_embeddable/user_messages/api.ts | 22 ++++---- 11 files changed, 87 insertions(+), 125 deletions(-) delete mode 100644 x-pack/plugins/lens/public/react_embeddable/initializers/initialize_visualization_context.ts diff --git a/x-pack/plugins/lens/public/react_embeddable/data_loader.ts b/x-pack/plugins/lens/public/react_embeddable/data_loader.ts index ac69b79b42230..a1d2e713d3f81 100644 --- a/x-pack/plugins/lens/public/react_embeddable/data_loader.ts +++ b/x-pack/plugins/lens/public/react_embeddable/data_loader.ts @@ -22,13 +22,7 @@ import { import fastIsEqual from 'fast-deep-equal'; import { pick } from 'lodash'; import { getEditPath } from '../../common/constants'; -import type { - GetStateType, - LensApi, - LensInternalApi, - LensPublicCallbacks, - VisualizationContextHelper, -} from './types'; +import type { GetStateType, LensApi, LensInternalApi, LensPublicCallbacks } from './types'; import { getExpressionRendererParams } from './expressions/expression_params'; import type { LensEmbeddableStartServices } from './types'; import { prepareCallbacks } from './expressions/callbacks'; @@ -84,7 +78,6 @@ export function loadEmbeddableData( parentApi: unknown, internalApi: LensInternalApi, services: LensEmbeddableStartServices, - { getVisualizationContext, updateVisualizationContext }: VisualizationContextHelper, metaInfo?: SharingSavedObjectProps ) { const { onLoad, onBeforeBadgesRender, ...callbacks } = apiHasLensComponentCallbacks(parentApi) @@ -103,7 +96,6 @@ export function loadEmbeddableData( } = buildUserMessagesHelpers( api, internalApi, - getVisualizationContext, services, onBeforeBadgesRender, services.spaces, @@ -174,7 +166,7 @@ export function loadEmbeddableData( }; const onDataCallback = (adapters: Partial | undefined) => { - updateVisualizationContext({ + internalApi.updateVisualizationContext({ activeData: adapters?.tables?.tables, }); // data has loaded @@ -243,8 +235,8 @@ export function loadEmbeddableData( // update the visualization context before anything else // as it will be used to compute blocking errors also in case of issues - updateVisualizationContext({ - doc: currentState.attributes, + internalApi.updateVisualizationContext({ + activeAttributes: currentState.attributes, mergedSearchContext: params?.searchContext || {}, ...rest, }); diff --git a/x-pack/plugins/lens/public/react_embeddable/helper.ts b/x-pack/plugins/lens/public/react_embeddable/helper.ts index 3ee63d907068d..bc0b7c957b9d4 100644 --- a/x-pack/plugins/lens/public/react_embeddable/helper.ts +++ b/x-pack/plugins/lens/public/react_embeddable/helper.ts @@ -40,7 +40,7 @@ export function createEmptyLensState( query: query || { query: '', language: 'kuery' }, filters: filters || [], internalReferences: [], - datasourceStates: { ...(isTextBased ? { text_based: {} } : { form_based: {} }) }, + datasourceStates: { ...(isTextBased ? { textBased: {} } : { formBased: {} }) }, visualization: {}, }, }, diff --git a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.test.ts b/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.test.ts index 016bc0e87f11d..d7a073f10e024 100644 --- a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.test.ts +++ b/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.test.ts @@ -13,8 +13,8 @@ import { getLensApiMock, makeEmbeddableServices, getLensRuntimeStateMock, - getVisualizationContextHelperMock, createUnifiedSearchApi, + getLensInternalApiMock, } from '../mocks'; import { createEmptyLensState } from '../helper'; const DATAVIEW_ID = 'myDataView'; @@ -40,11 +40,17 @@ function setupActionsApi( ) { const services = makeEmbeddableServices(undefined, undefined, { visOverrides: { id: 'lnsXY' }, - dataOverrides: { id: 'form_based' }, + dataOverrides: { id: 'formBased' }, }); const uuid = faker.string.uuid(); const runtimeState = getLensRuntimeStateMock(stateOverrides); const apiMock = getLensApiMock(); + // create the internal API and customize internal state + const internalApi = getLensInternalApiMock(); + internalApi.updateVisualizationContext({ + ...contextOverrides, + activeAttributes: runtimeState.attributes, + }); const { api } = initializeActionApi( uuid, @@ -53,7 +59,7 @@ function setupActionsApi( createUnifiedSearchApi(), pick(apiMock, ['timeRange$']), pick(apiMock, ['panelTitle']), - getVisualizationContextHelperMock(stateOverrides?.attributes, contextOverrides), + internalApi, { ...services, data: { @@ -85,6 +91,7 @@ describe('Dashboard actions', () => { describe('Explore in Discover', () => { // make it pass the basic check on viewUnderlyingData const visualizationContextMockOverrides = { + activeAttributes: undefined, mergedSearchContext: {}, indexPatterns: { [DATAVIEW_ID]: { diff --git a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.ts b/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.ts index 65fd13c8fca50..ac6739d9ded1c 100644 --- a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.ts +++ b/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.ts @@ -34,10 +34,10 @@ import { buildObservableVariable, isTextBasedLanguage } from '../helper'; import type { GetStateType, LensEmbeddableStartServices, + LensInternalApi, LensRuntimeState, ViewInDiscoverCallbacks, ViewUnderlyingDataArgs, - VisualizationContextHelper, } from '../types'; import { getActiveDatasourceIdFromDoc, getActiveVisualizationIdFromDoc } from '../../utils'; @@ -120,7 +120,7 @@ function getViewUnderlyingDataArgs({ function loadViewUnderlyingDataArgs( state: LensRuntimeState, - { getVisualizationContext }: VisualizationContextHelper, + { getVisualizationContext }: LensInternalApi, searchContextApi: { timeRange$: PublishingSubject }, parentApi: unknown, { @@ -132,16 +132,21 @@ function loadViewUnderlyingDataArgs( visualizationMap, }: LensEmbeddableStartServices ) { - const { doc, activeData, activeDatasourceState, activeVisualizationState, indexPatterns } = - getVisualizationContext(); - const activeVisualizationId = getActiveVisualizationIdFromDoc(doc); - const activeDatasourceId = getActiveDatasourceIdFromDoc(doc); + const { + activeAttributes, + activeData, + activeDatasourceState, + activeVisualizationState, + indexPatterns, + } = getVisualizationContext(); + const activeVisualizationId = getActiveVisualizationIdFromDoc(activeAttributes); + const activeDatasourceId = getActiveDatasourceIdFromDoc(activeAttributes); const activeVisualization = activeVisualizationId ? visualizationMap[activeVisualizationId] : undefined; const activeDatasource = activeDatasourceId ? datasourceMap[activeDatasourceId] : undefined; if ( - !doc || + !activeAttributes || !activeData || !activeDatasource || !activeDatasourceState || @@ -199,7 +204,7 @@ function loadViewUnderlyingDataArgs( function createViewUnderlyingDataApis( getState: GetStateType, - visualizationContextHelper: VisualizationContextHelper, + internalApi: LensInternalApi, searchContextApi: { timeRange$: PublishingSubject }, parentApi: unknown, services: LensEmbeddableStartServices @@ -213,7 +218,7 @@ function createViewUnderlyingDataApis( loadViewUnderlyingData: () => { viewUnderlyingDataArgs = loadViewUnderlyingDataArgs( getState(), - visualizationContextHelper, + internalApi, searchContextApi, parentApi, services @@ -237,7 +242,7 @@ export function initializeActionApi( parentApi: unknown, searchContextApi: { timeRange$: PublishingSubject }, titleApi: { panelTitle: PublishingSubject }, - visualizationContextHelper: VisualizationContextHelper, + internalApi: LensInternalApi, services: LensEmbeddableStartServices ): { api: ViewInDiscoverCallbacks & HasDynamicActions; @@ -257,7 +262,7 @@ export function initializeActionApi( ...(isTextBasedLanguage(initialState) ? {} : dynamicActionsApi?.dynamicActionsApi ?? {}), ...createViewUnderlyingDataApis( getLatestState, - visualizationContextHelper, + internalApi, searchContextApi, parentApi, services diff --git a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_internal_api.ts b/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_internal_api.ts index e366c24a6c0e0..2c89ed463e1c5 100644 --- a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_internal_api.ts +++ b/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_internal_api.ts @@ -15,6 +15,7 @@ import type { LensInternalApi, LensOverrides, LensRuntimeState, + VisualizationContext, } from '../types'; import { apiHasAbortController, apiHasLensComponentProps } from '../type_guards'; import type { UserMessage } from '../../types'; @@ -52,6 +53,18 @@ export function initializeInternalApi( // the isNewPanel won't be serialized so it will be always false after the edit panel closes applying the changes const isNewlyCreated$ = new BehaviorSubject(initialState.isNewPanel || false); + const visualizationContext$ = new BehaviorSubject({ + // doc can point to a different set of attributes for the visualization + // i.e. when inline editing or applying a suggestion + activeAttributes: initialState.attributes, + mergedSearchContext: {}, + indexPatterns: {}, + indexPatternRefs: [], + activeVisualizationState: undefined, + activeDatasourceState: undefined, + activeData: undefined, + }); + // No need to expose anything at public API right now, that would happen later on // where each initializer will pick what it needs and publish it return { @@ -65,6 +78,8 @@ export function initializeInternalApi( renderCount$, isNewlyCreated$, dataViews: dataViews$, + messages$, + validationMessages$, dispatchError: () => { hasRenderCompleted$.next(true); renderCount$.next(renderCount$.getValue() + 1); @@ -82,9 +97,7 @@ export function initializeInternalApi( updateAbortController: (abortController: AbortController | undefined) => expressionAbortController$.next(abortController), updateDataViews: (dataViews: DataView[] | undefined) => dataViews$.next(dataViews), - messages$, updateMessages: (newMessages: UserMessage[]) => messages$.next(newMessages), - validationMessages$, updateValidationMessages: (newMessages: UserMessage[]) => validationMessages$.next(newMessages), resetAllMessages: () => { messages$.next([]); @@ -116,5 +129,12 @@ export function initializeInternalApi( return displayOptions; }, + getVisualizationContext: () => visualizationContext$.getValue(), + updateVisualizationContext: (newVisualizationContext: Partial) => { + visualizationContext$.next({ + ...visualizationContext$.getValue(), + ...newVisualizationContext, + }); + }, }; } diff --git a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_visualization_context.ts b/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_visualization_context.ts deleted file mode 100644 index 93d544013e710..0000000000000 --- a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_visualization_context.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { LensInternalApi, VisualizationContext, VisualizationContextHelper } from '../types'; - -export function initializeVisualizationContext( - internalApi: LensInternalApi -): VisualizationContextHelper { - // TODO: this will likely be merged together with the state$ observable - let visualizationContext: VisualizationContext = { - doc: internalApi.attributes$.getValue(), - mergedSearchContext: {}, - indexPatterns: {}, - indexPatternRefs: [], - activeVisualizationState: undefined, - activeDatasourceState: undefined, - activeData: undefined, - }; - return { - getVisualizationContext: () => visualizationContext, - updateVisualizationContext: (newVisualizationContext: Partial) => { - visualizationContext = { - ...visualizationContext, - ...newVisualizationContext, - }; - }, - }; -} diff --git a/x-pack/plugins/lens/public/react_embeddable/lens_embeddable.tsx b/x-pack/plugins/lens/public/react_embeddable/lens_embeddable.tsx index 074ae451115b5..2fc1928dc40c8 100644 --- a/x-pack/plugins/lens/public/react_embeddable/lens_embeddable.tsx +++ b/x-pack/plugins/lens/public/react_embeddable/lens_embeddable.tsx @@ -22,7 +22,6 @@ import { initializeInspector } from './initializers/initialize_inspector'; import { initializeDashboardServices } from './initializers/initialize_dashboard_services'; import { initializeInternalApi } from './initializers/initialize_internal_api'; import { initializeSearchContext } from './initializers/initialize_search_context'; -import { initializeVisualizationContext } from './initializers/initialize_visualization_context'; import { initializeActionApi } from './initializers/initialize_actions'; import { initializeIntegrations } from './initializers/initialize_integrations'; import { initializeStateManagement } from './initializers/initialize_state_management'; @@ -61,8 +60,6 @@ export const createLensEmbeddableFactory = ( */ const internalApi = initializeInternalApi(initialState, parentApi, services); - const visualizationContextHelper = initializeVisualizationContext(internalApi); - /** * Initialize various configurations required to build all the required * parts for the Lens embeddable. @@ -108,7 +105,7 @@ export const createLensEmbeddableFactory = ( parentApi, searchContextConfig.api, dashboardConfig.api, - visualizationContextHelper, + internalApi, services ); @@ -165,8 +162,7 @@ export const createLensEmbeddableFactory = ( api, parentApi, internalApi, - services, - visualizationContextHelper + services ); const onUnmount = () => { diff --git a/x-pack/plugins/lens/public/react_embeddable/mocks/index.tsx b/x-pack/plugins/lens/public/react_embeddable/mocks/index.tsx index 30a0920f9557d..96ba1b547a5d4 100644 --- a/x-pack/plugins/lens/public/react_embeddable/mocks/index.tsx +++ b/x-pack/plugins/lens/public/react_embeddable/mocks/index.tsx @@ -32,19 +32,9 @@ import { LensSerializedState, VisualizationContext, } from '../types'; -import { - createMockDatasource, - createMockVisualization, - defaultDoc, - makeDefaultServices, -} from '../../mocks'; -import { - Datasource, - DatasourceMap, - UserMessage, - Visualization, - VisualizationMap, -} from '../../types'; +import { createMockDatasource, createMockVisualization, makeDefaultServices } from '../../mocks'; +import { Datasource, DatasourceMap, Visualization, VisualizationMap } from '../../types'; +import { initializeInternalApi } from '../initializers/initialize_internal_api'; const LensApiMock: LensApi = { // Static props @@ -263,7 +253,7 @@ export function createExpressionRendererMock(): jest.Mock< )); } -function getValidExpressionParams( +export function getValidExpressionParams( overrides: Partial = {} ): ExpressionWrapperProps { return { @@ -284,34 +274,11 @@ function getValidExpressionParams( }; } -const LensInternalApiMock: LensInternalApi = { - dataViews: new BehaviorSubject(undefined), - attributes$: new BehaviorSubject(defaultDoc), - overrides$: new BehaviorSubject(undefined), - disableTriggers$: new BehaviorSubject(undefined), - dataLoading$: new BehaviorSubject(undefined), - hasRenderCompleted$: new BehaviorSubject(true), - expressionParams$: new BehaviorSubject(getValidExpressionParams()), - expressionAbortController$: new BehaviorSubject(undefined), - renderCount$: new BehaviorSubject(0), - messages$: new BehaviorSubject([]), - validationMessages$: new BehaviorSubject([]), - isNewlyCreated$: new BehaviorSubject(true), - updateAttributes: jest.fn(), - updateOverrides: jest.fn(), - dispatchRenderStart: jest.fn(), - dispatchRenderComplete: jest.fn(), - updateDataLoading: jest.fn(), - updateExpressionParams: jest.fn(), - updateAbortController: jest.fn(), - updateDataViews: jest.fn(), - updateMessages: jest.fn(), - resetAllMessages: jest.fn(), - dispatchError: jest.fn(), - updateValidationMessages: jest.fn(), - setAsCreated: jest.fn(), - getDisplayOptions: jest.fn(() => ({})), -}; +const LensInternalApiMock = initializeInternalApi( + getLensRuntimeStateMock(), + {}, + makeEmbeddableServices() +); export function getLensInternalApiMock(overrides: Partial = {}): LensInternalApi { return { @@ -326,6 +293,7 @@ export function getVisualizationContextHelperMock( ) { return { getVisualizationContext: jest.fn(() => ({ + activeAttributes: getLensAttributesMock(attributesOverrides), mergedSearchContext: {}, indexPatterns: {}, indexPatternRefs: [], @@ -333,7 +301,6 @@ export function getVisualizationContextHelperMock( activeDatasourceState: undefined, activeData: undefined, ...contextOverrides, - doc: getLensAttributesMock(attributesOverrides), })), updateVisualizationContext: jest.fn(), }; diff --git a/x-pack/plugins/lens/public/react_embeddable/renderer/lens_embeddable_component.test.tsx b/x-pack/plugins/lens/public/react_embeddable/renderer/lens_embeddable_component.test.tsx index f444f429250ba..fd6d271e2c9bb 100644 --- a/x-pack/plugins/lens/public/react_embeddable/renderer/lens_embeddable_component.test.tsx +++ b/x-pack/plugins/lens/public/react_embeddable/renderer/lens_embeddable_component.test.tsx @@ -6,7 +6,7 @@ */ import { render, screen } from '@testing-library/react'; -import { getLensApiMock, getLensInternalApiMock } from '../mocks'; +import { getLensApiMock, getLensInternalApiMock, getValidExpressionParams } from '../mocks'; import { LensApi, LensInternalApi } from '../types'; import { BehaviorSubject } from 'rxjs'; import { PublishingSubject } from '@kbn/presentation-publishing'; @@ -25,6 +25,9 @@ function getDefaultProps({ internalApiOverrides = undefined, apiOverrides = undefined, }: { internalApiOverrides?: Partial; apiOverrides?: Partial } = {}) { + const internalApi = getLensInternalApiMock(internalApiOverrides); + // provide a valid expression to render + internalApi.updateExpressionParams(getValidExpressionParams()); return { internalApi: getLensInternalApiMock(internalApiOverrides), api: getLensApiMock(apiOverrides), diff --git a/x-pack/plugins/lens/public/react_embeddable/types.ts b/x-pack/plugins/lens/public/react_embeddable/types.ts index 1a4bf45b11f17..98b85860f414f 100644 --- a/x-pack/plugins/lens/public/react_embeddable/types.ts +++ b/x-pack/plugins/lens/public/react_embeddable/types.ts @@ -100,8 +100,12 @@ interface LensApiProps {} export type LensSavedObjectAttributes = Omit; +/** + * This visualization context can have a different attributes than the + * one stored in the Lens API attributes + */ export interface VisualizationContext { - doc: LensDocument | undefined; + activeAttributes: LensDocument | undefined; mergedSearchContext: ExecutionContextSearch; indexPatterns: IndexPatternMap; indexPatternRefs: IndexPatternRef[]; @@ -111,6 +115,7 @@ export interface VisualizationContext { } export interface VisualizationContextHelper { + // the doc prop here is a convenience reference to the internalApi.attributes getVisualizationContext: () => VisualizationContext; updateVisualizationContext: (newContext: Partial) => void; } @@ -399,7 +404,8 @@ export type LensApi = Simplify< // there's some overlapping between this and the LensApi but they are shared references export type LensInternalApi = Simplify< Pick & - PublishesDataViews & { + PublishesDataViews & + VisualizationContextHelper & { attributes$: PublishingSubject; overrides$: PublishingSubject; disableTriggers$: PublishingSubject; diff --git a/x-pack/plugins/lens/public/react_embeddable/user_messages/api.ts b/x-pack/plugins/lens/public/react_embeddable/user_messages/api.ts index 90061cfb7c2fe..8058f79619555 100644 --- a/x-pack/plugins/lens/public/react_embeddable/user_messages/api.ts +++ b/x-pack/plugins/lens/public/react_embeddable/user_messages/api.ts @@ -28,7 +28,6 @@ import { import { LensPublicCallbacks, LensEmbeddableStartServices, - VisualizationContext, VisualizationContextHelper, LensApi, LensInternalApi, @@ -43,7 +42,7 @@ function getUpdatedState( datasourceMap: LensEmbeddableStartServices['datasourceMap'] ) { const { - doc, + activeAttributes, mergedSearchContext, indexPatterns, indexPatternRefs, @@ -51,15 +50,15 @@ function getUpdatedState( activeDatasourceState, activeData, } = getVisualizationContext(); - const activeVisualizationId = getActiveVisualizationIdFromDoc(doc); - const activeDatasourceId = getActiveDatasourceIdFromDoc(doc); + const activeVisualizationId = getActiveVisualizationIdFromDoc(activeAttributes); + const activeDatasourceId = getActiveDatasourceIdFromDoc(activeAttributes); const activeDatasource = activeDatasourceId ? datasourceMap[activeDatasourceId] : null; const activeVisualization = activeVisualizationId ? visualizationMap[activeVisualizationId] : undefined; const dataViewObject = getInitialDataViewsObject(indexPatterns, indexPatternRefs); return { - doc, + activeAttributes, mergedSearchContext, activeDatasource, activeVisualization, @@ -100,7 +99,6 @@ function getWarningMessages( export function buildUserMessagesHelpers( api: LensApi, internalApi: LensInternalApi, - getVisualizationContext: () => VisualizationContext, { coreStart, data, visualizationMap, datasourceMap }: LensEmbeddableStartServices, onBeforeBadgesRender: LensPublicCallbacks['onBeforeBadgesRender'], spaces?: SpacesApi, @@ -131,7 +129,7 @@ export function buildUserMessagesHelpers( const getUserMessages: UserMessagesGetter = (locationId, filters) => { const { - doc, + activeAttributes, activeVisualizationState, activeVisualization, activeVisualizationId, @@ -141,12 +139,12 @@ export function buildUserMessagesHelpers( dataViewObject, mergedSearchContext, activeData, - } = getUpdatedState(getVisualizationContext, visualizationMap, datasourceMap); + } = getUpdatedState(internalApi.getVisualizationContext, visualizationMap, datasourceMap); const userMessages: UserMessage[] = []; userMessages.push( ...getApplicationUserMessages({ - visualizationType: doc?.visualizationType, + visualizationType: activeAttributes?.visualizationType, visualizationState: { state: activeVisualizationState, activeId: activeVisualizationId, @@ -162,7 +160,7 @@ export function buildUserMessagesHelpers( }) ); - if (!doc || !activeDatasourceState || !activeVisualizationState) { + if (!activeAttributes || !activeDatasourceState || !activeVisualizationState) { return userMessages; } @@ -178,7 +176,7 @@ export function buildUserMessagesHelpers( datasourceMap, dataViewObject.indexPatterns ), - query: doc.state.query, + query: activeAttributes.state.query, filters: mergedSearchContext.filters ?? [], dateRange: { fromDate: mergedSearchContext.timeRange?.from ?? '', @@ -278,7 +276,7 @@ export function buildUserMessagesHelpers( updateWarnings: () => { addUserMessages( getWarningMessages( - getUpdatedState(getVisualizationContext, visualizationMap, datasourceMap), + getUpdatedState(internalApi.getVisualizationContext, visualizationMap, datasourceMap), api.adapters$.getValue(), data ) From 529a4e3b196309c5b181703a9f0bdd94c7baf758 Mon Sep 17 00:00:00 2001 From: Ido Cohen <90558359+CohenIdo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:20:53 +0200 Subject: [PATCH 6/9] Deprecate Cloud Defend billing logic --- config/serverless.security.yml | 2 +- .../cloud_security/cloud_security_metering.ts | 20 +- .../cloud_security_metering_task.test.ts | 180 +----------------- .../server/cloud_security/constants.ts | 7 - .../defend_for_containers_metering.ts | 148 -------------- .../server/cloud_security/types.ts | 4 +- .../tsconfig.json | 1 - .../cloud_security_metering.ts | 76 +------- 8 files changed, 10 insertions(+), 428 deletions(-) delete mode 100644 x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/defend_for_containers_metering.ts diff --git a/config/serverless.security.yml b/config/serverless.security.yml index 47a67c293565a..0e3a0c92f8546 100644 --- a/config/serverless.security.yml +++ b/config/serverless.security.yml @@ -106,7 +106,7 @@ xpack.fleet.internal.registry.excludePackages: [ 'dga', # Unsupported in serverless - 'cloud-defend', + 'cloud_defend', ] # fleet_server package installed to publish agent metrics xpack.fleet.packages: diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering.ts index 1a5fb8e64a265..08d5b0d088aaa 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering.ts +++ b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering.ts @@ -7,11 +7,10 @@ import type { Logger } from '@kbn/core/server'; import { ProductLine } from '../../common/product'; import { getCloudSecurityUsageRecord } from './cloud_security_metering_task'; -import { CLOUD_DEFEND, CNVM, CSPM, KSPM } from './constants'; +import { CNVM, CSPM, KSPM } from './constants'; import type { CloudSecuritySolutions } from './types'; import type { MeteringCallBackResponse, MeteringCallbackInput, Tier, UsageRecord } from '../types'; import type { ServerlessSecurityConfig } from '../config'; -import { getCloudDefendUsageRecords } from './defend_for_containers_metering'; export const cloudSecurityMetringCallback = async ({ esClient, @@ -35,24 +34,11 @@ export const cloudSecurityMetringCallback = async ({ const tier: Tier = getCloudProductTier(config, logger); try { - const cloudSecuritySolutions: CloudSecuritySolutions[] = [CSPM, KSPM, CNVM, CLOUD_DEFEND]; + const cloudSecuritySolutions: CloudSecuritySolutions[] = [CSPM, KSPM, CNVM]; const promiseResults = await Promise.allSettled( cloudSecuritySolutions.map((cloudSecuritySolution) => { - if (cloudSecuritySolution !== CLOUD_DEFEND) { - return getCloudSecurityUsageRecord({ - esClient, - projectId, - logger, - taskId, - lastSuccessfulReport, - cloudSecuritySolution, - tier, - }); - } - - // since lastSuccessfulReport is not used by getCloudSecurityUsageRecord, we want to verify if it is used by getCloudDefendUsageRecords before getCloudSecurityUsageRecord. - return getCloudDefendUsageRecords({ + return getCloudSecurityUsageRecord({ esClient, projectId, logger, diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task.test.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task.test.ts index 6d55e52469283..423b26b5f7e98 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task.test.ts +++ b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task.test.ts @@ -16,15 +16,7 @@ import { import type { ServerlessSecurityConfig } from '../config'; import type { ProductTier } from '../../common/product'; -import { - CLOUD_SECURITY_TASK_TYPE, - CSPM, - KSPM, - CNVM, - CLOUD_DEFEND, - BILLABLE_ASSETS_CONFIG, -} from './constants'; -import { getCloudDefendUsageRecords } from './defend_for_containers_metering'; +import { CLOUD_SECURITY_TASK_TYPE, CSPM, KSPM, CNVM, BILLABLE_ASSETS_CONFIG } from './constants'; const mockEsClient = elasticsearchServiceMock.createStart().client.asInternalUser; const logger: ReturnType = loggingSystemMock.createLogger(); @@ -336,173 +328,3 @@ describe('should return the relevant product tier', () => { expect(tier).toBe('none'); }); }); - -describe('cloud defend metering', () => { - it('should return usageRecords with correct values', async () => { - const cloudSecuritySolution = 'cloud_defend'; - const agentId1 = chance.guid(); - const eventIngestedStr = '2024-05-28T12:10:51Z'; - const eventIngestedTimestamp = new Date(eventIngestedStr); - - // @ts-ignore - mockEsClient.search.mockResolvedValueOnce({ - hits: { - hits: [ - { - _id: 'someRecord', - _index: 'mockIndex', - _source: { - 'cloud_defend.block_action_enabled': true, - 'agent.id': agentId1, - event: { - ingested: eventIngestedStr, - }, - }, - }, - ], - }, - }); - - const projectId = chance.guid(); - const taskId = chance.guid(); - - const tier = 'essentials' as ProductTier; - - const result = await getCloudDefendUsageRecords({ - esClient: mockEsClient, - projectId, - taskId, - lastSuccessfulReport: new Date(), - cloudSecuritySolution, - logger, - tier, - }); - - const roundedIngestedTimestamp = eventIngestedTimestamp; - roundedIngestedTimestamp.setMinutes(0); - roundedIngestedTimestamp.setSeconds(0); - roundedIngestedTimestamp.setMilliseconds(0); - - expect(result).toEqual([ - { - id: expect.stringContaining( - `${projectId}_${agentId1}_${roundedIngestedTimestamp.toISOString()}` - ), - usage_timestamp: eventIngestedStr, - creation_timestamp: expect.any(String), - usage: { - type: CLOUD_SECURITY_TASK_TYPE, - sub_type: CLOUD_DEFEND, - quantity: 1, - period_seconds: 3600, - }, - source: { - id: taskId, - instance_group_id: projectId, - metadata: { - tier: 'essentials', - }, - }, - }, - ]); - }); - - it('should return an empty array when Elasticsearch returns an empty response', async () => { - // @ts-ignore - mockEsClient.search.mockResolvedValueOnce({ - hits: { - hits: [], - }, - }); - const tier = 'essentials' as ProductTier; - // Call the function with mock parameters - const result = await getCloudDefendUsageRecords({ - esClient: mockEsClient, - projectId: chance.guid(), - taskId: chance.guid(), - lastSuccessfulReport: new Date(), - cloudSecuritySolution: 'cloud_defend', - logger, - tier, - }); - - // Assert that the result is an empty array - expect(result).toEqual([]); - }); - - it('should handle errors from Elasticsearch', async () => { - // Mock Elasticsearch client's search method to throw an error - mockEsClient.search.mockRejectedValueOnce(new Error('Elasticsearch query failed')); - - const tier = 'essentials' as ProductTier; - - // Call the function with mock parameters - await getCloudDefendUsageRecords({ - esClient: mockEsClient, - projectId: chance.guid(), - taskId: chance.guid(), - lastSuccessfulReport: new Date(), - cloudSecuritySolution: 'cloud_defend', - logger, - tier, - }); - - // Assert that the logger's error method was called with the correct error message - expect(logger.error).toHaveBeenCalledWith( - 'Failed to fetch cloud_defend metering data Error: Elasticsearch query failed' - ); - }); - - it('should return usageRecords when Elasticsearch returns multiple records', async () => { - // Mock Elasticsearch response with multiple records - const agentId1 = chance.guid(); - const agentId2 = chance.guid(); - const eventIngestedStr1 = '2024-05-28T12:10:51Z'; - const eventIngestedStr2 = '2024-05-28T13:10:51Z'; - - // @ts-ignore - mockEsClient.search.mockResolvedValueOnce({ - hits: { - hits: [ - { - _id: 'record1', - _index: 'mockIndex', - _source: { - 'cloud_defend.block_action_enabled': true, - 'agent.id': agentId1, - event: { - ingested: eventIngestedStr1, - }, - }, - }, - { - _id: 'record2', - _index: 'mockIndex', - _source: { - 'cloud_defend.block_action_enabled': true, - 'agent.id': agentId2, - event: { - ingested: eventIngestedStr2, - }, - }, - }, - ], - }, - }); - const tier = 'essentials' as ProductTier; - - // Call the function with mock parameters - const result = await getCloudDefendUsageRecords({ - esClient: mockEsClient, - projectId: chance.guid(), - taskId: chance.guid(), - lastSuccessfulReport: new Date(), - cloudSecuritySolution: 'cloud_defend', - logger, - tier, - }); - - // Assert that the result contains usage records for both records - expect(result).toHaveLength(2); - }); -}); diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/constants.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/constants.ts index fa98707e5ebeb..774f7e7fd2ae7 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/constants.ts +++ b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/constants.ts @@ -12,9 +12,7 @@ import { CDR_LATEST_NATIVE_VULNERABILITIES_INDEX_PATTERN, } from '@kbn/cloud-security-posture-common'; import { CNVM_POLICY_TEMPLATE } from '@kbn/cloud-security-posture-plugin/common/constants'; -import { INTEGRATION_PACKAGE_NAME } from '@kbn/cloud-defend-plugin/common/constants'; -export const CLOUD_DEFEND_HEARTBEAT_INDEX = 'metrics-cloud_defend.heartbeat-*'; export const CLOUD_SECURITY_TASK_TYPE = 'cloud_security'; export const AGGREGATION_PRECISION_THRESHOLD = 40000; export const ASSETS_SAMPLE_GRANULARITY = '24h'; @@ -23,7 +21,6 @@ export const THRESHOLD_MINUTES = 30; export const CSPM = CSPM_POLICY_TEMPLATE; export const KSPM = KSPM_POLICY_TEMPLATE; export const CNVM = CNVM_POLICY_TEMPLATE; -export const CLOUD_DEFEND = INTEGRATION_PACKAGE_NAME; export const METERING_CONFIGS = { [CSPM]: { @@ -38,10 +35,6 @@ export const METERING_CONFIGS = { index: CDR_LATEST_NATIVE_VULNERABILITIES_INDEX_PATTERN, assets_identifier: 'cloud.instance.id', }, - [CLOUD_DEFEND]: { - index: CLOUD_DEFEND_HEARTBEAT_INDEX, - assets_identifier: 'agent.id', - }, }; // see https://github.com/elastic/security-team/issues/8970 for billable asset definition diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/defend_for_containers_metering.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/defend_for_containers_metering.ts deleted file mode 100644 index 61240df94f9b2..0000000000000 --- a/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/defend_for_containers_metering.ts +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; -import type { - AggregationsAggregate, - SearchResponse, - SortResults, -} from '@elastic/elasticsearch/lib/api/types'; -import type { Tier, UsageRecord } from '../types'; -import type { CloudSecurityMeteringCallbackInput } from './types'; -import { CLOUD_DEFEND, CLOUD_SECURITY_TASK_TYPE, CLOUD_DEFEND_HEARTBEAT_INDEX } from './constants'; - -const BATCH_SIZE = 1000; -const SAMPLE_WEIGHT_SECONDS = 3600; // 1 Hour - -export interface CloudDefendHeartbeat { - '@timestamp': string; - 'agent.id': string; - event: { - ingested: string; - }; -} - -const buildMeteringRecord = ( - agentId: string, - timestampStr: string, - taskId: string, - tier: Tier, - projectId: string -): UsageRecord => { - const timestamp = new Date(timestampStr); - timestamp.setMinutes(0); - timestamp.setSeconds(0); - timestamp.setMilliseconds(0); - const creationTimestamp = new Date(); - const usageRecord = { - id: `${projectId}_${agentId}_${timestamp.toISOString()}`, - usage_timestamp: timestampStr, - creation_timestamp: creationTimestamp.toISOString(), - usage: { - type: CLOUD_SECURITY_TASK_TYPE, - sub_type: CLOUD_DEFEND, - period_seconds: SAMPLE_WEIGHT_SECONDS, - quantity: 1, - }, - source: { - id: taskId, - instance_group_id: projectId, - metadata: { - tier, - }, - }, - }; - - return usageRecord; -}; -export const getUsageRecords = async ( - esClient: ElasticsearchClient, - searchFrom: Date, - searchAfter?: SortResults -): Promise>> => { - return esClient.search( - { - index: CLOUD_DEFEND_HEARTBEAT_INDEX, - size: BATCH_SIZE, - sort: [{ 'event.ingested': 'asc' }, { 'agent.id': 'asc' }], - search_after: searchAfter, - query: { - bool: { - must: [ - { - range: { - 'event.ingested': { - // gt: searchFrom.toISOString(), Tech debt: https://github.com/elastic/security-team/issues/9895 - gte: `now-30m`, - }, - }, - }, - { - term: { - 'cloud_defend.block_action_enabled': true, - }, - }, - ], - }, - }, - }, - { ignore: [404] } - ); -}; - -export const getCloudDefendUsageRecords = async ({ - esClient, - projectId, - taskId, - lastSuccessfulReport, - cloudSecuritySolution, - tier, - logger, -}: CloudSecurityMeteringCallbackInput): Promise => { - try { - let allRecords: UsageRecord[] = []; - let searchAfter: SortResults | undefined; - let fetchMore = true; - - while (fetchMore) { - const usageRecords = await getUsageRecords(esClient, lastSuccessfulReport, searchAfter); - - if (!usageRecords?.hits?.hits?.length) { - break; - } - - const records = usageRecords.hits.hits.reduce((acc, { _source }) => { - if (!_source) { - return acc; - } - - const { event } = _source; - const record = buildMeteringRecord( - _source['agent.id'], - event.ingested, - taskId, - tier, - projectId - ); - - return [...acc, record]; - }, [] as UsageRecord[]); - - allRecords = [...allRecords, ...records]; - - if (usageRecords.hits.hits.length < BATCH_SIZE) { - fetchMore = false; - } else { - searchAfter = usageRecords.hits.hits[usageRecords.hits.hits.length - 1].sort; - } - } - - return allRecords; - } catch (err) { - logger.error(`Failed to fetch ${cloudSecuritySolution} metering data ${err}`); - } -}; diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/types.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/types.ts index 0ca9a7b5b943a..c8149e75b720a 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/types.ts +++ b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/types.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { CSPM, KSPM, CNVM, CLOUD_DEFEND } from './constants'; +import type { CSPM, KSPM, CNVM } from './constants'; import type { MeteringCallbackInput, Tier } from '../types'; export interface CloudDefendAssetCountAggregation { @@ -39,7 +39,7 @@ export interface MinTimestamp { value_as_string: string; } -export type CloudSecuritySolutions = typeof CSPM | typeof KSPM | typeof CNVM | typeof CLOUD_DEFEND; +export type CloudSecuritySolutions = typeof CSPM | typeof KSPM | typeof CNVM; export interface CloudSecurityMeteringCallbackInput extends Omit { diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/tsconfig.json b/x-pack/solutions/security/plugins/security_solution_serverless/tsconfig.json index 7b9a77199aeec..6b082dea68d86 100644 --- a/x-pack/solutions/security/plugins/security_solution_serverless/tsconfig.json +++ b/x-pack/solutions/security/plugins/security_solution_serverless/tsconfig.json @@ -38,7 +38,6 @@ "@kbn/fleet-plugin", "@kbn/serverless-security-settings", "@kbn/core-elasticsearch-server", - "@kbn/cloud-defend-plugin", "@kbn/core-logging-server-mocks", "@kbn/stack-connectors-plugin", "@kbn/actions-plugin", diff --git a/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts b/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts index b57dace68c4da..13ac5f96347c0 100644 --- a/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts +++ b/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts @@ -9,18 +9,13 @@ import expect from '@kbn/expect'; import { CDR_LATEST_NATIVE_VULNERABILITIES_INDEX_PATTERN } from '@kbn/cloud-security-posture-common'; import { LATEST_FINDINGS_INDEX_DEFAULT_NS } from '@kbn/cloud-security-posture-plugin/common/constants'; import * as http from 'http'; -import { - createPackagePolicy, - createCloudDefendPackagePolicy, -} from '@kbn/test-suites-xpack/api_integration/apis/cloud_security_posture/helper'; +import { createPackagePolicy } from '@kbn/test-suites-xpack/api_integration/apis/cloud_security_posture/helper'; import { EsIndexDataProvider } from '@kbn/test-suites-xpack/cloud_security_posture_api/utils'; import { RoleCredentials } from '../../../../../shared/services'; -import { getMockFindings, getMockDefendForContainersHeartbeats } from './mock_data'; +import { getMockFindings } from './mock_data'; import type { FtrProviderContext } from '../../../../ftr_provider_context'; import { UsageRecord, getInterceptedRequestPayload, setupMockServer } from './mock_usage_server'; -const CLOUD_DEFEND_HEARTBEAT_INDEX_DEFAULT_NS = 'metrics-cloud_defend.heartbeat-default'; - export default function (providerContext: FtrProviderContext) { const mockUsageApiApp = setupMockServer(); const { getService } = providerContext; @@ -32,7 +27,6 @@ export default function (providerContext: FtrProviderContext) { const svlUserManager = getService('svlUserManager'); const supertestWithoutAuth = getService('supertestWithoutAuth'); const findingsIndex = new EsIndexDataProvider(es, LATEST_FINDINGS_INDEX_DEFAULT_NS); - const cloudDefinedIndex = new EsIndexDataProvider(es, CLOUD_DEFEND_HEARTBEAT_INDEX_DEFAULT_NS); const vulnerabilitiesIndex = new EsIndexDataProvider( es, CDR_LATEST_NATIVE_VULNERABILITIES_INDEX_PATTERN @@ -74,7 +68,6 @@ export default function (providerContext: FtrProviderContext) { await findingsIndex.deleteAll(); await vulnerabilitiesIndex.deleteAll(); - await cloudDefinedIndex.deleteAll(); }); afterEach(async () => { @@ -82,7 +75,6 @@ export default function (providerContext: FtrProviderContext) { await esArchiver.unload('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); await findingsIndex.deleteAll(); await vulnerabilitiesIndex.deleteAll(); - await cloudDefinedIndex.deleteAll(); }); after(async () => { await svlUserManager.invalidateM2mApiKeyWithRoleScope(roleAuthc); @@ -202,43 +194,6 @@ export default function (providerContext: FtrProviderContext) { }); }); - it('Should intercept usage API request for Defend for Containers', async () => { - await createCloudDefendPackagePolicy( - supertestWithoutAuth, - agentPolicyId, - roleAuthc, - internalRequestHeader - ); - - const blockActionEnabledHeartbeats = getMockDefendForContainersHeartbeats({ - isBlockActionEnables: true, - numberOfHearbeats: 2, - }); - - const blockActionDisabledHeartbeats = getMockDefendForContainersHeartbeats({ - isBlockActionEnables: false, - numberOfHearbeats: 2, - }); - - await cloudDefinedIndex.addBulk([ - ...blockActionEnabledHeartbeats, - ...blockActionDisabledHeartbeats, - ]); - - let interceptedRequestBody: UsageRecord[] = []; - - await retry.try(async () => { - interceptedRequestBody = getInterceptedRequestPayload(); - expect(interceptedRequestBody.length).to.greaterThan(0); - if (interceptedRequestBody.length > 0) { - const usageSubTypes = interceptedRequestBody.map((record) => record.usage.sub_type); - expect(usageSubTypes).to.contain('cloud_defend'); - expect(interceptedRequestBody.length).to.be(blockActionEnabledHeartbeats.length); - expect(interceptedRequestBody[0].usage.type).to.be('cloud_security'); - } - }); - }); - it('Should intercept usage API request with all integrations usage records', async () => { // Create one package policy - it takes care forCSPM, KSMP and CNVM await createPackagePolicy( @@ -253,13 +208,6 @@ export default function (providerContext: FtrProviderContext) { internalRequestHeader ); - // Create Defend for Containers package policy - await createCloudDefendPackagePolicy( - supertestWithoutAuth, - agentPolicyId, - roleAuthc, - internalRequestHeader - ); const billableFindingsCSPM = getMockFindings({ postureType: 'cspm', isBillableAsset: true, @@ -289,16 +237,6 @@ export default function (providerContext: FtrProviderContext) { numberOfFindings: 11, }); - const blockActionEnabledHeartbeats = getMockDefendForContainersHeartbeats({ - isBlockActionEnables: true, - numberOfHearbeats: 2, - }); - - const blockActionDisabledHeartbeats = getMockDefendForContainersHeartbeats({ - isBlockActionEnables: false, - numberOfHearbeats: 2, - }); - await Promise.all([ findingsIndex.addBulk([ ...billableFindingsCSPM, @@ -307,10 +245,6 @@ export default function (providerContext: FtrProviderContext) { ...notBillableFindingsKSPM, ]), vulnerabilitiesIndex.addBulk([...billableFindingsCNVM]), - cloudDefinedIndex.addBulk([ - ...blockActionEnabledHeartbeats, - ...blockActionDisabledHeartbeats, - ]), ]); // Intercept and verify usage API request @@ -323,16 +257,12 @@ export default function (providerContext: FtrProviderContext) { expect(usageSubTypes).to.contain('cspm'); expect(usageSubTypes).to.contain('kspm'); expect(usageSubTypes).to.contain('cnvm'); - expect(usageSubTypes).to.contain('cloud_defend'); const totalUsageQuantity = interceptedRequestBody.reduce( (acc, record) => acc + record.usage.quantity, 0 ); expect(totalUsageQuantity).to.be( - billableFindingsCSPM.length + - billableFindingsKSPM.length + - billableFindingsCNVM.length + - blockActionEnabledHeartbeats.length + billableFindingsCSPM.length + billableFindingsKSPM.length + billableFindingsCNVM.length ); }); }); From e29a14d623d1034f6ea12bce679a8fceb95b4cdc Mon Sep 17 00:00:00 2001 From: Mason Herron <46727170+Supplementing@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:37:32 -0700 Subject: [PATCH 7/9] [Fleet] removed extraneous '/downloads' in path for curl commands (#204660) ## Summary Removed the extra `/downloads` portion of the curl command, as it is already returned in the base url. Closes #204462 Before: ![image](https://github.com/user-attachments/assets/5a156aca-ea2b-4703-97b3-f7a5e4ae6ab1) After: ![image](https://github.com/user-attachments/assets/d5c9f0d4-1452-40c1-b8df-4473584ac288) --- .../enrollment_instructions/standalone/index.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/fleet/public/components/enrollment_instructions/standalone/index.tsx b/x-pack/plugins/fleet/public/components/enrollment_instructions/standalone/index.tsx index dd8eafec86ec4..8901c3b5f0883 100644 --- a/x-pack/plugins/fleet/public/components/enrollment_instructions/standalone/index.tsx +++ b/x-pack/plugins/fleet/public/components/enrollment_instructions/standalone/index.tsx @@ -22,24 +22,24 @@ export const StandaloneInstructions = ({ const { windows: windowsDownloadSourceProxyArgs, curl: curlDownloadSourceProxyArgs } = getDownloadSourceProxyArgs(downloadSourceProxy); - const linuxDebCommand = `curl -L -O ${downloadBaseUrl}/downloads/beats/elastic-agent/elastic-agent-${agentVersion}-amd64.deb ${curlDownloadSourceProxyArgs} + const linuxDebCommand = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-amd64.deb ${curlDownloadSourceProxyArgs} sudo dpkg -i elastic-agent-${agentVersion}-amd64.deb \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`; - const linuxRpmCommand = `curl -L -O ${downloadBaseUrl}/downloads/beats/elastic-agent/elastic-agent-${agentVersion}-x86_64.rpm ${curlDownloadSourceProxyArgs} + const linuxRpmCommand = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-x86_64.rpm ${curlDownloadSourceProxyArgs} sudo rpm -vi elastic-agent-${agentVersion}-x86_64.rpm \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`; - const linuxCommand = `curl -L -O ${downloadBaseUrl}/downloads/beats/elastic-agent/elastic-agent-${agentVersion}-linux-x86_64.tar.gz ${curlDownloadSourceProxyArgs} + const linuxCommand = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-linux-x86_64.tar.gz ${curlDownloadSourceProxyArgs} tar xzvf elastic-agent-${agentVersion}-linux-x86_64.tar.gz cd elastic-agent-${agentVersion}-linux-x86_64 sudo ./elastic-agent install`; - const macCommand = `curl -L -O ${downloadBaseUrl}/downloads/beats/elastic-agent/elastic-agent-${agentVersion}-darwin-aarch64.tar.gz ${curlDownloadSourceProxyArgs} + const macCommand = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-darwin-aarch64.tar.gz ${curlDownloadSourceProxyArgs} tar xzvf elastic-agent-${agentVersion}-darwin-aarch64.tar.gz cd elastic-agent-${agentVersion}-darwin-aarch64 sudo ./elastic-agent install`; const windowsCommand = `$ProgressPreference = 'SilentlyContinue' -Invoke-WebRequest -Uri ${downloadBaseUrl}/downloads/beats/elastic-agent/elastic-agent-${agentVersion}-windows-x86_64.zip -OutFile elastic-agent-${agentVersion}-windows-x86_64.zip ${windowsDownloadSourceProxyArgs} +Invoke-WebRequest -Uri ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-windows-x86_64.zip -OutFile elastic-agent-${agentVersion}-windows-x86_64.zip ${windowsDownloadSourceProxyArgs} Expand-Archive .\elastic-agent-${agentVersion}-windows-x86_64.zip -DestinationPath . cd elastic-agent-${agentVersion}-windows-x86_64 .\\elastic-agent.exe install`; From 4bb6521f265554aa659700fdf2d974f1ce6c8ff0 Mon Sep 17 00:00:00 2001 From: Mykola Harmash Date: Wed, 18 Dec 2024 16:58:05 +0100 Subject: [PATCH 8/9] [Observability Onboarding] Migrate e2e Playwright tests from oblt-playwright repo (#203616) Closes https://github.com/elastic/kibana/issues/199016 This change migrates and and expands tests from [oblt-playwright](https://github.com/elastic/oblt-playwright) repo. These tests are part of the [Nightly workflow](https://github.com/elastic/ensemble/actions/workflows/nightly.yml) and being run by an Ensemble story on the CI. The Nightly workflow itself is still in development and does not support some of the use cases, that's why kubernetes tests are skipped for now in this PR. See the `./README.md` on how to run the tests locally. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../lib/config/run_check_ftr_configs_cli.ts | 4 + .../e2e/playwright/.gitignore | 2 + .../e2e/playwright/README.md | 25 +++++ .../e2e/playwright/lib/assert_env.ts | 12 +++ .../e2e/playwright/lib/helpers.ts | 35 ++++++ .../e2e/playwright/lib/logger.ts | 13 +++ .../e2e/playwright/playwright.config.ts | 102 ++++++++++++++++++ .../e2e/playwright/stateful/auth.ts | 50 +++++++++ .../playwright/stateful/auto_detect.spec.ts | 65 +++++++++++ .../playwright/stateful/fixtures/base_page.ts | 47 ++++++++ .../playwright/stateful/kubernetes_ea.spec.ts | 66 ++++++++++++ .../pom/components/header_bar.component.ts | 22 ++++ .../components/space_selector.component.ts | 23 ++++ .../pom/pages/auto_detect_flow.page.ts | 51 +++++++++ .../stateful/pom/pages/host_details.page.ts | 38 +++++++ .../pom/pages/kubernetes_ea_flow.page.ts | 51 +++++++++ .../kubernetes_overview_dashboard.page.ts | 48 +++++++++ .../pom/pages/onboarding_home.page.ts | 44 ++++++++ .../e2e/tsconfig.json | 3 +- .../auto_detect/auto_detect_panel.tsx | 6 +- .../kubernetes/command_snippet.tsx | 7 +- .../kubernetes/data_ingest_status.tsx | 1 + 22 files changed, 712 insertions(+), 3 deletions(-) create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/.gitignore create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/README.md create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/assert_env.ts create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/helpers.ts create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/logger.ts create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/playwright.config.ts create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/auth.ts create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/auto_detect.spec.ts create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/fixtures/base_page.ts create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/kubernetes_ea.spec.ts create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/components/header_bar.component.ts create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/components/space_selector.component.ts create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/auto_detect_flow.page.ts create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/host_details.page.ts create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/kubernetes_ea_flow.page.ts create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/kubernetes_overview_dashboard.page.ts create mode 100644 x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/onboarding_home.page.ts diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts b/packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts index 5808c88901b11..265bdbe9e0082 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts @@ -25,6 +25,10 @@ const THIS_REL = Path.relative(REPO_ROOT, THIS_PATH); const IGNORED_PATHS = [ THIS_PATH, Path.resolve(REPO_ROOT, 'packages/kbn-test/src/jest/run_check_jest_configs_cli.ts'), + Path.resolve( + REPO_ROOT, + 'x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/playwright.config.ts' + ), ]; export async function runCheckFtrConfigsCli() { diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/.gitignore b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/.gitignore new file mode 100644 index 0000000000000..b88cb2a2003ab --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/.gitignore @@ -0,0 +1,2 @@ +.playwright +.env* diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/README.md b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/README.md new file mode 100644 index 0000000000000..f2952214127f4 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/README.md @@ -0,0 +1,25 @@ +# Observability Onboarding Playwright Tests + +These tests are part of the [Nightly CI workflow](https://github.com/elastic/ensemble/actions/workflows/nightly.yml) and do not run on PRs. + +Playwright tests are only responsible for UI checks and do not automate onboarding flows fully. On the CI, the missing parts (like executing code snippets on the host) are automated by Ensemble stories, but when running locally you need to do those steps manually. + +## Running The Tests Locally + +1. Run ES and Kibana +2. Create a `.env` file in the `./x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/` directory with the following content (adjust the values like Kibana URL according yo your local setup): +```bash +KIBANA_BASE_URL = "http://localhost:5601/ftw" +ELASTICSEARCH_HOST = "http://localhost:9200" +KIBANA_USERNAME = "elastic" +KIBANA_PASSWORD = "changeme" +CLUSTER_ENVIRONMENT = local +ARTIFACTS_FOLDER = ./.playwright +``` +3. Run the `playwright test` +```bash +# Assuming the working directory is the root of the Kibana repo +npx playwright test -c ./x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/playwright.config.ts --project stateful --reporter list --headed +``` +4. Once the test reaches one of the required manual steps, like executing auto-detect command snippet, do the step manually. +5. The test will proceed once the manual step is done. diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/assert_env.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/assert_env.ts new file mode 100644 index 0000000000000..6c54cabdc1601 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/assert_env.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 function assertEnv(variable: unknown, message: string): asserts variable is string { + if (typeof variable !== 'string') { + throw new Error(message); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/helpers.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/helpers.ts new file mode 100644 index 0000000000000..e7c6afaefbd23 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/helpers.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Locator } from '@playwright/test'; +import { HeaderBar } from '../stateful/pom/components/header_bar.component'; +import { SpaceSelector } from '../stateful/pom/components/space_selector.component'; + +type WaitForRes = [locatorIndex: number, locator: Locator]; + +export async function waitForOneOf(locators: Locator[]): Promise { + const res = await Promise.race([ + ...locators.map(async (locator, index): Promise => { + let timedOut = false; + await locator.waitFor({ state: 'visible' }).catch(() => (timedOut = true)); + return [timedOut ? -1 : index, locator]; + }), + ]); + if (res[0] === -1) { + throw new Error('No locator is visible before timeout.'); + } + return res; +} + +export async function spaceSelectorStateful(headerBar: HeaderBar, spaceSelector: SpaceSelector) { + const [index] = await waitForOneOf([headerBar.helpMenuButton(), spaceSelector.spaceSelector()]); + const selector = index === 1; + if (selector) { + await spaceSelector.selectDefault(); + await headerBar.assertHelpMenuButton(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/logger.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/logger.ts new file mode 100644 index 0000000000000..92ec2ba6918f0 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/logger.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ToolingLog } from '@kbn/tooling-log'; + +export const log: ToolingLog = new ToolingLog({ + level: 'info', + writeTo: process.stdout, +}); diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/playwright.config.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/playwright.config.ts new file mode 100644 index 0000000000000..39217999f5a2e --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/playwright.config.ts @@ -0,0 +1,102 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import dotenv from 'dotenv'; +import { defineConfig, devices } from '@playwright/test'; +import path from 'path'; +import { log } from './lib/logger'; +import { assertEnv } from './lib/assert_env'; + +const dotEnvPath = process.env.DOTENV_PATH ?? path.join(__dirname, '.env'); + +dotenv.config({ path: dotEnvPath }); + +assertEnv(process.env.ARTIFACTS_FOLDER, 'ARTIFACTS_FOLDER is not defined.'); + +export const STORAGE_STATE = path.join(__dirname, process.env.ARTIFACTS_FOLDER, '.auth/user.json'); + +// eslint-disable-next-line import/no-default-export +export default defineConfig({ + testDir: './', + outputDir: './.playwright', + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + // workers: 4, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: [ + ['json'], + ['json', { outputFile: path.join(process.env.ARTIFACTS_FOLDER, 'results.json') }], + ], + /* Timeouts */ + timeout: 400000, + expect: { timeout: 400000 }, + + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Base URL to use in actions like `await page.goto('/')`. */ + baseURL: process.env.KIBANA_BASE_URL, + + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: 'on-first-retry', + testIdAttribute: 'data-test-subj', + permissions: ['clipboard-read'], + screenshot: 'only-on-failure', + }, + + projects: [ + { + name: 'auth', + testMatch: '*stateful/auth.ts', + use: { + viewport: { width: 1920, height: 1080 }, + launchOptions: { + logger: { + isEnabled: () => true, + log: (name, severity, message) => log.info(`[${severity}] ${name} ${message}`), + }, + }, + }, + }, + { + name: 'stateful', + testMatch: '*stateful/*.spec.ts', + use: { + ...devices['Desktop Chrome'], + viewport: { width: 1920, height: 1200 }, + storageState: STORAGE_STATE, + launchOptions: { + logger: { + isEnabled: () => true, + log: (name, severity, message) => log.info(`[${severity}] ${name} ${message}`), + }, + }, + }, + dependencies: ['auth'], + }, + { + name: 'teardown', + testMatch: 'teardown.setup.ts', + use: { + viewport: { width: 1920, height: 1080 }, + storageState: STORAGE_STATE, + testIdAttribute: 'data-test-subj', + launchOptions: { + logger: { + isEnabled: () => true, + log: (name, severity, message) => log.info(`[${severity}] ${name} ${message}`), + }, + }, + }, + }, + ], +}); diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/auth.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/auth.ts new file mode 100644 index 0000000000000..726085fbabc33 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/auth.ts @@ -0,0 +1,50 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { test as ess_auth, expect } from '@playwright/test'; +import { STORAGE_STATE } from '../playwright.config'; +import { waitForOneOf } from '../lib/helpers'; +import { log } from '../lib/logger'; +import { assertEnv } from '../lib/assert_env'; + +const isLocalCluster = process.env.CLUSTER_ENVIRONMENT === 'local'; + +ess_auth('Authentication', async ({ page }) => { + assertEnv(process.env.KIBANA_BASE_URL, 'KIBANA_BASE_URL is not defined.'); + assertEnv(process.env.KIBANA_USERNAME, 'KIBANA_USERNAME is not defined.'); + assertEnv(process.env.KIBANA_PASSWORD, 'KIBANA_PASSWORD is not defined.'); + + await page.goto(process.env.KIBANA_BASE_URL); + log.info(`...waiting for login page elements to appear.`); + if (!isLocalCluster) { + await page.getByRole('button', { name: 'Log in with Elasticsearch' }).click(); + } + await page.getByLabel('Username').fill(process.env.KIBANA_USERNAME); + await page.getByLabel('Password', { exact: true }).click(); + await page.getByLabel('Password', { exact: true }).fill(process.env.KIBANA_PASSWORD); + await page.getByRole('button', { name: 'Log in' }).click(); + + const [index] = await waitForOneOf([ + page.getByTestId('helpMenuButton'), + page.getByText('Select your space'), + page.getByTestId('loginErrorMessage'), + ]); + + const spaceSelector = index === 1; + const isAuthenticated = index === 0; + + if (isAuthenticated) { + await page.context().storageState({ path: STORAGE_STATE }); + } else if (spaceSelector) { + await page.getByRole('link', { name: 'Default' }).click(); + await expect(page.getByTestId('helpMenuButton')).toBeVisible(); + await page.context().storageState({ path: STORAGE_STATE }); + } else { + log.error('Username or password is incorrect.'); + throw new Error('Authentication is failed.'); + } +}); diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/auto_detect.spec.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/auto_detect.spec.ts new file mode 100644 index 0000000000000..cff927a2061c1 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/auto_detect.spec.ts @@ -0,0 +1,65 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import fs from 'node:fs'; +import path from 'node:path'; +import { test } from './fixtures/base_page'; +import { HostDetailsPage } from './pom/pages/host_details.page'; +import { assertEnv } from '../lib/assert_env'; + +test.beforeEach(async ({ page }) => { + await page.goto(`${process.env.KIBANA_BASE_URL}/app/observabilityOnboarding`); +}); + +test('Auto-detect logs and metrics', async ({ page, onboardingHomePage, autoDetectFlowPage }) => { + assertEnv(process.env.ARTIFACTS_FOLDER, 'ARTIFACTS_FOLDER is not defined.'); + + const fileName = 'code_snippet_logs_auto_detect.sh'; + const outputPath = path.join(__dirname, '..', process.env.ARTIFACTS_FOLDER, fileName); + + await onboardingHomePage.selectHostUseCase(); + await onboardingHomePage.selectAutoDetectWithElasticAgent(); + + await autoDetectFlowPage.assertVisibilityCodeBlock(); + await autoDetectFlowPage.copyToClipboard(); + + const clipboardData = (await page.evaluate('navigator.clipboard.readText()')) as string; + + /** + * Ensemble story watches for the code snippet file + * to be created and then executes it + */ + fs.writeFileSync(outputPath, clipboardData); + + await autoDetectFlowPage.assertReceivedDataIndicator(); + await autoDetectFlowPage.clickAutoDetectSystemIntegrationCTA(); + + /** + * Host Details pages open in a new tab, so it + * needs to be captured using the `popup` event. + */ + const hostDetailsPage = new HostDetailsPage(await page.waitForEvent('popup')); + + /** + * There is a glitch on the Hosts page where it can show "No data" + * screen even though data is available and it can show it with a delay + * after the Hosts page layout was loaded. This workaround waits for + * the No Data screen to be visible, and if so - reloads the page. + * If the No Data screen does not appear, the test can proceed normally. + * Seems like some caching issue with the Hosts page. + */ + try { + await hostDetailsPage.noData().waitFor({ state: 'visible', timeout: 10000 }); + await hostDetailsPage.page.waitForTimeout(2000); + await hostDetailsPage.page.reload(); + } catch { + /* Ignore if "No Data" screen never showed up */ + } + + await hostDetailsPage.clickHostDetailsLogsTab(); + await hostDetailsPage.assertHostDetailsLogsStream(); +}); diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/fixtures/base_page.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/fixtures/base_page.ts new file mode 100644 index 0000000000000..e10be1d60cc1c --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/fixtures/base_page.ts @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { test as base } from '@playwright/test'; +import { HeaderBar } from '../pom/components/header_bar.component'; +import { OnboardingHomePage } from '../pom/pages/onboarding_home.page'; +import { SpaceSelector } from '../pom/components/space_selector.component'; +import { KubernetesOverviewDashboardPage } from '../pom/pages/kubernetes_overview_dashboard.page'; +import { AutoDetectFlowPage } from '../pom/pages/auto_detect_flow.page'; +import { KubernetesEAFlowPage } from '../pom/pages/kubernetes_ea_flow.page'; + +export const test = base.extend<{ + headerBar: HeaderBar; + spaceSelector: SpaceSelector; + onboardingHomePage: OnboardingHomePage; + autoDetectFlowPage: AutoDetectFlowPage; + kubernetesEAFlowPage: KubernetesEAFlowPage; + kubernetesOverviewDashboardPage: KubernetesOverviewDashboardPage; +}>({ + headerBar: async ({ page }, use) => { + await use(new HeaderBar(page)); + }, + + spaceSelector: async ({ page }, use) => { + await use(new SpaceSelector(page)); + }, + + onboardingHomePage: async ({ page }, use) => { + await use(new OnboardingHomePage(page)); + }, + + autoDetectFlowPage: async ({ page }, use) => { + await use(new AutoDetectFlowPage(page)); + }, + + kubernetesEAFlowPage: async ({ page }, use) => { + await use(new KubernetesEAFlowPage(page)); + }, + + kubernetesOverviewDashboardPage: async ({ page }, use) => { + await use(new KubernetesOverviewDashboardPage(page)); + }, +}); diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/kubernetes_ea.spec.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/kubernetes_ea.spec.ts new file mode 100644 index 0000000000000..8478630b232f0 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/kubernetes_ea.spec.ts @@ -0,0 +1,66 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import fs from 'node:fs'; +import path from 'node:path'; +import { test } from './fixtures/base_page'; +import { assertEnv } from '../lib/assert_env'; + +test.beforeEach(async ({ page }) => { + await page.goto(`${process.env.KIBANA_BASE_URL}/app/observabilityOnboarding`); +}); + +test('Kubernetes EA', async ({ + page, + onboardingHomePage, + kubernetesEAFlowPage, + kubernetesOverviewDashboardPage, +}) => { + assertEnv(process.env.ARTIFACTS_FOLDER, 'ARTIFACTS_FOLDER is not defined.'); + + const fileName = 'code_snippet_kubernetes.sh'; + const outputPath = path.join(__dirname, '..', process.env.ARTIFACTS_FOLDER, fileName); + + await onboardingHomePage.selectKubernetesUseCase(); + await onboardingHomePage.selectKubernetesQuickstart(); + + await kubernetesEAFlowPage.assertVisibilityCodeBlock(); + await kubernetesEAFlowPage.copyToClipboard(); + + const clipboardData = (await page.evaluate('navigator.clipboard.readText()')) as string; + /** + * The page waits for the browser window to loose + * focus as a signal to start checking for incoming data + */ + await page.evaluate('window.dispatchEvent(new Event("blur"))'); + + /** + * Ensemble story watches for the code snippet file + * to be created and then executes it + */ + fs.writeFileSync(outputPath, clipboardData); + + await kubernetesEAFlowPage.assertReceivedDataIndicatorKubernetes(); + await kubernetesEAFlowPage.clickKubernetesAgentCTA(); + + await kubernetesOverviewDashboardPage.openNodesInspector(); + /** + * There might be a case that dashboard still does not show + * the data even though it was ingested already. This usually + * happens during in the test when navigation from the onboarding + * flow to the dashboard happens almost immediately. + * Waiting for a few seconds and reloading the page handles + * this case and makes the test a bit more robust. + */ + try { + await kubernetesOverviewDashboardPage.assertNodesNoResultsNotVisible(); + } catch { + await kubernetesOverviewDashboardPage.page.waitForTimeout(2000); + await kubernetesOverviewDashboardPage.page.reload(); + } + await kubernetesOverviewDashboardPage.assetNodesInspectorStatusTableCells(); +}); diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/components/header_bar.component.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/components/header_bar.component.ts new file mode 100644 index 0000000000000..9165622bf6ce0 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/components/header_bar.component.ts @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { expect, Page } from '@playwright/test'; + +export class HeaderBar { + page: Page; + + constructor(page: Page) { + this.page = page; + } + + public readonly helpMenuButton = () => this.page.getByTestId('helpMenuButton'); + + public async assertHelpMenuButton() { + await expect(this.helpMenuButton(), 'Help menu button').toBeVisible(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/components/space_selector.component.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/components/space_selector.component.ts new file mode 100644 index 0000000000000..8527141d455af --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/components/space_selector.component.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Page } from '@playwright/test'; + +export class SpaceSelector { + page: Page; + + constructor(page: Page) { + this.page = page; + } + + public readonly spaceSelector = () => this.page.getByText('Select your space'); + private readonly spaceSelectorDefault = () => this.page.getByRole('link', { name: 'Default' }); + + public async selectDefault() { + await this.spaceSelectorDefault().click(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/auto_detect_flow.page.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/auto_detect_flow.page.ts new file mode 100644 index 0000000000000..b1090b3cf091d --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/auto_detect_flow.page.ts @@ -0,0 +1,51 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { expect, Page } from '@playwright/test'; + +export class AutoDetectFlowPage { + page: Page; + + constructor(page: Page) { + this.page = page; + } + + private readonly copyToClipboardButton = () => + this.page.getByTestId('observabilityOnboardingCopyToClipboardButton'); + + private readonly receivedDataIndicator = () => + this.page + .getByTestId('observabilityOnboardingAutoDetectPanelDataReceivedProgressIndicator') + .getByText('Your data is ready to explore!'); + + private readonly autoDetectSystemIntegrationActionLink = () => + this.page.getByTestId( + 'observabilityOnboardingDataIngestStatusActionLink-inventory-host-details' + ); + + private readonly codeBlock = () => + this.page.getByTestId('observabilityOnboardingAutoDetectPanelCodeSnippet'); + + public async copyToClipboard() { + await this.copyToClipboardButton().click(); + } + + public async assertVisibilityCodeBlock() { + await expect(this.codeBlock(), 'Code block should be visible').toBeVisible(); + } + + public async assertReceivedDataIndicator() { + await expect( + this.receivedDataIndicator(), + 'Received data indicator should be visible' + ).toBeVisible(); + } + + public async clickAutoDetectSystemIntegrationCTA() { + await this.autoDetectSystemIntegrationActionLink().click(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/host_details.page.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/host_details.page.ts new file mode 100644 index 0000000000000..d22b33d851639 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/host_details.page.ts @@ -0,0 +1,38 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { expect, Page } from '@playwright/test'; + +export class HostDetailsPage { + page: Page; + + public readonly hostDetailsLogsTab = () => this.page.getByTestId('infraAssetDetailsLogsTab'); + + private readonly hostDetailsLogsStream = () => this.page.getByTestId('logStream'); + + public readonly noData = () => this.page.getByTestId('kbnNoDataPage'); + + constructor(page: Page) { + this.page = page; + } + + public async clickHostDetailsLogsTab() { + await this.hostDetailsLogsTab().click(); + } + + public async assertHostDetailsLogsStream() { + await expect( + this.hostDetailsLogsStream(), + 'Host details log stream should be visible' + /** + * Using toBeAttached() instead of toBeVisible() because the element + * we're selecting here has a bit weird layout with 0 height and + * overflowing child elements. 0 height makes toBeVisible() fail. + */ + ).toBeAttached(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/kubernetes_ea_flow.page.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/kubernetes_ea_flow.page.ts new file mode 100644 index 0000000000000..e956de4855579 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/kubernetes_ea_flow.page.ts @@ -0,0 +1,51 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { expect, Page } from '@playwright/test'; + +export class KubernetesEAFlowPage { + page: Page; + + constructor(page: Page) { + this.page = page; + } + + private readonly receivedDataIndicatorKubernetes = () => + this.page + .getByTestId('observabilityOnboardingKubernetesPanelDataProgressIndicator') + .getByText('We are monitoring your cluster'); + + private readonly kubernetesAgentExploreDataActionLink = () => + this.page.getByTestId( + 'observabilityOnboardingDataIngestStatusActionLink-kubernetes-f4dc26db-1b53-4ea2-a78b-1bfab8ea267c' + ); + + private readonly codeBlock = () => + this.page.getByTestId('observabilityOnboardingKubernetesPanelCodeSnippet'); + + private readonly copyToClipboardButton = () => + this.page.getByTestId('observabilityOnboardingCopyToClipboardButton'); + + public async assertVisibilityCodeBlock() { + await expect(this.codeBlock(), 'Code block should be visible').toBeVisible(); + } + + public async copyToClipboard() { + await this.copyToClipboardButton().click(); + } + + public async assertReceivedDataIndicatorKubernetes() { + await expect( + this.receivedDataIndicatorKubernetes(), + 'Received data indicator should be visible' + ).toBeVisible(); + } + + public async clickKubernetesAgentCTA() { + await this.kubernetesAgentExploreDataActionLink().click(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/kubernetes_overview_dashboard.page.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/kubernetes_overview_dashboard.page.ts new file mode 100644 index 0000000000000..9562f0262994f --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/kubernetes_overview_dashboard.page.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 { expect, Page } from '@playwright/test'; + +export class KubernetesOverviewDashboardPage { + page: Page; + + constructor(page: Page) { + this.page = page; + } + + private readonly nodesPanelHeader = () => this.page.getByTestId('embeddablePanelHeading-Nodes'); + + private readonly nodesInspectorButton = () => + this.page + .getByTestId('embeddablePanelHoverActions-Nodes') + .getByTestId('embeddablePanelAction-openInspector'); + + private readonly nodesInspectorTableNoResults = () => + this.page.getByTestId('inspectorTable').getByText('No items found'); + + private readonly nodesInspectorTableStatusTableCells = () => + this.page.getByTestId('inspectorTable').getByText('Status'); + + public async assertNodesNoResultsNotVisible() { + await expect( + this.nodesInspectorTableNoResults(), + 'Nodes "No results" message should not be visible' + ).toBeHidden(); + } + + public async openNodesInspector() { + await this.nodesPanelHeader().hover(); + await this.nodesInspectorButton().click(); + } + + public async assetNodesInspectorStatusTableCells() { + await expect( + this.nodesInspectorTableStatusTableCells(), + 'Status table cell should exist' + ).toBeVisible(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/onboarding_home.page.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/onboarding_home.page.ts new file mode 100644 index 0000000000000..6997001496521 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/onboarding_home.page.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 { Page } from '@playwright/test'; + +export class OnboardingHomePage { + page: Page; + + constructor(page: Page) { + this.page = page; + } + + private readonly useCaseKubernetes = () => + this.page.getByTestId('observabilityOnboardingUseCaseCard-kubernetes').getByRole('radio'); + + private readonly kubernetesQuickStartCard = () => + this.page.getByTestId('integration-card:kubernetes-quick-start'); + + private readonly useCaseHost = () => + this.page.getByTestId('observabilityOnboardingUseCaseCard-host').getByRole('radio'); + + private readonly autoDetectElasticAgent = () => + this.page.getByTestId('integration-card:auto-detect-logs'); + + public async selectHostUseCase() { + await this.useCaseHost().click(); + } + + public async selectKubernetesUseCase() { + await this.useCaseKubernetes().click(); + } + + public async selectAutoDetectWithElasticAgent() { + await this.autoDetectElasticAgent().click(); + } + + public async selectKubernetesQuickstart() { + await this.kubernetesQuickStartCard().click(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/tsconfig.json b/x-pack/plugins/observability_solution/observability_onboarding/e2e/tsconfig.json index 94d4f2278cb63..a18951aeb8cf7 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/e2e/tsconfig.json +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/tsconfig.json @@ -14,6 +14,7 @@ "@kbn/cypress-config", "@kbn/observability-onboarding-plugin", "@kbn/ftr-common-functional-services", - "@kbn/ftr-common-functional-ui-services" + "@kbn/ftr-common-functional-ui-services", + "@kbn/tooling-log" ] } diff --git a/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/auto_detect/auto_detect_panel.tsx b/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/auto_detect/auto_detect_panel.tsx index d12f0cae583f4..2891d4c47834d 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/auto_detect/auto_detect_panel.tsx +++ b/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/auto_detect/auto_detect_panel.tsx @@ -95,7 +95,11 @@ export const AutoDetectPanel: FunctionComponent = () => { {/* Bash syntax highlighting only highlights a few random numbers (badly) so it looks less messy to go with plain text */} - + {command} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/command_snippet.tsx b/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/command_snippet.tsx index ac00190fb268d..ce22e31829730 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/command_snippet.tsx +++ b/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/command_snippet.tsx @@ -63,7 +63,12 @@ export function CommandSnippet({ - + {command} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/data_ingest_status.tsx b/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/data_ingest_status.tsx index 659c1e5bd7b50..50725e262eb5a 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/data_ingest_status.tsx +++ b/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/data_ingest_status.tsx @@ -80,6 +80,7 @@ export function DataIngestStatus({ onboardingId }: Props) { css={css` max-width: 40%; `} + data-test-subj="observabilityOnboardingKubernetesPanelDataProgressIndicator" /> {isTroubleshootingVisible && ( From 96af6fa88057a8ec42cb643735c77412d9033108 Mon Sep 17 00:00:00 2001 From: Gerard Soldevila Date: Wed, 18 Dec 2024 17:05:37 +0100 Subject: [PATCH 9/9] Sustainable Kibana Architecture: Move modules owned by `@elastic/security-detection-rule-management` (#202846) ## Summary This PR aims at relocating some of the Kibana modules (plugins and packages) into a new folder structure, according to the _Sustainable Kibana Architecture_ initiative. > [!IMPORTANT] > * We kindly ask you to: > * Manually fix the errors in the error section below (if there are any). > * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the source code (Babel and Eslint config files), and update them appropriately. > * Manually review `.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that any CI pipeline customizations continue to be correctly applied after the changed path names > * Review all of the updated files, specially the `.ts` and `.js` files listed in the sections below, as some of them contain relative paths that have been updated. > * Think of potential impact of the move, including tooling and configuration files that can be pointing to the relocated modules. E.g.: > * customised eslint rules > * docs pointing to source code > [!NOTE] > * This PR has been auto-generated. > * Any manual contributions will be lost if the 'relocate' script is re-run. > * Try to obtain the missing reviews / approvals before applying manual fixes, and/or keep your changes in a .patch / git stash. > * Please use [#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E) Slack channel for feedback. Are you trying to rebase this PR to solve merge conflicts? Please follow the steps describe [here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E). #### 2 packages(s) are going to be relocated: | Id | Target folder | | -- | ------------- | | `@kbn/openapi-common` | `src/platform/packages/shared/kbn-openapi-common` | | `@kbn/zod-helpers` | `src/platform/packages/shared/kbn-zod-helpers` |
Updated references ``` ./.buildkite/scripts/steps/code_generation/security_solution_codegen.sh ./package.json ./packages/kbn-repo-packages/package-map.json ./packages/kbn-ts-projects/config-paths.json ./src/platform/packages/shared/kbn-openapi-common/jest.config.js ./src/platform/packages/shared/kbn-zod-helpers/jest.config.js ./tsconfig.base.json ./tsconfig.base.type_check.json ./tsconfig.refs.json ./x-pack/platform/plugins/shared/fleet/tsconfig.type_check.json ./x-pack/plugins/integration_assistant/tsconfig.type_check.json ./x-pack/plugins/osquery/tsconfig.type_check.json ./x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list/create_list.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_common.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list/read_list.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list/update_list.schema.yaml ./x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.schema.yaml ./x-pack/solutions/security/plugins/lists/tsconfig.type_check.json ./x-pack/test/api_integration/apis/entity_manager/fixture_plugin/tsconfig.type_check.json ./x-pack/test/tsconfig.type_check.json ./yarn.lock .github/CODEOWNERS ```
Updated relative paths ``` src/platform/packages/shared/kbn-openapi-common/jest.config.js:12 src/platform/packages/shared/kbn-openapi-common/scripts/openapi_generate.js:10 src/platform/packages/shared/kbn-openapi-common/tsconfig.json:7 src/platform/packages/shared/kbn-openapi-common/tsconfig.type_check.json:14 src/platform/packages/shared/kbn-zod-helpers/jest.config.js:12 src/platform/packages/shared/kbn-zod-helpers/tsconfig.json:7 src/platform/packages/shared/kbn-zod-helpers/tsconfig.type_check.json:14 src/platform/packages/shared/kbn-zod-helpers/tsconfig.type_check.json:23 ```
--------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../security_solution_codegen.sh | 2 +- .github/CODEOWNERS | 4 ++-- package.json | 4 ++-- .../shared}/kbn-openapi-common/README.md | 0 .../shared}/kbn-openapi-common/jest.config.js | 4 ++-- .../shared}/kbn-openapi-common/kibana.jsonc | 0 .../shared}/kbn-openapi-common/package.json | 0 .../schemas/error_responses.gen.ts | 0 .../schemas/error_responses.schema.yaml | 0 .../schemas/primitives.gen.ts | 0 .../schemas/primitives.schema.yaml | 0 .../schemas/primitives.test.ts | 0 .../scripts/openapi_generate.js | 2 +- .../kbn-openapi-common/shared/index.ts | 0 .../shared/path_params_replacer.ts | 0 .../shared}/kbn-openapi-common/tsconfig.json | 2 +- .../shared}/kbn-zod-helpers/README.md | 0 .../packages/shared}/kbn-zod-helpers/index.ts | 0 .../shared}/kbn-zod-helpers/jest.config.js | 4 ++-- .../shared}/kbn-zod-helpers/kibana.jsonc | 0 .../shared}/kbn-zod-helpers/package.json | 0 .../src/array_from_string.test.ts | 0 .../kbn-zod-helpers/src/array_from_string.ts | 0 .../src/boolean_from_string.test.ts | 0 .../src/boolean_from_string.ts | 0 .../src/build_route_validation_with_zod.ts | 0 .../kbn-zod-helpers/src/expect_parse_error.ts | 0 .../src/expect_parse_success.ts | 0 .../kbn-zod-helpers/src/is_valid_date_math.ts | 0 .../kbn-zod-helpers/src/non_empty_string.ts | 0 .../kbn-zod-helpers/src/required_optional.ts | 0 .../kbn-zod-helpers/src/safe_parse_result.ts | 0 .../src/stringify_zod_error.ts | 0 .../shared}/kbn-zod-helpers/tsconfig.json | 2 +- tsconfig.base.json | 8 +++---- .../create_endpoint_list.schema.yaml | 10 ++++----- .../create_endpoint_list_item.schema.yaml | 12 +++++----- .../delete_endpoint_list_item.schema.yaml | 12 +++++----- .../find_endpoint_list_item.schema.yaml | 16 +++++++------- .../read_endpoint_list_item.schema.yaml | 12 +++++----- .../update_endpoint_list_item.schema.yaml | 12 +++++----- .../create_exception_list.schema.yaml | 12 +++++----- .../create_exception_list_item.schema.yaml | 14 ++++++------ .../create_rule_exceptions.schema.yaml | 14 ++++++------ .../create_shared_exceptions_list.schema.yaml | 12 +++++----- .../delete_exception_list.schema.yaml | 12 +++++----- .../delete_exception_list_item.schema.yaml | 12 +++++----- .../duplicate_exception_list.schema.yaml | 12 +++++----- .../export_exception_list.schema.yaml | 12 +++++----- .../find_exception_list_items.schema.yaml | 16 +++++++------- .../find_exception_lists.schema.yaml | 10 ++++----- .../import_exceptions.schema.yaml | 10 ++++----- .../model/exception_list_common.schema.yaml | 22 +++++++++---------- .../exception_list_item_entry.schema.yaml | 18 +++++++-------- .../read_exception_list.schema.yaml | 12 +++++----- .../read_exception_list_item.schema.yaml | 12 +++++----- .../read_exception_list_summary.schema.yaml | 12 +++++----- .../update_exception_list.schema.yaml | 12 +++++----- .../update_exception_list_item.schema.yaml | 16 +++++++------- .../api/create_list/create_list.schema.yaml | 12 +++++----- .../create_list_index.schema.yaml | 12 +++++----- .../create_list_item.schema.yaml | 12 +++++----- .../api/delete_list/delete_list.schema.yaml | 12 +++++----- .../delete_list_index.schema.yaml | 12 +++++----- .../delete_list_item.schema.yaml | 12 +++++----- .../export_list_items.schema.yaml | 12 +++++----- .../find_list_items.schema.yaml | 14 ++++++------ .../api/find_lists/find_lists.schema.yaml | 14 ++++++------ .../import_list_items.schema.yaml | 12 +++++----- .../api/model/list_common.schema.yaml | 12 +++++----- .../api/patch_list/patch_list.schema.yaml | 12 +++++----- .../patch_list_item.schema.yaml | 12 +++++----- .../api/read_list/read_list.schema.yaml | 12 +++++----- .../read_list_index.schema.yaml | 12 +++++----- .../read_list_item/read_list_item.schema.yaml | 12 +++++----- .../read_list_privileges.schema.yaml | 10 ++++----- .../api/update_list/update_list.schema.yaml | 12 +++++----- .../update_list_item.schema.yaml | 12 +++++----- yarn.lock | 4 ++-- 79 files changed, 290 insertions(+), 290 deletions(-) rename {packages => src/platform/packages/shared}/kbn-openapi-common/README.md (100%) rename {packages => src/platform/packages/shared}/kbn-openapi-common/jest.config.js (83%) rename {packages => src/platform/packages/shared}/kbn-openapi-common/kibana.jsonc (100%) rename {packages => src/platform/packages/shared}/kbn-openapi-common/package.json (100%) rename {packages => src/platform/packages/shared}/kbn-openapi-common/schemas/error_responses.gen.ts (100%) rename {packages => src/platform/packages/shared}/kbn-openapi-common/schemas/error_responses.schema.yaml (100%) rename {packages => src/platform/packages/shared}/kbn-openapi-common/schemas/primitives.gen.ts (100%) rename {packages => src/platform/packages/shared}/kbn-openapi-common/schemas/primitives.schema.yaml (100%) rename {packages => src/platform/packages/shared}/kbn-openapi-common/schemas/primitives.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-openapi-common/scripts/openapi_generate.js (95%) rename {packages => src/platform/packages/shared}/kbn-openapi-common/shared/index.ts (100%) rename {packages => src/platform/packages/shared}/kbn-openapi-common/shared/path_params_replacer.ts (100%) rename {packages => src/platform/packages/shared}/kbn-openapi-common/tsconfig.json (81%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/README.md (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/index.ts (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/jest.config.js (83%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/kibana.jsonc (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/package.json (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/src/array_from_string.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/src/array_from_string.ts (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/src/boolean_from_string.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/src/boolean_from_string.ts (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/src/build_route_validation_with_zod.ts (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/src/expect_parse_error.ts (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/src/expect_parse_success.ts (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/src/is_valid_date_math.ts (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/src/non_empty_string.ts (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/src/required_optional.ts (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/src/safe_parse_result.ts (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/src/stringify_zod_error.ts (100%) rename {packages => src/platform/packages/shared}/kbn-zod-helpers/tsconfig.json (82%) diff --git a/.buildkite/scripts/steps/code_generation/security_solution_codegen.sh b/.buildkite/scripts/steps/code_generation/security_solution_codegen.sh index 13bd0aaf7189a..5f140efc5db8d 100755 --- a/.buildkite/scripts/steps/code_generation/security_solution_codegen.sh +++ b/.buildkite/scripts/steps/code_generation/security_solution_codegen.sh @@ -7,7 +7,7 @@ source .buildkite/scripts/common/util.sh echo --- Security Solution OpenAPI Code Generation echo -e "\n[Security Solution OpenAPI Code Generation] OpenAPI Common Package\n" -(cd packages/kbn-openapi-common && yarn openapi:generate) +(cd src/platform/packages/shared/kbn-openapi-common && yarn openapi:generate) echo -e "\n[Security Solution OpenAPI Code Generation] Lists Common Package\n" (cd x-pack/solutions/security/packages/kbn-securitysolution-lists-common && yarn openapi:generate) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 05ba8d0ac18a8..24d61d2740e57 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -395,7 +395,6 @@ packages/kbn-monaco @elastic/appex-sharedux packages/kbn-object-versioning @elastic/appex-sharedux packages/kbn-object-versioning-utils @elastic/appex-sharedux packages/kbn-openapi-bundler @elastic/security-detection-rule-management -packages/kbn-openapi-common @elastic/security-detection-rule-management packages/kbn-openapi-generator @elastic/security-detection-rule-management packages/kbn-optimizer @elastic/kibana-operations packages/kbn-optimizer-webpack-helpers @elastic/kibana-operations @@ -499,7 +498,6 @@ packages/kbn-whereis-pkg-cli @elastic/kibana-operations packages/kbn-xstate-utils @elastic/obs-ux-logs-team packages/kbn-yarn-lock-validator @elastic/kibana-operations packages/kbn-zod @elastic/kibana-core -packages/kbn-zod-helpers @elastic/security-detection-rule-management packages/presentation/presentation_containers @elastic/kibana-presentation packages/presentation/presentation_publishing @elastic/kibana-presentation packages/react/kibana_context/common @elastic/appex-sharedux @@ -595,6 +593,7 @@ src/platform/packages/shared/kbn-management/settings/components/field_row @elast src/platform/packages/shared/kbn-management/settings/field_definition @elastic/kibana-management src/platform/packages/shared/kbn-management/settings/types @elastic/kibana-management src/platform/packages/shared/kbn-management/settings/utilities @elastic/kibana-management +src/platform/packages/shared/kbn-openapi-common @elastic/security-detection-rule-management src/platform/packages/shared/kbn-osquery-io-ts-types @elastic/security-asset-management src/platform/packages/shared/kbn-securitysolution-ecs @elastic/security-threat-hunting-explore src/platform/packages/shared/kbn-securitysolution-es-utils @elastic/security-detection-engine @@ -609,6 +608,7 @@ src/platform/packages/shared/kbn-sse-utils-client @elastic/obs-knowledge-team src/platform/packages/shared/kbn-sse-utils-server @elastic/obs-knowledge-team src/platform/packages/shared/kbn-typed-react-router-config @elastic/obs-knowledge-team @elastic/obs-ux-infra_services-team src/platform/packages/shared/kbn-unsaved-changes-prompt @elastic/kibana-management +src/platform/packages/shared/kbn-zod-helpers @elastic/security-detection-rule-management src/platform/packages/shared/serverless/settings/security_project @elastic/security-solution @elastic/kibana-management src/platform/plugins/shared/ai_assistant_management/selection @elastic/obs-ai-assistant src/platform/plugins/shared/console @elastic/kibana-management diff --git a/package.json b/package.json index 7ac4a95fe5631..a60710029650e 100644 --- a/package.json +++ b/package.json @@ -713,7 +713,7 @@ "@kbn/observability-utils-server": "link:x-pack/packages/observability/observability_utils/observability_utils_server", "@kbn/oidc-provider-plugin": "link:x-pack/test/security_api_integration/plugins/oidc_provider", "@kbn/open-telemetry-instrumented-plugin": "link:test/common/plugins/otel_metrics", - "@kbn/openapi-common": "link:packages/kbn-openapi-common", + "@kbn/openapi-common": "link:src/platform/packages/shared/kbn-openapi-common", "@kbn/osquery-io-ts-types": "link:src/platform/packages/shared/kbn-osquery-io-ts-types", "@kbn/osquery-plugin": "link:x-pack/platform/plugins/shared/osquery", "@kbn/paertial-results-example-plugin": "link:examples/partial_results_example", @@ -1027,7 +1027,7 @@ "@kbn/watcher-plugin": "link:x-pack/platform/plugins/private/watcher", "@kbn/xstate-utils": "link:packages/kbn-xstate-utils", "@kbn/zod": "link:packages/kbn-zod", - "@kbn/zod-helpers": "link:packages/kbn-zod-helpers", + "@kbn/zod-helpers": "link:src/platform/packages/shared/kbn-zod-helpers", "@langchain/aws": "^0.1.2", "@langchain/community": "0.3.14", "@langchain/core": "^0.3.16", diff --git a/packages/kbn-openapi-common/README.md b/src/platform/packages/shared/kbn-openapi-common/README.md similarity index 100% rename from packages/kbn-openapi-common/README.md rename to src/platform/packages/shared/kbn-openapi-common/README.md diff --git a/packages/kbn-openapi-common/jest.config.js b/src/platform/packages/shared/kbn-openapi-common/jest.config.js similarity index 83% rename from packages/kbn-openapi-common/jest.config.js rename to src/platform/packages/shared/kbn-openapi-common/jest.config.js index c8e533f9d7ed8..12c38e4154655 100644 --- a/packages/kbn-openapi-common/jest.config.js +++ b/src/platform/packages/shared/kbn-openapi-common/jest.config.js @@ -9,6 +9,6 @@ module.exports = { preset: '@kbn/test/jest_node', - rootDir: '../..', - roots: ['/packages/kbn-openapi-common'], + rootDir: '../../../../..', + roots: ['/src/platform/packages/shared/kbn-openapi-common'], }; diff --git a/packages/kbn-openapi-common/kibana.jsonc b/src/platform/packages/shared/kbn-openapi-common/kibana.jsonc similarity index 100% rename from packages/kbn-openapi-common/kibana.jsonc rename to src/platform/packages/shared/kbn-openapi-common/kibana.jsonc diff --git a/packages/kbn-openapi-common/package.json b/src/platform/packages/shared/kbn-openapi-common/package.json similarity index 100% rename from packages/kbn-openapi-common/package.json rename to src/platform/packages/shared/kbn-openapi-common/package.json diff --git a/packages/kbn-openapi-common/schemas/error_responses.gen.ts b/src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.gen.ts similarity index 100% rename from packages/kbn-openapi-common/schemas/error_responses.gen.ts rename to src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.gen.ts diff --git a/packages/kbn-openapi-common/schemas/error_responses.schema.yaml b/src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml similarity index 100% rename from packages/kbn-openapi-common/schemas/error_responses.schema.yaml rename to src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml diff --git a/packages/kbn-openapi-common/schemas/primitives.gen.ts b/src/platform/packages/shared/kbn-openapi-common/schemas/primitives.gen.ts similarity index 100% rename from packages/kbn-openapi-common/schemas/primitives.gen.ts rename to src/platform/packages/shared/kbn-openapi-common/schemas/primitives.gen.ts diff --git a/packages/kbn-openapi-common/schemas/primitives.schema.yaml b/src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml similarity index 100% rename from packages/kbn-openapi-common/schemas/primitives.schema.yaml rename to src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml diff --git a/packages/kbn-openapi-common/schemas/primitives.test.ts b/src/platform/packages/shared/kbn-openapi-common/schemas/primitives.test.ts similarity index 100% rename from packages/kbn-openapi-common/schemas/primitives.test.ts rename to src/platform/packages/shared/kbn-openapi-common/schemas/primitives.test.ts diff --git a/packages/kbn-openapi-common/scripts/openapi_generate.js b/src/platform/packages/shared/kbn-openapi-common/scripts/openapi_generate.js similarity index 95% rename from packages/kbn-openapi-common/scripts/openapi_generate.js rename to src/platform/packages/shared/kbn-openapi-common/scripts/openapi_generate.js index 07b7c4c0e4a0b..54fa109cfb2cd 100644 --- a/packages/kbn-openapi-common/scripts/openapi_generate.js +++ b/src/platform/packages/shared/kbn-openapi-common/scripts/openapi_generate.js @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -require('../../../src/setup_node_env'); +require('../../../../../setup_node_env'); const { resolve } = require('path'); const { generate } = require('@kbn/openapi-generator'); diff --git a/packages/kbn-openapi-common/shared/index.ts b/src/platform/packages/shared/kbn-openapi-common/shared/index.ts similarity index 100% rename from packages/kbn-openapi-common/shared/index.ts rename to src/platform/packages/shared/kbn-openapi-common/shared/index.ts diff --git a/packages/kbn-openapi-common/shared/path_params_replacer.ts b/src/platform/packages/shared/kbn-openapi-common/shared/path_params_replacer.ts similarity index 100% rename from packages/kbn-openapi-common/shared/path_params_replacer.ts rename to src/platform/packages/shared/kbn-openapi-common/shared/path_params_replacer.ts diff --git a/packages/kbn-openapi-common/tsconfig.json b/src/platform/packages/shared/kbn-openapi-common/tsconfig.json similarity index 81% rename from packages/kbn-openapi-common/tsconfig.json rename to src/platform/packages/shared/kbn-openapi-common/tsconfig.json index 29a271ba4840d..cf3d0ba7804aa 100644 --- a/packages/kbn-openapi-common/tsconfig.json +++ b/src/platform/packages/shared/kbn-openapi-common/tsconfig.json @@ -4,7 +4,7 @@ "types": ["jest", "node"] }, "exclude": ["target/**/*"], - "extends": "../../tsconfig.base.json", + "extends": "../../../../../tsconfig.base.json", "include": ["**/*.ts"], "kbn_references": [ "@kbn/zod", diff --git a/packages/kbn-zod-helpers/README.md b/src/platform/packages/shared/kbn-zod-helpers/README.md similarity index 100% rename from packages/kbn-zod-helpers/README.md rename to src/platform/packages/shared/kbn-zod-helpers/README.md diff --git a/packages/kbn-zod-helpers/index.ts b/src/platform/packages/shared/kbn-zod-helpers/index.ts similarity index 100% rename from packages/kbn-zod-helpers/index.ts rename to src/platform/packages/shared/kbn-zod-helpers/index.ts diff --git a/packages/kbn-zod-helpers/jest.config.js b/src/platform/packages/shared/kbn-zod-helpers/jest.config.js similarity index 83% rename from packages/kbn-zod-helpers/jest.config.js rename to src/platform/packages/shared/kbn-zod-helpers/jest.config.js index 4f66c7eed2eee..a24e940983817 100644 --- a/packages/kbn-zod-helpers/jest.config.js +++ b/src/platform/packages/shared/kbn-zod-helpers/jest.config.js @@ -9,6 +9,6 @@ module.exports = { preset: '@kbn/test', - rootDir: '../..', - roots: ['/packages/kbn-zod-helpers'], + rootDir: '../../../../..', + roots: ['/src/platform/packages/shared/kbn-zod-helpers'], }; diff --git a/packages/kbn-zod-helpers/kibana.jsonc b/src/platform/packages/shared/kbn-zod-helpers/kibana.jsonc similarity index 100% rename from packages/kbn-zod-helpers/kibana.jsonc rename to src/platform/packages/shared/kbn-zod-helpers/kibana.jsonc diff --git a/packages/kbn-zod-helpers/package.json b/src/platform/packages/shared/kbn-zod-helpers/package.json similarity index 100% rename from packages/kbn-zod-helpers/package.json rename to src/platform/packages/shared/kbn-zod-helpers/package.json diff --git a/packages/kbn-zod-helpers/src/array_from_string.test.ts b/src/platform/packages/shared/kbn-zod-helpers/src/array_from_string.test.ts similarity index 100% rename from packages/kbn-zod-helpers/src/array_from_string.test.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/array_from_string.test.ts diff --git a/packages/kbn-zod-helpers/src/array_from_string.ts b/src/platform/packages/shared/kbn-zod-helpers/src/array_from_string.ts similarity index 100% rename from packages/kbn-zod-helpers/src/array_from_string.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/array_from_string.ts diff --git a/packages/kbn-zod-helpers/src/boolean_from_string.test.ts b/src/platform/packages/shared/kbn-zod-helpers/src/boolean_from_string.test.ts similarity index 100% rename from packages/kbn-zod-helpers/src/boolean_from_string.test.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/boolean_from_string.test.ts diff --git a/packages/kbn-zod-helpers/src/boolean_from_string.ts b/src/platform/packages/shared/kbn-zod-helpers/src/boolean_from_string.ts similarity index 100% rename from packages/kbn-zod-helpers/src/boolean_from_string.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/boolean_from_string.ts diff --git a/packages/kbn-zod-helpers/src/build_route_validation_with_zod.ts b/src/platform/packages/shared/kbn-zod-helpers/src/build_route_validation_with_zod.ts similarity index 100% rename from packages/kbn-zod-helpers/src/build_route_validation_with_zod.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/build_route_validation_with_zod.ts diff --git a/packages/kbn-zod-helpers/src/expect_parse_error.ts b/src/platform/packages/shared/kbn-zod-helpers/src/expect_parse_error.ts similarity index 100% rename from packages/kbn-zod-helpers/src/expect_parse_error.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/expect_parse_error.ts diff --git a/packages/kbn-zod-helpers/src/expect_parse_success.ts b/src/platform/packages/shared/kbn-zod-helpers/src/expect_parse_success.ts similarity index 100% rename from packages/kbn-zod-helpers/src/expect_parse_success.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/expect_parse_success.ts diff --git a/packages/kbn-zod-helpers/src/is_valid_date_math.ts b/src/platform/packages/shared/kbn-zod-helpers/src/is_valid_date_math.ts similarity index 100% rename from packages/kbn-zod-helpers/src/is_valid_date_math.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/is_valid_date_math.ts diff --git a/packages/kbn-zod-helpers/src/non_empty_string.ts b/src/platform/packages/shared/kbn-zod-helpers/src/non_empty_string.ts similarity index 100% rename from packages/kbn-zod-helpers/src/non_empty_string.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/non_empty_string.ts diff --git a/packages/kbn-zod-helpers/src/required_optional.ts b/src/platform/packages/shared/kbn-zod-helpers/src/required_optional.ts similarity index 100% rename from packages/kbn-zod-helpers/src/required_optional.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/required_optional.ts diff --git a/packages/kbn-zod-helpers/src/safe_parse_result.ts b/src/platform/packages/shared/kbn-zod-helpers/src/safe_parse_result.ts similarity index 100% rename from packages/kbn-zod-helpers/src/safe_parse_result.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/safe_parse_result.ts diff --git a/packages/kbn-zod-helpers/src/stringify_zod_error.ts b/src/platform/packages/shared/kbn-zod-helpers/src/stringify_zod_error.ts similarity index 100% rename from packages/kbn-zod-helpers/src/stringify_zod_error.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/stringify_zod_error.ts diff --git a/packages/kbn-zod-helpers/tsconfig.json b/src/platform/packages/shared/kbn-zod-helpers/tsconfig.json similarity index 82% rename from packages/kbn-zod-helpers/tsconfig.json rename to src/platform/packages/shared/kbn-zod-helpers/tsconfig.json index 9eab856c8c4d2..d3b33b22966b8 100644 --- a/packages/kbn-zod-helpers/tsconfig.json +++ b/src/platform/packages/shared/kbn-zod-helpers/tsconfig.json @@ -4,7 +4,7 @@ "types": ["jest", "node"] }, "exclude": ["target/**/*"], - "extends": "../../tsconfig.base.json", + "extends": "../../../../../tsconfig.base.json", "include": ["**/*.ts"], "kbn_references": [ "@kbn/datemath", diff --git a/tsconfig.base.json b/tsconfig.base.json index 15e2e250e0d08..6e1e67c3aa148 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1364,8 +1364,8 @@ "@kbn/open-telemetry-instrumented-plugin/*": ["test/common/plugins/otel_metrics/*"], "@kbn/openapi-bundler": ["packages/kbn-openapi-bundler"], "@kbn/openapi-bundler/*": ["packages/kbn-openapi-bundler/*"], - "@kbn/openapi-common": ["packages/kbn-openapi-common"], - "@kbn/openapi-common/*": ["packages/kbn-openapi-common/*"], + "@kbn/openapi-common": ["src/platform/packages/shared/kbn-openapi-common"], + "@kbn/openapi-common/*": ["src/platform/packages/shared/kbn-openapi-common/*"], "@kbn/openapi-generator": ["packages/kbn-openapi-generator"], "@kbn/openapi-generator/*": ["packages/kbn-openapi-generator/*"], "@kbn/optimizer": ["packages/kbn-optimizer"], @@ -2076,8 +2076,8 @@ "@kbn/yarn-lock-validator/*": ["packages/kbn-yarn-lock-validator/*"], "@kbn/zod": ["packages/kbn-zod"], "@kbn/zod/*": ["packages/kbn-zod/*"], - "@kbn/zod-helpers": ["packages/kbn-zod-helpers"], - "@kbn/zod-helpers/*": ["packages/kbn-zod-helpers/*"], + "@kbn/zod-helpers": ["src/platform/packages/shared/kbn-zod-helpers"], + "@kbn/zod-helpers/*": ["src/platform/packages/shared/kbn-zod-helpers/*"], // END AUTOMATED PACKAGE LISTING // Allows for importing from `kibana` package for the exported types. "@emotion/core": ["typings/@emotion"] diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.schema.yaml index 12b131e728c55..cdc9004ce7e60 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.schema.yaml @@ -23,23 +23,23 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Insufficient privileges content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 500: description: Internal server error content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.schema.yaml index 0393fa3d943eb..6948df21afbbc 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.schema.yaml @@ -57,29 +57,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Insufficient privileges content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 409: description: Endpoint list item already exists content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.schema.yaml index fac5a12ecc5df..ae1010573e5ef 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.schema.yaml @@ -36,29 +36,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Insufficient privileges content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Endpoint list item not found content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.schema.yaml index 35f565bfa27ff..400851ac52543 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.schema.yaml @@ -38,7 +38,7 @@ paths: required: false description: Determines which field is used to sort the results schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - name: sort_order in: query required: false @@ -80,34 +80,34 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Insufficient privileges content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Endpoint list not found content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: schemas: FindEndpointListItemsFilter: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.schema.yaml index 45f0c384c7f09..0b64bac231df5 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.schema.yaml @@ -38,29 +38,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Insufficient privileges content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Endpoint list item not found content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.schema.yaml index cd4cbf0c11d5e..1fbe40d2b94ee 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.schema.yaml @@ -62,29 +62,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Insufficient privileges content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Endpoint list item not found content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.schema.yaml index e7a399c2d7a82..e4aa39a5db30f 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.schema.yaml @@ -59,29 +59,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 409: description: Exception list already exists response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.schema.yaml index 2913d8c5c07d7..a86c6a21e25ed 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.schema.yaml @@ -69,32 +69,32 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 409: description: Exception list item already exists response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: x-codegen-enabled: true @@ -103,7 +103,7 @@ components: type: object properties: comment: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' required: - comment diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.schema.yaml index b7b2db3fabefd..246c8de363a68 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.schema.yaml @@ -45,37 +45,37 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: schemas: RuleId: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/UUID' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/UUID' CreateRuleExceptionListItemComment: type: object properties: comment: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' required: - comment diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.schema.yaml index 040acca3ebd77..5ac7e8e78ccbb 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.schema.yaml @@ -40,29 +40,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 409: description: Exception list already exists response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.schema.yaml index 2912070635b8f..709afe0fdff6b 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.schema.yaml @@ -42,29 +42,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Exception list not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.schema.yaml index 05f997307a4ca..22344db77f619 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.schema.yaml @@ -42,29 +42,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Exception list item not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.schema.yaml index 80620c4adf7f7..a758d2856123b 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.schema.yaml @@ -43,29 +43,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 405: description: Exception list to duplicate not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.schema.yaml index 89f97ff8bbe6a..2d5242131adbe 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.schema.yaml @@ -51,29 +51,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Exception list not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.schema.yaml index 6d390e9ecdf69..fc76802492420 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.schema.yaml @@ -65,7 +65,7 @@ paths: required: false description: Determines which field is used to sort the results schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - name: sort_order in: query required: false @@ -107,34 +107,34 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Exception list not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: schemas: FindExceptionListItemsFilter: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.schema.yaml index 49017d6d45912..e5ef4f83a1343 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.schema.yaml @@ -93,26 +93,26 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: schemas: diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.schema.yaml index 95bc9ee508e5a..75778f07c0c8e 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.schema.yaml @@ -92,26 +92,26 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: schemas: diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml index 4ca9326ec6c92..8d8cdf82b6d94 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml @@ -7,10 +7,10 @@ components: x-codegen-enabled: true schemas: ExceptionListId: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ExceptionListHumanId: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' description: Human readable string identifier, e.g. `trusted-linux-processes` ExceptionListType: @@ -122,17 +122,17 @@ components: - updated_by ExceptionListItemId: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ExceptionListItemHumanId: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ExceptionListItemType: type: string enum: [simple] ExceptionListItemName: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ExceptionListItemDescription: type: string @@ -144,7 +144,7 @@ components: ExceptionListItemTags: type: array items: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ExceptionListItemOsType: type: string @@ -162,19 +162,19 @@ components: type: object properties: id: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' comment: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' created_at: type: string format: date-time created_by: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' updated_at: type: string format: date-time updated_by: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' required: - id - comment @@ -278,7 +278,7 @@ components: comments: $ref: '#/components/schemas/ExceptionListItemCommentArray' version: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' tie_breaker_id: type: string created_at: diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.schema.yaml index ab8c427344a0d..73fe9ea229bc3 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.schema.yaml @@ -17,9 +17,9 @@ components: type: string enum: [match] field: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' value: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' operator: $ref: '#/components/schemas/ExceptionListItemEntryOperator' required: @@ -35,11 +35,11 @@ components: type: string enum: [match_any] field: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' value: type: array items: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' minItems: 1 operator: $ref: '#/components/schemas/ExceptionListItemEntryOperator' @@ -56,7 +56,7 @@ components: type: string enum: [list] field: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' list: type: object properties: @@ -80,7 +80,7 @@ components: type: string enum: [exists] field: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' operator: $ref: '#/components/schemas/ExceptionListItemEntryOperator' required: @@ -101,7 +101,7 @@ components: type: string enum: [nested] field: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' entries: type: array items: @@ -119,9 +119,9 @@ components: type: string enum: [wildcard] field: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' value: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' operator: $ref: '#/components/schemas/ExceptionListItemEntryOperator' required: diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.schema.yaml index e50147083dafe..001c56a3eafb4 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.schema.yaml @@ -42,29 +42,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Exception list item not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.schema.yaml index 6d7fac7767182..82cac05e97813 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.schema.yaml @@ -42,29 +42,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Exception list item not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.schema.yaml index 02fc3c9c8f6fe..fe6bb93b9cdb9 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.schema.yaml @@ -61,29 +61,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Exception list not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.schema.yaml index 0f7218a86c23f..5a07623f4c937 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.schema.yaml @@ -59,29 +59,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Exception list not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.schema.yaml index 9adc75141f569..d6021768492c5 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.schema.yaml @@ -70,32 +70,32 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Exception list item not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: x-codegen-enabled: true @@ -104,9 +104,9 @@ components: type: object properties: id: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' comment: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' required: - comment diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list/create_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list/create_list.schema.yaml index df3e6b35ef65a..3c1d090687fe6 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list/create_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list/create_list.schema.yaml @@ -53,29 +53,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 409: description: List already exists response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.schema.yaml index 8ff9ad6ab1b2e..8f79811144374 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.schema.yaml @@ -27,29 +27,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 409: description: List data stream exists response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.schema.yaml index 01d024f8b40d8..bdf266c8926f6 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.schema.yaml @@ -54,29 +54,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 409: description: List item already exists response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.schema.yaml index e8caef0eb2c6c..d8440aa347cde 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.schema.yaml @@ -45,29 +45,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: List not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.schema.yaml index ae43c58726d52..8773925e358b1 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.schema.yaml @@ -27,29 +27,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: List data stream not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.schema.yaml index b95afcdc1ed3b..752a246bdd9b3 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.schema.yaml @@ -54,29 +54,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: List item not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.schema.yaml index 999eb4a0ae42d..2dd518904d0f8 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.schema.yaml @@ -32,29 +32,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: List not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.schema.yaml index 746b3e9fdbe37..5cb15220e17cc 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.schema.yaml @@ -34,7 +34,7 @@ paths: required: false description: Determines which field is used to sort the results schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - name: sort_order in: query required: false @@ -94,31 +94,31 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: schemas: FindListItemsCursor: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' FindListItemsFilter: type: string diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.schema.yaml index 9b0012e8d6968..44713827d29f9 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.schema.yaml @@ -28,7 +28,7 @@ paths: required: false description: Determines which field is used to sort the results schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - name: sort_order in: query required: false @@ -88,31 +88,31 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: schemas: FindListsCursor: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' FindListsFilter: type: string diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.schema.yaml index f3fae45159346..78f44f7dd7f71 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.schema.yaml @@ -73,29 +73,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 409: description: List with specified list_id does not exist response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_common.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_common.schema.yaml index 808e99c7b1e13..ef29224a5b73c 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_common.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_common.schema.yaml @@ -6,7 +6,7 @@ paths: {} components: schemas: ListId: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ListType: type: string @@ -36,23 +36,23 @@ components: - text ListName: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ListDescription: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ListMetadata: type: object additionalProperties: true ListItemId: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ListItemValue: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ListItemDescription: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ListItemMetadata: type: object diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.schema.yaml index 6a61e668ced87..be8c5871413fc 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.schema.yaml @@ -46,29 +46,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: List not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.schema.yaml index fdd7a020d098f..7802133dc4b16 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.schema.yaml @@ -48,29 +48,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: List item not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list/read_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list/read_list.schema.yaml index 280a6fdab7543..e4a72d6555096 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list/read_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list/read_list.schema.yaml @@ -30,29 +30,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: List not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.schema.yaml index 40dbddf25e69e..b06b78ac34147 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.schema.yaml @@ -29,29 +29,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: List data stream(s) not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.schema.yaml index a41fb497f611a..c1bb0697152bd 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.schema.yaml @@ -46,29 +46,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: List item not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.schema.yaml index df7b4a5f5174b..d51e420aa4a94 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.schema.yaml @@ -33,26 +33,26 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: schemas: diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list/update_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list/update_list.schema.yaml index a059ede38584c..077a96d25d9ed 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list/update_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list/update_list.schema.yaml @@ -51,29 +51,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: List not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.schema.yaml index 04d86cf1947a9..8971372210475 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.schema.yaml @@ -45,29 +45,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: List item not found response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../../../../../packages/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/yarn.lock b/yarn.lock index 90597fb5545cc..839171e5f7134 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6545,7 +6545,7 @@ version "0.0.0" uid "" -"@kbn/openapi-common@link:packages/kbn-openapi-common": +"@kbn/openapi-common@link:src/platform/packages/shared/kbn-openapi-common": version "0.0.0" uid "" @@ -7965,7 +7965,7 @@ version "0.0.0" uid "" -"@kbn/zod-helpers@link:packages/kbn-zod-helpers": +"@kbn/zod-helpers@link:src/platform/packages/shared/kbn-zod-helpers": version "0.0.0" uid ""